From tody Thu Jan 23 18:25:36 1986
Received: by lyra.noao.UUCP (4.12/4.7)
	id AA28464; Thu, 23 Jan 86 18:25:29 mst
Date: Thu, 23 Jan 86 18:25:29 mst
From: tody (Doug Tody X217)
Message-Id: <8601240125.AA28464@lyra.noao.UUCP>
To: rooke
Subject: Re:  longplot
Status: RO

Longplot is a generic plot task, hence should not have knowledge of any
instrument specific parameters.  If you make it instrument specific then
it won't be very useful for plotting anything else.  The CRPIX etc. parameters
are not really supported by the system and will change, so it is doubtful
where a task like longplot should use them.

Our usual approach in a situation such as this is to build a CL script in
the IMRED package for the instrument in question to read the instrument
dependent parameters from the image header, and use them to compute arguments
to the generic program (longplot).  This is the only realistic way to deal
with all the possible instrument dependent parameters.

From rooke Wed Mar 19 18:01:28 1986
Received: by lyra.noao (4.12/5.0)
	id AA28759; Wed, 19 Mar 86 18:01:21 mst
Date: Wed, 19 Mar 86 18:01:21 mst
From: rooke (Steve Rooke)
Message-Id: <8603200101.AA28759@lyra.noao>
To: tody
Subject: longplot
Cc: jbarnes, rooke
Status: RO

Caty has been using LONGPLOT for several days, and has come up with the
inevitable problems & suggestions.  I list these in order of difficulty &
impact on the existing design, easiest first:

1)  She would like to be able to specify a marker type directly as a
    task parameter, rather than only through file indirection.

    Solution:  add a task parameter; marker type is the only indirection-
    file field that does not already have a high-level task parameter.

    (Recall that the primary purpose of the indirection file was to be
    able to supply individual control for each member of a series of
    overlaid / stacked / serial plots.)

2)  She would like to be able to specify a marker size directly as a
    task parameter and also embedded in input file indirection.

    Solution:  add marker size as a task parameter, and as a field in
    input indirection.  Since Caty wants to plot real spectra as the
    individual data points, and overlay these with synthetic spectra
    plotted as connected lines, this is a reasonable request; depending
    on the size of the plot and the density of data points, marker size
    control is indeed desirable.  This would be the FIFTH indirection
    file field.  Note that these are NOT individual sizes for each
    marker, as are used by the GRAPH task; that capability could be
    added independently for list input at the cost of diverging the
    list- and image- plotting modes of LONGPLOT.

3)  She would like to be able to use the file indirection capability
    from WAVEPLOT, not just LONGPLOT.  This would be necessary when
    attempting to overplot real spectra as markers and synthetic spectra
    as lines (indirection is the only way to specify separate line/marker
    types for each member of a list of images being plotted in the same
    task invocation).

    Solution:  this is much harder.  WAVEPLOT is a script that expands an
    input image template into individual members, opens each header, extracts
    those instrument-specific parameters, and constructs the x- and y-
    transformation specifications, then calls LONGPLOT.  That means that 
    currently there is no way to run WAVEPLOT on more than one image at
    a time (as for overlays); there is only one task parameter for the x-
    transform and one for the y-transform.

    a)  One answer, keeping the WAVEPLOT script separate from the generic
	plotting task LONGPLOT, would be to add the x- and y-transform
	parameters as the SIXTH and SEVENTH indirection-file fields.  Then
	WAVEPLOT could make a first pass through all the images in a template,
	compute the x- and y-transform parameters from the instrument-specific
	wavelength calibration parameters, and write these in as the 6th and
	7th fields in the indirection file.  It would then make only one call
	to LONGPLOT.

    b)  The other way would be to recognize that these wretched wavelength-
	related image header parameters are too closely bound to the purpose
	of producing a longplot, and make a separate task (no more script)
	called WAVEPLOT or something, which would be identical to LONGPLOT
	except that it knows about those image header parameters.  Such a
	task would no longer need the capability for list input, so could
	be stripped of that at least.  It would also be easier to add any
	future capabilities depending on KPNO or other non-standard image
	header parameters.

    (a) would keep only one, image-header-independent version of LONGPLOT
    at the expense of stretching things quite a bit -- using a 
    surrounding script, and communication information to LONGPLOT via
    an indirection file enhanced by the script.  (b) would create two
    tasks instead of one, leaving a plot task tightly bound to images
    and one totally independent of them, to diverge forever into the
    future.  I think I favor (b), mainly to accommodate future modifications
    involving image header parameters.

Wrapup:  I could take care of points (1) and (2) in a half day.  Either
solution to point (3) would in reality take 2 or 3 days, counting getting
back into it, updating documentation, and learning more about scripts if
that is the method of solution.  If I don't address (3) at all, there will
be no way to plot wavelength-calibrated raw spectra as data points (markers)
overlaid with a synthetic spectrum plotted as lines.

From tody Wed Mar 19 20:54:13 1986
Received: by lyra.noao (4.12/5.0)
	id AA29218; Wed, 19 Mar 86 20:54:09 mst
Date: Wed, 19 Mar 86 20:54:09 mst
From: tody (Doug Tody X217)
Message-Id: <8603200354.AA29218@lyra.noao>
To: rooke
Subject: Re:  longplot
Cc: jbarnes
Status: RO

Steve - finish the prototype CGI kernel and then do the longplot work while
the SUN/CGI stuff is under evaluation.  I do not have time to do justice
to your queries on how to extend longplot at this time.  We definitely want
to try to develop the program since we have an staff member interested in
it enough to make all these suggestions, however, we may be pushing the limits
of the user interface used for this program.  The next step is a syntax or
screen driven interface, which we are not ready to tackle yet.


From v24 Thu Apr 10 13:41:42 1986
Received: by lyra.noao (4.12/SAG.2)
	id AA08454; Thu, 10 Apr 86 13:41:35 mst
Date: Thu, 10 Apr 86 13:41:35 mst
From: v24 (Not Active)
Message-Id: <8604102041.AA08454@lyra.noao>
To: rooke
Subject: LONGPLOT
Status: RO


Steve:

   This comment may apply to the Calcomp kernel itself, but definitely to
   LONGPLOT. 

  1.)  When drawing the box, the plotter is:
              a.) drawing x-axis
              b.) drawing right side
              c.) drawing y-axis (moving pen diagonally all the way back)
              d.) drawing top
              e.) drawing spectrum (after moving pen all the way back again.

      May I suggest that the following sequence be done:
              a.) draw x-axis (left-to-right)
              b.) draw right side (bottom-to-top)
              c.) draw top (right-to-left)
              d.) draw y-axis
              e.) draw spectrum
          This way saves time be not having the pen travel down the length of
          the plot (twice).  For V24, this amounts to 40 inches each way!

  2.)  I think it would be useful to be able to print BOTH the image title and
       the IRAF file name on the plot.


By the way, thanks for all of your help!

                                                  Ed.
From jbarnes Wed May  7 08:32:38 1986
Received: by lyra.noao (4.12/SAG.2)
	id AA28752; Wed, 7 May 86 08:32:31 mst
Date: Wed, 7 May 86 08:32:31 mst
From: jbarnes (Jeannette Barnes X381)
Message-Id: <8605071532.AA28752@lyra.noao>
To: hammand, rooke
Subject: plotting
Status: RO

The photo lab had some plots of Phil Massey's that needed to be modified 
slightly for publication - they were generated with waveplot.  After
looking at the problem (and there were only six plots) it seemed 
easier for them to do the mods rather than regenerate the plots 
through IRAF.  In looking at these plots, however, I found the following 
that probably needs to be investigated as time allows.

1.  longplot (waveplot) produce very plots - in several instances they 
    could be used for publication by the photo lab - the one annoying 
    thing that we discovered is that when you make a very long plot 
    the label for the y-axis is placed too far away from the rest of the 
    plot to make it usable without cutting and pasting.  (first line 
    should read `very nice plots').

2.
    After making a longplot that is very long (20 inches or so) and 
    putting it into a spool file so one can edit it - when this is then 
    run through calcomp  the labelling is messed up.  Parts of the 
    plot are also missing.  Now it may be that what I was doing was 
    not legal, I don't know.

3.  What you see with stdgraph is not necessarily what you get - that's 
    understandable I think, especially in the labels.

4.  Ed was generating some plots with longplot where a small section 
    of the x-axis was being used (waveplot) - the Y-axis did not get
    rescaled to compensate for this - I would think that it should 
    work that way ie  the y-range is determined from the section specified 
    be the x parameters if yauto=yes.

I have some example of all of this if you would like to see some plots.

Welcome back, Suzanne.

Jeannette

===============================================================================
BUGS

1.  WAVEPLOT cannot work with an indirection file that includes any fields
    other than the inputspec.  WAVEPLOT uses imgets to expand the contents
    of its own input specification -- thus it works fine for an "@file" that
    contains only one image name per line -- and then calls LONGPLOT once for
    each image.  It has to do it this way, because only WAVEPLOT is supposed
    to know anything about the KPNO-specific wavecal parameters (e.g. W0, WPC).
    The only solution would be to create a separate, local-to-KPNO version
    of waveplot that contains its own version of longplot that does the wavecal
    extraction itself -- i.e. don't drive it from a script.

    Doc says an indir file can contain:

	    inputspec	titlespec	linetype	markertype	or
	    inputspec	*		*		markertype	etc.

    In practice, each field must be enclosed in quotes.

2.  bus error when "waveplot dev=stdgraph"; check out ability to edit a
    metacode file output by wave/longplot in cursor mode, then dump it on
    the Calcomp.

================================================================================
TODO
-   if user specifies "none" in main parameter space, and has nothing
    in title position in indirection file, then use real "none" for all.

-   ability to rotate whole plot 90 degrees.

-   ability to waveplot multiple images in one execution.  Will have to
    create separate non-script version for WAVEPLOT.

-   Look at adding some parameters to the indirection-file.  Also make sure
    it is easy to create an indirection-file by using tools (ls).

    Examples:
	-   marker size
	-   xt, yt
