[Previous]
[Next]
NAME:
T_APER
PURPOSE:
Driver procedure (for APER) to compute concentric aperture photometry.
EXPLANATION:
Data is read from and written to disk FITS ASCII tables.
Part of the IDL-DAOPHOT photometry sequence
CALLING SEQUENCE:
T_APER, image, fitsfile, [ apr, skyrad, badpix, PRINT=, NEWTABLE=,
/EXACT, /SILENT, SETSKYVAL = ]
INPUTS:
IMAGE - input data array
FITSFILE - disk FITS ASCII table name (from T_FIND). Must contain
the keywords 'X' and 'Y' giving the centroid of the source
positions in FORTRAN (first pixel is 1) convention. An
extension of .fit is assumed if not supplied.
OPTIONAL INPUTS:
User will be prompted for the following parameters if not supplied.
APR - Vector of up to 12 REAL photometry aperture radii.
SKYRAD - Two element vector giving the inner and outer radii
to be used for the sky annulus
BADPIX - Two element vector giving the minimum and maximum
value of a good pixel (Default [-32765,32767])
OPTIONAL KEYWORDS INPUTS:
/EXACT - If this keyword is set, then intersection of the circular
aperture is computed exactly (and slowly) rather than using
an approximation. See APER for more info.
/PRINT - if set and non-zero then NSTAR will also write its results to
a file aper.prt. One can specify a different output file
name by setting PRINT = 'filename'.
/SILENT - If this keyword is set and non-zero, then APER will not
display photometry results at the screen, and the results
will be automatically incorporated in the FITS table without
prompting the user
NEWTABLE - Name of output disk FITS ASCII table, scalar string.
If not supplied, then the input FITSFILE will be updated with
the aperture photometry results.
SETSKYVAL - Use this keyword to force the sky to a specified value
rather than have APER compute a sky value. SETSKYVAL
can either be a scalar specifying the sky value to use for
all sources, or a 3 element vector specifying the sky value,
the sigma of the sky value, and the number of elements used
to compute a sky value. The 3 element form of SETSKYVAL
is needed for accurate error budgeting.
PROMPTS:
T_APER requires the number of photons per analog digital unit
(PHPADU), so that it can compute Poisson noise statistics to assign
photometry errors. It first tries to find the PHPADU keyword in the
original image header, and if not found will look for the GAIN,
CCDGAIN and finally ATODGAIN keywords. If still not found, T_APER
will prompt the user for this value.
PROCEDURES:
APER, FTADDCOL, FTGET(), FTINFO, FTPUT, READFITS(), SXADDPAR,
SXPAR(), WRITEFITS
REVISON HISTORY:
Written W. Landsman ST Systems Co. May 1988
Store results as flux or magnitude August 1988
Added SILENT keyword W. Landsman Sep. 1991
Changed ERR SKY to ERR_SKY W. Landsman March 1996
Replace TEXTOUT keyword with PRINT keyword W. Landsman May 1996
Check CCDGAIN or ATODGAIN keywords to find phpadu W. Landsman May 1997
Converted to IDL V5.0 W. Landsman September 1997
Updated for new FTINFO calling sequence W. Landsman May 2000
Added /EXACT keyword W. Landsman June 2000
CALLS:
[Previous]
[Next]
NAME:
T_FIND
PURPOSE:
Driver procedure (for FIND) to locate stars in an image.
EXPLANATION:
Finds positive brightness perturbations (i.e stars) in a
2 dimensional image. Output is to a FITS ASCII table.
CALLING SEQUENCE:
T_FIND, image, im_hdr, [ fitsfile, hmin, fwhm, sharplim, roundlim,
PRINT = , /SILENT ]
INPUTS:
image - 2 dimensional image array (integer or real) for which one
wishes to identify the stars present
im_hdr - FITS header associated with image array
OPTIONAL INPUTS:
T_FIND will prompt for these parameters if not supplied
fitsfile - scalar string specifying the name of the output FITS ASCII
table file
fwhm - FWHM to be used in the convolving filter
hmin - Threshold intensity for a point source - should generally
be 3 or 4 sigma above background level
sharplim - 2 element vector giving low and high Limit for
sharpness statistic (Default: [0.2,1.0] )
roundlim - 2 element vector giving low and high Limit for
roundness statistic (Default: [-1.0,1.0] )
OPTIONAL INPUT KEYWORDS:
/PRINT - if set and non-zero then NSTAR will also write its results to
a file find.prt. One can specify the output file name by
setting PRINT = 'filename'.
/SILENT - If this keyword is set and non-zero, then FIND will work
silently, and not display each star found
OUTPUTS:
None
PROCEDURES CALLED:
CHECK_FITS, FDECOMP, FIND, FTADDCOL, FTCREATE, SXADDHIST, SXADDPAR,
SXDELPAR, SXPAR(), WRITEFITS
REVISION HISTORY:
Written W. Landsman, STX May, 1988
Added phpadu, J. Hill, STX, October, 1990
New calling syntax output to disk FITS table, W. Landsman May 1996
Work with more than 32767 stars W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
Remove obsolete !ERR system variable W. Landsman May 2000
CALLS:
[Previous]
[Next]
NAME:
T_GETPSF
PURPOSE:
Driver procedure (for GETPSF) to generate a PSF from isolate stars.
EXPLANATION:
Generates a point-spread function from one or more isolated stars.
List of stars is read from the FITS ASCII table output of T_APER.
PSF is represented as a sum of a Gaussian plus residuals.
Ouput residuals are written to a FITS image file.
CALLING SEQUENCE:
T_GETPSF, image, fitsfile, [ idpsf, psfrad, fitrad, psfname,
/DEBUG, NEWTABLE =]
INPUTS:
IMAGE - image array
FITSFILE - scalar string giving name of disk FITS ASCII table. Must
contain the keywords 'X','Y' (from T_FIND) and 'AP1_MAG','SKY'
(from T_APER).
OPTIONAL INPUTS:
IDPSF - vector of stellar ID indices indicating which stars are to be
used to create the PSF. Not that the PSF star should be
specified *not* by its STAR_ID value, but rather by the its
row number (starting with 0) in the FITS table
PSFRAD - the radius for which the PSF will be defined
FITRAD - fitting radius, always smaller than PSFRAD
PSFNAME - name of FITS image file to contain PSF residuals,
scalar string
GETPSF will prompt for all the above values if not supplied.
OPTIONAL KEYWORD INPUT
NEWTABLE - scalar string specifying the name of the output FITS ASCII
table. If not supplied, then the input table is updated with
the keyword PSF_CODE, specifying which stars were used for the
PSF.
DEBUG - if this keyword is set and non-zero, then the result of each
fitting iteration will be displayed.
PROMPTS:
T_GETPSF will prompt for the readout noise (in data numbers), and
the gain (in photons or electrons per data number) so that pixels can
be weighted during the PSF fit. To avoid the prompt, add the
keywords RONOIS and PHPADU to the FITS ASCII table header.
PROCEDURES USED:
FTADDCOL, FTGET(), FTPUT, GETPSF, READFITS(), SXADDHIST, SXADDPAR,
SXPAR(), WRITEFITS, ZPARCHECK
REVISION HISTORY:
Written W. Landsman STX May, 1988
Update PSF_CODE to indicate PSF stars in order used, W. Landsman Mar 96
I/O to FITS ASCII disk files W. Landsman May 96
Converted to IDL V5.0 W. Landsman September 1997
Update for new FTINFO call W. Landsman May 2000
CALLS:
[Previous]
[Next]
NAME:
T_GROUP
PURPOSE:
Driver procedure (for GROUP) to place stars in non-overlapping groups.
EXPLANATION:
This procedure is part of the DAOPHOT sequence that places star
positions with non-overlapping PSFs into distinct groups
Input and output are to FITS ASCII tables
CALLING SEQUENCE:
T_GROUP, fitsfile, [ rmax, XPAR = , YPAR = , NEWTABLE = ]
INPUTS:
FITSFILE - Name of disk FITS ASCII table containing the X,Y positions
in FITS (FORTRAN) convention (first pixel is 1,1)
OPTIONAL INPUTS:
rmax - maximum allowable distance between stars in a single group
OPTIONAL INPUT KEYWORDS:
XPAR, YPAR - scalar strings giving the field name in the output table
containing the X and Y coordinates. If not supplied,
then the fields 'X' and 'Y' are read.
NEWTABLE - scalar giving name of output disk FITS ASCII table. If not
supplied,
PROCEDURES:
FTADDCOL, FTGET(), FTINFO, FTPUT, GROUP, READFITS(), SXADDHIST,
SXADDHIST, WRITEFITS
REVISION HISTORY:
Written, W. Landsman STX Co. May, 1996
Converted to IDL V5.0 W. Landsman September 1997
Updated for new FTINFO call W. Landsman May 2000
CALLS:
[Previous]
[Next]
NAME:
T_NSTAR
PURPOSE:
Driver procedure (for NSTAR) for simultaneous PSF fitting.
EXPLANATION:
Input and output are to disk FITS ASCII tables.
CALLING SEQUENCE:
T_NSTAR, image, fitsfile, [psfname, groupsel, /SILENT, /PRINT
NEWTABLE = , /VARSKY ]
INPUTS:
IMAGE - 2-d image array
FITSFILE - scalar string giving name of disk FITS ASCII table. Must
contain the keywords 'X','Y' (from T_FIND) 'AP1_MAG','SKY'
(from T_APER) and 'GROUP_ID' (from T_GROUP). This table
will be updated with the results of T_NSTAR, unless the
keyword NEWTABLE is supplied.
OPTIONAL INPUTS:
PSFNAME - Name of the FITS file created by T_GETPSF containing
PSF residuals, scalar string
GROUPSEL - Scalar or vector listing the groups to process. For
example, to process stars in groups 2 and 5 set
GROUPSEL = [2,5]. If omitted, or set equal to -1,
then NSTAR will process all groups.
OPTIONAL KEYWORD INPUTS:
VARSKY - If this keyword is set and non-zero, then the mean sky level
in each group of stars, will be fit along with the brightness
and positions.
/SILENT - if set and non-zero, then NSTAR will not display its results
at the terminal
/PRINT - if set and non-zero then NSTAR will also write its results to
a file NSTAR.PRT. One can specify the output file name by
setting PRINT = 'filename'.
NEWTABLE - Name of output disk FITS ASCII table to contain the results
of NSTAR. If not supplied, then the input FITSFILE will be
updated.
DEBUG - if this keyword is set and non-zero, then the result of each
fitting iteration will be displayed.
PROCEDURES CALLED:
FTADDCAL, FTINFO, FTGET(), FTPUT, NSTAR, SXADDHIST,
SXADDPAR, SXPAR(), READFITS(), WRITEFITS
REVISION HISTORY:
Written W. Landsman STX Co. May, 1988
Check for CCDGAIN, ATODGAIN keywords to get PHPADU W. Landsman May 1997
Fixed typo preventing compilation, groupsel parameter W.L. July 1997
Converted to IDL V5.0 W. Landsman September 1997
Update for new FTINFO call W. Landsman May 2000
CALLS:
[Previous]
[Next]
NAME:
T_SUBSTAR
PURPOSE:
Driver procedure (for SUBSTAR) to subtract scaled PSF values
EXPLANATION:
Computes residuals of the PSF fitting program
CALLING SEQUENCE:
T_SUBSTAR, image, fitsfile, id,[ psfname, /VERBOSE, /NOPSF ]
INPUT-OUTPUT:
IMAGE - On input, IMAGE is the original image array. A scaled
PSF will be subtracted from IMAGE at specified star positions.
Make a copy of IMAGE before calling SUBSTAR, if you want to
keep a copy of the unsubtracted image array
INPUTS:
FITSFILE - scalar string giving the name of the disk FITS ASCII
produced as an output from T_NSTAR.
OPTIONAL INPUTS:
ID - Index vector indicating which stars are to be subtracted. If
omitted, (or set equal to -1), then stars will be subtracted
at all positions specified by the X and Y vectors.
(IDL convention - zero-based subscripts)
PSFNAME - Name of the FITS file containing the PSF residuals, as
generated by GETPSF. SUBSTAR will prompt for this parameter
if not supplied.
OPTIONAL INPUT KEYWORD:
/VERBOSE - If this keyword is set and non-zero, then the value of each
star number will be displayed as it is processed.
/NOPSF - if this keyword is set and non-zero, then all stars will be
be subtracted *except* those used to determine the PSF.
An improved PSF can then be derived from the subtracted image.
If NOPSF is supplied, then the ID parameter is ignored
NOTES:
T_SUBSTAR does not modify the input FITS table.
PROCEDURES USED:
FTGET(), FTINFO, READFITS(), REMOVE, SUBSTAR
REVISION HISTORY:
Written, R. Hill, ST Sys. Corp., 22 August 1991
Added NOPSF keyword W. Landsman March, 1996
Use FITS format for PSF resduals July, 1997
Converted to IDL V5.0 W. Landsman September 1997
Call FTINFO first to improve efficiency W. Landsman May 2000
CALLS:
[Previous]
[Next]
NAME: t_utplot
PURPOSE:
Given the input time vector, x0, prepare the time variable, xplot, for utplot.
Put it in a standard form, seconds from 79/1/1, set the plot range, xrange,
determine the plot reference time, xstart, and decide whether utbase needs to
be set or changed.
CATEGORY: Graphics
CALLING SEQUENCE: t_utplot, x0, xplot=x, xrange=xrange, xstart=xst, utbase=utbase, $
timerange=timerange
CALLED BY: utplot, set_utplot
CALLS TO: anytim
INPUTS:
x0 - time axis variable in any accepted anytim format
utbase - current value of utbase
xstart - current value of plot reference time
timerange - xrange specified with two fully referenced times
base_time - passed reference time for double precession seconds time array
ordinate - keyword used to pass the ordinate of the plot to anytim
used to determine whether time is in 2xN or 7xN longword format or
if it is to be interpreted as seconds from the fiducial (default 1-jan-1979)
OUTPUTS:
xrange - plot range relative to xstart
utbase
xstart
CALLS: ***
CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], FCHECK, GETUT [1], GETUT [2]
SETUT [1], SETUT [2], SETUTBASE [1], SETUTBASE [2], anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], checkvar [2]
CALLED BY:
DEF_UTPLOT
MODIFICATION HISTORY:
pulled from utplot and set_utplot, ras- 5-jan-94
xst is set to a yohkoh time format (external 7xn Int2) prior to return, ras, 25-jan-94
2-May-94 (MDM) - Patch since sometimes the xrange is passed to this
routine and sometimes the full x-vector is passed
3-May-94 (MDM) - Expanded conditional to call ANYTIM if the input is
a structure (even if only two elements)
4-May-94 (MDM) - Removed 2-May and 3-May patches. The problem was
elsewhere.
31-may-95 (SLF) - per RAS, ensure TIMERANGE is used as plot reference
28-Feb-00 (Kim) - only use TIMERANGE passed in if both values are not zero.
10-Mar-00 (SLF) - update 28-feb change to permit TIMERANGE structures
AND strings....(2nd 10-mar update)
23-May-05 (Kim) - use dblarr, not fltarr for xrange
06-Jan-06 richard.schwartz@gsfc.nasa.gov, added ORDINATE keyword
[Previous]
[Next]
NAME:
TAB_ADDCOL
PURPOSE:
Procedure to add a new column to an existing STSDAS table.
CALLING SEQUENCE:
tab_addcol, name, data, tcb, tab
INPUTS:
name - column name
data - sample data of type to be written to the column.
This parameter is only used to determine data type.
INPUT/OUTPUTS:
tcb - table control block
tab - table array
CALLS: ***
TAB_COL, TAB_EXPAND
CALLED BY:
TAB_PUT
HISTORY:
version 1 D. Lindler April 89
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_COL
PURPOSE:
Procedure to extract column information from table control block
CALLING SEQUENCE:
tab_col, tcb, column, offset, width, datatype, name, units, format
INPUTS:
tcb - table control block returned by tab_open.
column - column name (string) or column number
OUTPUTS:
offset - column offset bytes
width - column width in bytes
datatype - column data type:
6 - real*4
7 - real*8
4 - integer*4
1 - boolean
2 - character string
name - column name
units - column units
format - format code
CALLS: ***
NULLTRIM
CALLED BY:
TABLE_APPEND, TABLE_CALC, TABLE_LIST, TAB_ADDCOL, TAB_MODCOL, TAB_NULLROW, TAB_PRINT
TAB_PUT, TAB_READ, TAB_VAL, TAB_WRITE
SIDE EFFECTS:
If the column is not found then !err is set to -1.
Otherwise !err is set to the column number (starting at one).
HISTORY:
version 1 D. Lindler Jan 88
Converted to NEW IDL April 90
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_CREATE
PURPOSE:
Procedure to create a new table file.
CALLING SEQUENCE:
tab_create, tcb, tab, maxcol, maxrows, row_len, tb_type
OUTPUTS:
tcb - table control block for reading from and writing
to the file (see tab_open for description)
tab - table array
OPTIONAL INPUTS:
maxcol - maximum allocated number of columns [default=10]
maxrows - maximum allocated number of rows [default=100]
row_len - row length in 2 byte units [default=2*maxcol]
tb_type - table type 'row' or 'column' ordered
CALLED BY:
ST_DISKREAD, ST_DISK_DATA, ST_DISK_GEIS, ST_DISK_TABLE
SIDE EFFECTS:
Table file is created and left opened to unit number tcb(0,0)
for writing.
HISTORY:
version 1 D. Lindler Dec. 88
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_DEL
PURPOSE:
Delete specified row(s) from an STSDAS table
CALLING SEQUENCE:
tab_del, tcb, tab, rows
INPUT/OUTPUTS
tcb - table control block
tab - table array
OPTIONAL INPUTS:
rows - row (scalar) or rows(vector) to delete from the table
If not supplied all rows are deleted.
CALLED BY:
TABLE_DELETE
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_EXPAND
PURPOSE:
routine to expand the size of an SDAS table file.
CALLING SEQUENCE:
tab_expand, tcb, tab, maxcol, maxrow, rowlen
INPUT/OUTPUT:
tcb - table control block returned by routine TAB_READ
or TAB_CREATE.
tab - table array
OPTIONAL INPUTS:
maxcol - new maximum number of columns.
maxrow - new maximum number of rows.
rowlen - new maximum row length in 2 byte units.
If maxcol, maxrow, or rowlen are supplied with
values less than the previous maximums, the previous
maximums are used. All values are defaulted to zero
if not supplied.
CALLED BY:
TABLE_APPEND, TAB_ADDCOL, TAB_PUT
HISTORY:
Version 1 D. Lindler Dec. 88
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_FORTOSPP
PURPOSE:
Procedure to convert a FORTRAN format to an SPP format specfication.
CALLING SEQUENCE:
sppformat, format, sppformat
INPUTS:
format - fortran format specification
OUTPUTS:
sppformat - sppformat specification
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
CALLED BY:
TAB_MODCOL
HISTORY:
version 1 D. Lindler Jan, 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_MODCOL
PURPOSE:
Modify column description in a STSDAS table
CALLING SEQUENCE:
tab_modcol, tcb, column, units, format, newname
INPUTS:
tcb - table control block
column - column name or number to be modified
OPTIONAL INPUTS:
units - string giving physical units for the column.
If not supplied or set to the null string
the units are not changed.
format - print format (either fortran or SPP format)
An spp format should be preceeded by a '%'.
If not supplied or set to a null string, the
print format for the column is not changed.
newname - new name for the column. If not supplied
or set to a null string, the name is not
changed
CALLS: ***
TAB_COL, TAB_FORTOSPP
EXAMPLES:
change the wavelength column to WAVE with a new format
of 'F10.3' and columns units of ANGSTROMS.
tab_modcol,tcb,'wavelength','ANGSTROMS','F10.3','WAVE'
Change to print format of column 3 to spp format
20.10e
tab_modcol,tcb,3,'','%20.10e'
HISTORY:
version 1 D. Lindler Apr 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_NULL
PURPOSE:
function to locate null values within a vector of values from
an STSDAS table.
CALLING SEQUENCE
result = tab_null(values)
INPUTS:
values - data value(s)
OUTPUTS:
a boolean variable is returned with the same length as values.
1 indicates that the corresponding value was null
OPERATIONAL NOTES:
Boolean columns in an STSDAS table does not presently
have the capability to flag null values.
CALLS: ***
NULLTRIM
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_NULLROW
PURPOSE:
Insert null row(s) into a STSDAS table
CALLING SEQUENCE:
tab_nullrow, tcb, tab, [ row1, row2 ]
INPUTS:
tcb - table control block
INPUT/OUTPUTS:
tab - table array
OPTIONAL INPUTS:
row1 - first row number to insert nulls (default=0)
row2 - last row number to insert nulls (default = last row)
CALLS: ***
TAB_COL
CALLED BY:
TAB_PUT
HISTORY:
version 1, D. Lindler Apr 89
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_PRINT
PURPOSE:
Routine to print an stsdas table.
CALLING SEQUENCE:
tab_print, tcb, tab, columns, row1, row2
INPUTS:
tcb - table control block returned by TAB_READ
tab - table array read by TAB_READ
OPTIONAL INPUTS:
columns - vector of column numbers to be printed or a string
with column names separated by commas. If not supplied
or set to the null string, all columns are printed.
row1 - first row to print. (default=0)
row2 - last row to print. (default=last row in table)
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], NULLTRIM, TAB_COL, TAB_SPPTOFOR
TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2]
TEXTOPEN [3]
CALLED BY:
TABLE_PRINT [1], table_print [2]
SIDE EFFECTS:
text is printed as directed by !textout
HISTORY:
version 1, D. Lindler Apr 89
April 90 Converted to NEW IDL D. Lindler
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_PUT
PURPOSE:
Procedure to place new values into a STSDAS table.
CALLING SEQUENCE:
tab_put, column, values, tcb, tab, row
INPUTS:
column - column name or number (if it is a new column then
a column name must be specified)
values - data values to add to the table
INPUT/OUTPUTS:
tcb - table control block
tab - table array
OPTIONAL INPUT:
row - starting row to insert values
CALLS: ***
TAB_ADDCOL, TAB_COL, TAB_EXPAND, TAB_NULLROW
CALLED BY:
ST_DISKREAD, ST_DISK_DATA, ST_DISK_GEIS, ST_DISK_TABLE, TABLE_CALC
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_READ
PURPOSE:
Procedure to read an SDAS table file
CALLING SEQUENCE:
tab_read,name,tcb,table,header
INPUTS:
name - name of the table file
OUTPUTS:
tcb - table control block
Longword array of size 16 x maxcols+2
where maxcols is the maximum number of columns
allocated for the table.
tcb(*,0) contains:
word 0 SPARE
1 number of user parameters
2 max. number of user par. allowed
3 number of rows in the table
4 number of allocated rows (for col. ordered tab)
5 number of columns defined
6 max number of columns
7 length of row used (in units of 2-bytes)
8 max row length (in units of 2-bytes)
relevant only for row ordered tables.
9 table type (11 for row order, 12 for col. order)
15 update flag (0-readonly, 1-update)
tcb(*,i) contains description of column i
word 0 column number
1 offset for start of row in units of 2-bytes
2 width or column in 2-byte units
3 data type
6 = real*4
7 = real*8
4 = integer*4
1 = boolean*4
2 = character string
4-8 ascii column name up to 19 characters
9-13 column units (up to 19 characters)
14-15 format string
tcb(*,max number of columns+1)= file name
table - table array, Byte array row length (bytes) x nrows
header - header parameters in form usable by sxpar, sxaddhist,
sxaddpar, ect.
CALLS: ***
FDECOMP [1], FDECOMP [2], FDECOMP [3], NULLTRIM, SXADDPAR [1], SXADDPAR [2]
SXADDPAR [3], TAB_COL
CALLED BY:
TABLE_APPEND, TABLE_CALC, TABLE_DELETE, TABLE_EXT, TABLE_HELP, TABLE_LIST
TABLE_PRINT [1], TABLE_SORT, table_print [2]
HISTORY:
Version 1 D. Lindler Jan 88
Converted to NEW IDL April 90 D. Lindler
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_SIZE
PURPOSE:
Routine to extract the table size from a table control block
CALLING SEQUENCE:
tab_size, tcb, nrows, ncols, maxrows, maxcols, rowlen, max_rowlen
INPUTS:
tcb - table control block
OUTPUTS:
nrows - number of rows in the table
ncols - number of columns in the table
maxrows - number of rows allocated
maxcols - number of columns allocated
rowlen - length of the rows in bytes
max_rowlen - allocated row length
CALLED BY:
TABLE_CALC, TABLE_LIST
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_SORT
PURPOSE:
Procedure to sort table by the specified column
CALLING SEQUENCE:
tab_sort, column, tcb, tab
INPUTS:
column - column name or number to sort on
tcb - table control block
INPUT/OUTPUTS:
tab - table array
CALLS: ***
TAB_VAL
CALLED BY:
TABLE_SORT
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_SPPTOFOR
PURPOSE:
This procedure converts an spp format specification to a normal
Fortran format specification.
CALLING SEQUENCE:
tab_spptofor, sppformat, format, width
INPUTS:
sppformat - spp format specification (without preceeding %)
OUTPUTS:
forformat - fortran format specification (string)
width - field width (integer)
CALLED BY:
TAB_PRINT
HISTORY:
version 1 D. Lindler Jan 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_VAL
PURPOSE:
Routine to read a column from an SDAS table file
CALLING SEQUENCE:
values = tab_val( tcb, table, column, [ rows ] )
INPUTS:
tcb - table control block returned by tab_val
table - table array returned by tab_val
column - scalar column name or number
OPTIONAL INPUT:
rows - scalar giving row number or vector giving rows.
If not supplied all rows are returned.
OUTPUT:
the values for the specified column (and rows) is returned
as the function value. If row is specified as a scalar
(single row) then the result will be a scalar.
CALLS: ***
NULLTRIM, TAB_COL
CALLED BY:
TABLE_EXT, TABLE_LIST, TAB_SORT
HISTORY:
version 1 D. Lindler Jan. 1988
Allow for a null column Landsman/Feggans April 1992
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TAB_WRITE
PURPOSE:
Routine to write an stsdas table to disk
CALLING SEQUENCE:
tab_write, name, tcb, tab, header
INPUTS:
name - file name (default extension = .tab)
tcb - table control block
tab - table array
OPTIONAL INPUT:
header - FITS header array
CALLS: ***
SXPAR [1], SXPAR [2], SXPAR [3], TAB_COL
CALLED BY:
ST_DISKREAD, ST_DISK_DATA, ST_DISK_GEIS, ST_DISK_TABLE, TABLE_APPEND, TABLE_CALC
TABLE_DELETE, TABLE_SORT
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
Remove VMS-specific OPEN statement W. Landsman September 2006
[Previous]
[Next]
NAME:
TABINV
PURPOSE:
To find the effective index of a function value in an ordered vector.
CALLING SEQUENCE:
TABINV, XARR, X, IEFF, [/FAST]
INPUTS:
XARR - the vector array to be searched, must be monotonic
increasing or decreasing
X - the function value(s) whose effective
index is sought (scalar or vector)
OUTPUT:
IEFF - the effective index or indices of X in XARR
real or double precision, same # of elements as X
CALLED BY:
LINTERP
OPTIONAL KEYWORD INPUT:
/FAST - If this keyword is set, then the input vector is not checked
for monotonicity, in order to improve the program speed.
RESTRICTIONS:
TABINV will abort if XARR is not monotonic. (Equality of
neighboring values in XARR is allowed but results may not be
unique.) This requirement may mean that input vectors with padded
zeroes could cause routine to abort.
PROCEDURE:
VALUE_LOCATE() is used to find the values XARR[I]
and XARR[I+1] where XARR[I] < X < XARR[I+1].
IEFF is then computed using linear interpolation
between I and I+1.
IEFF = I + (X-XARR[I]) / (XARR[I+1]-XARR[I])
Let N = number of elements in XARR
if x < XARR[0] then IEFF is set to 0
if x > XARR[N-1] then IEFF is set to N-1
EXAMPLE:
Set all flux values of a spectrum (WAVE vs FLUX) to zero
for wavelengths less than 1150 Angstroms.
IDL> tabinv, wave, 1150.0, I
IDL> flux[ 0:fix(I) ] = 0.
FUNCTIONS CALLED:
None
REVISION HISTORY:
Adapted from the IUE RDAF January, 1988
More elegant code W. Landsman August, 1989
Mod to work on 2 element decreasing vector August, 1992
Converted to IDL V5.0 W. Landsman September 1997
Updated for V5.3 to use VALUE_LOCATE() W. Landsman January 2000
Work when both X and Xarr are integers W. Landsman August 2001
[Previous]
[Next]
Name: table2struct
Purpose: convert ascii table data to structure - optionally read file
Input Parameters:
table - table data - string array OR ascii file name (ala rd_tfile)
names - (if FORMAT option used) optional list of tag names
(should map 1:1 to FORMAT data )
(names can be an array or a comma delimited scalar string)
Output Parameters:
function returns structure converted version of ascii table
Keyword Paramters:
FORMAT - format string describing one line (SIMPLE ONLY FOR NOW)
A, I , F, and D formats are mapped->structure tags
STRTEMPLATE - (instead of FORMAT) template structure to use
NOCOMMENT - comment delimiter (';', '#', etc)
(scalar, array or comma delimited list)
Calling Sequence:
table_structure=table2struct(tabledata [,names=names] , format='(XXXX)',$
nocomment='c1,c2...cn')
OR
table_structure=table2struct(tabledata, strtemplate={template}, $
nocomment=comment_characters )
Calling Example:
Let's say you have a file named 'table.dat' table which looks like...
--------------------------------
; Comment 1
; Comment 2
; Comment N
;
1996 02 01 123.12 [other stuff] ; partial comment line OK
1997 05 15 456.21 [other stuff]
1997 09 25 107.33 [other stuff]
; embedded comments ok
; arbitrary number of data lines ...(etc)..
1998 01 13 2012.11 [other stuff]
--------------------------------
You can read/convert into a vector of structures (just dates in this ex)
------------------ CALL -----------------------
IDL> tstruct=table2struct('table.dat', nocomment=';', $ ; FILE
'year,month,day,data', $ ; NAMES
format='(1x,i4,2x,i2,1x,i2,2x,f7.2)' ) ; FORMAT
------------------------------------------------
--- here is what the above call returned for the file above ---
IDL> help,tstruct & help,tstruct,/str
TSTRUCT STRUCT = -> MS_246991521002 Array(4) ; <<< 1 per line
** Structure MS_246991521002, 4 tags, length=16:
YEAR LONG 1996
MONTH LONG 2
DAY LONG 1
DATA FLOAT 123.120
--------------------------------
CALLED BY:
rd_goesp_ascii, rd_goesx_ascii
History:
23-Oct-1997 - S.L.Freeland based on G.L.Slater suggestion/requirements
24-Oct-1997 - S.L.Freeland - document, call 'strnocomment'
(remove comments and null lines)
17-Nov-1997 - Allow NOCOMMENT to be array or comma delimited list
Add STRTEMPLATE keyword and function
18-nov-1997 - Allow multiple file handling (filename vector)
CALLS: ***
ARR2STR [1], Arr2Str [2], FILE_EXIST [2], MAKE_STR [1], MAKE_STR [2], MAP_FORMAT
STR2ARR [1], STR2ARR [2], data_chk [1], data_chk [2], file_exist [1]
file_exist [3], prstr [1], prstr [2], rd_tfile [1], rd_tfile [2], strjustify
strnocomment
Restrictions:
FORMAT or STRTEMPLATE currently required (describes layout of typical line)
Groups (imply array tag) not yet handled (would use call to fmt_tag.pro)
Not much error checking - assumes all lines are uniform
If multiple file name input, assume all files have like structure
[Previous]
[Next]
NAME:
TABLE_APPEND
PURPOSE:
Routine to append STSDAS tables to create a single table.
Input tables must all have identical columns.
CALLING SEQUENCE:
table_append,list,name
INPUTS:
list - string array listing the file names or a string
scalar giving a file name template.
name - output file name.
CALLS: ***
TAB_COL, TAB_EXPAND, TAB_READ, TAB_WRITE
SIDE EFFECTS:
a new STSDAS table is created with the specified name.
OPERATIONAL NOTES:
all input tables must have the same number of columns
with the same names, datatypes, and column order.
Header parameters are taken only from the first table.
HISTORY:
version 1 D. Lindler April 1989
Removed call to non-standard system variable !DUMP WBL September 1997
Converted to IDL V5.0 W. Landsman September 1997
Use file_search rather than findfile W. Landsman Sep 2006
[Previous]
[Next]
NAME:
TABLE_CALC
PURPOSE:
Adds a new table column from a expression using existing columns
CALLING SEQUENCE:
table_calc, table, expression, table_out
INPUTS:
table - input SDAS table table
expression - expression for new or updated column values.
Any legal IDL expression is valid where existing
column names can be used as variables. User functions
within the expression are allowed if the function
is in an IDL library or previously compiled.
OPTIONAL INPUT:
table_out - output table name. If not supplied, the
input name is used.
OUTPUTS:
a new SDAS table file is created.
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], SXADDHIST [1], SXADDHIST [2]
TAB_COL, TAB_PUT, TAB_READ, TAB_SIZE, TAB_WRITE
EXAMPLES:
create a column WAVELENGTH in table TAB which is the average
of the WLOW and WHIGH columns of table TAB.
table_calc,'tab','WAVELENGTH=(WLOW+WHIGH)/2.0'
add a column SINX which is the sin of column X to table JUNK.
table_calc,'junk','SINX=sin(X)'
add 10.0 to an existing column in table MYTAB.
table_calc,'mytab','flux=flux+10.0'
HISTORY
version 1 D. Lindler November, 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TABLE_DELETE
PURPOSE:
Delete specified rows from an STSDAS table
CALLING SEQUENCE:
table_delete, name, rows, [ outname ]
INPUT:
name - table name
rows - row (scalar) or rows(vector) to delete from the table
OPTIONAL OUTPUT:
outname - output table name, if not supplied the input name
is used
CALLS: ***
TAB_DEL, TAB_READ, TAB_WRITE
HISTORY:
version 1 D. Lindler April 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TABLE_EXT
PURPOSE:
Routine to extract columns from an STSDAS table
CALLING SEQUENCE:
TABLE_EXT, name, columns, v1, [v2,v3,v4,v5,v6,v7,v8,v9]
INPUTS:
name - table name, scalar string
columns - table columns to extract. Can be either
(1) String with names separated by commas
(2) Scalar or vector of column numbers
OUTPUTS:
v1,...,v9 - values for the columns
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], TAB_READ, TAB_VAL
EXAMPLES:
Read wavelength and throughput vectors from STSDAS table, wfpc_f725.tab
IDL> table_ext,'wfpc_f725.tab','wavelength,throughput',w,t
or
IDL> table_ext,'wfpc_f725.tab',[1,2],w,t
PROCEDURES CALLED:
GETTOK(), TAB_READ, TAB_VAL()
HISTORY:
version 1 D. Lindler May 1989
Accept Column Numbers as well as names, W. Landsman February 1996
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TABLE_HELP
PURPOSE:
Procedure to decribe an SDAS table file.
CALLING SEQUENCE:
table_help, tcb, header
table_help, name
INPUTS:
tcb - table control block returned by TAB_READ or TAB_CREATE
name - the table name
OPTIONAL INPUTS:
header - header array returned by TAB_READ. If supplied
it will be printed, otherwise it won't.
CALLS: ***
NULLTRIM, TAB_READ, TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1]
TEXTOPEN [2], TEXTOPEN [3]
SIDE EFFECTS:
text output as specified by !textout
HISTORY:
version 1 D. Lindler JAN 1988
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TABLE_LIST
PURPOSE:
List the contents of an STSDAS table.
EXPLANATION:
Procedure to list contents of an STSDAS table. This does not
print the table in tabular form but instead for each row
prints the column name followed by its value (one column per
output line.
CALLING SEQUENCE:
table_list, name, row1, row2, [ TEXTOUT=, /HEADER ]
INPUTS:
name - table name
CALLS: ***
TAB_COL, TAB_READ, TAB_SIZE, TAB_VAL, TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3]
TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3]
OPTIONAL KEYWORD INPUT:
TEXTOUT - Scalar string giving output file name, or integer (1-5)
specifying output device. See TEXTOPEN for more info.
Default is to display output at the terminal
HEADER - if set, the header is printed before the selected row printout
OPTIONAL INPUTS:
row1 - first row to list (default = first row)
row2 - last row to list (default = last row)
OUTPUT:
text output is written to the output device specified by the TEXTOUT
keyword, or the nonstandard system variable !TEXTOUT
PROCEDURES USED:
TAB_COL, TAB_READ, TAB_SIZE, TAB_VAL(), TEXTOPEN, TEXTCLOSE
HISTORY:
version 1 D. Lindler May 1989
July 1996, DJL, added /header keyword to optionally print header
August 1996, WBL, added TEXTOUT keyword
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TABLE_PRINT
PURPOSE:
Routine to print an stsdas table.
CALLING SEQUENCE:
table_print, name, columns, row1, row2
INPUTS:
name - table name
OPTIONAL INPUTS:
columns - vector of column numbers to be printed or a string
with column names separated by commas. If not supplied
or set to the null string, all columns are printed.
row1 - first row to print. (default=0)
row2 - last row to print. (default=last row in table)
CALLS: ***
TAB_PRINT, TAB_READ, TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3]
CALLED BY:
table_dump
SIDE EFFECTS:
text is printed as directed by !textout
HISTORY:
version 1, D. Lindler Apr 89
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TABLE_SORT
PURPOSE:
Procedure to sort an STSDAS table by the specified column
CALLING SEQUENCE:
table_sort, name, column, [ name_out ]
INPUTS:
name - table name
column - column to sort on
OPTIONAL INPUTS:
name_out - output table name. If not supplied, input name
is used.
CALLS: ***
TAB_READ, TAB_SORT, TAB_WRITE
HISTORY:
version 1 D. Lindler MAY 1989
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
PROJECT:
HESSI
NAME:
TAG_DEREFERENCE( struct )
PURPOSE:
Checks structure tags for pointers, dereferences them and
returns a structure without pointers
CATEGORY:
gen/struct
CALLING SEQUENCE:
new_struct = tag_dereference( struct )
INPUTS:
struct: any structure
OUTPUTS:
new_struct: an anonymous structure containing the pointerless
copy of the structure passed in.
EXAMPLE:
IDL> struct = {a: 0, b: ptr_new( indgen(10) ), c: 'test' }
IDL> help, struct, /str
** Structure <824884c>, 3 tags, length=20, data length=18, refs=1:
A INT 0
B POINTER <PtrHeapVar1>
C STRING 'test'
IDL> help, tag_dereference( struct ), /str
** Structure <8257614>, 3 tags, length=36, data length=34, refs=1:
A INT 0
B INT Array[10]
C STRING 'test'
CALLS: ***
TAG_DEREFERENCE, str_taginfo
SEE ALSO:
REP_TAG_VALUE
HISTORY:
Version 1, December 16, 1999,
A Csillaghy, csillag@ssl.berkeley.edu
2-May-2005, Kim Tolbert -speed up by using create_struct instead of rep_tag_value
3-aug-2005, acs, checks whether there is something to dereference otherwise
just return the same structure. This allows not loosing named structures
when no dereference is needed (needed by jimm in obssumm)
[Previous]
[Next]
Project : SOHO - CDS
Name : TAG_EXIST()
Purpose : To test whether a tag name exists in a structure.
Explanation : Routine obtains a list of tagnames and tests whether the
requested one exists or not. The search is recursive so
if any tag names in the structure are themselves structures
the search drops down to that level. (However, see the keyword
TOP_LEVEL).
Use : IDL> status = tag_exist(str, tag)
Inputs : str - structure variable to search
tag - tag name to search for
Opt. Inputs : None
Outputs : Function returns 1 if tag name exists or 0 if it does not.
Opt. Outputs: None
Keywords : INDEX = Index of matching tag
TOP_LEVEL = If set, then only the top level of the structure is
searched.
RECURSE = set to recurse on nested structures
Category : Util, structure
Written : C D Pike, RAL, 18-May-94
Modified : Version 1.1, D Zarro, ARC/GSFC, 27-Jan-95
Passed out index of matching tag
Version 2, William Thompson, GSFC, 6 March 1996
Added keyword TOP_LEVEL
Version 2.1, Zarro, GSFC, 1 August 1996
Added call to help
Version 3, Zarro, EIT/GSFC, 3 June 2000
added check for input array structure
Version 4, Zarro, EIT/GSFC, 23 Aug 2000
removed calls to DATATYPE
Version 5, Zarro, EIT/GSFC, 29 Sept 2000
added /quiet
Version 6, Zarro (EER/GSC), 22 Dec 2002
made recursion NOT the default
CALLED BY
AD2XY, ADD_DETAIL, ADD_TAG [1], ADD_TAG [2], ANYTIM2UTC [1], BSCALE, CDS_PLAN_BRIEF
CDS_STACK, CF_GIS1A, CF_GIS1B, CF_GIS1C, CF_GIS2A [1], CF_GIS4A, CF_GIS4B, CF_GIS4C
CHECK_INT_TIME, CHECK_KAP, CHIANTI_DEM, CH_LINE_LIST, COPY_QLDS, CWQ_CUBE, CW_MOUSE
CW_PSELECT, DELETE_QLDS, DETDATA, DROT_COORD, DROT_MAP_FAST, DROT_RASTER
EDGES_HVSPEC, EIT_CATRD [1], EIT_FXPAR, ENABLEFLAG, FIND_PACKET, FITSHEAD2WCS
FORM_INT, FORM_VEL, FREEZE_RAS_DUR, GET_CDS_DUR, GET_CDS_FOV, GET_CDS_GIS
GET_CDS_PLAN, GET_CDS_STUDY, GET_CDS_XY, GET_FITS_TIME, GET_MAP_PROP, GET_MAP_TIME
GET_PLAN_TT, GET_PLAN_TYPE, GET_STUDY_PAR, GIS_UTPLOT, GT_IIMAGE, GT_SCANP, GT_SCANT
GT_SCANX, GT_SCANY, GT_SOLAR_XY, GT_SPECTRUM, GT_VMAP, GT_WINDATA, GT_WINDESC, HASTROM
HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3]
HESSI IMAGE FILE CLASS DEFINITION [1]
HESSI IMAGE STRATEGY CLASS DEFINITION, HESSI SIMULATION CLASS DEFINITION
HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_FITS2MAP [1], HSI_GET_TIMEBIN
HSI_HIST_GROUP, HSI_RADIAL_COORD, HSI_RD_FITS_SPECTRUM, HSI_RD_PACKET_TIMES
HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
HSI_SPECTROGRAM_DECIM_TABLE, INDEX2MAP, INT2UTC, ITOOL_RD_FITS, LOADCT
LOAD_WAVECAL, MAKE_CHIANTI_SPEC, MAP2FITS, MEAN_MAP, MK_CDS_PLAN, MK_CDS_STUDY
MK_IVM_MAP, MK_PLAN_CAMP, MK_PLAN_CONV, MK_PLAN_CORR, MK_PLAN_CUSTOM
MK_PLAN_EXIST, MK_PLAN_POINT, MK_PLAN_RECAL, MK_PLAN_XY, MK_RASTER, MK_SOHO
MK_SOHO_CUSTOM, MK_SOHO_TARGET, MK_STUDY, MK_SXT_MAP, MK_WAVECAL, MOD_CAMPAIGN
NIS_ROTATE, OPEN_ANACUBE, OPLOT_NAR [1], OPLOT_SPLAN, PLOT_CHIANTI_NE
PLOT_CHIANTI_TE, PLOT_MAP
PLOT_MAP2 WARNINGTEMPORARY FIX ONLY FOR 16 bit ZBuffer support
PLOT_RESOURCE, PLOT_SPLAN, POP_SOLVER, PUTAST, RD_CDS_POINT, RD_PLAN, RD_RESOURCE
READ_KAP, READ_KAP_ITEM, REDUCE_LEVEL_05, REM_MAP_LIMB, RESTORE_QLDS
RHESSI IMAGE SINGLE CLASS DEFINITION, ROT_CDS_XY, RTMVIPLAY [1], RTMVIPLAY [2]
RTMVIPLAYPNG, SAVE_QLDS, SETFLAG, SHOW_RES_STC, SOHO_ITEMS_HTML
SPECTROGRAM CLASS DEFINITION, SPEX_GEN__DEFINE, STORE_WND, ST_UPDATE_FIELD
ST_WINDATA, TKI_CALL, TKI_DISPLAY_DET, TP_CALL_HELP, TP_WRT_IEF, UNPACK_MAP
UNSETFLAG, UPDATE_CAMPAIGN, UPDATE_KAP, UPDATE_STUDY_DUR, UTC2DOY, UTC2STR
VALID_MAP, VALID_WCS, VDS_DEBIAS, WCS2FITSHEAD, WCS2MAP, WCS_DECOMP_ANGLE
WCS_FIND_PIXEL_LIST, WCS_FIND_POSITION, WCS_FIND_SPECTRUM, WCS_FIND_SYSTEM
WCS_FIND_TABLE, WCS_FIND_TIME, WCS_GET_TIME, WCS_INV_PROJ_A2F, WCS_INV_PROJ_A2V
WCS_INV_PROJ_A2W, WCS_INV_PROJ_AIR, WCS_INV_PROJ_AIT, WCS_INV_PROJ_ARC
WCS_INV_PROJ_AZP, WCS_INV_PROJ_BON, WCS_INV_PROJ_CAR, WCS_INV_PROJ_CEA
WCS_INV_PROJ_COD, WCS_INV_PROJ_COE, WCS_INV_PROJ_COO, WCS_INV_PROJ_COP
WCS_INV_PROJ_CSC, WCS_INV_PROJ_CYP, WCS_INV_PROJ_F2V, WCS_INV_PROJ_F2W
WCS_INV_PROJ_GRA, WCS_INV_PROJ_GRI, WCS_INV_PROJ_MER, WCS_INV_PROJ_MOL
WCS_INV_PROJ_PAR, WCS_INV_PROJ_PCO, WCS_INV_PROJ_QSC, WCS_INV_PROJ_SFL
WCS_INV_PROJ_SIN, WCS_INV_PROJ_STG, WCS_INV_PROJ_SZP, WCS_INV_PROJ_TAB
WCS_INV_PROJ_TAN, WCS_INV_PROJ_TSC, WCS_INV_PROJ_V2A, WCS_INV_PROJ_V2F
WCS_INV_PROJ_V2W, WCS_INV_PROJ_W2F, WCS_INV_PROJ_W2V, WCS_INV_PROJ_ZEA
WCS_INV_PROJ_ZPN, WCS_PROJ_A2F, WCS_PROJ_A2V, WCS_PROJ_A2W, WCS_PROJ_AIR
WCS_PROJ_AIT, WCS_PROJ_ARC, WCS_PROJ_AZP, WCS_PROJ_BON, WCS_PROJ_CAR, WCS_PROJ_CEA
WCS_PROJ_COD, WCS_PROJ_COE, WCS_PROJ_COO, WCS_PROJ_COP, WCS_PROJ_CSC, WCS_PROJ_CYP
WCS_PROJ_F2V, WCS_PROJ_F2W, WCS_PROJ_GRA, WCS_PROJ_GRI, WCS_PROJ_MER, WCS_PROJ_MOL
WCS_PROJ_PAR, WCS_PROJ_PCO, WCS_PROJ_QSC, WCS_PROJ_SFL, WCS_PROJ_SIN, WCS_PROJ_STG
WCS_PROJ_SZP, WCS_PROJ_TAB, WCS_PROJ_TAN, WCS_PROJ_TSC, WCS_PROJ_V2A, WCS_PROJ_V2F
WCS_PROJ_V2W, WCS_PROJ_W2F, WCS_PROJ_W2V, WCS_PROJ_ZEA, WCS_PROJ_ZPN, WCS_RECTIFY
WCS_SIMPLE, WCS_SIMPLIFY, WRUNMOVIE [2], XCAMP, XCPT, XPORT, XSTUDY, XTKI, XY2AD, ch_ss
cw_edroplist, db_gbo, fits_interp, fitshead2struct, get_plan_spec, gis_cqlds
hsi_chk_obj, hsi_coll_widget, hsi_get_image_abs_time, hsi_get_time_range
hsi_get_total_time, hsi_image__getaxis [2], hsi_image__plot [2]
hsi_image_fitsread, hsi_image_plot, hsi_imagefile_2_plotman
hsi_imagemisc_widget, hsi_imagesize_widget, hsi_obs_summary__define [1]
hsi_obs_summary__define [2], hsi_obs_summary_adapter__define
hsi_params2script, hsi_select_flare, hsi_spectrogramACCBIN [2]
hsi_spectrogram__define [1], hsi_spectrogram__define [2]
hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
hsi_spectrogram__livetime [1], hsi_spectrum_fitsread, hsi_ui_img, hsi_ui_lc
hsi_ui_mon, hsi_ui_obs, hsi_ui_ql, hsi_ui_qlimage, hsi_ui_spec, ihy_db, map2index
mreadfits, mreadfits_fixup, plotman, rd_fdss, read_hessi_4_ospex
read_hessi_4_spex [1], read_hessi_4_spex [2], read_soon, read_trace
read_xsm_4_ospex, spex_hessi_fits2drm, spex_merge_plots, ssw_install [1]
ssw_install [2], ssw_track_fov, struct2fitshead, sxig12_browsegen, tr_rd_index
trace_dph2struct [1], trace_rd_jpeg
[Previous]
[Next]
NAME:
TAG_EXIST()
PURPOSE:
To test whether a tag name exists in a structure.
EXPLANATION:
Routine obtains a list of tagnames and tests whether the requested one
exists or not. The search is recursive so if any tag names in the
structure are themselves structures the search drops down to that level.
(However, see the keyword TOP_LEVEL).
CALLING SEQUENCE:
status = TAG_EXIST(str, tag, [ INDEX =, /TOP_LEVEL ] )
INPUT PARAMETERS:
str - structure variable to search
tag - tag name to search for, scalar string
OUTPUTS:
Function returns 1b if tag name exists or 0b if it does not.
OPTIONAL INPUT KEYWORD:
TOP_LEVEL = If set, then only the top level of the structure is
searched.
OPTIONAL OUTPUT KEYWORD:
INDEX = index of matching tag, scalar longward, -1 if tag name does
not exist
CALLED BY:
AD2XY, ADD_DETAIL, ADD_TAG [1], ADD_TAG [2], ANYTIM2UTC [1], BSCALE, CDS_PLAN_BRIEF
CDS_STACK, CF_GIS1A, CF_GIS1B, CF_GIS1C, CF_GIS2A [1], CF_GIS4A, CF_GIS4B, CF_GIS4C
CHECK_INT_TIME, CHECK_KAP, CHIANTI_DEM, CH_LINE_LIST, COPY_QLDS, CWQ_CUBE, CW_MOUSE
CW_PSELECT, DELETE_QLDS, DETDATA, DROT_COORD, DROT_MAP_FAST, DROT_RASTER
EDGES_HVSPEC, EIT_CATRD [1], EIT_FXPAR, ENABLEFLAG, FIND_PACKET, FITSHEAD2WCS
FORM_INT, FORM_VEL, FREEZE_RAS_DUR, GET_CDS_DUR, GET_CDS_FOV, GET_CDS_GIS
GET_CDS_PLAN, GET_CDS_STUDY, GET_CDS_XY, GET_FITS_TIME, GET_MAP_PROP, GET_MAP_TIME
GET_PLAN_TT, GET_PLAN_TYPE, GET_STUDY_PAR, GIS_UTPLOT, GT_IIMAGE, GT_SCANP, GT_SCANT
GT_SCANX, GT_SCANY, GT_SOLAR_XY, GT_SPECTRUM, GT_VMAP, GT_WINDATA, GT_WINDESC, HASTROM
HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3]
HESSI IMAGE FILE CLASS DEFINITION [1]
HESSI IMAGE STRATEGY CLASS DEFINITION, HESSI SIMULATION CLASS DEFINITION
HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_FITS2MAP [1], HSI_GET_TIMEBIN
HSI_HIST_GROUP, HSI_RADIAL_COORD, HSI_RD_FITS_SPECTRUM, HSI_RD_PACKET_TIMES
HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
HSI_SPECTROGRAM_DECIM_TABLE, INDEX2MAP, INT2UTC, ITOOL_RD_FITS, LOADCT
LOAD_WAVECAL, MAKE_CHIANTI_SPEC, MAP2FITS, MEAN_MAP, MK_CDS_PLAN, MK_CDS_STUDY
MK_IVM_MAP, MK_PLAN_CAMP, MK_PLAN_CONV, MK_PLAN_CORR, MK_PLAN_CUSTOM
MK_PLAN_EXIST, MK_PLAN_POINT, MK_PLAN_RECAL, MK_PLAN_XY, MK_RASTER, MK_SOHO
MK_SOHO_CUSTOM, MK_SOHO_TARGET, MK_STUDY, MK_SXT_MAP, MK_WAVECAL, MOD_CAMPAIGN
NIS_ROTATE, OPEN_ANACUBE, OPLOT_NAR [1], OPLOT_SPLAN, PLOT_CHIANTI_NE
PLOT_CHIANTI_TE, PLOT_MAP
PLOT_MAP2 WARNINGTEMPORARY FIX ONLY FOR 16 bit ZBuffer support
PLOT_RESOURCE, PLOT_SPLAN, POP_SOLVER, PUTAST, RD_CDS_POINT, RD_PLAN, RD_RESOURCE
READ_KAP, READ_KAP_ITEM, REDUCE_LEVEL_05, REM_MAP_LIMB, RESTORE_QLDS
RHESSI IMAGE SINGLE CLASS DEFINITION, ROT_CDS_XY, RTMVIPLAY [1], RTMVIPLAY [2]
RTMVIPLAYPNG, SAVE_QLDS, SETFLAG, SHOW_RES_STC, SOHO_ITEMS_HTML
SPECTROGRAM CLASS DEFINITION, SPEX_GEN__DEFINE, STORE_WND, ST_UPDATE_FIELD
ST_WINDATA, TKI_CALL, TKI_DISPLAY_DET, TP_CALL_HELP, TP_WRT_IEF, UNPACK_MAP
UNSETFLAG, UPDATE_CAMPAIGN, UPDATE_KAP, UPDATE_STUDY_DUR, UTC2DOY, UTC2STR
VALID_MAP, VALID_WCS, VDS_DEBIAS, WCS2FITSHEAD, WCS2MAP, WCS_DECOMP_ANGLE
WCS_FIND_PIXEL_LIST, WCS_FIND_POSITION, WCS_FIND_SPECTRUM, WCS_FIND_SYSTEM
WCS_FIND_TABLE, WCS_FIND_TIME, WCS_GET_TIME, WCS_INV_PROJ_A2F, WCS_INV_PROJ_A2V
WCS_INV_PROJ_A2W, WCS_INV_PROJ_AIR, WCS_INV_PROJ_AIT, WCS_INV_PROJ_ARC
WCS_INV_PROJ_AZP, WCS_INV_PROJ_BON, WCS_INV_PROJ_CAR, WCS_INV_PROJ_CEA
WCS_INV_PROJ_COD, WCS_INV_PROJ_COE, WCS_INV_PROJ_COO, WCS_INV_PROJ_COP
WCS_INV_PROJ_CSC, WCS_INV_PROJ_CYP, WCS_INV_PROJ_F2V, WCS_INV_PROJ_F2W
WCS_INV_PROJ_GRA, WCS_INV_PROJ_GRI, WCS_INV_PROJ_MER, WCS_INV_PROJ_MOL
WCS_INV_PROJ_PAR, WCS_INV_PROJ_PCO, WCS_INV_PROJ_QSC, WCS_INV_PROJ_SFL
WCS_INV_PROJ_SIN, WCS_INV_PROJ_STG, WCS_INV_PROJ_SZP, WCS_INV_PROJ_TAB
WCS_INV_PROJ_TAN, WCS_INV_PROJ_TSC, WCS_INV_PROJ_V2A, WCS_INV_PROJ_V2F
WCS_INV_PROJ_V2W, WCS_INV_PROJ_W2F, WCS_INV_PROJ_W2V, WCS_INV_PROJ_ZEA
WCS_INV_PROJ_ZPN, WCS_PROJ_A2F, WCS_PROJ_A2V, WCS_PROJ_A2W, WCS_PROJ_AIR
WCS_PROJ_AIT, WCS_PROJ_ARC, WCS_PROJ_AZP, WCS_PROJ_BON, WCS_PROJ_CAR, WCS_PROJ_CEA
WCS_PROJ_COD, WCS_PROJ_COE, WCS_PROJ_COO, WCS_PROJ_COP, WCS_PROJ_CSC, WCS_PROJ_CYP
WCS_PROJ_F2V, WCS_PROJ_F2W, WCS_PROJ_GRA, WCS_PROJ_GRI, WCS_PROJ_MER, WCS_PROJ_MOL
WCS_PROJ_PAR, WCS_PROJ_PCO, WCS_PROJ_QSC, WCS_PROJ_SFL, WCS_PROJ_SIN, WCS_PROJ_STG
WCS_PROJ_SZP, WCS_PROJ_TAB, WCS_PROJ_TAN, WCS_PROJ_TSC, WCS_PROJ_V2A, WCS_PROJ_V2F
WCS_PROJ_V2W, WCS_PROJ_W2F, WCS_PROJ_W2V, WCS_PROJ_ZEA, WCS_PROJ_ZPN, WCS_RECTIFY
WCS_SIMPLE, WCS_SIMPLIFY, WRUNMOVIE [2], XCAMP, XCPT, XPORT, XSTUDY, XTKI, XY2AD, ch_ss
cw_edroplist, db_gbo, fits_interp, fitshead2struct, get_plan_spec, gis_cqlds
hsi_chk_obj, hsi_coll_widget, hsi_get_image_abs_time, hsi_get_time_range
hsi_get_total_time, hsi_image__getaxis [2], hsi_image__plot [2]
hsi_image_fitsread, hsi_image_plot, hsi_imagefile_2_plotman
hsi_imagemisc_widget, hsi_imagesize_widget, hsi_obs_summary__define [1]
hsi_obs_summary__define [2], hsi_obs_summary_adapter__define
hsi_params2script, hsi_select_flare, hsi_spectrogramACCBIN [2]
hsi_spectrogram__define [1], hsi_spectrogram__define [2]
hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
hsi_spectrogram__livetime [1], hsi_spectrum_fitsread, hsi_ui_img, hsi_ui_lc
hsi_ui_mon, hsi_ui_obs, hsi_ui_ql, hsi_ui_qlimage, hsi_ui_spec, ihy_db, map2index
mreadfits, mreadfits_fixup, plotman, rd_fdss, read_hessi_4_ospex
read_hessi_4_spex [1], read_hessi_4_spex [2], read_soon, read_trace
read_xsm_4_ospex, spex_hessi_fits2drm, spex_merge_plots, ssw_install [1]
ssw_install [2], ssw_track_fov, struct2fitshead, sxig12_browsegen, tr_rd_index
trace_dph2struct [1], trace_rd_jpeg
EXAMPLE:
Determine if the tag 'THICK' is in the !P system variable
IDL> print,tag_exist(!P,'THICK')
PROCEDURE CALLS:
None.
MODIFICATION HISTORY: :
Written, C D Pike, RAL, 18-May-94
Passed out index of matching tag, D Zarro, ARC/GSFC, 27-Jan-95
William Thompson, GSFC, 6 March 1996 Added keyword TOP_LEVEL
Zarro, GSFC, 1 August 1996 Added call to help
Converted to IDL V5.0 W. Landsman September 1997
Use SIZE(/TNAME) rather than DATATYPE() W. Landsman October 2001
[Previous]
[Next]
Name: tag_index
Purpsose: return tag position (index) of 'tag' within 'str'
Input Parameters:
str - structure
tag - tag name (string scaler or vector )
Output:
function returns indices of tag within str (-1 if not found)
longword scaler returned if tag is scaler, else longword vector
CALLED BY:
BFITS, FIX_OLD_ATT [1], FIX_OLD_ATT [2], GET_LATLON, GET_TAG_INDEX, HXTPIXON
HXT_ERROR, HXT_LCURVE, HXT_QLOOK, IDEPROJECT, MK_SOHO_MAP_EARTH, PIXSQUARE, PLOT_HSI
PLOT_HXT, RD_BDA [1], RD_BDA_DATA, REP_TAG_VALUE, diff_str [1], diff_str [2]
fitshead2struct, get_index_ver, goes2str, gt_dp_mode [1], gt_dp_mode [2], gt_hxa
gt_iru, gt_tagval [1], gt_tagval [2], gt_tfss, hxtpix, make_mirror, mreadfits_fixup
plot_ace, plot_eit_filters, plot_eit_mirror, plotman, pr_evn [2], read_eit, sav_bsc
soon_search_www, ssw_install [1], ssw_install [2], sswstruct_fill [1]
str_tagval [1], str_tagval [2], struct2fitshead, timeavg [1], timeavg [2]
trace_scale, write_trace, xspr [1], xspr [2], yoh_orb_interp [1]
yoh_orb_interp [2]
History: slf
modified, 21-feb-92 for to allow tag vector
[Previous]
[Next]
PROJECT:
HESSI
NAME:
TAG_PREFIX()
PURPOSE:
Appends or removes a prefix and optionally a potfix to the tag
names of a structure.
CATEGORY:
gen / struct
CALLING SEQUENCE:
out_struct = tag_prefix( struct, prefix )
INPUTS:
struct: the structure for which tag names must be modified
prefix: the prefix to append, a string or string array
OUTPUTS:
out_struct: a structure with the modified tag names. The
prefix is separated from the original tag nem with
an underscore "_".
KEYWORDS:
REMOVE; if set, the prefix is removed from the
tag names. The prefix will be removed up to and with the
underscore "_"
CALLED BY:
HESSI IMAGING ALGORITHM ABSTRACT CLASS DEFINITION, hsi_params_write_pro
RESTRICTIONS:
With the REMOVE keyword, the prefix and postfix must be scalar strings
EXAMPLES:
IDL> struct = { a: 0.0, b: indgen(10), c: 0L }
IDL> new_struct= tag_prefix( struct, 'hello' )
IDL> help, new_struct, /str
** Structure <851006c>, 3 tags, length=28, data length=28, refs=1:
HELLO_A FLOAT 0.00000
HELLO_B INT Array[10]
HELLO_C LONG 0
IDL> help, tag_prefix( struct, 'hell', /remove ), /str
** Structure <844ebec>, 3 tags, length=28, data length=28, refs=2:
A FLOAT 0.00000
B INT Array[10]
C LONG 0
CALLS: ***
REP_TAG_NAME, STRUP, ssw_strsplit
SEE ALSO:
REP_TAG_NAME
HISTORY:
Version 1, June 28, 2001,
A Csillaghy, csillag@ssl.berkeley.edu
26-May-2003, Kim Tolbert - change StrSplit to SSW_StrSplit
27-May-2003, Kim Tolbert - change trup to strup
[Previous]
[Next]
Project : SOHO - CDS
Name : TAI2UTC()
Purpose : Converts TAI time in seconds to UTC calendar time.
Explanation : This procedure takes the Atomic International Time (TAI)
calculated from the 6 byte (local) on-board time from the
spacecraft and converts it into UTC calendar time in one of the
CDS standard formats -- for acceptable formats see file
aaareadme.txt.
Use : Result = TAI2UTC( TAI )
Result = TAI2UTC( TAI, /EXTERNAL )
Result = TAI2UTC( TAI, /CCSDS )
Result = TAI2UTC( TAI, /ECS )
Inputs : TAI = The time in seconds from midnight, 1 January 1958.
This should be a double precision array. Any
necessary calibrations should be applied before
calling this routine.
Opt. Inputs : None.
Outputs : The result of the function will be the UTC calendar time in one
of several formats, depending on the keywords passed.
Internal: A structure containing the tags:
MJD: The Modified Julian Day number.
TIME: The time of day, in milliseconds since
the beginning of the day.
Both are long integers. This is the default
format.
External: A structure containing the integer tags
"18-JAN-1988 17:20:43.12", "18-JAN-1988 17:20:43.123"
"1988-01-18T17:20:43.123Z", "1988/01/18 17:20:43.123"
CCSDS: An ASCII string containing the UTC time to, DAY
ECS: Similar to CCSDS, HOUR, MILLISECOND., MINUTE, MONTH, SECOND
STIME: The date and time has the format
See UTC2STR for more information.
VMS: The date and time has the format, YEAR, and, e.g.
except that the date has, for Space Data Systems (ISO 8601)
millisecond accuracy in the format
recommended by the Consultative Committee, the format:
Opt. Outputs: None.
Keywords : EXTERNAL = If set, then the output is in external format, as
explained above.
CCSDS = If set, then the output is in CCSDS format, as
explained above.
ECS = If set, then the output is in ECS format, as
explained above.
VMS = If set, then the output will be in VMS format, as
described above.
STIME = If set, then the output will be in STIME format, as
described above.
NOCORRECT = If set, then the time will be assumed to be already
a UTC value, even though apparently in TAI format,
and no adjustment will be made for leap seconds.
This keyword can also be used to convert to a TAI
time in a UTC-formatted format.
The following keywords are only valid if one of the string
formats is selected.
TRUNCATE = If set, then the time will be truncated to 1 second
accuracy. Note that this is not the same thing as
rounding off to the nearest second, but is a
rounding down.
DATE_ONLY = If set, then only the date part of the string is
returned.
TIME_ONLY = If set, then only the time part of the string is
returned.
UPPERCASE = If set, then the month field in either the VMS or
STIME format is returned as uppercase.
NOZ = When set, the "Z" delimiter (which denotes UTC
time) is left off the end of the CCSDS/ISO-8601
string format. It was decided by the FITS
committee to not append the "Z" in standard FITS
keywords.
The following keyword is always valid.
ERRMSG = If defined and passed, then any error messages
will be returned to the user in this parameter
rather than being handled by the IDL MESSAGE
utility. If no errors are encountered, then a null
string is returned. In order to use this feature,
the string ERRMSG must be defined first, e.g.,
ERRMSG = ''
RESULT = TAI2UTC( TAI, ERRMSG=ERRMSG )
IF ERRMSG NE '' THEN ...
Calls : ***
CHECK_INT_TIME, DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_LEAP_SEC, INT2UTC
CALLED BY:
ADD_ALT, ADD_DETAIL, ADD_FLAG, ADD_PLAN, ADJUST_HDR_TCR, ANYTIM2UTC [1]
ANYTIM2UTC [2], AN_NIMCP_1_2, CARRDATE [1], CARRDATE [2], CAT_FITS, CDF2TAI, CDF2UTC
CDS_PLOT_ERR, CDS_VEL_SLICE [1], CDS_VEL_SLICE [2], CHECK_INTEG, EIS_CAT [1]
EIS_CAT [2], EIS_CPT_COMMAND_STORE_CHECK [1]
EIS_CPT_COMMAND_STORE_CHECK [2], EIS_IMAGE_TOOL [1], EIS_IMAGE_TOOL [2]
EIS_IMAGE_TOOL_EVENT [1], EIS_IMAGE_TOOL_EVENT [2], EIS_ITOOL_PTOOL [1]
EIS_ITOOL_PTOOL [2], EXPSTA, FIX_TIME_JUMP, GET_OBS_DATE, GET_ROLL_OR_XY
GET_SC_ATT [1], GET_SOLAR_RADIUS, GISPLOT, IMAGE_TOOL, IMAGE_TOOL_EVENT
ITOOL_GET_TIME, ITOOL_PTOOL, LIST_FITS, LIST_SUPPORT, MISS_PCKTS, MKMOVIE
MKMOVIE0 obsolete version of mkmoviepro, MKMOVIEM, MKMOVIE_kpd, MK_CDS_PLAN
MK_DAILY_MED, MK_PLAN_CHANGE, MK_PLAN_CLONE, MK_PLAN_CONV, MK_PLAN_COPY
MK_PLAN_COPY_EV, MK_PLAN_CUSTOM, MK_PLAN_ORDER, MK_PLAN_RECAL, MK_PLAN_SHIFT
MK_PLAN_WRITE, MK_POINT_BASE, MK_SOHO, MK_SOHO_CUSTOM, MK_WAVECAL, OBETIME2TAI
OPLOT_ERR, OPLOT_SPLAN, PLAN_XCAT_SUMM, PLOT_ERR, PLOT_EXPINT, PLOT_HT, PLOT_SPLAN
PLOT_SUBHTR, POINTING3, PRG_DETAIL, PRG_PLAN, QUERY_ANOMALY, RD_PLAN, RD_RESOURCE
REDUCE_LEVEL_1, RTMOVIE, RTMVI [1], SCAN_SC_HDR, SHOW_PLAN, SOLB_PLOT_POINTING [1]
SOLB_PLOT_POINTING [2], SPLIT_QKL, STARFIELD, SUM_IMAGE_HEAD, SYSTIM, S_HK0_utc
TIME_AVERAGE, TIME_CORRECTION, UNPACK_ALL_SCIENCE, UNPACK_LZ_SCIENCE
UPDATE_CAMPAIGN, UPDATE_MPG, UPD_PLAN, UPD_SOHO_DET, UTC_HEAD, WCS_GET_TIME
WPLOT_NONOP, WPLOT_SUBHTR [2], WRITE_CALFITS, WRITE_CAP, WRITE_CIF, WRITE_HKBYDATE
WRITE_IAP, XCAT, XCME_MES, XCPT, XIAP, XPLOT_HT, XPORT, XREPORT, XZOOM_PLAN
eis_timeline_graphics_axes_default [1]
eis_timeline_graphics_axes_default [2], eis_timeline_plot_gui [1]
eis_timeline_plot_gui [2], getcputime, mk_stdim_hdr, rel_ql_fill
Common : None.
Restrictions: Not valid for dates before 1 January 1972.
This procedure requires a file containing the dates of all leap
second insertions starting with 31 December 1971. This file
must have the name 'leap_seconds.dat', and must be in the
directory given by the environment variable TIME_CONV. It must
be properly updated as new leap seconds are announced.
Side effects: The result of an array with a single element may be a scalar.
If an error has been encountered and the ERRMSG keyword has
been set, TAI2UTC returns an integer value of -1.
Category : Utilities, Time.
Prev. Hist. : None. However, the concept of "internal" and "external" time
is based in part on the Yohkoh software by M. Morrison and G.
Linford, LPARL.
Written : William Thompson, GSFC, 12 September 1993.
Modified : Version 1, William Thompson, GSFC, 21 September 1993.
Version 2, William Thompson, GSFC, 14 November 1994
Changed .DAY to .MJD
Version 3, William Thompson, GSFC, 20 December 1994
Added keywords TRUNCATE, DATE_ONLY, TIME_ONLY
Version 4, Donald G. Luttermoser, GSFC/ARC, 28 December 1994
Added the keyword ERRMSG.
Version 5, William Thompson, GSFC, 25 January 1995
Changed to call intrinsic ROUND instead of NINT. The
version of NINT in the Astronomy User's Library doesn't
automatically select between short and long integers as
the CDS version does.
Version 6, Donald G. Luttermoser, GSFC/ARC, 30 January 1995
Added ERRMSG keyword to internally called procedures.
Made error handling procedure more robust. Note
that this routine can handle both scalars and vectors
as input.
Version 7, William Thompson, GSFC, 14 March 1995
Added keywords VMS, STIME, UPPERCASE
Version 8, William Thompson, GSFC, 28 January 1997
Allow for long input arrays.
Version 9, William Thompson, GSFC, 8-Sep-2004
Added keyword NOCORRECT
Version 10, William Thompson, GSFC, 26-Sep-2006
Add call to CHECK_INT_TIME to correct round-off errors
Version : Version 10, 26-Sep-2006
[Previous]
[Next]
Project : SOHO - CDS
Name : TAPRD
Purpose : Emulates VMS TAPRD procedure on UNIX machines.
Explanation : Emulates VMS TAPRD procedure on UNIX machines. However, the
actions of this routine may differ from the VMS equivalent in
nonstandard situations.
*** Unix only ***
Use : TAPRD, ARRAY, UNIT [, BYTE_REVERSE ]
Inputs : ARRAY = Variable into which the data should be read. The
datatype and number of values to attempt to read is
based on this array.
UNIT = Specifies the magnetic tape unit. Not to be confused
with logical unit numbers. In UNIX, the number
refers to one of the environment variables MT0, MT1,
etc., which translate into a physical device name,
e.g.
setenv MT0 /dev/nrst0
Opt. Inputs : BYTE_REVERSE = If present, then even and odd bytes are swapped.
Outputs : The output is read into ARRAY. Also, !ERR is set to the number
of bytes actually read.
Opt. Outputs: None.
Keywords : None.
Calls : ***
CHECK_TAPE_DRV [1], CHECK_TAPE_DRV [2]
CALLED BY:
FITSTAPE, RD_EXB, TCOPY, mt, vmscopytape
Common : None.
Restrictions: This routine may not have all the abilities of the VMS
equivalent, particularly in regards to the !ERR system
variable.
The environment variable "MTn", where n corresponds to the
variable UNIT, must be defined. E.g.,
setenv MT0 /dev/nrst0
Requires IDL v3.1 or later.
Side effects: The device file is opened.
Category : Utilities, I/O, Tape.
Prev. Hist. : William Thompson, GSFC, June 1991.
Written : William Thompson, GSFC, June 1991.
Modified : Version 1, William Thompson, GSFC, 21 December 1993.
Rewrote to use READU with TRANSFER_COUNT keyword.
Version 2, William Thompson, GSFC, 22 December 1993.
Added check of ARRAY variable.
Version : Version 2, 22 December 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name : TAPWRT
Purpose : Emulates VMS TAPWRT procedure on UNIX machines.
Explanation : Emulates VMS TAPWRT procedure on UNIX machines.
*** Unix only ***
Use : TAPWRT, ARRAY, UNIT [, BYTE_REVERSE ]
Inputs : ARRAY = Variable into which the data should be read.
UNIT = Specifies the magnetic tape unit. Not to be confused
with logical unit numbers. In UNIX, the number
refers to one of the environment variables MT0, MT1,
etc., which translate into a physical device name,
e.g.
setenv MT0 /dev/nrst0
Opt. Inputs : BYTE_REVERSE = If present, then even and odd bytes are swapped.
Outputs : None.
Opt. Outputs: None.
Keywords : None.
Calls : ***
CHECK_TAPE_DRV [1], CHECK_TAPE_DRV [2]
CALLED BY:
FITSTAPE, TCOPY, vmscopytape
Common : None.
Restrictions: The environment variable "MTn", where n corresponds to the
variable UNIT, must be defined. E.g.,
setenv MT0 /dev/nrst0
Requires IDL v3.1 or later.
Side effects: The device file is opened.
Category : Utilities, I/O, Tape.
Prev. Hist. : William Thompson, GSFC, June 1991.
Written : William Thompson, GSFC, June 1991.
Modified : Version 1, William Thompson, GSFC, 21 December 1993.
Rewrote to use WRITEU.
Version : Version 1, 21 December 1993.
[Previous]
[Next]
NAME:
TBDELCOL
PURPOSE:
Delete a column of data from a FITS binary table
CALLING SEQUENCE:
TBDELCOL, h, tab, name
INPUTS-OUPUTS
h,tab - FITS binary table header and data array. H and TAB will
be updated with the specified column deleted
INPUTS:
name - Either (1) a string giving the name of the column to delete
or (2) a scalar giving the column number to delete
CALLS: ***
SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], TBINFO, TBSIZE
EXAMPLE:
Delete the column "FLUX" from FITS binary table
IDL> TBDELCOL, H, TAB, 'FLUX'
PROCEDURES USED:
SXADDPAR, TBINFO, TBSIZE
REVISION HISTORY:
Written W. Landsman STX Co. August, 1988
Adapted for IDL Version 2, J. Isensee, July, 1990
Use new structure returned by TBINFO, August, 1997
Converted to IDL V5.0 W. Landsman September 1997
Use SIZE(/TNAME) instead of DATATYPE() October 2001
[Previous]
[Next]
NAME:
TBDELROW
PURPOSE:
Delete specified row or rows of data from a FITS binary table
CALLING SEQUENCE:
TBDELROW, h, tab, rows
INPUTS-OUPUTS
h,tab - FITS binary table header and data array. H and TAB will
be updated on output with the specified row(s) deleted.
rows - scalar or vector, specifying the row numbers to delete
First row has index 0. If a vector it will be sorted and
duplicates removed by TBDELROW
CALLS: ***
REM_DUP [1], REM_DUP [2], REM_DUP [3], SXADDPAR [1], SXADDPAR [2], SXADDPAR [3]
SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FTAB_DELROW
EXAMPLE:
Compress a table to include only non-negative flux values
flux = TBGET(h,tab,'FLUX') ;Obtain original flux vector
bad = where(flux lt 0) ;Find negative fluxes
TBDELROW,h,tab,bad ;Delete rows with negative fluxes
PROCEDURE:
Specified rows are deleted from the data array, TAB. The NAXIS2
keyword in the header is updated.
REVISION HISTORY:
Written W. Landsman STX Co. August, 1988
Checked for IDL Version 2, J. Isensee, July, 1990
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Name: tbeep
Purpose: beep terminal
Input Paramters:
nbeeps - number of beeps (defalut=1)
ibwait - inter-beep wait
Keyword Parameters:
waitn - inter-beep wait (can be positional too)
History - slf, 2-Sep-92 (couldnt rembember existing one)
CALLED BY:
ACOPY [1], CH_XMENU_SEL, COVER_PAGE [1], COVER_PAGE [2], DPE_GUESS
FIX_OLD_ATT [1], FIX_OLD_ATT [2], GET_SUNCENTER [1], GET_SUNCENTER [2], HXT_EFF
PICK_CAN_PRELIM, RD_HXT_DBOOK, ROT, STEPPER [3], STEPPER [4], SXT_PREP0, SXT_TE
SXT_TEEM [1], SXT_TEEM [2], SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3]
SXT_TEEM2 [1], SXT_TEEM2 [2], SXT_TEEM2 [3], UNIX_CMD [1], UNIX_CMD [2]
WL_CUBE_II, XMENU_SEL [1], XMENU_SEL [2], azimuth_avg, cancel_dsn
check_compile [1], check_compile [2], check_log [1], check_log [2], collexc [1]
collexc [2], cont2time [1], cont2time [2], cube_edit, daily_forecast [2]
dark_sub [1], dark_sub [2], dark_sub [3], dbase2disk, delete_week [1]
delete_week [2], do_demo [1], do_demo [2], dont_use_this [1], dont_use_this [2]
dummy [10], dummy [11], dummy [12], dummy [13], dummy [14], dummy [1], dummy [2]
dummy [3], dummy [4], dummy [5], dummy [6], dummy [7], dummy [8], dummy [9]
eit_getobs, evt_demo, evt_grid, file_compress [1], file_compress [2]
file_uncompress [1], file_uncompress [2], first_bcs, first_over, fitstap2tap [1]
fitstap2tap [2], flares2disk, fort2hxi [1], fort2hxi [2], ftp_copy2sites
genx_newver [1], genx_newver [2], get_last_tfr, get_sfc_info, get_utevent [1]
get_utevent [2], goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4]
goes_plot [5], gt_day [1], gt_day [2], gt_expdur [1], gt_expdur [2], gt_time [1]
gt_time [2], gtt_info, hardcopy [1], hardcopy [2], hxt_survey, is_alive [1]
is_alive [2], jitter_gif_xyimg, lcur_image, mdi_display, mk_mdi_load, mk_pix [1]
mk_pix [2], mk_sdm, mk_sfc [1], mk_sfc [2], mk_trace_i0, mk_vcr, mk_week_file [1]
mk_week_file [2], mo_check, mo_init [1], mo_init [2], mo_patch, mo_prep, mod_res
nobeyama_update, ocontour [1], ocontour [2], ocontour [5], op_pass_sheets [1]
op_pass_sheets [2], op_same_time [1], op_same_time [2], op_times, pass_sheets
plot_eit_flux, pointing, pr_visible, pref_super, radial_avg, rd_atodat [1]
rd_atodat [2], rd_old_obs, rd_tr_seq_head, rd_trace_i0 [1], rd_ydbtap, res_freq
run_dsnfil, sector_avg, sel_dc_image [1], sel_dc_image [2], sel_dc_image [3]
set_printer [1], set_printer [2], set_printer [5], sft2sfc, show_contacts
show_pixf, sonyloop [1], sonyloop [2], soon_search [1], soon_search [3]
sxt_cen [1], sxt_cen [2], sxt_decon [1], sxt_decon [2], sxt_dn_unc, sxt_eff_area
sxt_etemp, sxt_flux [1], sxt_flux [2], sxt_flux [3], sxt_interp [1]
sxt_interp [2], sxt_mwave, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_sumtime
sxt_sumxy, sxt_vignette, sxt_xsaa, tim2dbase, tim2pass, timeavg [1], timeavg [2]
timeline, topsdb [1], topsdb [2], tr_build_img [1], ut_time [1], ut_time [2]
video_menu, web_seq, where_change [1], where_change [2], where_pattern [1]
where_pattern [2], xcheckip, xdisp_fits, xdisp_sci5k, xdisp_tfr, xdisp_trace [1]
xdisp_trace2, xdisp_trace3, xhkplot, xread_hist, xsearch_obs, xset_chain [1]
xset_chain [2], xso_butevents [1], xso_butevents [2], xso_search, xspr [1]
xspr [2], xsw2tree, xsw2tree_event, xswlist [2], xsxt_prep, xsxt_prep_event
ydb_install [1], ydb_install [2], yoyo_man2, zcurs_ok
Restrictions:
if ibwait is less then .15, not all beeps are visible
[Previous]
[Next]
NAME:
TBGET
PURPOSE:
Return value(s) from specified column in a FITS binary table
CALLING SEQUENCE
values = TBGET( h, tab, field, [ rows, nulls, /NOSCALE] )
or
values = TBGET( tb_str, tab, field, [ rows, nulls, /NOSCALE] )
INPUTS:
h - FITS binary table header, e.g. as returned by FITS_READ
or
tb_str - IDL structure extracted from FITS header by TBINFO.
Use of the IDL structure will improve processing speed
tab - FITS binary table array, e.g. as returned by FITS_READ
field - field name or number, scalar
OPTIONAL INPUTS:
rows - scalar or vector giving row number(s)
Row numbers start at 0. If not supplied or set to
-1 then values for all rows are returned
CALLS: ***
TBINFO
CALLED BY:
FITS_HDR__READ [1], FTAB_EXT
OPTIONAL KEYWORD INPUT:
/NOSCALE - If this keyword is set and nonzero, then the TSCALn and
TZEROn keywords will *not* be used to scale to physical values
Default is to perfrom scaling
CONTINUE - This keyword does nothing, it is kept for consistency with
with earlier versions of TBGET().
OUTPUTS:
the values for the row are returned as the function value.
Null values are set to 0 or blanks for strings.
OPTIONAL OUTPUT:
nulls - null value flag of same length as the returned data.
Only used for integer data types, B, I, and J
It is set to 1 at null value positions and 0 elsewhere.
If supplied then the optional input, rows, must also
be supplied.
EXAMPLE:
Read the columns labeled 'WAVELENGTH' and 'FLUX' from the second
extension of a FITS file 'spectra.fits' into IDL vectors w and f
IDL> fits_read,'spectra.fits',tab,htab,exten=2 ;Read 2nd extension
IDL> w = tbget(htab,tab,'wavelength')
IDL> f = tbget(htab,tab,'flux')
NOTES:
(1) If the column is variable length ('P') format, then TBGET() will
return the longword array of pointers into the heap area. TBGET()
currently lacks the ability to actually extract the data from the
heap area.
(2) Use the higher-level procedure FTAB_EXT (which calls TBGET()) to
extract vectors directly from the FITS file.
(3) Use the procedure FITS_HELP to determine which extensions are
binary tables, and FTAB_HELP or TBHELP to determine the columns of the
table
PROCEDURE CALLS:
TBINFO, TBSIZE
HISTORY:
Written W. Landsman February, 1991
Work for string and complex W. Landsman April, 1993
Default scaling by TSCALn, TZEROn, Added /NOSCALE keyword,
Fixed nulls output, return longword pointers for variable length
binary tables, W. Landsman December 1996
Added a check for zero width column W. Landsman April, 1997
Add TEMPORARY() and REFORM() for speed W. Landsman May, 1997
Use new structure returned by TBINFO W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
Add IS_IEEE_BIG(), No subscripting when all rows requested
W. Landsman March 2000
Use SIZE(/TNAME) instead of DATATYPE() W. Landsman October 2001
Bypass IEEE_TO_HOST call for improved speed W. Landsman November 2002
Cosmetic changes to SIZE() calls W. Landsman December 2002
Added unofficial support for 64bit integers W. Landsman February 2003
Support unsigned integers, new pointer types of TSCAL and TZERO
returned by TBINFO W. Landsman April 2003
Add an i = i[0] for V6.0 compatibility W. Landsman August 2003
Use faster BYTEORDER byteswapping W. Landsman April 2006
[Previous]
[Next]
NAME:
TBHELP
PURPOSE:
Routine to print a description of a FITS binary table header
CALLING SEQUENCE:
TBHELP, h, [TEXTOUT = ]
INPUTS:
h - FITS header for a binary table, string array
OPTIONAL INPUT KEYWORD:
TEXTOUT - scalar number (0-7) or string (file name) controling
output device (see TEXTOPEN). Default is TEXTOUT=1, output
to the user's terminal
METHOD:
FITS Binary Table keywords NAXIS*,EXTNAME,TFIELDS,TTYPE*,TFORM*,TUNIT*,
are read from the header and displayed at the terminal
A FITS header is recognized as bein for a binary table if the keyword
XTENSION has the value 'BINTABLE' or 'A3DTABLE'
NOTES:
Certain fields may be truncated in the display
SYSTEM VARIABLES:
Uses the non-standard system variables !TEXTOUT and !TEXTUNIT. These
are automatically defined by TBHELP if they have not been defined
previously.
PROCEDURES USED:
REMCHAR, SXPAR(), TEXTCLOSE, TEXTOPEN, ZPARCHECK
CALLS: ***
REMCHAR [1], REMCHAR [2], REMCHAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2]
TEXTOPEN [3], ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
CALLED BY:
FTAB_HELP
HISTORY:
W. Landsman February, 1991
Parsing of a FITS binary header made more robust May, 1992
Added TEXTOUT keyword August 1997
Define !TEXTOUT if not already present W. Landsman November 2002
Slightly more compact display W. Landsman August 2005
Fix Aug 2005 error omitting TFORM display W. Landsman Sep 2005
[Previous]
[Next]
NAME:
TBINFO
PURPOSE:
Return an informational IDL structure from a FITS binary table header.
CALLING SEQUENCE:
tbinfo, h, tb_str, [ERRMSG = ]
INPUTS:
h - FITS binary table header, e.g. as returned by READFITS()
OUTPUTS:
tb_str - IDL structure with extracted info from the FITS binary table
header. Tags include
.tbcol - starting column position in bytes, integer vector
.width - width of the field in bytes, integer vector
.idltype - idltype of field, byte vector
7 - string, 4- real*4, 3-integer*4, 5-real*8
.numval - repeat count, longword vector
.tunit - string unit numbers, string vector
.tnull - integer null value for the field, stored as a string vector
so that an empty string indicates that TNULL is not present
.tform - format for the field, string vector
.ttype - field name, string vector
.maxval- maximum number of elements in a variable length array, long
vector
.tscal - pointer array giving the scale factor for converting to
physical values, default 1.0
.tzero - pointer array giving the additive offset for converting to
physical values, default 0.0
.tdisp - recommended output display format
All of the output vectors will have same number of elements, equal
to the number of columns in the binary table.
The .tscal and .tzero values are stored as pointers so as to preserve
the individual data types (e.g. float or double) which may differ
in different columns. For example, to obtain the value of TSCAL for
the third column use *tab_str.tscal[2]
OPTIONAL OUTPUT:
ERRMSG = if present, then error messages are returned in this keyword
rather than displayed using the MESSAGE facility
PROCEDURES USED:
SXPAR()
NOTES:
For variable length ('P' format) column, TBINFO returns values for
reading the 2 element longward array of pointers (numval=2,
idltype = 3, width=4)
CALLS: ***
SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FTAB_EXT, TBDELCOL, TBGET, TBPRINT
HISTORY:
Major rewrite to return a structure W. Landsman August 1997
Added "unofficial" 64 bit integer "K" format W. Landsamn Feb. 2003
Store .tscal and .tzero tags as pointers, so as to preserve
type information W. Landsman April 2003
Treat repeat count for string as specifying string length, not number
of elements, added ERRMSG W. Landsman July 2006
Treat logical as character string 'T' or 'F' W. Landsman October 2006
[Previous]
[Next]
NAME:
TBPRINT
PURPOSE:
Procedure to print specified columns & rows of a FITS binary table
CALLING SEQUENCE:
TBPRINT, h, tab, columns, [ rows, TEXTOUT =, FMT = ]
or
TBPRINT,tb_str, tab, columns, [ rows, TEXTOUT =, FMT = ]
INPUTS:
h - FITS header for table, string array
or
tb_str - IDL structure extracted from FITS header by TBINFO, useful
when TBPRINT is called many times with the same header
tab - table array
columns - string giving column names, or vector giving
column numbers (beginning with 1). If string
supplied then column names should be separated by comma's.
rows - (optional) vector of row numbers to print. If
not supplied or set to scalar, -1, then all rows
are printed.
OUTPUTS:
None
OPTIONAL INPUT KEYWORDS:
TEXTOUT - scalar number (0-7) or string (file name) determining
output device (see TEXTOPEN). Default is TEXTOUT=1, output
to the user's terminal
FMT = Format string for print display. If not supplied, then any
formats in the TDISP keyword fields of the table will be
used, otherwise IDL default formats.
SYSTEM VARIABLES:
Uses nonstandard system variables !TEXTOUT and !TEXTOPEN
Set !TEXTOUT = 3 to direct output to a disk file. The system
variable is overriden by the value of the keyword TEXTOUT
CALLED BY:
FTAB_PRINT
EXAMPLES:
tab = readfits('test.fits',htab,/ext) ;Read first extension into vars
tbprint,h,tab,'STAR ID,RA,DEC' ;print id,ra,dec for all stars
tbprint,h,tab,[2,3,4],indgen(100) ;print columns 2-4 for
first 100 stars
tbprint,h,tab,text="stars.dat" ;Convert entire FITS table to
;an ASCII file named 'stars.dat'
PROCEDURES USED:
GETTOK(), STRNUMBER(), TEXTOPEN, TEXTCLOSE, TBINFO
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], STRNUMBER [1], STRNUMBER [2]
STRNUMBER [3], STRNUMBER [4], TBINFO, TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3]
TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3], strsplit
RESTRICTIONS:
(1) Program does not check whether output length exceeds output
device capacity (e.g. 80 or 132).
(2) Column heading may be truncated to fit in space defined by
the FORMAT specified for the column
(3) Program does not check for null values
(4) Does not work with variable length columns
(5) Will only the display the first value of fields with multiple values
(unless there is one row each with the same number of mulitple values
HISTORY:
version 1 D. Lindler Feb. 1987
Accept undefined values of rows,columns W. Landsman August 1997
Use new structure returned by TBINFO W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
Made formatting more robust W. Landsman March 2000
Use STRSPLIT to parse string column listing W. Landsman July 2002
Wasn't always printing last row W. Landsman Feb. 2003
Better formatting (space between columns) W. Landsman Oct. 2005
Use case-insensitive match with TTYPE, use STRJOIN W.L. June 2006
Fixed check for multiple values W.L. August 2006
Fixed bad index value in August 2006 fix W.L Aug 15 2006
[Previous]
[Next]
NAME:
TBSIZE
PURPOSE:
Procedure to return the size of a FITS binary table.
CALLING SEQUENCE:
tbsize, h, tab, ncols, nrows, tfields, ncols_all, nrows_all
INPUTS:
h - FITS table header
tab - FITS table array
OUTPUTS:
ncols - number of characters per row in table
nrows - number of rows in table
tfields - number of fields per row
ncols_all - number of characters/row allocated (size of tab)
nrows_all - number of rows allocated
PROCEDURES USED:
SXPAR()
HISTORY
D. Lindler July, 1987
Converted to IDL V5.0 W. Landsman September 1997
Remove obsolete !ERR call W. Landsman May 2000
CALLS:
CALLED BY
TBDELCOL
[Previous]
[Next]
NAME:
TCOPY
PURPOSE:
Copy files from tape to tape
CALLING SEQUENCE:
TCOPY
INPUTS:
idrv, odrv = unit numbers to copy from and to, respectively
PROCEDURE
does it record by record, and file by file.
CALLS: ***
SKIPF [1], SKIPF [2], TAPRD [1], TAPRD [2], TAPWRT [1], TAPWRT [2], WEOF [1], WEOF [2]
RESTRICTIONS:
VMS only
HISTORY:
written DMZ (ARC Mar'93)
[Previous]
[Next]
NAME:
TDB2TDT
AUTHOR:
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov
UPDATED VERSIONs can be found on my WEB PAGE:
http://cow.physics.wisc.edu/~craigm/idl/idl.html
PURPOSE:
Relativistic clock corrections due to Earth motion in solar system
MAJOR TOPICS:
Planetary Orbits
CALLING SEQUENCE:
corr = TDB2TDT(JD, TBASE=, DERIV=deriv)
DESCRIPTION:
The function TDB2TDT computes relativistic corrections that must
be applied when performing high precision absolute timing in the
solar system.
According to general relativity, moving clocks, and clocks at
different gravitational potentials, will run at different rates
with respect to each other. A clock placed on the earth will run
at a time-variable rate because of the non-constant influence of
the sun and other planets. Thus, for the most demanding
astrophysical timing applications -- high precision pulsar timing
-- times in the accelerating earth observer's frame must be
corrected to an inertial frame, such as the solar system
barycenter (SSB). This correction is also convenient because the
coordinate time at the SSB is the ephemeris time of the JPL
Planetary Ephemeris.
In general, the difference in the rate of Ti, the time kept by an
arbitrary clock, and the rate of T, the ephemeris time, is given
by the expression (Standish 1998):
dTi/dT = 1 - (Ui + vi^2/2) / c^2
where Ui is the potential of clock i, and vi is the velocity of
clock i. However, when integrated, this expression depends on the
position of an individual clock. A more convenient approximate
expression is:
T = Ti + (robs(Ti) . vearth(T))/c^2 + dtgeo(Ti) + TDB2TDT(Ti)
where robs is the vector from the geocenter to the observer;
vearth is the vector velocity of the earth; and dtgeo is a
correction to convert from the observer's clock to geocentric TT
time. TDB2TDT is the value computed by this function, the
correction to convert from the geocenter to the solar system
barycenter.
As the above equation shows, while this function provides an
important component of the correction, the user must also be
responsible for (a) correcting their times to the geocenter (ie,
by maintaining atomic clock corrections); (b) estimating the
observatory position vector; and and (c) estimating earth's
velocity vector (using JPLEPHINTERP).
Users may note a circularity to the above equation, since
vearth(T) is expressed in terms of the SSB coordinate time. This
appears to be a chicken and egg problem since in order to get the
earth's velocity, the ephemeris time is needed to begin with.
However, to the precision of the above equation, < 25 ns, it is
acceptable to replace vearth(T) with vearth(TT).
The method of computation of TDB2TDT in this function is based on
the analytical formulation by Fairhead, Bretagnon & Lestrade, 1988
(so-called FBL model) and Fairhead & Bretagnon 1990, in terms of
sinusoids of various amplitudes. TDB2TDT has a dominant periodic
component of period 1 year and amplitude 1.7 ms. The set of 791
coefficients used here were drawn from the Princeton pulsar timing
program TEMPO version 11.005 (Taylor & Weisberg 1989).
Because the TDB2TDT quantity is rather expensive to compute but
slowly varying, users may wish to also retrieve the time
derivative using the DERIV keyword, if they have many times to
convert over a short baseline.
Verification
This implementation has been compared against a set of FBL test
data found in the 1996 IERS Conventions, Chapter 11, provided by
T. Fukushima. It has been verified that this routine reproduces
the Fukushima numbers to the accuracy of the table, within
10^{-14} seconds.
Fukushima (1995) has found that the 791-term Fairhead & Bretagnon
analytical approximation use here has a maximum error of 23
nanoseconds in the time range 1980-2000, compared to a numerical
integration. In comparison the truncated 127-term approximation
has an error of ~130 nanoseconds.
PARAMETERS:
JD - Geocentric time TT, scalar or vector, expressed in Julian
days. The actual time used is (JD + TBASE). For maximum
precision, TBASE should be used to express a fixed epoch in
whole day numbers, and JD should express fractional offset
days from that epoch.
KEYWORD PARAMETERS:
TBASE - scalar Julian day of a fixed epoch, which provides the
origin for times passed in JD.
Default: 0
DERIV - upon return, contains the derivative of TDB2TDT in units
of seconds per day. As many derivatives are returned as
values passed in JD.
RETURNS:
The correction offset(s) in units of seconds, to be applied as
noted above.
CALLS: ***
TDB2TDT_CALC
CALLED BY:
JPLEPHINTERP
EXAMPLE:
Find the correction at ephemeris time 2451544.5 (JD):
IDL> print, tdb2tdt(2451544.5d)
-0.00011376314
or 0.11 ms.
REFERENCES:
Princeton TEMPO Program
http://pulsar.princeton.edu/tempo/
FBL Test Data Set
ftp://maia.usno.navy.mil/conventions/chapter11/fbl.results
Fairhead, L. & Bretagnon, P. 1990, A&A, 229, 240
(basis of this routine)
Fairhead, L. Bretagnon, P. & Lestrade, J.-F. 1988, in *The Earth's
Rotation and Reference Frames for Geodesy and Geodynamics*,
ed. A. K. Babcock and G. A. Wilkins, (Dordrecht: Kluwer), p. 419
(original "FBL" paper)
Fukushima, T. 1995, A&A, 294, 895 (error analysis)
Irwin, A. W. & Fukushima, T. 1999, A&A, 348, 642 (error analysis)
Standish, E. M. 1998, A&A, 336, 381 (description of time scales)
Taylor, J. H. & Weisberg, J. M. 1989, ApJ, 345, 434 (pulsar timing)
SEE ALSO
JPLEPHREAD, JPLEPHINTERP, JPLEPHTEST
MODIFICATION HISTORY:
Original logic from Fairhead & Bretagnon, 1990
Drawn from TEMPO v. 11.005, copied 20 Jun 2001
Documented and vectorized, 30 Jun 2001
$Id: tdb2tdt.pro,v 1.4 2001/07/01 07:37:40 craigm Exp $
[Previous]
[Next]
NAME:
te_scale
PURPOSE:
Will take x, an NxN image of temperatures, or EM's, or
anything, and tv it with a scale on the side, into a file
called filen0. And also take y another NxN image and
overplot it with a contour plot
CALLING SEQUENCE:
te_scale,x,y=y,filen0=filen0,title=title,label=label,
lpix=lpix,color=color,range=range,win=win,
levels=levels,nlevels=nlevels,boxq=boxq,boxl=boxl
reverse=reverse, noscale=noscale, charsize=charsize
con_color=con_color,stop_and_look=stop_and_look,
noreverse=noreverse
INPUT:
x= an array, with the bad points set to ABS(x)=0.0
CALLS: ***
IMAGE_C17, box1_draw
CALLED BY:
amoeba_hxi, amoeba_hxi1, box_lc_array, hxt_memimg, mem_sato
OPTIONAL KEYWORD INPUT:
y= an array, with the bad points set to ABS(y)=0.0
filen0= a filename.
label= a label for the scale
title= a title for the image
lpix= pixel size in km's
color= color postscript
range= range of values to use
win= a window to use
levels= levels for the contour plot
nlevels= number of levels for contour plot, default is 17
boxq= box coordinates for boxes to be drawn
;;;;;;;boxl= labels for boxes
con_color= a color value for the contours, from 0 to 255
the default is whatever is normally used
stop_and_look= if set, stops before returning.
reverse = reverse the color scale, this is the default for
ps plots, when filen0 is set
noreverse= don't reverse, even if filen0 is set
HISTORY:
Written May '92 by J McTiernan
Chnaged units, 12-jul-94, jmm
[Previous]
[Next]
Project : SOHO - CDS
Name : TEK
Purpose : Sets graphics device to Tektronix 4010 mode.
Explanation : SETPLOT is called to save and set the system variables.
Use : TEK
Inputs : None.
Opt. Inputs : None.
Outputs : A message is printed to the screen.
Opt. Outputs: None.
Keywords : None.
Calls : ***
SETPLOT [1], SETPLOT [2]
Common : None. But calls SETPLOT, which uses common block PLOTFILE.
Restrictions: It is best if the routines TEK, REGIS, etc. (i.e. those
routines that use SETPLOT) are used to change the plotting
device.
In general, the SERTS graphics devices routines use the special
system variables !BCOLOR and !ASPECT. These system variables
are defined in the procedure DEVICELIB. It is suggested that
the command DEVICELIB be placed in the user's IDL_STARTUP file.
Side effects: If not the first time this routine is called, then system
variables that affect plotting are reset to previous values.
Category : Utilities, Devices.
Prev. Hist. : W.T.T., Nov. 1987.
Written : William Thompson, GSFC, November 1987.
Modified : Version 1, William Thompson, 27 April 1993.
Renamed to TEK, and incorporated into CDS library.
Version : Version 1, 27 April 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name : TEK4105
Purpose : Sets the graphics device for Tektronix 4105 terminals.
Explanation : SETPLOT is called to save and set the system variables. Then
DEVICE is called to enable TEK4100 mode with 8 colors.
Use : TEK4105
Inputs : None.
Opt. Inputs : None.
Outputs : A message is printed to the screen.
Opt. Outputs: None.
Keywords : None.
Calls : ***
SETPLOT [1], SETPLOT [2]
Common : None. But calls SETPLOT, which uses common block PLOTFILE.
Restrictions: It is best if the routines TEK, REGIS, etc. (i.e. those
routines that use SETPLOT) are used to change the plotting
device.
In general, the SERTS graphics devices routines use the special
system variables !BCOLOR and !ASPECT. These system variables
are defined in the procedure DEVICELIB. It is suggested that
the command DEVICELIB be placed in the user's IDL_STARTUP file.
Side effects: If not the first time this routine is called, then system
variables that affect plotting are reset to previous values.
Category : Utilities, Devices.
Prev. Hist. : W.T.T., Nov. 1987.
W.T.T., Mar. 1991, split TEK into TEK4105 and TEK4211.
Written : William Thompson, GSFC, November 1987.
Modified : Version 1, William Thompson, GSFC, 27 April 1993.
Incorporated into CDS library.
Version : Version 1, 27 April 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name : TEK4211
Purpose : Sets graphics device for Tektronix 4211 color terminal.
Explanation : SETPLOT is called to save and set the system variables. Then
DEVICE is called to enable TEK4100 mode with 64 colors.
Use : TEK4211
Inputs : None.
Opt. Inputs : None.
Outputs : A message is printed to the screen.
Opt. Outputs: None.
Keywords : None.
Calls : ***
SETPLOT [1], SETPLOT [2]
Common : None. But calls SETPLOT, which uses common block PLOTFILE.
Restrictions: It is best if the routines TEK, REGIS, etc. (i.e. those
routines that use SETPLOT) are used to change the plotting
device.
In general, the SERTS graphics devices routines use the special
system variables !BCOLOR and !ASPECT. These system variables
are defined in the procedure DEVICELIB. It is suggested that
the command DEVICELIB be placed in the user's IDL_STARTUP file.
Side effects: If not the first time this routine is called, then system
variables that affect plotting are reset to previous values.
Category : Utilities, Device.
Prev. Hist. : W.T.T., Nov. 1987.
W.T.T., Mar. 1991, split TEK into TEK4105 and TEK4211.
Written : William Thompson, GSFC, November 1987.
Modified : Version 1, William Thompson, GSFC, 27 April 1993.
Incorporated into CDS library.
Version : Version 1, 27 April 1993.
[Previous]
[Next]
PROJECT:
SDAC
NAME:
TEK_END
PURPOSE:
This procedure closes plot file and set plotting device back to screen device selected.
CATEGORY:
GRAPHICS
CALLING SEQUENCE:
TEK_PRINT
INPUTS:
None.
COMMON BLOCK:
TEK_COMMON.
CALLS: ***
XDEVICE
CALLED BY:
DRAW_FLARE, FS_ARCHIVE_DRAW, FS_GRAPH, FS_OVERLAY, HXARCHIVE, HXFITS, MOD_PLOT
QL_DAY_PLOT, QL_ORBIT_PLOT
PROCEDURE:
TEK_END is called after calling TEK_INIT and issuing plot commands,
to close the plot file and set the plotting device back to the screen
device selected. Implemented for TEK and PS only.
See documentation on TEK_INIT for full explanation.
Briefly, to make hardcopies of plots, use IDL commands:
tek_init
plot commands ...
tek_end
tek_print
MODIFICATION HISTORY:
Written by AKT and richard.schwartz@gsfc.nasa.gov, 1990.
Mod. 05/06/96 by RCJ. Added documentation.
Version 3, richard.schwartz@gsfc.nasa.gov, 10-nov-1999. set
screen device using xdevice to accommodate WIN and MAC safely.
[Previous]
[Next]
PROJECT:
SDAC
NAME:
TEK_INIT
PURPOSE:
Set up for making Tektronix or PostScript hardcopies of plots from IDL.
CATEGORY:
GRAPHICS
CALLING SEQUENCE:
TEK_INIT[,FILENAME=FNM,NOSCREEN=NOSCREEN,UPDATE=UPDATE,QUEUE=Q]
CALLED BY:
DRAW_FLARE, FS_ARCHIVE_DRAW, FS_GRAPH, FS_OVERLAY, HXARCHIVE, HXFITS, MOD_PLOT
QL_DAY_PLOT, QL_ORBIT_PLOT
EXAMPLES:
tek_init, file='qlarchive', update=update; CALLS:
CALLS: ***
CHECKVAR [1], DEFAULTS_2, SET_GRAPHICS [1], SET_GRAPHICS [2], checkvar [2]
INPUTS:
None.
KEYWORDS:
FILENAME: File descriptor for plot file, if no extension then
the default is .tek or .ps
NOSCREEN: Only send tektronix output to the file, Set if tek
is used for hardcopy, while X for instance is used
for screen.
UPDATE: Add to already existing plot file (VALID ONLY FOR tek)
QUEUE: Printer queue. net$print is default queue.
COMMON BLOCKS:
TEK_COMMON.
PROCEDURE:
First call SET_GRAPHICS, SCREEN=SCREEN, PRINTER=PRINTER where
SCREEN is 'x', 'tek', or 'regis', and PRINTER is 'TEK' or 'PS'.
If user doesn't call SET_GRAPHICS before calling TEK_INIT, TEK_INIT
will call it and set the printer type to the default which is PS.
To make hardcopies of plots, use IDL commands:
tek_init
plot commands ...
tek_end
tek_print
For both TEK and PS, calls set_plot to set plot device to the printer
device. TEK_END will reset the plot device to the screen device.
TEK_PRINT will close the file and send it to the printer.
TEKTRONIX:
Tektronix output will be created if HARD_DEVICE is set to 'TEK' by
SET_GRAPHICS. Tektronix graphics is capable of sending plots
simultaneously to the terminal screen and to disk file for hardcopy
plots. This is the default (both screen and file). User may disable
plotting to the screen by using /noscreen on the first call to
TEK_INIT. The output file may be subsequently reopened by using
TEK_INIT,/update in order to overlay plot commands on an existing
plot. The screen/noscreen option is saved in the common block
variable USE_SCREEN. The plot device is reset to the screen device
previously selected (SC_DEVICE) when TEK_END is called.
POSTSCRIPT:
Postscript files will be created if HARD_DEVICE is set to 'PS' by
SET_GRAPHICS.. Opens a new file is /update is not selected. Otherwise
does nothing further.
MODIFICATION HISTORY:
Written by AKT and richard.schwartz@gsfc.nasa.gov.
Mod. 06/28/95 by AES. Make filenames lowercase.
Mod. 05/06/96 by RCJ. Added documentation.
[Previous]
[Next]
PROJECT:
SDAC
NAME:
TEK_PRINT
PURPOSE:
This procedure sends a plot file to printer.
CATEGORY:
GRAPHICS
CALLING SEQUENCE:
TEK_PRINT,Delete_file[,VERSION_NUMBER=V,FILENAME=FNM,QUEUE=Q]
CALLED BY:
FLDISPLAY, FSPLOT, HXRBS, QLDISPLAY
EXAMPLES:
tek_print,filename='fsplot'
CALLS: ***
CHECKVAR [1], DEFAULTS, EXIST, PSPLOT [1], PSPLOT [2], checkvar [2]
INPUTS:
None.
OPTIONAL INPUTS:
DELETE_FILE: If set to 'D' or 'd', plot file is deleted after
printing.
KEYWORDS:
VERSION_NUMBER: Version number of plot file to print (default is
highest version).
FILENAME: Plot file to print (default is name stored in
common tek_common)
QUEUE: Printer queue to send plot to (default is net$print)
queue is remembered for remainder of IDL session
COMMON BLOCKS:
TEK_COMMON.
PROCEDURE:
TEK_PRINT is called after calling TEK_INIT, issuing plot commands,
and calling TEK_END, to send a plot file to the printer.
See documentation on TEK_INIT for full explanation.
Briefly, to make hardcopies of plots, use IDL commands:
tek_init
plot commands ...
tek_end
tek_print
tek_print sends the plot file whose name is stored in common tek_common
to the printer queue selected.
MODIFICATION HISTORY:
Written by AKT and richard.schwartz@gsfc.nasa.gov.
Mod. 03/29/96 by RAS. Version 2. Made hard_device string lower case
when concatenating filename, and since psplot knows the default
queue it should not be passed unless it is explicit.
Mod. 05/06/96 by RCJ. Added documentation.
Mod. 09/04/97 by AES. changed default printer to EAF_POST1
Version 5, richard.schwartz@gsfc.nasa.gov, 8-sep-1997, changed
default printer queue to PSLASER
[Previous]
[Next]
Project : SOHO - CDS
Name : TEKMONO
Purpose : Sets graphics device for Tek 4100+ terminals, mono mode.
Explanation : SETPLOT is called to save and set the system variables. Then
DEVICE is called to enable TEK4100 mode with 2 colors (black
and white).
Use : TEKMONO
Inputs : None.
Opt. Inputs : None.
Outputs : A message is printed to the screen.
Opt. Outputs: None.
Keywords : None.
Calls : ***
SETPLOT [1], SETPLOT [2]
Common : None. But calls SETPLOT, which uses common block PLOTFILE.
Restrictions: It is best if the routines TEK, REGIS, etc. (i.e. those
routines that use SETPLOT) are used to change the plotting
device.
In general, the SERTS graphics devices routines use the special
system variables !BCOLOR and !ASPECT. These system variables
are defined in the procedure DEVICELIB. It is suggested that
the command DEVICELIB be placed in the user's IDL_STARTUP file.
Side effects: If not the first time this routine is called, then system
variables that affect plotting are reset to previous values.
Category : Utilities, Devices.
Prev. Hist. : W.T.T., Nov. 1987.
W.T.T., Mar. 1991, split TEK into TEKMONO and TEK4211.
Written : William Thompson, GSFC, November 1987.
Modified : Version 1, William Thompson, GSFC, 27 April 1993.
Incorporated into CDS library.
Version : Version 1, 27 April 1993.
[Previous]
[Next]
NAME:
tem_thermal_power
PURPOSE:
Calculate thermal X-ray power for a given temperature and emission measure
CATEGORY:
X-ray
CALLING SEQUENCE:
power = tem_thermal_power(T, EM, flux_at_earth=flux_at_earth, $
[/meve, nbin=nbin, nmax=nmax, tmax=tmax, spectrum=spectrum, ...])
INPUTS:
T array[npnt]; type: float
temperature in MK
EM array[npnt] of same type and size as T
emission measure in 10^49 cm^-3
(these are the same units as used by goes_tem)
OPTIONAL INPUT PARAMETERS:
/mewe by default the power is calculated using Hugh Hudsons function
'thermal_power' (he calls this an 'interim program'; it was
written in 1993 ......) It is simple and fast and does not require
any specification of energy range.
if keyword /mewe is set then mewe_spec is called to get the thermal
energy spectrum. In that case the keywords below should be used to fix
the energy range for integration.
If /mewe is set then the power is calculated by summing over nbin energy intervals covering
the energy range 0 up to nmax*kB*T. The centers of the energy intervals are
(i/nbin)*nmax*kB*T, i=1,nbin
The next three keywords can be used to set the energy intervals over which to sum:
nbin=nbin scalar; type: integer; default: 100
number of energy intervals
nmax=nmax scalar; type: float; default: 5.0
width of total energy range in units of kB*T
tmax=tmax if tmax is set then a single set of intervals corresponding to
the specified temperature 'tmax' is used for all [T,EM] pairs.
if tmax is not set then for each [T,EM] pair the intervals
are based on temperature T (different for each [T,EM] pair).
_extra=_extra used to pass arguments to mewe_spec. Any input keyword to mewe_spec
other than /erg (which is always set) is permitted.
OUTPUTS:
power array[npnt]; type: float
integrated power in erg/s
OPTIONAL OUTPUT PARAMETERS:
flux_at_1AU=flux_at_1AU
array[npnt]; type: float
integrated flux at 1 AU in erg/s/cm^2
(flux_at_earth = power/(4*pi*r^2) where r = 1 AU)
The following will exist only if /mewe is set:
energies=energies
array[nbin,npnt]; type: float
center energies of energy intervals (keV)
spectrum=spectrum
array[nbin,npnt]; type: float
spectral flux in erg/s/keV at center energy of the intervals
CALLS: ***
REVERSE, THERMAL_POWER, mewe_spec [1], mewe_spec [2]
CALLED BY:
goes_reducer [1]
PROCEDURE:
Revives the /energy option provided by Hugh Hudsons obsolete Thomas_goes procedure
(superseded by goes_tem). Hugh's goes_reducer program now calls goes_tem to get
temperature and emission measure, then calls this routine to get the integrated power.
MODIFICATION HISTORY:
JUNE-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
Name: temporary
Purpose: mask routine to allow older versions of idl to run
software referencing the 'new' IDL function, temporary
Output: function just returns the input parameter
Restrictions: this routine should be in a directory which only is
included in !path if the idl version is older than 2.2.1
Side Effects: if this routine is compliled on systems running idl
release newer than 2.2.1, the IDL temporary function
is not accesible.
[Previous]
[Next]
Project : HESSI
Name : TEMPORARY2
Purpose : more robust TEMPORARY function that handles undefined input
Category : utility
Syntax : IDL> out=temporary2(in)
Inputs : IN = input variable
Outputs : OUT = output variable
CALLED BY:
IHY_READ
History : Written, 19-Nov-2003, Zarro (L-3/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
TEN()
PURPOSE:
Converts a sexigesimal number to decimal.
EXPLANATION:
Inverse of the SIXTY() function.
CALLING SEQUENCES:
X = TEN( [ HOUR_OR_DEG, MIN, SEC ] )
X = TEN( HOUR_OR_DEG, MIN, SEC )
X = TEN( [ HOUR_OR_DEG, MIN ] )
X = TEN( HOUR_OR_DEG, MIN )
X = TEN( [ HOUR_OR_DEG ] ) <-- Trivial cases
X = TEN( HOUR_OR_DEG ) <--
INPUTS:
HOUR_OR_DEG,MIN,SEC -- Scalars giving sexigesimal quantity in
in order from largest to smallest.
OUTPUTS:
Function value returned = double real scalar, decimal equivalent of
input sexigesimal quantity. A minus sign on any nonzero element
of the input vector causes all the elements to be taken as
< 0.
CALLED BY:
ADXY, CO_ABERRATION, MOONPOS, OBSERVATORY, QUERYSIMBAD
PROCEDURE:
Mostly involves checking arguments and setting the sign.
The procedure TENV can be used when dealing with a vector of
sexigesimal quantities.
MODIFICATION HISTORY:
Written by R. S. Hill, STX, 21 April 87
Modified to allow non-vector arguments. RSH, STX, 19-OCT-87
Recognize -0.0 W. Landsman/B. Stecklum Dec 2005
[Previous]
[Next]
NAME:
TENV()
PURPOSE:
Converts sexigesimal number or vector to decimal.
EXPLANATION:
Like TEN() but allows vector input.
CALLING SEQUENCES:
Result = TENV( dd, mm ) ; result = dd + mm/60.
Result = TENV( dd, mm, ss) ; result = dd + mm/60. + ss/3600.
INPUTS:
dd - Sexigesimal element(s) corresponding to hours or degrees
mm - Sexigesimal element(s) corresponding to minutes
ss - Sexigesimal element(s) corresponding to seconds (optional)
The input parameters can be scalars or vectors. However, the
number of elements in each parameter must be the same.
OUTPUTS:
Result - double, decimal equivalent of input sexigesimal
quantities. Same number of elements as the input parameters.
If the nth element in any of the input parameters is negative
then the nth element in Result will also be negative.
EXAMPLE:
If dd = [60,60,0], and mm = [30,-30,-30], then
IDL> Result = TENV(dd,mm) ====> Result = [60.5,-60.5,-0.5]
WARNING:
TENV() will recognize values of -0.0 as negative numbers. However,
there is no distinction in the binary representation of -0 and 0
(integer values), and so TENV will treat both values as positive.
PROCEDURE:
Mostly involves checking arguments and setting the sign.
MODIFICATION HISTORY:
Written by W.B. Landsman April, 1991
Recognize -0.0 W. Landsman/B. Stecklum Dec 2005
[Previous]
[Next]
Project : HINODE/EIS
Name : TEST_DIR
Purpose : Test if a directory exists and is writeable
Inputs : DIR = directory name to test
Keywords : See WRITE_DIR
Version : Written, 12-Nov-2006, Zarro (ADNET/GFSC)
Contact : dzarro@solar.stanford.edu
CALLS:
CALLED BY
CHECK_ANOMALY, EIS_LIST_EXPER [1], EIS_LIST_EXPER [2], EIS_LIST_MAIN [1]
EIS_LIST_MAIN [2], EIT_COPY, EIT__DEFINE, FILE2FID, FTP_SYNOP, GET_NOAA
GOES_TEMP_DIR, HSI_SOCK_FILE, JSMOVIE, JSMOVIE2, LAROBS_COPY, MAP2GIF, MAP2JPEG
MAP2MPEG, MDI_COPY, MK_FID, MK_FILE, MK_LINK, MK_MPEG, MK_SOHO_TARGET, MK_SUB_DIR
MK_SUMER_DBASE, PLOT_CDS_POINT [1], PLOT_CDS_POINT [2], PRINT_GEV, PRINT_NAR
SMART_FTP, TRACE_COPY, TRACE_GBO, UPDATE_CDS_TARGETS, UPDATE_SOHO_TARGETS, db_gbo
ihy_db, mdi_link, phoenix_spg_get
[Previous]
[Next]
Project : SOHO-CDS
Name : TEST_DIR2
Purpose : Test that a directory exists and is writable
Category : Utility
Syntax : status=test_dir(dir_name)
Inputs : DIR_NAME = directory name to check
Outputs : status = 1/0 if success/fail
Keywords : ERR = output messages
QUIET = turn off printing output messages
COUNT = # of valid directories
CALLS: ***
ARR2STR [1], Arr2Str [2], IS_DIR2, IS_STRING, TRIM, UNIQ [1], UNIQ [2], UNIQ [3]
WRITE_DIR2
History : Written 14 May 1998 D. Zarro, SAC/GSFC
Modified 14 March 2000, Zarro (SM&A/GSFC) - vectorized
Modified, 3-Jan-2002, Zarro - added check for input
directory as single element scalar
Modified, 16-Nov-2006, Zarro (ADNET/GSFC)
- renamed to TEST_DIR2
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HINODE/EIS
Name : TEST_OPEN
Purpose : Test open a file to determine existence and/or write access
Inputs : FILE = file to test
Keywords : See TEST_OPEN2
Version : Written, 12-Nov-2006, Zarro (ADNET/GSFC)
- uses better FILE_TEST
Contact : dzarro@solar.stanford.edu
CALLS:
CALLED BY
ADD_ANOMALY, ARR2GIF, CDSHEADFITS, CDS_COMPRESS, CDS_READ_MISSING
CDS_SAVE_MISSING, CHECK_ANOMALY, CHECK_LOCK, COMPILE_SFIT, FIT2GIF, FIX_IAP
GET_COMPILED_TKI, GET_LATEST_IAP, GET_UDP_HEAD, GIF2PICT, ITOOL_MODIFY_FH
ITOOL_WRITE_FITS, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], LZPLOT, MAP2FITS
MDI_GBO, MK_AGIF, MK_CDS_GIF, MK_PLAN_FORM, MK_PLAN_HTML, MK_PLAN_RECOVER, MK_RASTER
MK_STUDY, PLOTMAP, PRIV_ZDBASE, REBIN_GIF, RESTORE_ANALYSIS, RESTORE_CDS_ADEF
SAVE_CDS_ADEF, SFITSLIST, STR2FILE, ST_MK_UDP_STC, ST_SUMER, ST_TKI_INIT, TKI_CALL
TKI_UDPSLIT, UPDATE_KAP, URL_GET, WBDA [1], WBDA [2], WBSC_FIT_EV [1]
WBSC_FIT_EV [2], WBSC_FPAR_EV [1], WBSC_FPAR_EV [2], WBSC_LTC_EV [1]
WBSC_LTC_EV [2], WR_ASC, X2GIF, X2JPEG, X2PS, XCDS_COSMIC, XCPT, XPORT, XPS_SETUP, XREPORT
XSPECT_SETSUMPAR, XSTUDY, XTKI, hsi_gbo, sumer_ffdb
[Previous]
[Next]
Project : SOHO - CDS
Name : TEST_OPEN2
Purpose : Test open a file to determine existence and/or write access
Explanation :
Uses OPENR or OPENW (if /WRITE is set) to return status of
input file. If input file is not given, then TEST_OPEN will
test if the current directory is writeable.
Use :
OK=TEST_OPEN(FILE) ;test for existence
OK=TEST_OPEN(FILE,/WRITE) ;test for write access
Inputs :
FILE = file to test
Opt. Inputs :
None.
Outputs :
OK = logical 1 for existence and readable
or 0 for nonexistent and/or not writeable (if /WRITE)
Opt. Outputs:
None.
Keywords :
WRITE = If set, then test for write access.
QUIET = set to keep quiet
NODIR = do not test if input is a directory (for speed)
ERR = error string
Category :
Utilities, Operating_system.
Written :
Dominic Zarro, GSFC, 1993.
Version :
Version 1, 1 August 1993.
Version 2, 15 March 1995, modified, Zarro
-- added check for directory input
Version 3, 3 September 1996, Zarro
-- added VMS check for non-existent file input
Version 4, 2-Feb-1999, Zarro (SM&A) - check for scalar input
Version 5, 7-Oct-1999, Zarro (SM&A) - vectorized
Version 6, 17-Nov-1999, Zarro (SM&A) - added CATCH, and
randomized temporary files.
Version 7, 18-Dec-2000, Zarro (EIT/GSFC) - allowed checking
current directory write access when input is undefined.
Modified: 30-Sept-2005, Zarro (L-3Com/GSFC)
- removed datatype calls
Modified, 14-Nov-2006, Zarro (ADNET/GFSC)
- renamed to TEST_OPEN2 and called from TEST_OPEN
CALLS:
CALLED BY
TEST_OPEN, WRITE_DIR2
[Previous]
[Next]
Name: testcube
Purpose: return test data cube (shifted dist) - optionally make gif files
Input (all optional):
n - number of 'images' - default=5
nx - X size of 'images' - default=256
ny - Y size of 'images' - default=nx
Keyword Parameters:
gif (input) - if set, write to sequence of GIF files in current directory
outfiles (output) - output file names (only if /gif set)
labels (output) - text array (strarr(n)) - image labels (strarr(n))
Calling Sequence:
cube=testcube( [n, nx, labels=labels] )
Calling Examples:
cube1 = testcube() ; default = 256x256x5
cube2 = testcube(10,512) ; 512x512x10
Usage Example (xstepper test)
IDL> cubex=testcube(10,512,labels=labels)
IDL> xstepper,cubex,labels
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], DIST, SSW_WRITE_GIF
History:
Circa 1-jan-1992 - S.L.Freeland - for 3D SW testing
5-mar-1997 - S.L.Freeland - added LABELS output & documentation
add /GIF and OUTFILES (for WWW movie testing)
13-Aug-2003, William Thompson
Use SSW_WRITE_GIF instead of WRITE_GIF
[Previous]
[Next]
Project : SOHO - CDS
Name : TEXT_MATCH()
Purpose : Find text(s) matching expression
Explanation : The supplied text array (INITIAL_LIST) is searched, and the
indices of the texts that match the supplied search criteria
(FIND, FIRST and LAST) are returned. The search is
CASE SENSITIVE.
The search string (FIND) is a sequence of texts separated by
the operators '&' (high precedence AND), '|' (OR), and '$'
(low precedence AND).
The search string "active&nis" contains the search texts
"active" and "nis", and will match only those lines in
INITIAL_LIST that contain BOTH these texts as substrings.
"active|nis" will select lines with EITHER "active"
OR "nis".
"16/03|17/03$NIS" will select lines with (EITHER "16/03" OR
"17/03") AND "NIS".
Parentheses are not allowed in the search, but with one AND
operator with high precedence (&) and one with low precedence
($), there should be little need for them.
The search can be narrowed down by specifying FIRST and LAST
as substrings (no operators) to match the first and last
selectable strings.
Use : INDEX = TEXT_MATCH(INITIAL_LIST,FIND,FIRST,LAST)
Inputs : INITIAL_LIST : An array of texts to be searched.
FIND : Search string.
FIRST : Simple (one search text, no operators) text to match
the first of the selectable texts.
LAST : Simple text to match the last of the selectable texts.
Opt. Inputs : None.
Outputs : Returns the indices of the matching lines. Returns -1 if
no matches were found.
Opt. Outputs: None.
Keywords : None.
Calls : ***
PARCHECK, STR_SEP, TYP
CALLED BY:
PICKFITS
Common : None.
Restrictions: None.
Side effects: None.
Category : Cds_utility, string
Prev. Hist. : Distilled from PICKFITS v 5
Written : S.V.H. Haugan, UiO, 18 April 1996
Modified : Version 2, SVHH, 23 April 1996
Removed a side effect that altered input
parameter FIND.
Version 3, SVHH, 29 April 1996
Added wrapper around !DEBUG reference to allow
compilation everywhere.
Version : 3, 29 April 1996
[Previous]
[Next]
Name: text_output
Purpose: Display ascii text on screen, send to printer, or save in file
Calling sequence:
text_output, text [, show_text=show_text, print_text=print_text, file_text=file, group=group, err_msg=err_msg]
Inputs:
text - string of text
Input Keywords:
show_text - if set, then show text on screen in a text widget
print_text - if set, then create temporary file and print it
file_text - if set, ask user for output file name and write file. Or alternatively, file_text may be the
name of the file (if no path will write in current directory)
group - group leader for text widget if show is selected
title - title of screen output text widget
queue - printer queue for print output
CALLS: ***
DSP_STRARR, HAVE_WINDOWS [1], HAVE_WINDOWS [2], OS_FAMILY, SEND_PRINT, WRT_ASCII
XANSWER
CALLED BY:
SPEX__DEFINE, hessi_list, hsi_ui_flarecat
Note: If none of show_text, print_text, or file_text keywords are set, then show_text is automatically set.
Output keywords:
filename - name of file that was written to, if any
err_msg - string error message returned if there was an error
Written: 31-Jul-2000, Kim Tolbert
Modifications:
3-Nov-2000, Kim - changed keyword names from show,print,file to show_text,print_text,file_text
to make them unique in cases where _extra is used in routines that call text_output
3-Dec-2000, Kim - added queue keyword
21-Jan-2001, Kim - added filename keyword. And use message instead of print for filename.
29-Jan-2001, Kim - call dsp_strarr with /no_block
25-Mar-2001, Kim - Pass ysize on call to dsp_strarr
11-Aug-2002, Kim - Modified header documentation
[Previous]
[Next]
NAME:
TEXTCLOSE
PURPOSE:
Close a text outpu file previously opened with TEXTOPEN
EXPLANATION:
procedure to close file for text output as specifed
by the (non-standard) system variable !TEXTOUT.
CALLING SEQUENCE:
textclose, [ TEXTOUT = ]
KEYWORDS:
textout - Indicates output device that was used by
TEXTOPEN
CALLED BY:
DBCOMPARE [1], DBCOMPARE [2], DBHELP [1], DBHELP [2], DBHELP [3], DBPRINT [1]
DBPRINT [2], DBPRINT [3], FITSDIR, FITS_INFO [1], FITS_INFO [2], FORPRINT, FTAB_HELP
FTHELP, FTPRINT, IMLIST, IRAFDIR, PCA, TABLE_HELP, TABLE_LIST, TABLE_PRINT [1]
TAB_PRINT, TBHELP, TBPRINT, UVBYBETA, table_print [2]
SIDE EFFECTS:
if !textout is not equal to 5 and the textunit is
opened. Then unit !textunit is closed and released
HISTORY:
D. Lindler Dec. 1986 (Replaces PRTOPEN)
Test if TEXTOUT is a scalar string W. Landsman August 1993
Can't close unit -1 (Standard Output) I. Freedman April 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TEXTCLOSE
PURPOSE:
Close a text outpu file previously opened with TEXTOPEN
EXPLANATION:
procedure to close file for text output as specifed
by the (non-standard) system variable !TEXTOUT.
CALLING SEQUENCE:
textclose, [ TEXTOUT = ]
KEYWORDS:
textout - Indicates output device that was used by
TEXTOPEN
CALLED BY:
DBCOMPARE [1], DBCOMPARE [2], DBHELP [1], DBHELP [2], DBHELP [3], DBPRINT [1]
DBPRINT [2], DBPRINT [3], FITSDIR, FITS_INFO [1], FITS_INFO [2], FORPRINT, FTAB_HELP
FTHELP, FTPRINT, IMLIST, IRAFDIR, PCA, TABLE_HELP, TABLE_LIST, TABLE_PRINT [1]
TAB_PRINT, TBHELP, TBPRINT, UVBYBETA, table_print [2]
SIDE EFFECTS:
if !textout is not equal to 5 and the textunit is
opened. Then unit !textunit is closed and released
HISTORY:
D. Lindler Dec. 1986 (Replaces PRTOPEN)
Test if TEXTOUT is a scalar string W. Landsman August 1993
Can't close unit -1 (Standard Output) I. Freedman April 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
TEXTOPEN
PURPOSE:
Open a device specified by TEXTOUT with unit !TEXTUNIT
EXPLANATION:
Procedure to open file for text output. The type of output
device (disk file or terminal screen) is specified by the
TEXTOUT keyword or the (nonstandard) system variable !TEXTOUT.
CALLING SEQUENCE:
textopen, program, [ TEXTOUT =, /STDOUT, /SILENT, MORE_SET= ]
INPUTS:
program - scalar string giving name of program calling textopen
OPTIONAL INPUT KEYWORDS:
TEXTOUT - Integer scalar (0-7) specifying output file/device to be
opened (see below) or scalar string giving name of output file.
If TEXTOUT is not supplied, then the (non-standard) system
variable !TEXTOUT is used.
/SILENT - By default, TEXTOPEN prints an informational message when
opening a file for hardcopy output. Set /SILENT (or !QUIET)
to suppress this message.
/STDOUT - if this keyword is set and non-zero, then the standard output
(unit = -1) is used for TEXTOUT=1 or TEXTOUT=2. The use
of STDOUT has 2 possible advantages:
(1) the output will appear in a journal file
(2) Many Unix machines print spurious control characters when
printing to /dev/tty. These characters are eliminated by
setting /STDOUT
The disadvantage of /STDOUT is that the /MORE option is not
available.
OPTIONAL OUTPUT KEYWORD:
MORE_SET - Returns 1 if the output unit was opened with /MORE. This
occurs if (1) TEXTOUT = 1 and (2) the device is a tty, and
(3) /STDOUT is not set. User can use the returned value
of MORE_SET to determine whether to end output when user
presses 'Q'.
CALLS: ***
FILEPATH
CALLED BY:
DBCOMPARE [1], DBCOMPARE [2], DBHELP [1], DBHELP [2], DBHELP [3], DBPRINT [1]
DBPRINT [2], DBPRINT [3], FITSDIR, FITS_INFO [1], FITS_INFO [2], FORPRINT, FTAB_HELP
FTHELP, FTPRINT, IMLIST, IRAFDIR, PCA, TABLE_HELP, TABLE_LIST, TAB_PRINT, TBHELP, TBPRINT
UVBYBETA
SIDE EFFECTS:
The following dev/file is opened for output. Different effects
occur depending whether the standard output is a GUI (Macintosh,
Windows, Unix/IDLTool) or a TTY
textout=0 Nowhere
textout=1 if a TTY then TERMINAL using /more option
otherwise standard (Unit=-1) output
textout=2 if a TTY then TERMINAL without /more option
otherwise standard (Unit=-1) output
textout=3 <program>.prt
textout=4 laser.tmp
textout=5 user must open file
textout=7 same as 3 but text is appended to <program>.prt
file if it already exists.
textout = filename (default extension of .prt)
The unit to be opened is obtained with the procedure GET_LUN
unless !TEXTOUT=5. The unit number is placed in system variable
!TEXTUNIT. For !TEXTOUT=5 the user must set !TEXTUNIT to the
appropriate unit number.
NOTES:
When printing to a TTY terminal, the output will *not* appear in an
IDL JOURNAL session, unlike text printed with the PRINT command.
NON-STANDARD SYSTEM VARIABLES:
TEXTOPEN will automatically define the following system variables if
they are not previously defined:
DEFSYSV,'!TEXTOUT',1
DEFSYSV,'!TEXTUNIT',0
HISTORY:
D. Lindler Dec. 1986
Keyword textout added, J. Isensee, July, 1990
Made transportable, D. Neill, April, 1991
Trim input PROGRAM string W. Landsman Feb 1993
Don't modify TEXTOUT value W. Landsman Aug 1993
Modified for MacOS I. Freedman April 1994
Modified for output terminals without a TTY W. Landsman August 1995
Added /STDOUT keyword W. Landsman April 1996
added textout=7 option, D. Lindler, July, 1996
Converted to IDL V5.0 W. Landsman September 1997
Exit with RETURN instead of RETALL W. Landsman June 1999
In IDL V5.4 filepath(/TERMINAL) not allowed in the IDLDE WL August 2001
Added MORE_SET output keyword W.Landsman January 2002
Added /SILENT keyword W. Landsman June 2002
Define !TEXTOUT and !TEXTUNIT if needed. R. Sterner, 2002 Aug 27
Return Calling Sequence if no parameters supplied W.Landsman Nov 2002
[Previous]
[Next]
NAME:
TEXTOPEN
PURPOSE:
Open a device specified by TEXTOUT with unit !TEXTUNIT
EXPLANATION:
Procedure to open file for text output. The type of output
device (disk file or terminal screen) is specified by the
TEXTOUT keyword or the (nonstandard) system variable !TEXTOUT.
CALLING SEQUENCE:
textopen, program, [ TEXTOUT =, /STDOUT, /SILENT, MORE_SET= ]
INPUTS:
program - scalar string giving name of program calling textopen
OPTIONAL INPUT KEYWORDS:
TEXTOUT - Integer scalar (0-7) specifying output file/device to be
opened (see below) or scalar string giving name of output file.
If TEXTOUT is not supplied, then the (non-standard) system
variable !TEXTOUT is used.
/SILENT - By default, TEXTOPEN prints an informational message when
opening a file for hardcopy output. Set /SILENT (or !QUIET)
to suppress this message.
/STDOUT - if this keyword is set and non-zero, then the standard output
(unit = -1) is used for TEXTOUT=1 or TEXTOUT=2. The use
of STDOUT has 2 possible advantages:
(1) the output will appear in a journal file
(2) Many Unix machines print spurious control characters when
printing to /dev/tty. These characters are eliminated by
setting /STDOUT
The disadvantage of /STDOUT is that the /MORE option is not
available.
OPTIONAL OUTPUT KEYWORD:
MORE_SET - Returns 1 if the output unit was opened with /MORE. This
occurs if (1) TEXTOUT = 1 and (2) the device is a tty, and
(3) /STDOUT is not set. User can use the returned value
of MORE_SET to determine whether to end output when user
presses 'Q'.
CALLS: ***
FILEPATH
CALLED BY:
DBCOMPARE [1], DBCOMPARE [2], DBHELP [1], DBHELP [2], DBHELP [3], DBPRINT [1]
DBPRINT [2], DBPRINT [3], FITSDIR, FITS_INFO [1], FITS_INFO [2], FORPRINT, FTAB_HELP
FTHELP, FTPRINT, IMLIST, IRAFDIR, PCA, TABLE_HELP, TABLE_LIST, TAB_PRINT, TBHELP, TBPRINT
UVBYBETA
SIDE EFFECTS:
The following dev/file is opened for output. Different effects
occur depending whether the standard output is a GUI (Macintosh,
Windows, Unix/IDLTool) or a TTY
textout=0 Nowhere
textout=1 if a TTY then TERMINAL using /more option
otherwise standard (Unit=-1) output
textout=2 if a TTY then TERMINAL without /more option
otherwise standard (Unit=-1) output
textout=3 <program>.prt
textout=4 laser.tmp
textout=5 user must open file
textout=7 same as 3 but text is appended to <program>.prt
file if it already exists.
textout = filename (default extension of .prt)
The unit to be opened is obtained with the procedure GET_LUN
unless !TEXTOUT=5. The unit number is placed in system variable
!TEXTUNIT. For !TEXTOUT=5 the user must set !TEXTUNIT to the
appropriate unit number.
NOTES:
When printing to a TTY terminal, the output will *not* appear in an
IDL JOURNAL session, unlike text printed with the PRINT command.
NON-STANDARD SYSTEM VARIABLES:
TEXTOPEN will automatically define the following system variables if
they are not previously defined:
DEFSYSV,'!TEXTOUT',1
DEFSYSV,'!TEXTUNIT',0
HISTORY:
D. Lindler Dec. 1986
Keyword textout added, J. Isensee, July, 1990
Made transportable, D. Neill, April, 1991
Trim input PROGRAM string W. Landsman Feb 1993
Don't modify TEXTOUT value W. Landsman Aug 1993
Modified for MacOS I. Freedman April 1994
Modified for output terminals without a TTY W. Landsman August 1995
Added /STDOUT keyword W. Landsman April 1996
added textout=7 option, D. Lindler, July, 1996
Exit with RETURN instead of RETALL W. Landsman June 1999
In IDL V5.4 filepath(/TERMINAL) not allowed in the IDLDE WL August 2001
Added MORE_SET output keyword W.Landsman January 2002
Added /SILENT keyword W. Landsman June 2002
Define !TEXTOUT and !TEXTUNIT if needed. R. Sterner, 2002 Aug 27
Return Calling Sequence if no parameters supplied W.Landsman Nov 2002
Remove VMS specific code W. Landsman Sep 2006
Make sure MORE_SET is always defined W. Landsman Jan 2007
[Previous]
[Next]
Name: tfile__define
Purpose: read/return contents of text file - optionally interpret
and convert text table data
Input Control Paramters:
filename - string variable containing file name to read
ncols - (optional) #colunms (output will be matrix, strarr(NCOLSxN)
skip - (optional) #lines to skip (header) for readfile compatibile
(if skip=-1, first non-numeric lines are skipped)
delim - table column delimiter (default is blank/tab)
nocomment - if=1 (switch) , remove lines with (unix:#, vms:!)
if string (scaler), remove lines with specified character
compress - eliminate leading/trailing blanks and excess whitespace
(for table data (ncols gt 1), compress is assumed)
quiet - if set, suppress warning messages
autocol - if set, derive column count from first non-comment line
convert - if set, convert to numeric data type
hskip - header skip (sets skip to -1)
first_char_comm - if set, only apply "nocomment" flag when the
comment character is the first character
Output Parameters:
getdata returns file contents (string array(list) or matrix)
if convert is set, auto-convert to numeric data type
Info Parameters
header - output string(array) containing header lines
Calling Sequence:
tfile = obj_new('tfile')
tfile->set,filename=filename, /nocomment, /autocolumn, /convert
text=rd_tfile(filename) ; orig. file-> string array
text=rd_tfile(filename,/nocomment) ; same less comment lines
text=rd_tfile(filename,/compress) ; same less excess blanks
data=rd_tfile('text.dat',3) ; strarr(3,N) (table data)
data=rd_tfile('fdata.dat',/auto,/convert); determine n columns and
; data type automatically
data=rd_tfile(filename,/hskip,head=head) ; return file header in head
CALLS: ***
TFILE::FILE_SEARCH, TFILE::GETDATA, TFILE::INIT, TFILE::PROCESS, TFILE_CONTROL
TFILE_CONTROL__DEFINE, TFILE_INFO__DEFINE, curdir [1], curdir [2], rd_tfile [1]
rd_tfile [2]
History:
slf, 4-Jan-1992 - for yohkoh configuration files
slf, 6-Jan-1992 - remove partial comment lines
slf, 11-feb-1993 - added autocol keyword and function
added convert keyword and function
slf, 28-Oct-1993 - temp fix for VMS variable length files
slf, 26-jan-94 fixed bug if /auto and user supplied comment char
dmz, 3-Mar-94 - changed type to type/nopage (for vms), otherwise
it is really slow
slf, 21-May-94 - fix bug in /convert auto skip function (allow '-' !!)
mdm, 15-Mar-95 - Modified to not crash on reading a null file.
mdm, 12-Oct-95 - Modification to allow tab character to be the delimiter.
slf, 27-mar-96 - Put MDM oct change online
ras, 19-jun-96 - Use rd_ascii in vms
slf, 29-may-97 - force FILENAME -> scalar
slf, 16-sep-97 - allow ascii files with NO carraige returns
slf, 6-oct-97 - include last line which has NO carraige return
mdm, 25-Nov-97 - Made FOR loop long integer
mdm, 7-Apr-98 - Print the filename when NULL
slf, 19-aug-98 - per MDM report, free lun on read error
mdm, 11-Feb-99 - Added /first_char_comm
Category:
gen, setup, swmaint, file i/o, util
Method:
files are assumed to be ascii - file contents read into a variable
if ncols is greater than 1, then a table is assumed and a string
matrix is returned - table is null filled for non existant table
entries (ncols gt 1 forces white space removal for proper alignment)
[Previous]
[Next]
Project : SOHO - CDS
Name : TFTD
Purpose : Search for a string in header documentation.
Explanation : From a previously created and saved list of one-liners
from the IDL userlib and CDS trees the routine selects
up to 50 at random and prints them. This routine is run at
IDL startup as part of a user-education drive.
Use : IDL> tftd [,'search_string', lines=lines, /prog, cat=cat]
Inputs : None
Opt. Inputs : search_string - if given only routine names or one-line
documentation containing that string will
be presented. If present, all matches are
output and the LINES keyword is ignored.
The default search is effectively wild-carded
to search for '*string*'. If however a
wildcard is used explicitly at the end of
the search string, eg 'FITS*' then only those
entries beginning with the supplied
characters will be located. The /NAME
keyword is then redundant.
Outputs : Listing to screen or printer
Opt. Outputs: None
Keywords : lines - specifies the number of one-liners to output
(limit of 50 is imposed)
prog - use programmer routines only
cat - if specified, only routines having the supplied
string in the CATEGORY header section will be
listed. If cat has the value '?' then a list
of possible categories is printed.
name - if set, search is conducted within the name only
of the program - not the explanation.
hard - produce hardcopy of list
keep - keep output in file tftd_results in current
directory
Calls : ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2]
LOC_FILE [3], PRINT_STR, REMCHAR [1], REMCHAR [2], REMCHAR [3], REM_DUP [1]
REM_DUP [2], REM_DUP [3], REPSTR [1], REPSTR [2], REPSTR [3], STR_SEP
concat_dir [4]
Common : None
Restrictions: Only userlib and CDS trees used at the moment.
Side effects: User awareness increased. Authors of routines with
non-standard documentation embarrassed (hopefully).
Category : Doc, help
Prev. Hist. : None
Written : C D Pike, RAL, 5-May-94
Modified : Look for save file in CDS_INFO, CDP, 20-May-1994
Add prog keyword. CDP, 13-Jun-94
Make LINES a keyword and string search the only parameter.
CDP, 14-Sep-94
To include category option. CDP, 20-Sep-94
Added /NAME keyword and explicit wildcard. CDP, 14-Feb-95
Added check for existence of save files. DMZ, 28-Feb-95
Add hardcopy option. CDP, 11-Apr-97
Add keep keyword. CDP, 25-Jan-99
Version : Version 8, 10-Apr-97
[Previous]
[Next]
Purpose: Make an html thumbnail table - optionally make the thumbnails
Input:
giffiles - list of giffile names (including full path)
thumbnails - corresponding thumbnails (default is GIFFILES_thumb.gif)
Keyword Parameters:
make_thumbnails - if set, make the thumbnails (via call mkthumb)
factor - if set, use as thumbnail factor (implies /MAKE_THUMBNAIL)
ncols - number of columns (thumbnails) in html table
tperline - ncols synonym - 'thumbnails per line'
text - optional text desciption (one element per giffiles)
(default is name of giffile and full gif file size)
Calling Sequence:
IDL> html=thumbnail_table_html(giffiles [,thumbnails] [,make_thumb]
[,ncols=xx] )
Calling Example:
IDL> html=thumbnail_table_html(giffiles, ncols=5, /make_thumb,factor=.1)
IDL> file_append,hdoc, html ; << insert table in html document
Calls: ***
BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
CONCAT_DIR [2], CONCAT_DIR [3], break_file [4], concat_dir [4], data_chk [1]
data_chk [2], file_size [1], file_size [2], mkthumb, str2html [1], str2html [2]
str2html [3], str_replace [1], str_replace [2], strtab2html
CALLED BY:
eit_proton_summary
History:
24-Aug-1998 - S.L.Freeland - break code from image2movie,/still
[Previous]
[Next]
NAME:
TIC_ONE
PURPOSE:
Determine the position of the first tic mark for astronomical images.
EXPLANATION:
For use in labelling images with right ascension
and declination axes. This routine determines the
position in pixels of the first tic.
CALLING SEQUENCE:
tic_one, zmin, pixx, incr, min2, tic1, [RA = ]
INPUTS:
zmin - astronomical coordinate value at axis zero point (degrees
or hours)
pixx - distance in pixels between tic marks (usually obtained from TICS)
incr - increment in minutes for labels (usually an even number obtained
from the procedure TICS)
OUTPUTS:
min2 - astronomical coordinate value at first tic mark
tic1 - position in pixels of first tic mark
CALLED BY:
IMCONTOUR
EXAMPLE:
Suppose a declination axis has a value of 30.2345 degrees at its
zero point. A tic mark is desired every 10 arc minutes, which
corresponds to 12.74 pixels. Then
IDL> TIC_ONE, 30.2345, 1, 12.74, min2, tic1
yields values of min2 = 30.333 and tic1 = 5.74, i.e. the first tic
mark should be labeled 30 deg 20 minutes and be placed at pixel value
5.74
REVISION HISTORY:
by B. Pfarr, 4/15/87
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Project : SOHO - CDS
Name : TICK_VEC
Purpose : Generate tickmarks for tight (or wide) displays.
Explanation : Up to a specified number of equidistant tickmarks are
returned.
Use : TICVEC = TICK_VEC(MAXN,MIN,MAX)
Inputs : MAXN : The maximum number of tick marks allowed.
MIN : The minimum value on the axis
MAX : The maximum value on the axis
Opt. Inputs : None.
Outputs : Returns a vector in the interval [ MIN, MAX ], with up to MAXN
entries.
Opt. Outputs: None.
Keywords : MINOR : Number of minor ticks that are appropriate.
Calls : None.
CALLED BY:
CW_PLOTZ [1], CW_PZOOM [1], cw_plotz [2], cw_pzoom [2]
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities
Prev. Hist. : None.
Written : Stein Vidar Haugan, June 1994
Modified : Version 2, SVHH, 30 May 1996
Improved algorithm, added SUBTICKS keyword
Version : 2, 30 May 1996
[Previous]
[Next]
NAME:
TICLABELS
PURPOSE:
Create tic labels for labeling astronomical images.
EXPLANATION:
Used to display images with right ascension or declination
axes. This routine creates labels for already determined tic
marks (every other tic mark by default)
CALLING SEQUENCE:
TICLABELS, minval, numtics, incr, ticlabs, [ RA = ,DELTA = ]
INPUTS:
minval - minimum value for labels (degrees)
numtics - number of tic marks
incr - increment in minutes for labels
OUTPUTS:
ticlabs - array of charater string labels
OPTIONAL INPUT KEYWORDS:
/RA - if this keyword is set then the grid axis is assumed to be
a Right Ascension. Otherwise a declination axis is assumed
DELTA - Scalar specifying spacing of labels. The default is
DELTA = 2 which means that a label is made for every other tic
mark. Set DELTA=1 to create a label for every tic mark.
FONT - scalar font graphics keyword (-1,0 or 1) for text
PROCEDURES USED:
RADEC
CALLS: ***
RADEC
CALLED BY:
IMCONTOUR
RESTRICTIONS:
Invalid for wide field (> 2 degree) images since it assumes that a
fixed interval in Y (or X) corresponds to a fixed interval in Dec
(or RA)
REVISON HISTORY:
written by B. Pfarr, 4/15/87
Added DELTA keywrd for compatibility with IMCONTOUR W. Landsman Nov 1991
Added nicer hms and dms symbols when using native PS fonts Deutsch 11/92
Added Patch for bug in IDL <2.4.0 as explained in NOTES E. Deutsch 11/92
Fix when crossing 0 dec or 24h RA
Fix DELTA keyword so that it behaves according to the documentation
W. Landsman Hughes STX, Nov 95
Converted to IDL V5.0 W. Landsman September 1997
Allow sub arcsecond formatting W. Landsman May 2000
Better formatting for non-unity DELTA values W. Landsamn July 2004
Allow FONT keyword to be passed. T. Robishaw Apr. 2006
[Previous]
[Next]
NAME:
TICPOS
PURPOSE:
Specify distance between tic marks for astronomical coordinate overlays
EXPLANATION:
User inputs number an approximate distance
between tic marks, and the axis length in degrees. TICPOS will return
a distance between tic marks such that the separation is a round
multiple in arc seconds, arc minutes, or degrees
CALLING SEQUENCE:
TICPOS, deglen, pixlen, ticsize, incr, units
INPUTS:
deglen - length of axis in DEGREES
pixlen - length of axis in plotting units (pixels)
ticsize - distance between tic marks (pixels). This value will be
adjusted by TICPOS such that the distance corresponds to
a round multiple in the astronomical coordinate.
OUTPUTS:
ticsize - distance between tic marks (pixels), positive scalar
incr - incremental value for tic marks in round units given
by the UNITS parameter
units - string giving units of ticsize, either 'ARC SECONDS',
'ARC MINUTES', or 'DEGREES'
CALLED BY:
IMCONTOUR
EXAMPLE:
Suppose a 512 x 512 image array corresponds to 0.2 x 0.2 degrees on
the sky. A tic mark is desired in round angular units, approximately
every 75 pixels.
IDL> ticsize = 75
IDL> TICPOS,0.2,512,ticsize,incr,units
==> ticsize = 85.333, incr = 2. units = 'Arc Minutes'
i.e. a good tic mark spacing is every 2 arc minutes, corresponding
to 85.333 pixels.
REVISON HISTORY:
written by W. Landsman November, 1988
Converted to IDL V5.0 W. Landsman September 1997
Don't use all capital letters W. Landsman May 2003
Fix case where incr crosses degree/minute or minute/degree boundary
A. Mortier/W.Landsman April 2005
[Previous]
[Next]
NAME:
TICS
PURPOSE:
Compute a nice increment between tic marks for astronomical images.
EXPLANATION:
For use in labelling a displayed image with right ascension
or declination axes. An approximate distance between tic
marks is input, and a new value is computed such that the
distance between tic marks is in simple increments of the
tic label values.
CALLING SEQUENCE:
tics, radec_min, radec_max, numx, ticsize, incr, [ /RA ]
INPUTS:
radec_min - minimum axis value (degrees)
radec_max - maximum axis value (degrees)
numx - number of pixels in x direction
INPUT/OUTPUT
ticsize - distance between tic marks (pixels)
OUTPUTS:
incr - incremental value for tic labels (in minutes of
time for R.A., minutes of arc for dec.)
REVISON HISTORY:
written by B. Pfarr, 4/14/87
Added some more tick precision (i.e. 1 & 2 seconds in case:) EWD May92
Added sub arcsecond tick precision W. Landsman May 2000
Plate scale off by 1 pixel W. Landsman July 2004
CALLED BY
IMCONTOUR
[Previous]
[Next]
Project : SOHO-CDS
Name : TIFF2GIF
Purpose : convert TIFF to GIF files
Category : Utility
Explanation :
Syntax : IDL> tiff2gif,tiff_file
Examples :
Inputs : TIFF_FILE = list of TIFF filenames OR directory name
containing files.
Opt. Inputs : None
Outputs : GIF files
Opt. Outputs:
Keywords : OUT_DIR = output directory for GIF files
[def is same as input location of TIFF files)
SIZE = size of GIF files
(e.g. size=512, or size=[512,512] to rebin to 512)
VERBOSE = print messages
FLIP = flip N/S
JPEG = out JPEG instead
Restrictions: None
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], CONGRID [1], CONGRID [2], CONGRID [3], DATATYPE [1], DATATYPE [2]
DATATYPE [3], EXIST, IS_DIR, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PR_SYNTAX
SAVEIMAGE, TRIM, WRITE_DIR, break_file [4], concat_dir [4], curdir [1], curdir [2]
data_chk [1], data_chk [2]
Side effects: None
History : Written 8 June 1999 D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
TIM2CARR
PURPOSE
Determine the decimal Carrington rotation number or the Carrington
longitude of the central meridian of the sun for a given time or
set of times
INPUT
TIME - Scalar or vector of times in any standard format
CALLS: ***
GET_SUN [1], GET_SUN [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
CALLED BY:
MAP2WCS, TIM2UPOS, V4XCARR2HEL, V4XHEL2CARR, WCS_FIND_POSITION, conv_c2h, conv_h2c
disp_synop, tim2clon OBSOLETE See TIM2CAR instead
OPTIONAL KEYWORD INPUT:
OFFSET - Reference heliographic longitude(s). The default is 0
(central meridian). For example, if offset = 90, then
the Carrington rotation number which coincides with
90 deg heliographic longitude at the supplied time is
returned.
DC - If set, return the decimal Carrington rotation number of the
central meridian rather than the Carrington longitude
OUTPUT
Carrington longitude or, optionally, decimal Carrington rotation
number, if keyword DC is set
CALLING SEQUENCE
CARR = TIM2CARR('16-Feb-1994 10:46:27')
HISTORY
Feb 15, 1994 - GLS - Written using CARR2EX as starting point
Modified : Version 2, November 4, 1997 Giulio Del Zanna, UCLAN, UK
Corrected the error that not any standard time
format was accepted. Different time formats were
producing different results.
23-Feb-1998 - S.L.Freeland - handle absolutely ANY SSW time
4-nov-97 change was problem for external, etc.
Version : Version 2
[Previous]
[Next]
Name:
tim2clon (** OBSOLETE ** See TIM2CAR instead)
Purpose:
Calculate the 'Carrington' or heliographic longitude of the
central point of the solar disk corresponding to input time(s).
Input:
time_arr - A structure array with the
fields .TIME and .DAY
(OR)
A 2xN array with the MSOD variable first, and the DS79
variable second (see example). It
is assumed that they are the same length
(OR)
A 7xN array which hold the 7-element external
representation of time.
(OR)
String array of times.
Output:
returns a single array of longitudes.
CALLS: ***
TIM2CARR, TIM2CLON
History:
Written by G.Slater Dec-92
19-May-97 (MDM) - Gutted and made to call TIM2CAR
[Previous]
[Next]
NAME:
tim2dset
PURPOSE:
Given a structure (roadmap or index), find the dataset with
the time closest to an input time.
CALLING SEQUENCE:
xx = tim2dset(roadmap, tarr)
xx = tim2dset(roadmap, '12:33 5-Nov-91',delta_sec=delta_sec)
print, tim2set(roadmap)
INPUT:
struct - The roadmap or index structure to search
tim_in - The reference time to search the dataset for.
Form can be (1) structure with a .time and .day
field, (2) the standard 7-element external representation
or (3) a string of the format "hh:mm dd-mmm-yy"
- If no input is passed, the user is prompted for the
time to use
OPTIONAL OUTPUT KEWORDS:
delta_sec - Absolute value of the time difference in secs.
offset - The time difference in seconds
CALLS: ***
Int2Ex [1], Int2Ex [2], anytim2ints [1], anytim2ints [2], gt_day [1], gt_day [2]
gt_time [1], gt_time [2], input [1], input [2], int2secarr [1], int2secarr [2]
CALLED BY:
ACRIM_READER, ALIGN_AR, ANAL_STIMS, CHECK_SFC_PNT, ECL_FRAC, GET_SUNCENTER [1]
GET_SUNCENTER [2], GET_TRANGE, Goes_bck0, HELIO_FOOT, HXA2HEL, HXA_SUNC, HXA_SUNC2
HXA_SUNCENTER, HXTPIXON, HXT_QLOOK, IRUHXASCAN2SXT [1], IRUHXASCAN2SXT [2]
PFI_CENT, PR_PATROLS, QUICKDARK [2], QUICKLIMB [1], QUICKLIMB [2], RD_AR, SFD_PHOT
TERM_FIDS, TERM_QUICK, TERM_REVIEW, TERM_REVIEW_GIF, TIM2UPOS, TRACE_SSWHERE [1]
WBS_DB, WBS_DB2, XMOVIE_SFM, ada2str, ads_into_att, ads_into_pnt
check_oldprocess [1], check_oldprocess [2], check_oldprocess [3]
check_oldprocess [4], choose_pairs, disp_sci5k, eit_files, get_ads [1], get_atr
get_att, get_gevloc_data, get_mk3 [1], get_mk3 [2], get_pnt, get_sfm
get_solar_indices, get_suncenter2, get_sxa, go_lasdisk golaserdisk
go_lasdisk2 golaserdisk, go_nvs5, goes_log, grid_data [1], grid_data [2]
hkplot_info, hxtaccumulate, iperr_sea, kluge_att, lapalma_files, lastsfd [1]
lastsfd [2], les_archive_info, match_index [1], match_index [2], mdi_files
mk_coal_movie, mk_obs_str, mk_pnt, mk_sd2, mk_sdc [2], mk_sdc [3], mk_sdc [4], mk_sdm
mk_sfc [1], mk_sfc [2], mk_sff_pair [1], mk_sff_pair [2], mk_ssc [1], mk_ssc [2]
new_disp_sci5k [1], new_disp_sci5k [2], op_term_score, pfi_loc, plot_fov [1]
rd_sxtgoes, rd_xda_same, read_genxcat, ref_term [2], reget_dc_image, sft2sfc
show_contacts, ssc_files [1], ssc_files [2], ssc_files [3], ssc_scan2
ssw_build_trace, ssw_fov_context, ssw_fs_cat2db, ssw_timestat, ssw_track_fov
sswdb_files, sxi_files, sxl2radiance, sxl_select, sxt_adjacent_image, sxt_chk_era
sxt_his2dbase, sxt_mornint, sxt_patch_att, sxt_prep [1], sxt_prep [2]
sxt_prep [3], tim2orbit [1], tim2orbit [2], tim2tfss, trace_files, trace_isorbevt
trace_orbevt, trace_sswhere [2], trace_sswhere [3], trace_sswhere [4]
wrt_fits_bin_exten [2], xspr [1], xspr [2], yohkoh_legacy_files [1]
yohkoh_legacy_files [2]
HISTORY:
Written Oct-91 by M.Morrison
20-apr-92, J.R. Lemen, Speeded up the alogorithm.
2-May-92 (MDM) Removed call to make_str - hardwired
the structure name
20-may-92, JRL, Added the delta_sec keyword
9-Jun-92, MDM, Removed code and used ANYTIM2INTS
27-Jul-92, MDM, Return a scalar if there is only one element
9-Mar-93, MDM, Made the FOR loop an integer*4 value
20-Jul-93, MDM, Added OFFSET option
11-Jan-94, MDM, Updated document header
30-Sep-98, RDB, Added extra code to do end value. The routine was
confused by identical times in TRACE data and
returned one less than it should.
06-Oct-98, rdb, fixed bug introduced for Yohkoh...
[Previous]
[Next]
NAME:
TIM2JD
PURPOSE:
Compute Julian day number from item.
CATEGORY:
Time
CALLING SEQUENCE:
jd = tim2jd(item)
INPUTS:
Item - all time formats acceptable to ANYTIM().
KEYWORD PARAMETERS:
HELP - does nothing. Only for legacy.
OUTPUTS:
jd = Julian Day number (like 2447000).
CALLS: ***
anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], gt_time [1]
gt_time [2]
CALLED BY:
GET_SUN [1], GET_SUN [2], JD2EX, get_zenang
COMMON BLOCKS:
NOTES:
y2k compliant with version 3.
MODIFICATION HISTORY:
R. Sterner, 23 June, 1985 --- converted from FORTRAN.
Johns Hopkins University Applied Physics Laboratory.
RES 18 Sep, 1989 --- converted to SUN
Version 3.
richard.schwartz@gsfc.nasa.gov, 21-oct-1998, made y2k compliant using
anytim2jd in SSW distribution. All that remains is the name and arguments.
Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.
[Previous]
[Next]
NAME:
tim2match
PURPOSE:
Give an array of reference times, determine if the input times fall
within any of the time ranges
SAMPLE CALLING SEQUENCE:
out = tim2match(evn, gev) ;uses GOES start
out = tim2match(evn, gev, /entim_dur) ;uses GOES time span
out = tim2match(evn, gev, /peak) ;uses GOES peak time
ii = where(tim2match(sttim, gev, entim_ref=entim) gt 0) ;subscript of GEV where match
INPUT:
sttim_ref -
sttim_ref/entim_ref: ...........xxxxxxxxxxxxx...........
sttim_input: ......x............................ 0000 = 0
..................x................ 0001 = 1
sttim_input/entim_input:...xxx............................. 0000 = 0
................xxxx............... 0011 = 3
...............xxxxxxxxxxxxxxx..... 0001 = 1
......xxxxxxxxxxxxx................ 0010 = 2
......xxxxxxxxxxxxxxxxxxxxxxxx..... 0100 = 4
Special cases:
CALLS:
CALLED BY
gtt_orbit, obs_summary, soon_search [1], soon_search [3]
[Previous]
[Next]
Project : HESSI
Name : TIME2FID
Purpose : create YYMMDD_HHMM fid name based on date/time
Category : utility io
Syntax : fid=time2fid(date)
Inputs : DATE/TIME
Outputs : FID = matching ID (e.g., 10-may-99 -> 990510)
Keywords : NO_DAY = exclude day from output
FULL= include full year in output
TIME = include _HHMM in output
YEAR_ONLY = include year only
DELIM = delimiter between year, month, & day
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], EXIST, IS_STRING, STR_FORMAT, TRIM2, Y2K_PATCH
CALLED BY:
EIS_FITS_URL [1], EIS_FITS_URL [2], EIT__DEFINE, GET_FID, LAROBS_COPY
MESOLA__DEFINE, MK_FID, NOBE__DEFINE, RSTN__DEFINE, hsi_gbo, mdi_link
History : Written 6 Jan 1999, D. Zarro (SM&A/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : General mapping
Name : time_at_meridian
Purpose : calculate the time a map was at the central meridian
Category : imaging
Syntax : ntime = time_at_meridian( map, [ center = center, time = time, ncenter = ncenter ] )
Inputs : map = image structure map created by MAKE_MAP
Keywords : center = [ solar_x, solar_y ] = heliocentric position in arcseconds
time = the time in ANYTIM format
ncenter = the heliocentric position closest to the central meridian
Outputs : ntime = the time the map center was closest to the central meridian
CALLS: ***
ROT_XY, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], timegrid
History : Written 18 May 2004, Peter T Gallagher (L-3 Communications GSI/NASA GSFC)
Contact : ptgallagher@solar.stanford.edu
[Previous]
[Next]
Project : SOHO - CDS
Name : TIME_AVERAGE()
Purpose : To form a time average of a set of time series data.
Explanation : Given a time series of data (ie a set of data values and
associated time values) the function returns an array of data
values which are the averages within a user-defined time range.
The time range to use is specified via a key word. A time
array is also returned and this gives the mean of the first
and last time of data used within the associated time bin.
Use : out = time_average(time, data [,one-of-the-keywords, $
top=top,bottom=bottom]
Inputs : time - an structure array of time values in standard CDS
UTC format.
data - the associated data values
Opt. Inputs : None
Outputs : Function returns a structure array containing a day/time
structure and an averaged data value. The make up of the
output is
out = {{mjd:0L,time:0L}, data:0.0d0}
On return it is therefore easy to plot the time averaged
values thus:
IDL> utplot,out.date,out.data
Opt. Outputs: None
Keywords : DAY - if specified, the time averaging period is taken as
00:00 on the day of the first datum to day*24 hours
later.
HOUR - if specified, the time averaging period is taken as
nn hours starting at the beginning of the hour of the
first datum.
MINUTE - if specified, the time averaging period is taken as
nn minutes starting at the beginning of the minute of
the first datum.
SECOND - if specified, the time averaging period is taken as
nn seconds.
TOP - if present will be returned with an array giving the
maximum datum found in each averaged time interval
BOTTOM - if present will be returned with an array giving the
minimum datum found in each averaged time interval
Calls : ***
ANYTIM2UTC [1], ANYTIM2UTC [2], AVERAGE, DATATYPE [1], DATATYPE [2], DATATYPE [3]
TAI2UTC, UTC2TAI
Common : None
Restrictions: Only one of the DAY/HOUR/MINUTE/SECOND keywords must be set.
Side effects: None
Category : Util, numerical
Prev. Hist. : None
Written : C D Pike, RAL, 23-Jan-95
Modified :
Version : Version 1, 23-Jan-95
[Previous]
[Next]
Project : HESSI
Name : TIME_CHECK
Purpose : Define a TIME_CHECK object
Category : Objects
;
Syntax : IDL> o=obj_new('time_check',tstart,tend,back=back)
Inputs : TSTART, TEND = input times to check
Keywords : BACK = # of days to check back
Methods : o->get,dstart,dend
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], EXIST, TIME_CHECK::CLEANUP, TIME_CHECK::GET
TIME_CHECK::INIT, TIME_CHECK::SET, TIME_CHECK::SHOW, TIME_CHECK__DEFINE
VALID_TIME
History : Written, 10 March 2001, Zarro (EITI/GSFC)
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
NAME:
TIME_LABEL
PURPOSE:
Make a time label array
CATEGORY:
CALLING SEQUENCE:
lbl = time_label(v, form)
INPUTS:
v = Array of values in seconds. in
form = Time date format string. in
KEYWORD PARAMETERS:
Keywords:
JD=jd Set Julian Day of reference date.
If not given the 1-Jan-2000 is used.
OUTPUTS:
lbl = String array of labels. out
CALLS: ***
DT_TM_MAK [1], DT_TM_MAK [2], DT_TM_MAK [3]
CALLED BY:
TIMEAXIS [1], TIMEAXIS [2], TIMEAXIS [3], XPRINT [1], XPRINT [3]
COMMON BLOCKS:
NOTES:
Notes: The input time array is really an array
of seconds from 0:00 on the reference date given
by JD=jd. If format string does not specify a
date output then JD=jd need not be given, it
defaults to 1-Jan-2000. When d$ is given in the
format string this just counts from day 1 up (to 31).
For a description of the time format string
see the routine dt_tm_mak.
MODIFICATION HISTORY:
R. Sterner. 18 Nov, 1988.
R. Sterner, 22 Feb, 1991 --- Converted to IDL V2.
R. Sterner, 26 Feb, 1991 --- Renamed from make_time_labels.pro
Johns Hopkins University Applied Physics Laboratory.
Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.
[Previous]
[Next]
Name: time_window
Purpose: return time range of input indices - optionally expand/pad range
Input Parameters:
index - structure vector including any SSW time standard
Output Parameters:
time0, time1 - time range of 'index' including optional expansion
Keyword Parameters:
XXX=NN , where XXX = {DAYS or HOURS or MINUTES or SECONDS}
type and magnitude of time window expansion
(pass to timegrid.pro via keyword inherit)
one elem= +/-(NN), two elem= [-n0,+n1]
PERCENT=% - alternately expand time window as a %age of deltaT
OUT_STYLE - output time format for time0/time1 (see anytim.pro) def=ECS
LOUD - if set, print time range (default if no output params
utc_stop - if set, and 'mjd_stop' & 'time_stop' exist, use those
as implied endtimes
Calling Examples:
IDL> time_window,index, time0, time1 ; return range
IDL> time_window,index, time0, time1, hours=12 ; expand +/- NN hours
IDL> time_window,index, time0, time1, seconds=20 ; expand +/- NN secs
IDL> time_window,index, time0, time1, percent=10. ; expand +/- 10%(dT)
IDL> time_window,index, time0, time1, min=45,/ccsds ; output in CCSDS
IDL> time_window,index, time0, time1, hours=[-12,48]; expand -12/+48 hours
CALLS: ***
BOX_MESSAGE, CONCAT_STRUCT, FMT_TIMER [1], FMT_TIMER [2], anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], data_chk [1], data_chk [2], is_member [1]
is_member [2], last_nelem, required_tags, ssw_deltat
CALLED BY:
GOES_TEK [1], eit_files, eit_proton_summary, get_solar_indices, get_ssc_best
hxt_impulsivness, les_archive_info, plot_goesp, ssc_files [1], ssc_files [2]
ssc_files [3], ssw_build_trace, ssw_fov_context, ssw_gxd_remove_flares
sxt_adjacent_image, sxt_patch_att, trace_cosmic2filename
trace_cosmic2hist_accum, trace_isorbevt, trace_movie_index [1]
trace_movie_index [2], trace_movies_prioritize [1]
trace_movies_prioritize [2], trace_orbevt, trace_special_movie [3]
yoh_orb_interp [1], yoh_orb_interp [2]
History:
19-November-1998 - S.L.Freeland - simplify a common 'fmt_timer' operation
26-July-2000 - S.L.Freeland - allow 2 element offset arrays
ie, time_window,index,t0,t1, hours=[-12,24]
30-aug-2005 - S.L.Freeland - add /UTC_STOP keyword & function
Method:
calls fmt_timer (H.Hudson et al) and optionally timegrid to expand
Motivation:
often want to plot or access dbases with time range expanded around
some other time entries (center plot in larger time window, $
get data +/- some deltaT around center time, etc.)
[Previous]
[Next]
Name: timeavg
Purpose: sum & average data values,
Input Parameters:
intimes - input (assume yohkoh data structure)
tag - string tag name or integer (tag index), scaler or array
Output:
function returns structure with standard Yohkoh structure format
Optional Keyword:
bin - (in) bin width in seconds (integration time)
center - (in) switch, if set, time is bin center (default)
start - (in) switch, if set, time is bin start
alltags - (in) switch, if set, average all vector tags
nsamp - (out) lonarr, number of valid samples per summed time
Calling Sequence:
outstr=timeavg(instr [,tagarray, bin=bin, /alltags, nsamp=nsamp] )
Calling Examples:
rd_gxd, t0, t1, goesdata ; read 3 second goes data
onemin=timeavg(goesdata) ; 1min avgs,all 1D tags (default)
fivemin=timeavg(goesdata,'lo',bin=300.) ; 5min avgs,lo channel only
(illustration for goes 3 second data averaging)
IDL> help,goesdata,onemin,fivemin
GOESDATA STRUCT = -> GXD_DATA_REC Array(1176)
ONEMIN STRUCT = -> MS_159127700002 Array(59)
FIVEMIN STRUCT = -> MS_159127700002 Array(13)
IDL> help,onemin,fivemin,/str
** Structure MS_159127700002, 4 tags, length=16:
TIME LONG 50402212
DAY INT 5146
LO FLOAT 1.57314e-06
HI FLOAT 5.15764e-08
** Structure MS_159138295005, 3 tags, length=12:
TIME LONG 50402212
DAY INT 5146
LO FLOAT 1.55500e-06
CALLED BY:
mk_week_file [1], mk_week_file [2]
History:
10-Jan-1995 (SLF) dusted off / revamped avg_data.pro
13-Jan-1995 (SLF) fix problem with tag subset
2-sep-1995 (SLF) protect against outgrid has 1 elements
CALLS: ***
ARR2STR [1], Arr2Str [2], MAKE_STR [1], MAKE_STR [2], data_chk [1], data_chk [2]
deriv_arr [1], deriv_arr [2], int2secarr [1], int2secarr [2], rem_elem [1]
rem_elem [2], tag_index [1], tag_index [2], tbeep [1], tbeep [2], tbeep [3]
timegrid
Restrictions:
maybe good to 1 second or so, maybe plus or minus I think.
[Previous]
[Next]
NAME:
TIMEAXIS
PURPOSE:
Plot a time axis.
CATEGORY:
CALLING SEQUENCE:
timeaxis, [t]
INPUTS:
t = optional array of seconds after midnight. in
KEYWORD PARAMETERS:
Keywords:
JD=jd Set Julian Day number of reference date.
FORM=f Set axis label format string, over-rides default.
do help,dt_tm_mak(/help) to get formats.
For multi-line labels use @ as line delimiter.
NTICKS=n Set approximate number of desired ticks (def=6).
TITLE=txt Time axis title (def=none).
TRANGE=[tmin,tmax] Set specified time range.
YVALUE=Y Y coordinate of time axis (def=bottom).
TICKLEN=t Set tick length as % of yrange (def=5).
/NOLABELS means suppress tick labels.
/NOYEAR drops year from automatically formatted labels.
Doesn't apply to user specified formats.
LABELOFFSET=off Set label Y offset as % yrange (def=0).
Allows label vertical position adjustment.
DY=d Set line spacing factor for multiline labels (def=1).
COLOR=c Axis color.
CHARSIZE=s Axis text size.
CHARTHICK=cth thickness of label text (def=1).
THICK=thk thickness of axes and ticks (def=1).
MAJOR=g Linestyle for an optional major tick grid.
MINOR=g2 Linestyle for an optional minor tick grid.
OUTPUTS:
CALLS: ***
GETWRD [1], GETWRD [2], JD2MDAYS, MAKEX [1], MAKEX [2], MAKEX [3], NWIN
TIME_LABEL [1], TIME_LABEL [2], TIME_LABEL [3], TNAXES [1], TNAXES [2], TNAXES [3]
VER, XPRINT [1], XPRINT [2], XPRINT [3], XPRINT [4], XPRINT [5]
CALLED BY:
Data Display, XPRINT [1], XPRINT [3], inspec_t
COMMON BLOCKS:
NOTES:
Notes: To use do the following:
plot, t, y, xstyle=4
timeaxis
If no arguments are given to TIMEAXIS then an
axis will be drawn based on the last plot, if any.
Try DY=1.5 for PS fonts.
MODIFICATION HISTORY:
R. Sterner, 25 Feb, 1991
R. Sterner, 26 Jun, 1991 --- made nticks=0 give default ticks.
R. Sterner, 18 Nov, 1991 --- allowed Log Y axes.
R. Sterner, 11 Dec, 1992 --- added /NOLABELS.
R. Sterner, 20 May, 1993 --- Made date labeling (jd2mdays).
Allowed CHARSIZE for SIZE.
Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.
[Previous]
[Next]
Name: timegrid
Purpose: create a (approximately) uniform grid of times
Input Parameters:
startt, stopt - start and stop times desired, any format
Keyword Parameters:
days, hours, minutes, seconds - desired grid time resolution
nsamp - number of elements in return (use instead of stop time)
strings - if set, return value is Yohkoh formatted string time
quiet - if set, dont print warning if no interediate points found
Output:
function returns grid in Yohkoh internal format
function returns string format if /strings keyword is set
Calling Sequence:
grid=timegrid(startime, stoptime [, days=days, hours=hours, minutes=minutes, seconds=seconds]
grid=timegrid(starttime, nsamp=NN [, days=days, hours=hours , etc]
Calling Examples:
tenmin=timegrid(starttime, stoptime, minutes=10) ; 10 minute spacing
onehour=timegrid(starttime, stoptime, /hour) ; 1 hour spacing
onehour=timegrid(starttime, nsamp=10) ; same, for 10 hours
yesterday=(timegrid(!stime,day=-1,/string)) ; 24 hours ago
toffset=timegrid(reference, hour=lindgen(24)) ; offset added to t0
ecsfmt=timegrid(t0,t1,/hour, /ecs,/truncate) ; allow 'anytim.pro'
; format/keyword options
CALLED BY:
EIT_CATRD [1], EIT_COPY, FIRST_LIGHT [1], FIRST_LIGHT [2], GOES_FITS_FILES
STEREO_SIMUL, TRACE_COPY, adjust_times, check_oldprocess [1]
check_oldprocess [2], check_oldprocess [3], check_oldprocess [4], divyup
eit_catrd [3], eit_files, eit_fulldisk, eit_fulldiskdb, eit_mirror
event_movie [1], event_movie [2], evt_demo, get_newsoon, get_selsis
get_solar_indices, get_utevent [1], get_utevent [2], goes3sec_copy, goes_widget
grid_data [1], grid_data [2], high_mag_lat, html_form_addtime [1]
html_form_addtime [2], html_form_addtime [3], killold [1], killold [2]
lapalma_files, lasco_time2file, mdi_files, mdi_time2file, mk_formt_html [1]
mk_formt_html [2], mk_formt_html [3], mk_gev [1], mk_gev [2], mk_week_file [1]
mk_week_file [2], mo_check, pr_visible, rd_goesp_ascii, rd_goesx_ascii, rd_sxtgoes
read_genxcat, ref_term [2], search_obs, selsis_copy [1], selsis_copy [2]
selsis_week, show_contacts, soon_catstat, ssc_files [1], ssc_files [2]
ssc_files [3], ssw_fov_context, ssw_getcme_cactus, ssw_getdst, ssw_kyoto2dst
ssw_sec_aktxt2struct, ssw_time2paths, sxi_files, sxt_files, sxt_mornint, tim2tfss
time_at_meridian, timeavg [1], timeavg [2], trace_cat, trace_files, trace_goodobs
trace_movie_context, trace_write_genxcat, xdate [1], xdate [2], ydb_install [1]
ydb_install [2], yohkoh_files, yohkoh_legacy_files [1]
yohkoh_legacy_files [2], yopos [1], yopos [2]
History:
7-Jul-1994 (SLF)
11-Jul-1994 (SLF) added STRINGS keyword and function
4-Aug-1994 (SLF) added NSAMP keyword/function
16-Sep-1994 (SLF) allow single parameter (start time) - just add offset
use n_elements instead of keyword_set (to allow 'zeros')
16-mar-1995 (SLF) allow vector offsets
7-apr-1997 (SLF) add QUIET keyword switch and function
12-Jan-1998 (SLF) add keyword inherit -> anytim.pro
(see 'anytim' doc head for keyword options)
16-Sep-1998 (SLF) - if no factor but NSAMP set, set factor accordingly
15-Oct-1998 (SLF) - apply 'anytim' to input (as well as output)
13-Jul-2000 (RDB) - fixed bug when t1-t0 < 1day but spans day boundary
31-Jul-2001 (SFL) - add /MONTH
5-Jan-2004 (SLF) - per Nariaki Nitta suggestion, use double precesion
to avoid round off ripples...
27-feb-2004 (SLF) - pass QUIET during recursive call
28-jul-2006 (SLF) - fix /MONTH logic error
CALLS: ***
CONCAT_STRUCT, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3]
anytim [4], anytim [5], anytim2ints [1], anytim2ints [2], data_chk [1]
data_chk [2], fmt_tim [1], fmt_tim [2], int2secarr [1], int2secarr [2]
Restrictions:
no interpolation - just offsets relative to start time
[Previous]
[Next]
NAME:
TIMER
PURPOSE:
Measure elapsed time between calls.
CATEGORY:
CALLING SEQUENCE:
timer, [dt]
INPUTS:
KEYWORD PARAMETERS:
Keywords:
/START starts timer.
/STOP stops timer (actually updates elapsed time).
/PRINT prints timer report.
NUMBER = n. Select timer number to use (default = 0).
Timer numbers 0 through 9 may be used.
COMMENT = cmt_text. Causes /PRINT to print:
cmt_text elapsed time: hh:mm:ss (nnn sec)
OUTPUTS:
dt = optionally returned elapsed time in seconds. out
CALLS: ***
GMT_OFFSEC, STRSEC [1], STRSEC [2]
COMMON BLOCKS:
timer_com
NOTES:
Notes:
Examples:
timer, /start use this call to start timer.
timer, /stop, /print, dt use this call to stop timer
and print start, stop, elapsed time. This example also
returns elapsed time in seconds.
Timer must be started before any elapsed time is available.
Timer may be stopped any number of times after starting once, and
the elapsed time is the time since the last timer start.
timer, /start, number=5 starts timer number 5.
timer, /stop, /print, number=5 stops timer number 5
and prints result.
MODIFICATION HISTORY:
R. Sterner, 17 Nov, 1989
R. Sterner, 28 Sep, 1993 --- Used dt_tm_tojs to handle long intervals.
R. Sterner, 2 Dec, 1993 --- Now uses systime(1) for high precision.
Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.
[Previous]
[Next]
Project : SOHO - CDS
Name : TIMER_VERSION
Purpose : check IDL version that supports timer events
Category : system
Explanation :
Syntax : IDL> a=timer_version()
CALLED BY:
SCANPATH, XACK, XANSWER, XCALENDAR, XCHOICE, XINPUT, XPS_SETUP, ethz_XCHOICE
Examples :
Inputs : None
Opt. Inputs :
Outputs : 1/0 if timers are supported or not
Opt. Outputs: None
Keywords : None
CALLS: ***
IDL_RELEASE
Common : None
Restrictions: None
Side effects: None.
History : Version 1, 27-Feb-1997, D M Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
NAME: TIMESTAMP
PURPOSE: Place the current time outside the upper right-hand corner
of the plot window or at very bottom of entire window
CATEGORY: Util,Gen, Graphics
CALLING SEQUENCE: TIMESTAMP
CALLED BY:
CALLS: ***
FCHECK, FCOLOR [1], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
fcolor [2]
INPUTS:
none
OPTIONAL INPUTS:
bottom - place timestamp in bottom right corner
XYOUTS KEYWORDS-
CHARSIZE
CHARTHICK
COLOR
OUTPUTS:
none
OPTIONAL OUTPUTS:
none
CALLED BY:
GE_WINDOW [1], QUICKDARK [2], QUICKSTRAY [2], QUICK_DPE, XYPLOT__DEFINE
hsi_image_plot, spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4]
spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3], spex_spec_plot [4]
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
ras, 24-jan-96
ras, version 2, 13-dec-1996, added keywords charsize, charthick, and color
ras, version 3, 24-dec-1996, fixed bug in charsize
kim, 27-sep-2000, added bottom option
[Previous]
[Next]
PROJECT:
SOHO
NAME:
TIMING
PURPOSE:
To measure the run time of given IDL routine(s)
CATEGORY:
Utility, misc
SYNTAX:
timing, str
EXAMPLES:
To report elapsed time on screen,
TIMING, ['a = findgen(300, 300)', 'b = a # a']
To pass out the elapsed time,
etime = 0.d0
TIMING, ['a = findgen(300, 300)', 'b = a # a'], out=etime
To pass out the elapsed time as a string,
etime = ''
TIMING, ['a = findgen(300, 300)', 'b = a # a'], out=etime
INPUTS:
STR - String scalar or array to be interpreted and executed by IDL
OPTIONAL INPUTS:
None.
OUTPUTS:
None.
OPTIONAL OUTPUTS:
None.
KEYWORDS:
OUTPUT - Named scalar variable. If defined and passed in, the
elapsed time will be returned via this variable (can
be a string or floating point number, depends on the
data type passed in) and no message is written to
screen. If OUTPUT is not passed or defined, a message
showing the elapsed time is printed on the screen.
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3]
COMMON:
None.
RESTRICTIONS:
Given string(s) must be a complete, valid IDL statement and
ready to be interpreted and executed.
SIDE EFFECTS:
None.
HISTORY:
Version 1, August 8, 1996, Liyun Wang, NASA/GSFC. Written
CONTACT:
Liyun Wang, NASA/GSFC (Liyun.Wang.1@gsfc.nasa.gov)
[Previous]
[Next]
NAME:
timstr2ex
PURPOSE:
Subroutine to convert a date/time string to a seven element array
CALLING SEQUENCE:
tarr = timstr2ex('4-oct-91 15:22')
tarr = timstr2ex(!stime)
INPUT:
dattim_str - Character string
4-OCT-91 14:20
4-OCT-91 4:20:00
4-OCT-91 4:20:00.10
14:20:00 4-Oct-91
14:20:00 4-Oct-1991
92/12/25 OK (YY/MM/DD) **DEFAULT**
25/12/92 OK (DD/MM/YY)
12/25/92 NEED "MDY" SWITCH
If the year is missing, it will assume the current year
For 2 digit years, 00-49 are 2000-2049 and
50-99 are 1950-1999
CALLS: ***
ARR2STR [1], Arr2Str [2], STR2ARR [1], STR2ARR [2]
CALLED BY:
BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], BCS_BROWSE24, LIST_BDA, MANY_DAYS
WR_PLAN_AREA, XMOVIE_SFM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], doytim2ex [1]
doytim2ex [2], dsn_input, eis_timeline_plot_gui [1], eis_timeline_plot_gui [2]
gettime, go_get_sirius, input_time [1], input_time [2], mk_orbit_sum, mon_sci5k
op_times, pr_fem, pr_gbe, pr_gev, pr_nar, pr_nel, redo_disploi, redo_mon_sci5k
OPTIONAL KEYWORD INPUT:
mdy - When using the "/" notation for the date, and having the
order MM/DD/YY, then it is necessary to use this switch.
OUTPUT:
returns - 7 ELEMENT INTEGER*2 ARRAY CONTAINING, IN ORDER,
HRS MIN SECS MILLISECS DAY MON YR ('90)
ASSUMPTIONS:
Date is separated by - and comes before the month
No spaces before/after the -
Month is three letters
Time is separated by :
Number of characters for minutes is two
Number of characters for seconds is two
Fractions of seconds is designated by a decimal after the seconds
Need at least one space between date and time
For "/" notation for the date:
No spaces before/after the /
Assumes month is the middle number unless using the /mdy switch
Must include all three items (date, month, year)
Year must be the first or last item
HISTORY:
Written Sep-91 by M.Morrison
15-Nov-91 (MDM) - Modified to break the string into two parts
before tackling the decompression. That fixed
some problems that were found.
7-Jun-92 (MDM) - Modified to accept an array of times
4-Jan-93 (MDM) - Modified to accept the "/" notation for date
7-May-93 (MDM) - Modified the millisec extraction due to a
roundoff error(?)
6-May-98 (MDM) - Made the FOR loop long integer
7-Jan-00 (MDM) - Handled year "00"
- Made the default for ambiguous dates YY/MM/DD
- Modified year field to be 4 digit value (not 2)
10-jan-2000 - S.L.Freeland - added DEF_FOR keyword (backward compat..)
27-mar-2003 - A. Csillaghy - changed calculation of ms for idl 5.6
03-jun-2003 - T. Metcalf - Made msec calculation use long integer.
11-July-2004 - Zarro - added check for when full month name (e.g. JULY) entered
13-sep-2004, richard.schwartz@gsfc.nasa.gov changed FIX() to ROUND() in
extracting the milliseconds from the input string
9-mar-2006, richard.schwartz@gsfc.nasa.gov, fixed bug using /mdy after 2000 (Y2K bug!!)
[Previous]
[Next]
Project:
SDAC
NAME:
TJD2YMD
PURPOSE:
This function converts truncated Julian days to a standard time format.
TJD is a CGRO/BATSE standard numerical internal format.
CATEGORY:
UTPLOT, TIME, BATSE
CALLING SEQUENCE:
time = tjd2ymd( item, [,seconds=seconds, string=string, error=error])
time = tjd2ymd(3874)
print, time
;1-jan-79
INPUT:
Item - The input time in Truncated Julian Day
TJD of 3874 is equivalent to 1-jan-1979
Form can be scalar or vector integer, long, float, double
OUTPUT:
The function returns the time in seconds from 1-jan-1979, ANYTIM
format.
CALLS: ***
ATIME [1], ATIME [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1]
anytim [2], anytim [3], anytim [4], anytim [5]
KEYWORDS:
OPTIONAL INPUT:
SECONDS - added to input days
STRING - if set, output is in string format
output is truncated to the calendar date if time is at midnight.
OUTPUT:
ERROR - set if there is an error in time conversion
CALLED BY:
CALIB_HIST, CONT_EDGES, EVAL_SHERB, FIND_DBFILE, FS_OPEN [1], Fits_spectra [1]
Fits_spectra [2], GET_DISCSP511, GET_SPEC_GAIN, GRABDATA, Load_sher
MERGE_DISCSP_HKG_OCC, OCC_AVG, OCC_DBASE, OCC_FROM_FITS, PARSE_GROSSC_ATTITUDE
QL_DAY_PLOT, QL_ORBIT_PLOT, RD_HXRBS_FITS, bfits_burst [1], bfits_burst [2]
mrdfits_spectra, where_are [1], where_are [2]
RESTRICTIONS:
limited to output strings covered by ATIME.pro
HISTORY:
ras, 19-march-94,
MODIFIED:
Version 2, documented RAS, 5-Feb-1997
[Previous]
[Next]
Project : SOHO - CDS
Name : TLB_PLACE()
Purpose : Find the "optimal" coordinates of a new top level base
Explanation : Given the (approximate) size of a new widget, and either
a widget EVENT or a SERTS window descriptor, the "best"
upper-left position of a new widget base is returned.
The position is either above, right, below or to the
left of the calling DRAW-window, the SERTS display window,
or the window's top level base. To force the position
outside the top level base, use /OUTSIDE. To align the
new window with the position of the cursor (only for
DRAW EVENTS) use /CURSOR.
Use : POS = TLB_PLACE(XSIZE,YSIZE,EVENT=EVENT)
or
POS = TLB_PLACE(XSIZE,YSIZE,SERTSW=SERTSW)
Inputs : XSIZE,
YSIZE = The (approximate) size of the new widget
Opt. Inputs :
Outputs :
Opt. Outputs:
Keywords : EVENT : For a WIDGET_DRAW event, the new position
will be outside the DRAW window, /OUTSIDE is
not set. If the EVENT.X/Y point is inside
a SERTS display, the display CLIP coordinates
are taken as the area that shouldn't be marked.
For any other event type, the new position
will be outside the EVENT.ID's top level base.
PWINDOW: Specifies the plot window region to keep
outside of.
SERTSW : Specify the SERTS window that the new base
should be placed outside of.
CURSOR : Set to align the new window position with the
cursor.
OUTSIDE : Set to always place the new window outside the
top level base area.
PRIORITY: Specify the most-wanted positions in an
array of integers, 0 means above, 1=right
2=below, 3=left. That is, PRIORITY=[2,3] means
"try to fit this in below, or if that's not
possible, on the left".
Calls : ***
CDSNOTIFY, PRESTORE, SETWINDOW [1], SETWINDOW [2], SET_SERTSW
CALLED BY:
PQLPROFILE, PQLZOOM
Common : None.
Restrictions: Needs a valid EVENT or SERTS window.
Side effects: None known.
Category : CDS, QL, DISPLAY, UTILITY
Prev. Hist. : Extracted from the QLZOOM/QLPROFILE routines.
Written : Stein Vidar Hagfors Haugan, 16 Dec. 1993
Modified :
Version : 1.0
[Previous]
[Next]
NAME:
TNAXES
PURPOSE:
Find nice time axis tics.
CATEGORY:
CALLING SEQUENCE:
tnaxes, xmn, xmx, nx, mjx1, mjx2, xinc, [mnx2, mnx2, xinc2]
INPUTS:
xmn, xmx = Axis min and max in sec. in
nx = Desired number of axis tics. in
KEYWORD PARAMETERS:
Keywords:
FORM=form returns a suggested format, suitable
for use in formatting time axis labels.
Ex: h$:m$:s$, h$:m$, d$
OUTPUTS:
mjx1 = first major tic position in sec. out
mjx2 = last major tic position in sec. out
xinc = Suggested major tic spacing in sec. out
mnx1 = first minor tic position in sec. out
mnx2 = last minor tic position in sec. out
xinc2 = suggested minor tic spacing in sec. out
CALLS: ***
INRANGE [1], INRANGE [2], INRANGE [3]
CALLED BY:
TIMEAXIS [1], TIMEAXIS [2], TIMEAXIS [3], XPRINT [1], XPRINT [3]
COMMON BLOCKS:
NOTES:
MODIFICATION HISTORY:
R. Sterner. 18 Nov, 1988.
R. Sterner, 22 Feb, 1991 --- converted to IDL V2.
R. Sterner, 25 Feb, 1991 --- added minor ticks.
Johns Hopkins University Applied Physics Laboratory.
Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.
[Previous]
[Next]
NAME:
TNMIN
AUTHOR:
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov
UPDATED VERSIONs can be found on my WEB PAGE:
http://cow.physics.wisc.edu/~craigm/idl/idl.html
PURPOSE:
Performs function minimization (Truncated-Newton Method)
MAJOR TOPICS:
Optimization and Minimization
CALLING SEQUENCE:
parms = TNMIN(MYFUNCT, X, FUNCTARGS=fcnargs, NFEV=nfev,
MAXITER=maxiter, ERRMSG=errmsg, NPRINT=nprint,
QUIET=quiet, XTOL=xtol, STATUS=status,
FGUESS=fguess, PARINFO=parinfo, BESTMIN=bestmin,
ITERPROC=iterproc, ITERARGS=iterargs, niter=niter)
DESCRIPTION:
TNMIN uses the Truncated-Newton method to minimize an arbitrary IDL
function with respect to a given set of free parameters. The
user-supplied function must compute the gradient with respect to
each parameter. TNMIN is based on TN.F (TNBC) by Stephen Nash.
If you want to solve a least-squares problem, to perform *curve*
*fitting*, then you will probably want to use the routines MPFIT,
MPFITFUN and MPFITEXPR. Those routines are specifically optimized
for the least-squares problem. TNMIN is suitable for constrained
and unconstrained optimization problems with a medium number of
variables. Function *maximization* can be performed using the
MAXIMIZE keyword.
TNMIN is similar to MPFIT in that it allows parameters to be fixed,
simple bounding limits to be placed on parameter values, and
parameters to be tied to other parameters. See PARINFO below for
discussion and examples.
USER FUNCTION
The user must define an IDL function which returns the desired
value as a single scalar. The IDL function must accept a list of
numerical parameters, P. Additionally, keyword parameters may be
used to pass more data or information to the user function, via the
FUNCTARGS keyword.
The user function should be declared in the following way:
FUNCTION MYFUNCT, p, dp [, keywords permitted ]
; Parameter values are passed in "p"
f = .... ; Compute function value
dp = .... ; Compute partial derivatives (optional)
return, f
END
The function *must* accept at least one argument, the parameter
list P. The vector P is implicitly assumed to be a one-dimensional
array. Users may pass additional information to the function by
composing and _EXTRA structure and passing it in the FUNCTARGS
keyword.
User functions may also indicate a fatal error condition using the
ERROR_CODE common block variable, as described below under the
TNMIN_ERROR common block definition (by setting ERROR_CODE to a
number between -15 and -1).
ANALYTIC vs. NUMERICAL DERIVATIVES
By default, the user must compute gradient components analytically
using AUTODERIVATIVE=0. As explained below, numerical derivatives
can also be calculated using AUTODERIVATIVE=1.
For analytic derivatives, the user should call TNMIN using the
default keyword value AUTODERIVATIVE=0. [ This is different
behavior from MPFIT, where AUTODERIVATIVE=1 is the default. ] The
IDL user routine should compute the gradient of the function as a
one-dimensional array of values, one for each of the parameters.
They are passed back to TNMIN via "dp" as shown above.
The derivatives with respect to fixed parameters are ignored; zero
is an appropriate value to insert for those derivatives. Upon
input to the user function, DP is set to a vector with the same
length as P, with a value of 1 for a parameter which is free, and a
value of zero for a parameter which is fixed (and hence no
derivative needs to be calculated). This input vector may be
overwritten as needed.
For numerical derivatives, a finite differencing approximation is
used to estimate the gradient values. Users can activate this
feature by passing the keyword AUTODERIVATIVE=1. Fine control over
this behavior can be achieved using the STEP, RELSTEP and TNSIDE
fields of the PARINFO structure.
When finite differencing is used for computing derivatives (ie,
when AUTODERIVATIVE=1), the parameter DP is not passed. Therefore
functions can use N_PARAMS() to indicate whether they must compute
the derivatives or not. However there is no penalty (other than
computation time) for computing the gradient values and users may
switch between AUTODERIVATIVE=0 or =1 in order to test both
scenarios.
CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD
The behavior of TNMIN can be modified with respect to each
parameter to be optimized. A parameter value can be fixed; simple
boundary constraints can be imposed; limitations on the parameter
changes can be imposed; properties of the automatic derivative can
be modified; and parameters can be tied to one another.
These properties are governed by the PARINFO structure, which is
passed as a keyword parameter to TNMIN.
PARINFO should be an array of structures, one for each parameter.
Each parameter is associated with one element of the array, in
numerical order. The structure can have the following entries
(none are required):
.VALUE - the starting parameter value (but see the START_PARAMS
parameter for more information).
.FIXED - a boolean value, whether the parameter is to be held
fixed or not. Fixed parameters are not varied by
TNMIN, but are passed on to MYFUNCT for evaluation.
.LIMITED - a two-element boolean array. If the first/second
element is set, then the parameter is bounded on the
lower/upper side. A parameter can be bounded on both
sides. Both LIMITED and LIMITS must be given
together.
.LIMITS - a two-element float or double array. Gives the
parameter limits on the lower and upper sides,
respectively. Zero, one or two of these values can be
set, depending on the values of LIMITED. Both LIMITED
and LIMITS must be given together.
.PARNAME - a string, giving the name of the parameter. The
fitting code of TNMIN does not use this tag in any
way.
.STEP - the step size to be used in calculating the numerical
derivatives. If set to zero, then the step size is
computed automatically. Ignored when AUTODERIVATIVE=0.
.MPSIDE - the sidedness of the finite difference when computing
numerical derivatives. This field can take four
values:
0 - one-sided derivative computed automatically
1 - one-sided derivative (f(x+h) - f(x) )/h
-1 - one-sided derivative (f(x) - f(x-h))/h
2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)
Where H is the STEP parameter described above. The
"automatic" one-sided derivative method will chose a
direction for the finite difference which does not
violate any constraints. The other methods do not
perform this check. The two-sided method is in
principle more precise, but requires twice as many
function evaluations. Default: 0.
.TIED - a string expression which "ties" the parameter to other
free or fixed parameters. Any expression involving
constants and the parameter array P are permitted.
Example: if parameter 2 is always to be twice parameter
1 then use the following: parinfo(2).tied = '2 * P(1)'.
Since they are totally constrained, tied parameters are
considered to be fixed; no errors are computed for them.
[ NOTE: the PARNAME can't be used in expressions. ]
Future modifications to the PARINFO structure, if any, will involve
adding structure tags beginning with the two letters "MP" or "TN".
Therefore programmers are urged to avoid using tags starting with
these two combinations of letters; otherwise they are free to
include their own fields within the PARINFO structure, and they
will be ignored.
PARINFO Example:
parinfo = replicate({value:0.D, fixed:0, limited:[0,0], $
limits:[0.D,0]}, 5)
parinfo(0).fixed = 1
parinfo(4).limited(0) = 1
parinfo(4).limits(0) = 50.D
parinfo(*).value = [5.7D, 2.2, 500., 1.5, 2000.]
A total of 5 parameters, with starting values of 5.7,
2.2, 500, 1.5, and 2000 are given. The first parameter
is fixed at a value of 5.7, and the last parameter is
constrained to be above 50.
INPUTS:
MYFUNCT - a string variable containing the name of the function to
be minimized (see USER FUNCTION above). The IDL routine
should return the value of the function and optionally
its gradients.
X - An array of starting values for each of the parameters of the
model.
This parameter is optional if the PARINFO keyword is used.
See above. The PARINFO keyword provides a mechanism to fix or
constrain individual parameters. If both X and PARINFO are
passed, then the starting *value* is taken from X, but the
*constraints* are taken from PARINFO.
RETURNS:
Returns the array of best-fit parameters.
KEYWORD PARAMETERS:
AUTODERIVATIVE - If this is set, derivatives of the function will
be computed automatically via a finite
differencing procedure. If not set, then MYFUNCT
must provide the (analytical) derivatives.
Default: 0 (analytical derivatives required)
BESTMIN - upon return, the best minimum function value that TNMIN
could find.
EPSABS - a nonnegative real variable. Termination occurs when the
absolute error between consecutive iterates is at most
EPSABS. Note that using EPSREL is normally preferable
over EPSABS, except in cases where ABS(F) is much larger
than 1 at the optimal point. A value of zero indicates
the absolute error test is not applied. If EPSABS is
specified, then both EPSREL and EPSABS tests are applied;
if either succeeds then termination occurs.
Default: 0 (i.e., only EPSREL is applied).
EPSREL - a nonnegative input variable. Termination occurs when the
relative error between two consecutive iterates is at
most EPSREL. Therefore, EPSREL measures the relative
error desired in the function. An additional, more
lenient, stopping condition can be applied by specifying
the EPSABS keyword.
Default: 100 * Machine Precision
ERRMSG - a string error or warning message is returned.
FGUESS - provides the routine a guess to the minimum value.
Default: 0
FUNCTARGS - A structure which contains the parameters to be passed
to the user-supplied function specified by MYFUNCT via
the _EXTRA mechanism. This is the way you can pass
additional data to your user-supplied function without
using common blocks.
Consider the following example:
if FUNCTARGS = { XVAL:[1.D,2,3], YVAL:[1.D,4,9]}
then the user supplied function should be declared
like this:
FUNCTION MYFUNCT, P, XVAL=x, YVAL=y
By default, no extra parameters are passed to the
user-supplied function.
ITERARGS - The keyword arguments to be passed to ITERPROC via the
_EXTRA mechanism. This should be a structure, and is
similar in operation to FUNCTARGS.
Default: no arguments are passed.
ITERDERIV - Intended to print function gradient information. If
set, then the ITERDERIV keyword is set in each call to
ITERPROC. In the default ITERPROC, parameter values
and gradient information are both printed when this
keyword is set.
ITERPROC - The name of a procedure to be called upon each NPRINT
iteration of the TNMIN routine. It should be declared
in the following way:
PRO ITERPROC, MYFUNCT, p, iter, fnorm, FUNCTARGS=fcnargs, $
PARINFO=parinfo, QUIET=quiet, _EXTRA=extra
; perform custom iteration update
END
ITERPROC must accept the _EXTRA keyword, in case of
future changes to the calling procedure.
MYFUNCT is the user-supplied function to be minimized,
P is the current set of model parameters, ITER is the
iteration number, and FUNCTARGS are the arguments to be
passed to MYFUNCT. FNORM is should be the function
value. QUIET is set when no textual output should be
printed. See below for documentation of PARINFO.
In implementation, ITERPROC can perform updates to the
terminal or graphical user interface, to provide
feedback while the fit proceeds. If the fit is to be
stopped for any reason, then ITERPROC should set the
common block variable ERROR_CODE to negative value
between -15 and -1 (see TNMIN_ERROR common block
below). In principle, ITERPROC should probably not
modify the parameter values, because it may interfere
with the algorithm's stability. In practice it is
allowed.
Default: an internal routine is used to print the
parameter values.
MAXITER - The maximum number of iterations to perform. If the
number is exceeded, then the STATUS value is set to 5
and TNMIN returns.
Default: 200 iterations
MAXIMIZE - If set, the function is maximized instead of
minimized.
MAXNFEV - The maximum number of function evaluations to perform.
If the number is exceeded, then the STATUS value is set
to -17 and TNMIN returns. A value of zero indicates no
maximum.
Default: 0 (no maximum)
NFEV - upon return, the number of MYFUNCT function evaluations
performed.
NITER - upon return, number of iterations completed.
NPRINT - The frequency with which ITERPROC is called. A value of
1 indicates that ITERPROC is called with every iteration,
while 2 indicates every other iteration, etc.
Default value: 1
PARINFO - Provides a mechanism for more sophisticated constraints
to be placed on parameter values. When PARINFO is not
passed, then it is assumed that all parameters are free
and unconstrained. Values in PARINFO are never modified
during a call to TNMIN.
See description above for the structure of PARINFO.
Default value: all parameters are free and unconstrained.
QUIET - set this keyword when no textual output should be printed
by TNMIN
STATUS - an integer status code is returned. All values greater
than zero can represent success (however STATUS EQ 5 may
indicate failure to converge). Gaps in the numbering
system below are to maintain compatibility with MPFIT.
Upon return, STATUS can have one of the following values:
-18 a fatal internal error occurred during optimization.
-17 the maximum number of function evaluations has been
reached without convergence.
-16 a parameter or function value has become infinite or an
undefined number. This is usually a consequence of
numerical overflow in the user's function, which must be
avoided.
-15 to -1
these are error codes that either MYFUNCT or ITERPROC
may return to terminate the fitting process (see
description of MPFIT_ERROR common below). If either
MYFUNCT or ITERPROC set ERROR_CODE to a negative number,
then that number is returned in STATUS. Values from -15
to -1 are reserved for the user functions and will not
clash with MPFIT.
0 improper input parameters.
1 convergence was reached.
2-4 (RESERVED)
5 the maximum number of iterations has been reached
6-8 (RESERVED)
EXAMPLE:
FUNCTION F, X, DF, _EXTRA=extra ;; *** MUST ACCEPT KEYWORDS
F = (X(0)-1)^2 + (X(1)+7)^2
DF = [ 2D * (X(0)-1), 2D * (X(1)+7) ] ; Gradient
RETURN, F
END
P = TNMIN('F', [0D, 0D], BESTMIN=F0)
Minimizes the function F(x0,x1) = (x0-1)^2 + (x1+7)^2.
CALLS: ***
TNMIN_AUTODER, TNMIN_CALL, TNMIN_DEFITER, TNMIN_DUMMY, TNMIN_ENORM, TNMIN_FIX
TNMIN_GETPTC, TNMIN_GTIMS, TNMIN_INITPC, TNMIN_LINDER, TNMIN_MODLNP, TNMIN_MSOLVE
TNMIN_NDIA3, TNMIN_PARINFO, TNMIN_SETMACHAR, TNMIN_SSBFGS, TNMIN_STEP1, TNMIN_TIE
COMMON BLOCKS:
COMMON TNMIN_ERROR, ERROR_CODE
User routines may stop the fitting process at any time by
setting an error condition. This condition may be set in either
the user's model computation routine (MYFUNCT), or in the
iteration procedure (ITERPROC).
To stop the fitting, the above common block must be declared,
and ERROR_CODE must be set to a negative number. After the user
procedure or function returns, TNMIN checks the value of this
common block variable and exits immediately if the error
condition has been set. By default the value of ERROR_CODE is
zero, indicating a successful function/procedure call.
REFERENCES:
TRUNCATED-NEWTON METHOD, TN.F
Stephen G. Nash, Operations Research and Applied Statistics
Department
http://www.netlib.org/opt/tn
Nash, S. G. 1984, "Newton-Type Minimization via the Lanczos
Method," SIAM J. Numerical Analysis, 21, p. 770-778
MODIFICATION HISTORY:
Derived from TN.F by Stephen Nash with many changes and additions,
to conform to MPFIT paradigm, 19 Jan 1999, CM
Changed web address to COW, 25 Sep 1999, CM
Alphabetized documented keyword parameters, 02 Oct 1999, CM
Changed to ERROR_CODE for error condition, 28 Jan 2000, CM
Continued and fairly major improvements (CM, 08 Jan 2001):
- calling of user procedure is now concentrated in TNMIN_CALL,
and arguments are reduced by storing a large number of them
in common blocks;
- finite differencing is done within TNMIN_CALL; added
AUTODERIVATIVE=1 so that finite differencing can be enabled,
both one and two sided;
- a new procedure to parse PARINFO fields, borrowed from MPFIT;
brought PARINFO keywords up to date with MPFIT;
- go through and check for float vs. double discrepancies;
- add explicit MAXIMIZE keyword, and support in TNMIN_CALL and
TNMIN_DEFITER to print the correct values in that case;
TNMIN_DEFITER now prints function gradient values if
requested;
- convert to common-based system of MPFIT for storing machine
constants; revert TNMIN_ENORM to simple sum of squares, at
least for now;
- remove limit on number of function evaluations, at least for
now, and until I can understand what happens when we do
numerical derivatives.
Further changes: more float vs double; disable TNMINSTEP for now;
experimented with convergence test in case of function
maximization, 11 Jan 2001, CM
TNMINSTEP is parsed but not enabled, 13 Mar 2001
Major code cleanups; internal docs; reduced commons, CM, 08 Apr
2001
Continued code cleanups; documentation; the STATUS keyword
actually means something, CM, 10 Apr 2001
Added reference to Nash paper, CM, 08 Feb 2002
Fixed 16-bit loop indices, D. Schelgel, 22 Apr 2003
Changed parens to square brackets because of conflicts with
limits function. K. Tolbert, 23 Feb 2005
TODO
- scale derivatives semi-automatically;
- ability to scale and offset parameters;
$Id: tnmin.pro,v 1.12 2003/04/22 23:42:49 craigm Exp $
[Previous]
[Next]
NAME:
TO_HEX
PURPOSE:
Translate a non-negative decimal integer to a hexadecimal string
CALLING SEQUENCE:
HEX = TO_HEX( D, [ NCHAR ] )
INPUTS:
D - non-negative decimal integer, scalar or vector. If input as a
string, (e.g. '32') then all leading blanks are removed.
OPTIONAL INPUT:
NCHAR - number of characters in the output hexadecimal string.
If not supplied, then the hex string will contain no
leading zeros.
OUTPUT:
HEX - hexadecimal translation of input integer, string
CALLED BY:
POINT_HEX2 [1], POINT_HEX2 [2]
EXAMPLES:
IDL> A = TO_HEX([11,16]) ==> A = ['B','10']
IDL> A = TO_HEX(100,3) ==> A = '064'
METHOD:
The hexadecimal format code '(Z)' is used to convert. No parameter
checking is done.
PROCEDURES CALLED:
None.
REVISION HISTORY:
Written W. Landsman November, 1990
Converted to IDL V5.0 W. Landsman September 1997
Use FSTRING() for more than 1024 values March 2000
Assume since V5.4, omit FSTRING() call April 2006
[Previous]
[Next]
ROUTINE: toggle,color=color,landscape=landscape,portrait=portrait, $
letter=letter,legal=legal,filename=filename
PURPOSE: toggles IDL graphics output between X-window and a postscript
output file.
OPTIONAL INPUTS (keyword parameters):
COLOR Enable color plotting (output to Tek Phaser color printer)
LANDSCAPE Horizontal plotting format
PORTRAIT Vertical plotting format (default)
LETTER 8.5 by 11 inch page size (default)
LEGAL 11 by 14 inch page size (Phaser)
EPS
if set, encapsulated postscript file is produced.
Many word processing and typesetting programs provide
facilities to include encapsulated PostScript output
within documents. See the discussion of the POSTSCRIPT
and EPS options of the DEVICE command in the IDL
user manual.
PRINT 1 = submit to default printer ( setenv PRINTER ????)
otherwise if PRINT is a string variable
the job will be spooled to the named print queue
QUEUE if set, print queue is selected from a pop-up menu
FILENAME name of postscript file (default = plot.ps or plotc.ps)
PROCEDURE: The first call to TOGGLE (and all odd number calls)
changes the output device from X-window to a
Postscript output file. If the output file name is not
specified on the command line the default file name will
be plot.ps for the laser printers, or plotc.ps for the
TEK Phaser color printer.
The next call (and all even number calls) switches back
to the X-window and closes the plot file. If the keyword
PRINT is set the plotfile will be submitted to one of the
ESRG print queues.
NOTE: Only one postscript file can be open at any given time
CALLS: ***
STR_SEP, TOGGLE
SIDE EFFECTS:
In order to maintain a font size which keeps the same
relation to the screen size, the global variable
!p.charsize is changed when switching to and from
postscript mode, as follows,
When toggleing to PS !p.charsize --> !p.charsize/fac
When toggleing to X !p.charsize --> !p.charsize*fac
[!d.x_ch_size] [!d.x_vsize ]
where fac= [------------] [----------- ]
[!d.x_vsize ] [!d.x_ch_size]
PS X
Thus, to ensure that plotted character strings scale
properly in postscript mode, specify all character
sizes as as multiples of !p.charsize.
EXAMPLE:
View the IDL dist function and then make a hardcopy:
d=dist(200)
loadct,5
tvscl,d ; view the plot on X-windows
toggle,/color,/landscape ; redirect output to plotc.ps
tvscl,d ; write plot onto plotc.ps
toggle,/print ; resume output to X-windows
; submit plot job to default printer
toggle,/color,/land
tvscl,d
toggle,print='term' ; submit plot "term" print queue
author: Paul Ricchiazzi 1jun92
Institute for Computational Earth System Science
University of California, Santa Barbara
NOTE: you can check for the currently defined print queues in /etc/printcap
REVISIONS:
feb93: added PRINT keyword
feb93: set yoffset=10.5 in landscape mode
feb93: added FILENAME keyword
mar93: added bits=8 in black and white mode
mar96: modify !p.charsize to compensate for larger ps font size
mar96: send output to print queue tree on eos
[Previous]
[Next]
Name: totvect
Purpose: running sum of a vector (must have been done at lease 10e9 times)
Input Parameters:
vector - vector to perform running total on
Keyword Parameters:
derivative - switch, if set, running total of derivative(vector)
Calling Sequence:
runsum=totvec(vector [,/derivative])
Method: brute force
CALLS: ***
deriv_arr [1], deriv_arr [2]
CALLED BY:
HSI_MODUL_PATTERN_BPROJ, READ_ANALIST, merge_genxcat, mreadfits, mreadfits_info
mxf_dset_map, mxfdset_map, mxfread, read_genxcat, sobel_scale, trace_cat2data
History:
14-mar-1995 (SLF)
22-oct-1996 (SLF) - made output double , error check, ucon->gen
change name from <totvec> to <totvect>
28-jan-1999 (RAS) - switch to Long index on do loop and do a
true running sum.
3-Dec-1999 (RAS) - fixed syntax error in CASE statement
[Previous]
[Next]
Project : HESSI
Name : TRACE_COPY
Purpose : copy reformatted and prep'ed TRACE files to
HESSI archive.
Category : synoptic gbo
Syntax : IDL> trace_copy,tstart,tend,back=back,_extra=extra
Inputs : TSTART, TEND = start and end times to consider
[def = current day]
Outputs : processed TRACE FITS files.
Keywords : BACK = days to look back
EXTRA = keywords for TRACE_PREP
COUNT = # of files processed
TESTARRAY = filter keywords to STRUCT_WHERE
CLOBBER = clobber existing files
PREFLARE = mins of preflare data to include [def=5]
LOW_RES = only process files nearest GOES start/peak/end
POSTFLARE = mins of postflare [def=10]
BY_TIME = process all times between TSTART/TEND
[def is process overlapping flare times]
GOES = key off GOES events instead of RHESSI
THRESHOLD = peak count rate threshold for RHESSI-based
selection
GRID = same as /BY_TIME, but select files relative to
a time grid [def = hourly]
CALLS: ***
ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, ARR2STR [1], Arr2Str [2]
CHKLOG [1], CHKLOG [2], CHMOD, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
DPRINT, ERR_STATE, ESPAWN, IS_STRING, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
MK_SUB_DIR, RD_GEV, TEST_DIR, TRACE_PREP, TRIM, WHERE_NEAR, WHERE_TIMES, anytim [1]
anytim [2], anytim [3], anytim [4], anytim [5], concat_dir [4], data_chk [1]
data_chk [2], decode_gev, get_def_times, get_uniq, hsi_read_flarelist
is_number [1], is_number [2], is_struct, struct_where, synop_link, timegrid
trace_cat, trace_cat2data, trace_struct2filename, write_trace
Restrictions: Unix only
History : Written 13 May 2001, D. Zarro (EITI/GSFC)
Modified 3 Sep 2006, Zarro (ADNET/GSFC)
- added /GRID
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : RHESSI
Name : TRACE_GBO
Purpose : update Max Millennium catalog with TRACE flare observations
Category : synoptic gbo
Syntax : IDL> trace_gbo,gev
Inputs : GEV = GOES events structure from RD_GEV
Keywords : REPROCESS = reprocess existing entries
VERBOSE = set verbose output
WITHIN = record if nearest TRACE observation occurs within
this amount of hours relative to GOES peak.
CALLS: ***
ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], ARR2STR [1], Arr2Str [2], CHKLOG [1]
CHKLOG [2], CHMOD, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DEF_GBO
ERR_STATE, ESPAWN, EXIST, LIST_NAR, MK_DIR, PURGE_GBO, RESTORE_GBO, SYNOP_SERVER
TEST_DIR, TRACE_PREP, TRIM2, UPDATE_GBO, WRITE_DIR, XY2HEL, anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], concat_dir [4], decode_gev, gt_day [1]
gt_day [2], gt_time [1], gt_time [2], is_number [1], is_number [2], is_struct
struct_where, trace_cat, trace_cat2data, trace_struct2filename, write_trace
CALLED BY:
UPDATE_MM
History : Written 10 March 2003, D. Zarro (EER/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : TRACE
Name : TRACE_JSMOVIE
Category : movies
Purpose : create Javascript HTML file for latest TRACE special movie
Syntax : IDL> trace_jsmovie,file,url
Inputs : FILE = Javascript movie file name
Outputs : URL = URL of latest movie
Keywords : None (for now)
CALLS: ***
CLOSE_LUN, ERR_STATE, GET_TEMP_DIR, IS_BLANK, IS_STRING, MKLOG, SOCK_COPY
TRACE_MOVIES_PRIORITIZE2
History : 1-Oct-2005, Zarro (L-3Com/GSFC). Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Name: trace_movies_prioritize
Purpose: return priortized movie URLs
Input Parameters:
NONE:
Output:
Function returns movie URLS, most->least priority
Output Paramteres:
mordered - movie info structures, most->least priority
Keyword Parameters:
wave_len - one or more wavelenths (returns 1st matching)
recent -if set, timeliness is most important for given WAVE_LEN
frequency - if set, frequency is most important param for WAVE_LEN
mcount (output) - number of movies matching criteria (zero if no match)
javascript/gif_animate/mpeg - type of URL to return
anchors (output) - corresponding top level html anchor point
associated with output urls
Calling Sequence:
urls=trace_movies_prioritize(wave_len='xxx' [,/frequency] [,/recent] $
[mcount=mcount], $
[,/javascript] [,/mpeg] [,/gif_animate]
CALLS: ***
BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2]
MATCH [1], MATCH [2], MATCH [3], REVERSE, STR2ARR [1], STR2ARR [2]
TRACE_MOVIES_PRIORITIZE2, concat_dir [4], data_chk [1], data_chk [2]
file_exist [1], file_exist [3], get_logenv [1], get_logenv [2], gt_tagval [1]
gt_tagval [2], restgenx, time_window
History:
10-May-2000 - S.L.Freeland - for auto WWW->display
18-May-2000 - S.L.Freeland - add ANCHORS output
11-Oct-2005 - Zarro (L-3Com/GSFC) - expanded wavelength search
[Previous]
[Next]
NAME:
track_h2a
PURPOSE:
Given a heliocentric coordinate and a set of dates, track the
angular position on the sun as it moves with differential rotation.
SAMPLE CALLING SEQUENCE:
ang = track_h2a(times, helio, date_helio)
INPUTS:
times - An array of times in any of the 3 standard formats
helio - The heliocentric coordinates in a 2 element array
(0) = longitude (degrees) W positive
(1) = latitude (degrees) N positive
They can also be strings in the form 'N30W23'.
date_helio - The date for the heliocentric coordinates
OUTPUTS:
ang - Returns the angle as seen from the earth
(0,*) = angle in E/W direction (arcseconds) W positive
(1,*) = angle in N/S direction (arcseconds) N positive
CALLS: ***
CONV_H2A [1], CONV_H2A [2], CONV_HS2H [1], CONV_HS2H [2], DIFF_ROT [1]
DIFF_ROT [2], anytim2ints [1], anytim2ints [2], int2secarr [1], int2secarr [2]
CALLED BY:
align_prep [1], align_prep [2], align_prep [3], get_gbo_pfi, in_fov, mk_coal_movie
rest_low8_cube [1], rest_low8_cube [2], sxt_obs_coord [1], sxt_obs_coord [2]
HISTORY:
Written 20-Jun-93 by M.Morrison using Metcalf ALIGN_AR as starting point
[Previous]
[Next]
NAME:
track_proc
PURPOSE:
To find all processes for a given process name and user. Optionally
kill the process
SAMPLE CALLING SEQUENCE:
pids = track_proc('mdi', 'mdi_sci')
pids = track_proc('mdi', 'mdi_sci', 'bin.sgi/idl')
pids = track_proc('mdi', 'mdi_sci', term0='?', /kill)
RESTRICTION:
Only runs on SGI
CALLS: ***
ARR2STR [1], Arr2Str [2], prstr [1], prstr [2], str2cols [1], str2cols [2]
where_arr [1], where_arr [2]
HISTORY:
Written 30-May-96 by M.Morrison
8-Aug-96 (MDM) - Added TERM0 option
18-Apr-97 (MDM) - changed extraction of "term" and "proc"
12-May-97 (MDM) - Added protection of parsing problem for PS results
12-May-97 (MDM) - Removed protection and added workaround
[Previous]
[Next]
NAME:
TRAPZD
PURPOSE:
Compute the nth stage of refinement of an extended trapezoidal rule.
EXPLANATION:
This procedure is called by QSIMP and QTRAP. Algorithm from Numerical
Recipes, Section 4.2. TRAPZD is meant to be called iteratively from
a higher level procedure.
CALLING SEQUENCE:
TRAPZD, func, A, B, S, step, [ _EXTRA = ]
INPUTS:
func - scalar string giving name of function to be integrated. This
must be a function of one variable.
A,B - scalars giving the limits of the integration
INPUT-OUTPUT:
S - scalar giving the total sum from the previous iterations on
input and the refined sum after the current iteration on output.
step - LONG scalar giving the number of points at which to compute the
function for the current iteration. If step is not defined on
input, then S is intialized using the average of the endpoints
of limits of integration.
OPTIONAL INPUT KEYWORDS:
Any supplied keywords will be passed to the user function via the
_EXTRA facility.
NOTES:
(1) TRAPZD will check for math errors when computing the function at the
endpoints, but not on subsequent iterations.
(2) TRAPZD always uses double precision to sum the function values
but the call to the user-supplied function is double precision only if
one of the limits A or B is double precision.
REVISION HISTORY:
Written W. Landsman August, 1991
Always use double precision for TOTAL March, 1996
Converted to IDL V5.0 W. Landsman September 1997
Pass keyword to function via _EXTRA facility W. Landsman July 1999
CALLED BY
QSIMP, QTRAP
[Previous]
[Next]
Project : HESSI
Name : trieste__DEFINE
Purpose : Define a trieste object for copying catalog data
Category : Ancillary GBO Synoptic Objects
Syntax : IDL> c=obj_new('trieste')
CALLS: ***
GET_UTC, TRIESTE::GET_SDIR, TRIESTE::INIT, TRIESTE::SYNOP
History : Written 24 Apr 2003, D. Zarro (EER/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO - CDS
Name :
TRIM()
Purpose :
Converts numbers to strings, without trailing zeros.
Explanation :
Converts numbers into a string representation, and trims off leading
and/or trailing blanks. Differs from STRTRIM in that trailing zeros
after the period are also trimmed off, unless NUMBER is already a
string, or an explicit format is passed.
Use :
Result = TRIM( NUMBER [, FORMAT ] [, FLAG ] )
Inputs :
NUMBER = Variable or constant. May be of any ordinary including
string. However, structures are not allowed.
Opt. Inputs :
FORMAT - Format specification for STRING function. Must be a string
variable, start with the "(" character, end with the ")"
character, and be a valid FORTRAN format specification. If
NUMBER is complex, then FORMAT will be applied separately to
the real and imaginary parts.
FLAG - Flag passed to STRTRIM to control the type of trimming:
FLAG = 0 Trim trailing blanks.
FLAG = 1 Trim leading blanks.
FLAG = 2 Trim both leading and trailing blanks.
The default value is 2. If NUMBER is complex, then FORMAT
will be applied separately to the real and imaginary parts.
Outputs :
Function returns as a string variable representing the value NUMBER.
Opt. Outputs:
None.
Keywords :
None.
Calls :
None.
CALLED BY:
ADD_ALT, ADD_CAMPAIGN, ADD_DETAIL, ADD_EXPER, ADD_EXP_COMM, ADD_FLAG, ADD_MAIN
ADD_METHOD, ADD_PLAN, ADD_TAG [2], ADD_WAVECAL, ANYTIM2CAL, AN_NIMCP, AN_NIMCP_1_2
AN_NIMCP_AVG, APPLY_CDS_ADEF, APPLY_LOCK, ARCMIN2HEL2, ARR2GIF, AUXREAD, AVG_WO_CR
BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], C2_CALFACTOR, C3_CALFACTOR [1], CACHE_DATA
CACHE__DATA, CAL_AUXREAD, CAL_DETREAD, CAL_DETSELECT, CAL_HDRREAD, CAL_MKAUXDESC
CAL_MKDETWDESC, CAT_DURATION, CDS_ADEF_PARSEFILE, CDS_AR_OBS, CDS_CLEAN
CDS_COMPRESS, CDS_ENG_N1_AN, CDS_ENG_N1_PR, CDS_ENG_N1_VW, CDS_ENG_N4_AN
CDS_ENG_N4_PR, CDS_FILES, CDS_FILL_MISSING, CDS_LINEFIT_WRAP, CDS_PAD_QLDS
CDS_SATURATE, CDS_SIMPLE_FITS, CDS_SNAPSHOT, CDS_STACK, CDS_WAVE_CAT
CDS_WAVE_FILES, CFITSLIST, CFIT_BLOCK, CFIT_ERRDEMO, CHECK_FTP, CHECK_INTEG
CHECK_KAP, CHECK_KAP_ANOMALY, CHIANTI_DEM, CH_LINE_LIST, CH_SYNTHETIC
CLR_INST_DLYD, CLR_NRT_RES, CLR_OTHER_OBS, CLR_RESOURCE, CLR_TEL_MODE
CLR_TEL_SUBMODE, CMOUSE, COMPILE_SFIT, CONCAT_PNT, CONGRID [1], CONGRID [2]
COUNTDOWN, CRONTAB, CWF_COMPONENT, CWF_STATUS, CWQ_CUBE, CWQ_DSPWAV [1]
CWQ_SPECTR [1], CWQ_WINSEL [1], CW_CUBEVEIW, CW_LOADCT, CW_MOUSE, DATA_PATHS
DBEXT [2], DBUPDATE [1], DB_CHECK, DEL_ALT, DEL_DETAIL, DEL_FLAG, DEL_PLAN
DEL_SOHO_DET, DEM_FIT, DENSITY_RATIOS, DETDATA, DETDESC, DETREAD, DETSELECT, DROT_MAP
DSPEXP, DSPWAV, DSP_AUX, DSP_INFO, DSP_MOVIE, DSP_WAV, EIS_CAT [1], EIS_CAT [2]
EIS_GET_HDR_STRUC, EIS_LIST_EXPER [1], EIS_LIST_EXPER [2], EIS_LIST_MAIN [1]
EIS_LIST_MAIN [2], EIS_RASTER_BROWSER [1], EIT_COPY, EIT_GBO, EIT__DEFINE
EXIST_JOB, EXPAND_TV, EXPORT_PLAN, EXPORT_STUDY, EXPSLICE, FASTFIT, FID__DEFINE
FIFO__DEFINE, FILL_MISSING, FIND_CAT, FIND_CDS_STUDY, FIND_COMPRESSED
FIND_KAP_FILE, FIND_ZDBASE, FITS__DEFINE, FITTER, FIT_CDS_MAP, FIX_CATALOG, FIX_IAP
FIX_OBS_SEQ, FIX_TIME_JUMP, FLUSH_CATALOG, FORM_HISTO, FORM_HISTO_2D, FORM_SIGMAS
FTP_MWSO, FTP_SYNOP, FTP__DEFINE, FUZZY_IMAGE, GDSPSPEC, GEN__DEFINE, GETBKGIMG
GET_ALT, GET_CALLER, GET_CAMPAIGN, GET_CDS_FOV, GET_CDS_GIS, GET_CDS_PNTCAL
GET_CDS_STUDY, GET_CDS_XY, GET_COMPRESS, GET_DATAWIN, GET_DEF_PRINTER, GET_DETAIL
GET_EFFICIENCY, GET_EFF_AREA, GET_EXPER, GET_EXP_FACTOR [1], GET_EXP_FACTOR [2]
GET_FITS_INSTR, GET_FITS_TIME, GET_FLAG, GET_F_RASTER, GET_F_STUDY, GET_GEV
GET_GSET, GET_HANDLER_ID, GET_KEYWORD, GET_LATEST_KAP, GET_LIB, GET_LINELIST
GET_MAIN, GET_MAP_PROP, GET_METHODS, GET_MIRSHIFT, GET_NOAA, GET_ORBIT [1]
GET_ORBIT [2], GET_PLAN, GET_PROGRAM, GET_PT, GET_RASTER, GET_RASTER_PAR, GET_RAW
GET_RECENT_EIT, GET_SC_ATT [1], GET_SID, GET_SOHO_DET, GET_SOURCE_STC, GET_SSWDB
GET_STUDY, GET_STUDY_PAR, GET_SUMER_FILES, GET_TILTCAL, GET_USER_ID, GET_VDS_BIAS
GET_WAVECAL, GET_WAVE_EFF, GET_ZDBASE, GE_WINDOW_SIM, GHOST_AMOUNT, GHOST_BUSTER
GHOST_INFO, GHOST_MOVE, GHOST_PLOT_ALL, GHOST_PLOT_ONE, GHOST_PLOT_SAMPLE
GHOST_RESTORE, GIF2PICT, GIS_CALIB_AREA, GIS_CALIB_EXTRACT, GIS_CALIB_LONGSLIT
GIS_HV_CAL, GOES_FITS_FILES, GOES__DEFINE, GOFNT, GT_BIMAGE, GT_CDS_QL
GT_CDS_WINDOW, GT_FPOINT, GT_IIMAGE, GT_LAMBDA, GT_MIMAGE, GT_SCANP, GT_SCANT
GT_SCANX, GT_SCANY, GT_SPECTRUM, GT_VALID, GT_WAVEBAND, HANDLE_KILLER_HOOKUP
HAVE_EXE, HAVE_PROC, HAVE_TAG, HDRREAD, HEAD2STC, HEL2ARCMIN [1], HESSI
HESSI CLEAN ALGORITHM CLASS DEFINITION
HESSI IMAGE STRATEGY CLASS DEFINITION, HFITS__DEFINE, HSI_DEBUG
HSI_FITS2MAP [1], HTTP__DEFINE, HXRS__DEFINE, IAP2STC, IMAGE_TOOL
IMAGE_TOOL_EVENT, IMPORT_PLAN, IMPORT_STUDY, IMP_DETAIL, INDEX2MAP, INDEX2OMAP
IS_BATCH, IS_LINK, ITOOL_EIT_DEGRID, ITOOL_GET_TIME, ITOOL_LOAD_IMAGE
ITOOL_RD_FITS, ITOOL_RD_GIF, JOIN_STRUCT [2], JSMOVIE, JSMOVIE2, KEYBOARD_CRS
KILL_JOB, LASCO_FITSHDR2STRUCT, LAST_KAP_VERS, LINECOLOR, LIST_ALT, LIST_ANOMALY
LIST_CAMPAIGN, LIST_CDROM, LIST_COM_TIMES, LIST_DETAIL, LIST_DLYD_TIMES, LIST_DSN
LIST_DURATION, LIST_EXPER, LIST_EXP_COMM, LIST_FLAG, LIST_GEV, LIST_HDR_SUM
LIST_INST_DLYD, LIST_MAIN, LIST_MDI_M, LIST_NRT_RES, LIST_OTHER_OBS
LIST_OTHER_RES, LIST_PLAN, LIST_SOHO_DET, LOCAL_DIFF, LOCATE_FFCAL, LOCK_ZDBASE
LSTSQR, MAKE_GIFS, MAKE_STRUCT, MAP2FITS, MAP2GIF, MAP2JPEG, MAP2MPEG
MAP_LIST__DEFINE, MAP__DEFINE, MATCH_STRUCT, MAX_TEMP, MCURVEFIT, MDI_COPY, MDI_GBO
MDI_LATEST, MISS_PCKTS, MJD2STR, MKAUXDESC, MKDETWDESC, MKLOG_LIST, MKMOVIE
MKMOVIE0 obsolete version of mkmoviepro, MKSUMWDESC, MK_AGIF, MK_CDS_ANALYSIS
MK_CDS_DBASE, MK_CDS_FITS, MK_CDS_GIF, MK_CDS_PLAN, MK_COMPONENT_STC, MK_DAILY_MED
MK_FILE, MK_GIF, MK_HEAD_CAT, MK_HXI_MAP, MK_IMG, MK_IVM_MAP, MK_LINK, MK_MONTHLY_MIN
MK_MPEG, MK_PLAN_CAMP, MK_PLAN_POINT, MK_PLAN_PRIV, MK_PLAN_READ, MK_PLAN_XY
MK_POINT_STC, MK_SOHO_TARGET, MK_STUDY, MK_SUMMARY, MK_SXT_MAP, MK_SYNOPTIC
MK_TEMP_FILE, MK_WAVECAL, MOD_CAMPAIGN, MOD_CATALOG, MOD_DETAIL, MOD_EXPER, MOD_GSET
MOD_LINELIST, MOD_MAIN, MOD_V_RASTER, MOD_V_STUDY, MONO_SPEC, MOVIE_MAP
NANCAY__DEFINE, NDSPSPEC, NIS_CALIB, NIS_MRGDATA, NOBE__DEFINE, NTRIM, OBJ_COMPILE
OBJ_DISSECT, OFFSET_BIAS, OLIST__DEFINE, OPEN_CALFITS, OPLOT_NAR [1], OPLOT_STRING
OVSA_LTC_DEFINE, PAIR_STRUCT, PARCHECK, PARSE_TIME, PCLCLOSE [1], PCLCLOSE [2]
PCONVERT, PICKFITS, PICK_LINE, PIX2WAVE, PLAN_XCAT_SUMM, PLOT_CDS_POINT [1]
PLOT_CDS_POINT [2], PLOT_MAP
PLOT_MAP2 WARNINGTEMPORARY FIX ONLY FOR 16 bit ZBuffer support
PLOT_RASTER, PLOT_STRING, PLOT_VDS_BIAS, PQLPROFILE, PQLZOOM, PRESTORE, PRG_DETAIL
PRG_PLAN, PRINT_CFIT, PROFILES2, PR_SYNTAX, PSCLOSE [1], PSCLOSE [2], PTEST
PURGE_CDHSSTATE, PUT, QLDS_CHECKIN, QL_MENU, QMCLOSE [1], QMCLOSE [2], QWAVECAL
RASTER_DUR, RATIO_PLOTTER [1], RD_ASCII_C, RD_CDS_POINT, RD_IMAGE_FITS
RD_IMAGE_GIF, RD_PLAN, READCDSCOL, READCDSFITS, READSUMCOL, READ_CALFITS
READ_DEFAULT, READ_FULL_ATT, READ_HT, READ_IONEQ, READ_KAP, READ_KAP_ITEM
READ_SC_ATT, REBIN_GIF, REDUCE_IMG_HDR, REDUCE_LEVEL_1, REDUCE_MAIN, REGEN_SYNOP
REG_CDROM, REMOVE_CR, REP_FITS_HEAD, REP_STRUCT_NAME, RESPACE_MAP, RESTORE_QLDS
ROT_FITS_HEAD, ROT_MAP, ROUND_TIME, ROUTINE_NAME [4], ROUTINE_NAME [7]
RSTN__DEFINE, RTMVI [1], SAVE_QLDS, SCANPATH, SEND_PRINT, SETIMAGE, SETVIEW [1]
SETVIEW [2], SETWINDOW [1], SETWINDOW [2], SET_CDS_FITS, SET_KAP_VERS, SFITSLIST
SHOWFLAGS, SHOW_PLAN, SHOW_QUEUE [1], SHOW_QUEUE [2], SHOW_SLIT6, SHOW_STUDY
SHOW_SYNOPTIC, SHOW_SYNOP__DEFINE, SHRINK_SUMER_FITS, SITE__DEFINE, SMART_FTP
SNAP_MOVIE, SOCK_FILES, SOCK_FIND, SOCK_SERVER, SOHOFILE2TIME, SOHO_CAMPAIGN
SOLAR_NORTH_UP, SOLB_READ_REPOINT [1], SOLB_READ_REPOINT [2]
SPECTROSCOPIC2ION, SPEX_DRM__DEFINE, SPEX_FITINT__DEFINE, SPEX_FIT__DEFINE
SPEX_GEN__DEFINE, SPEX_READ_FIT_RESULTS, SPEX__DEFINE, STR_SPACE, SUMDETSELECT
SUMER_CONFIG_DEF, SUPPRESS_MESSAGE, SXI_GBO, SYNOPTIC_STATS, SYNOP_DEFINE
SYNOP_PATH, TEMPERATURE_RATIOS, TEST_DIR2, TEST_OPEN2, TIFF2GIF, TP_DRAW_RASDUR
TP_DUMP_SETUP, TRACE_COPY, TRIM_CAMPAIGN, TRIM_TAGS, TVBOXCRS, TVPOS, UNIX_SPAWN
UNLOCK_ZDBASE, UNPACK_LZ_SCIENCE, UPDATE_CAMPAIGN, UPDATE_DEX, UPDATE_KAP
UPDATE_SOHO_TARGETS, UPD_PLAN, UPD_SOHO_DET, URL_GET, VALID_JPEG, VALID_PNG
VALID_TIME, VDS_DEBIAS, VDS_READ_FLAT, VIEW_RAW, WAS_CALLED, WAVE2PIX, WBDA [1]
WBDA [2], WDEL, WHAT_CDHS_STUDY, WHAT_USES, WIN_SPAWN, WMAX, WRITE_CAP, WRITE_CIF
WRITE_IAP, WTITLE, X2GIF, X2JPEG, X2PS, XACK, XCAMP, XCAT, XCDS_ANALYSIS, XCDS_BOOK
XCDS_COSMIC, XCFIT, XCFIT_BLOCK, XCOR_CDS, XCPT, XCRON, XCROP_CUBE, XCR_REMOVE, XDIFF
XIAP, XINPUT, XLIST, XMANAGER_RESET, XPLOTSCALE, XPL_STRUCT, XPOPUP, XPORT, XPRINT [2]
XPRINT [5], XPS_SETUP, XRECORDER, XREPORT_EDIT, XSEL_LIST [1], XSEL_LIST [2]
XSET_VALUE, XSTRUCT_BUTTONS, XSTUDY, XTVSCALE, XWIDUMP, XYPLOT__DEFINE, XZOOM_PLAN
carrmapmaker2, ch_ss, chktag
cmap2gif ftsfile maxdmind ROOTroot CONTROLcontrol, counts2countrate
cw_energy_range, cw_ut_range, cwq_dspwav [2], cwq_spectr [2], cwq_winsel [2]
db_gbo, destr_bilin [2], display_jpg, drm_correct_albedo, dsp_menu
eis_raster_browser [2], eit_files, expand_dirs, find_fits_ext
find_pixel_intersects, fit_comp_kw, fit_model_components, fits2rm
get_contributions, get_def_times, hessi_var, hsi_break_srm, hsi_coll_widget
hsi_cw_energy_range, hsi_format_flare, hsi_get_flare_flags
hsi_image__getaxis [2], hsi_image_fitsread, hsi_image_plot
hsi_imagefile_2_plotman, hsi_imagemisc_widget, hsi_select_flare
hsi_show_flags [2], hsi_show_flare_on_image, hsi_spectrum_fitsread
hsi_ui_flarecat, hsi_ui_img, hsi_ui_img_doimage [1], hsi_ui_img_doimage [2]
hsi_ui_lc, hsi_ui_mon, hsi_ui_obs, hsi_ui_ql, hsi_ui_spec, ihy_db, laser8ew
mk_comp_bgauss, mk_comp_gauss, mk_comp_poly, mk_comp_ppoly, mk_comp_voigt
mk_query [1], mk_query [2], mk_query_genx, mk_rate_hdr, mk_sumer_dbase_ff
nums2string, plot_goes_ospex, plotman, plotman_conf_panels, plotman_imageoptions
print2d_plot, ratio_plotter [2], rd_sumer_genx, read_hessi_4_ospex, rm2fits
rt_carrmapmaker yymmdd num_r rad limb wlimb hdr disp saveset nextrot
soxs_off_fwhm, spex_bk__define, spex_bkint__define, spex_convert_results [1]
spex_convert_results [2], spex_data__define, spex_gen_strategy_holder
spex_image__define, stc_sum, str_key, str_top2sub, sumer_destretch, sumer_ffdb
trace_euv_resp [1], trace_euv_resp [2], uncompress, wrt_rate_ext, xpickfile
xsel_list_multi
Common :
None.
Restrictions:
NUMBER must not be a structure.
FORMAT must be a valid format specification, and must not be passed
if NUMBER is of type string.
FLAG must not be of string type, or an array.
Side effects:
None.
Category :
Utilities, Strings.
Prev. Hist. :
William Thompson Applied Research Corporation
May, 1987 8201 Corporate Drive
Landover, MD 20785
William Thompson, Feb. 1992, added support for complex numbers, and
fixed Unix problem with lowercase "e".
Written :
William Thompson, GSFC, May 1987.
Modified :
Version 1, William Thompson, GSFC, 9 April 1993.
Incorporated into CDS library.
Version 2, Zarro (SAC/GSFC), 3-Jun-98
Added check for undefined input
Version 3, Zarro (SM&A/GSFC), 1-Dec-99
Returned invalid input as blank string
to avoid downstream problems.
Version 4, Zarro (SM&A/GSFC), 4-Jan-00
Added /QUIET
Version 5, Zarro (SM&A/GSFC), 20-Jan-00
Vectorized
Version 6, 24-Jan-2000, William Thompson, GSFC
Fixed bug introduced in version 5.
Version 7, 14-Mar-2000, Zarro (SM&A/GSFC)
Moved check for unsupported type ahead of recursion
Version 8, 22-Jul-2002, Zarro (LAC/GSFC)
Made loop variables LONG
Version 9, 08-Jan-2004, William Thompson, GSFC
Added support for double-precision complex, and unsigned data
types.
[Previous]
[Next]
Project : HESSI
Name : TRIM2
Purpose : vectorized version of TRIM
Category : string utility
Syntax : IDL> out=trim2(in,flag)
Inputs : IN = input string
Optional : FLAG = 0,1,2 [def = 2]
Outputs : OUT = output string
CALLED BY:
CHAN_DEFINE, CLEAN_PATH, EIS_SOCK_FIND [1], EIS_SOCK_FIND [2], EIT_COPY, EIT_GBO
ESPAWN, FID2TIME, FIND_PROC, FIX_DATE, GEN__DEFINE, GET_PID, GET_PROC, GET_TEMP_DIR
HTTP__DEFINE, LIST_NAR, LOC_FILE [2], MAP__DEFINE, MK_CDS_IMAP, OVSA_LTC_DEFINE
PRINT_GEV, PRINT_NAR, READ_KAP, RSTN__DEFINE, SITE__DEFINE, STRUP, STR_MATCH, SXI_GBO
SYNOP_DEFINE, TIME2FID, TRACE_GBO, VALID_TIME, XCAT, Y2KFIX, db_gbo, hsi_gbo, ihy_db
History : Written, 24-July-2002, Zarro (LAC/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HESSI
Name : TRIM_TAGS
Purpose : Trim all string tags in a structure
Syntax : IDL> out=trim_tags(in)
Inputs : IN = input struct
Opt. Inputs : None.
Outputs : OUT = output struct with string tags trimmed
Opt. Outputs: None.
Keywords : RECURSE = recurse on nested structures
NO_COPY = do not make new copy of input
Category : Structures
Written : Dominic Zarro, SM&A/GSFC, 19 May 1999
Contact : dzarro@solar.stanford.edu
CALLS:
[Previous]
[Next]
NAME:
TSC
PURPOSE:
Interpolate an irregularly sampled field using a Triangular Shaped Cloud
EXPLANATION:
This function interpolates an irregularly sampled field to a
regular grid using Triangular Shaped Cloud (nearest grid point
gets weight 0.75-dx^2, points before and after nearest grid
points get weight 0.5*(1.5-dx)^2, where dx is the distance
from the sample to the grid point in units of the cell size).
CATEGORY:
Mathematical functions, Interpolation
CALLING SEQUENCE:
Result = TSC, VALUE, POSX, NX[, POSY, NY, POSZ, NZ,
AVERAGE = average, WRAPAROUND = wraparound,
ISOLATED = isolated, NO_MESSAGE = no_message]
INPUTS:
VALUE: Array of sample weights (field values). For e.g. a
temperature field this would be the temperature and the
keyword AVERAGE should be set. For e.g. a density field
this could be either the particle mass (AVERAGE should
not be set) or the density (AVERAGE should be set).
POSX: Array of X coordinates of field samples, unit indices: [0,NX>.
NX: Desired number of grid points in X-direction.
OPTIONAL INPUTS:
POSY: Array of Y coordinates of field samples, unit indices: [0,NY>.
NY: Desired number of grid points in Y-direction.
POSZ: Array of Z coordinates of field samples, unit indices: [0,NZ>.
NZ: Desired number of grid points in Z-direction.
KEYWORD PARAMETERS:
AVERAGE: Set this keyword if the nodes contain field samples
(e.g. a temperature field). The value at each grid
point will then be the weighted average of all the
samples allocated to it. If this keyword is not
set, the value at each grid point will be the
weighted sum of all the nodes allocated to it
(e.g. for a density field from a distribution of
particles). (D=0).
WRAPAROUND: Set this keyword if you want the first grid point
to contain samples of both sides of the volume
(see below).
ISOLATED: Set this keyword if the data is isolated, i.e. not
periodic. In that case total `mass' is not conserved.
This keyword cannot be used in combination with the
keyword WRAPAROUND.
NO_MESSAGE: Suppress informational messages.
Example of default allocation of nearest grid points: n0=4, *=gridpoint.
0 1 2 3 Index of gridpoints
* * * * Grid points
|---|---|---|---| Range allocated to gridpoints ([0.0,1.0> --> 0, etc.)
0 1 2 3 4 posx
Example of ngp allocation for WRAPAROUND: n0=4, *=gridpoint.
0 1 2 3 Index of gridpoints
* * * * Grid points
|---|---|---|---|-- Range allocated to gridpoints ([0.5,1.5> --> 1, etc.)
0 1 2 3 4=0 posx
OUTPUTS:
Prints that a TSC interpolation is being performed of x
samples to y grid points, unless NO_MESSAGE is set.
RESTRICTIONS:
Field data is assumed to be periodic with the sampled volume
the basic cell, unless ISOLATED is set.
All input arrays must have the same dimensions.
Postition coordinates should be in `index units' of the
desired grid: POSX=[0,NX>, etc.
Keywords ISOLATED and WRAPAROUND cannot both be set.
PROCEDURE:
Nearest grid point is determined for each sample.
TSC weights are computed for each sample.
Samples are interpolated to the grid.
Grid point values are computed (sum or average of samples).
EXAMPLE:
nx=20
ny=10
posx=randomu(s,1000)
posy=randomu(s,1000)
value=posx^2+posy^2
field=tsc(value,posx*nx,nx,posy*ny,ny,/average)
surface,field,/lego
NOTES:
Use csc.pro or ngp.pro for lower order interpolation schemes. A
standard reference for these interpolation methods is: R.W. Hockney
and J.W. Eastwood, Computer Simulations Using Particles (New York:
McGraw-Hill, 1981).
MODIFICATION HISTORY:
Written by Joop Schaye, Feb 1999.
Check for overflow for large dimensions P. Riley/W. Landsman Dec. 1999
[Previous]
[Next]
NAME:
TSUM
PURPOSE:
Trapezoidal summation of the area under a curve.
EXPLANATION:
Adapted from the procedure INTEG in the IUE procedure library.
CALLING SEQUENCE:
Result = TSUM(y)
or
Result = TSUM( x, y, [ imin, imax ] )
INPUTS:
x = array containing monotonic independent variable. If omitted, then
x is assumed to contain the index of the y variable.
x = lindgen( N_elements(y) ).
y = array containing dependent variable y = f(x)
OPTIONAL INPUTS:
imin = scalar index of x array at which to begin the integration
If omitted, then summation starts at x[0].
imax = scalar index of x value at which to end the integration
If omitted then the integration ends at x[npts-1].
OUTPUTS:
result = area under the curve y=f(x) between x[imin] and x[imax].
EXAMPLE:
IDL> x = [0.0,0.1,0.14,0.3]
IDL> y = sin(x)
IDL> print,tsum(x,y) ===> 0.0445843
In this example, the exact curve can be computed analytically as
1.0 - cos(0.3) = 0.0446635
PROCEDURE:
The area is determined of individual trapezoids defined by x[i],
x[i+1], y[i] and y[i+1].
If the data is known to be at all smooth, then a more accurate
integration can be found by interpolation prior to the trapezoidal
sums, for example, by the standard IDL User Library int_tabulated.pro.
MODIFICATION HISTORY:
Written, W.B. Landsman, STI Corp. May 1986
Modified so X is not altered in a one parameter call Jan 1990
Converted to IDL V5.0 W. Landsman September 1997
Allow non-integer values of imin and imax W. Landsman April 2001
Fix problem if only 1 parameter supplied W. Landsman June 2002
[Previous]
[Next]
NAME:
tv2
PURPOSE:
To allow a user to output an image to a PostScript device and
to specify the location (and size) in pseudo-pixel coordinates.
SAMPLE CALLING SEQUENCE:
tv2, xsiz_pix, ysiz_pix, /init
tv2, xsiz_pix, ysiz_pix, /init, window=0 ; "X" version
tv2, xsiz_pix, ysiz_pix, /init, ppinch=100. ; Specify 100 pixs/inch
tv2, xsiz_pix, ysiz_pix, /init, xsize=6. ; Specify xsize=6inch
tv2, image, x0, y0 ; tv image at x0, y0
tv2, bytscl(image, top=!d.n_colors)
The tv2 routine makes it easy to send plots to the PostScript
printer by creating a pseudo-pixel coordinate system. tv2
also works in the normal way for 'X' output, so that the same
calling statements can work with either 'X' or 'PS' output.
Typically, an application should first:
IDL> set_plot, 'PS', /interpolate ; or set_plot,'Z'
IDL> tv2, xsiz_pix, ysiz_pix, /init ; Sets up coordinates
for example,
IDL> tv2, 512, 512, /init, window=0 ; Sets up 512x512 window
Then send the plot with the command:
IDL> tv2, image
or
IDL> tv2, image, x0, y0 ; x0,y0=lower left coordinate
Also see: plot2, xyouts2, ocontour, draw_grid and arrow2
INPUTS:
image - The byte scaled image to display
(except when /INIT is used -- in that case it is
the X size of the window in pixels)
x00 - The left corner pixel coordinate of the image
(except when /INIT is used -- in that case it is
the Y size of the window in pixels)
y00 - The lower corner pixel coordinate of the image
CALLS: ***
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], WDEF [1], WDEF [2], delvarx [5]
CALLED BY:
ROLL_PLOT, SIMPLE_TV2, cal_fig_mich, disp1focus [2], disp1focus_flt, disp_dt_genx
disp_focus, disp_gen [1], disp_gen [2], disp_sci160k [1], disp_sci160k [2]
disp_sci5k, fig_summary, fits_disp_month [1], fits_disp_month [2]
img_summary [1], img_summary [2], jitter_gif_xyimg, lcur_plotr [1]
lcur_plotr [2], mdidust, mk_refbar [1], mk_refbar [2], mk_sun_mosaic
mon_health [1], mon_health [2], new_disp_sci5k [1], new_disp_sci5k [2]
new_edac_summary, new_mon_health [1], new_mon_health [2], plot_loi_summary [1]
plot_loi_summary [2], plot_shutter_perf, timeline, wrt_sci160k_img, xdisp_sci5k
OPTIONAL KEYWORD INPUT:
init - Set this to set up the plotting characteristics.
** Note: The following keywords only work WITH the /init option. **
landscape - If set, output in postscript mode
Has no effect when the output device is "X"
window - The window number to create
Has no effect when the output device is "PS"
already - Do not create the window if it already exists
and is the proper size
Has no effect when the output device is "PS"
ppinch - Force the size of the output to be a fixed number
of "pixels per inch".
xsize - Force the X size of the output to be xsize inches.
If xsize is specified, then ppinch=xsize_pix/xsize
xsize is ignored if ppinch is explicitly defined.
ysize - Force the Y size of the output to be ysize inches.
ysize is ignored if either ppinch or xsize is defined.
color - If set, issue the device commands for color
Has no effect when the output device is "X"
hwfont - If set, use hardware fonts
Has no effect when the output device is "X"
revcolor - If set, set !p.color to 0 for device PS so that
writing will be in black on white paper. Set
!p.color to 255 for device X so that writing is
white on a black background.
OPTIONAL KEYWORD OUTPUT:
xy_size - Vector containing the PS size [xsize,ysize] in inches.
Nothing returned when the output device is "X".
METHOD:
Since the output size of the window is defined in pixels,
TV2, XYOUTS2, DRAW_GRID (Stonyhurst grid), OCONTOUR, PLOTS2,
and ARROW2 can convert the pixel coordinates into inches when
sending the output to the postscript device. The aspect ratios
are all figured out to maintain proper proportions.
MK_REFBAR will make a reference color bar.
tv2 reads back the color table using tvlct,/get,red,green,blue.
If tv2 thinks that the current table is a grey-scale, then the
image will be plotted using a tv,red(image). This will preserve
the grey-scale characteristics when printing to a non-color
PostScript file.
NOTES:
To work properly to the screen, the bytscl command should use
the "top=!d.n_colors" option
To work properly to the PS device, the 'set_plot,"ps"' command
needs to be 'set_plot,"ps",/interpolate' (so that the current
X colors are mapped properly to 256 PS colors).
COMMON BLOCK:
tv2_blk
SIDE EFFECTS:
1. If /color is set, the device,/color,bits=8,/helvetica is called.
When non-color PS output is next desired, this will have to be
reset by the user.
2. If /landscape is set, the device,/land call will be issued. When
non-landscape PS output is next desired, this will have to be
reset by the user.
3. If tv2,/init is called for an 'X' device and the window keyword
is not specified, then window 0 will be created.
ROUTINES CALLED:
wdef and delvarx
HISTORY:
Written Feb-94 by M.Morrison
9-Jun-94 (MDM) -
10-Aug-94 (MDM) - Added ppinch optional input
7-Apr-95 (MDM) - Added /COLOR and /HWFONT options
26-Jan-96 (JRL) - Added xsize, ysize, xoff, yoff, xy_size keywords.
For PS application, changed tv,img to tv,red(img), where
red is from tvlct,/get,red
28-Jan-96 (LWA) - Made ppinch floating.
24-Oct-96 (MDM) - Modified to use the current window as
long as it's greater than 0 (used to use
window 0 all of the time)
5-Nov-96 (MDM) - Re-added 24-Oct to merge with 26-Jan and 28-Jan
modifications
- Added some documentation information
18-Dec-2002, William Thompson, GSFC
Changed !COLOR to !P.COLOR
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVAXIS
Purpose :
Places X and/or Y axes on displayed images.
Explanation :
Places X and/or Y axes on images displayed with the EXPTV or similar
procedure.
Inputs :
None required.
Opt. Inputs :
ARRAY = Image to draw axes on.
MX, MY = The size of the image on the display screen.
JX, JY = The position of the lower left-hand corner of the image on
the display screen.
If the optional parameters are not passed, then they are retrieved with
GET_TV_SCALE. It is anticipated that these optional parameters will
only be used in extremely rare circumstances.
Outputs :
The values of MX, MY and JX, JY are printed to the terminal screen.
Opt. Outputs:
None.
Keywords :
XAXIS = If 0 then X axis is drawn below image, if 1 then above.
Default is not to draw an X axis.
YAXIS = If 0 then Y axis is drawn to the left, if 1 then right.
Default is not to draw a Y axis.
ORIGIN = Two-element array containing the coordinate value in
physical units of the center of the first pixel in the
image. Defaults to whatever was previously set, or [0,0] if
none.
SCALE = Pixel scale in physical units. Can have either one or two
elements. Defaults to whatever was previously set, or [1,1]
if none.
XRANGE = Array containing minimum and maximum values of X. Default
is to use predefined scale, or pixel numbers if none. It is
important to realize that the range refers to the edges of
the pixels, i.e. from the left edge of the leftmost pixel to
the right edge of the rightmost pixel. The width of the
pixels in the data coordinates must be taken into account.
This is to maintain compatibility with the behavior of AXIS
when used with graphic plots.
YRANGE = Array containing minimum and maximum values of Y. Default
is to use predefined scale, or pixel numbers if none. The
same comments for XRANGE also apply to YRANGE, except that
the range applies from the bottom of the bottommost pixel to
the top of the topmost pixel.
Either ORIGIN,SCALE or XRANGE,YRANGE can be used, but not both. If
neither are used, then whatever scale was previously defined will be
used. If no scale has been defined, then pixel numbers will be used.
XTITLE = X axis title. Default is value of !XTITLE.
YTITLE = Y " " " " "
TICKLEN = Length of tick marks. Default is !TICKLEN.
XTICKLEN = Length of X tick marks. Overrides TICKLEN.
YTICKLEN = " Y " "
XTICKNAME= String array giving the annotation of each X tick.
YTICKNAME= " " " " " Y "
XTICKS = Number of major X tick intervals to draw.
YTICKS = " " Y " "
XTICKV = Array of values for each X tick mark.
YTICKV = " " " Y "
NOXLABEL = If set, then the X axis is not labelled. Overridden by
XTITLE and XTICKNAME keywords.
NOYLABEL = If set, then the Y axis is not labelled. Overridden by
YTITLE and YTICKNAME keywords.
XTYPE = Either 0 for linear, or 1 for logarithmic.
YTYPE = Either 0 for linear, or 1 for logarithmic.
COLOR = Color to use for drawing the axes.
DISABLE = If set, then TVSELECT not used.
DATA = If set, then immediately activate the data coordinates for
the displayed image.
Other standard keywords for the AXIS command are also supported.
Calls : ***
GET_TV_SCALE, SETIMAGE, STORE_TV_SCALE, TVSELECT, TVUNSELECT
CALLED BY:
COLOR_BAR, ITOOL_PLOT_AXES
Common :
None.
Restrictions:
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
The data coordinates associated with an image are changed by this
routine.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., July 1991.
William Thompson, May 1992, modified to use GET_TV_SCALE.
William Thompson, Nov 1992, removed call to INIT_SC1_SC4.
Written :
William Thompson, GSFC, July 1991.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 1 September 1993.
Modified to keep track of image data coordinates.
Version 3, William Thompson, GSFC, 19 October 1994
Added XTYPE and YTYPE keywords.
Version 4, William Thompson, GSFC, 20 March 1995
Added ORIGIN and SCALE keywords.
Version 5, William Thompson, GSFC, 11 November 1999
Added keyword _EXTRA
Version 6, William Thompson, GSFC, 02-Apr-2001
Modified to use correct system variables (for v5.4)
Version 7, William Thompson, GSFC, 14-May-2001
Further modified system variables.
Version :
Version 7, 14-May-2001
[Previous]
[Next]
NAME:
TVBOX
PURPOSE:
Draw a box(es) or rectangle(s) of specified width
EXPLANATION:
Positions can be specified either by the cursor position or by
supplying a vector of X,Y positions.
CALLING SEQUENCE:
TVBOX, width, [ x, y, color, /DATA, ANGLE= ,COLOR =, _EXTRA = ]
INPUTS:
WIDTH - either a scalar giving the width of a box, or a 2 element
vector giving the length and width of a rectangle.
OPTIONAL INPUTS:
X - x position for box center, scalar or vector
Y - y position for box center, scalar or vector. If vector, then Y
must have the same number of elements as X
Positions are specified in device coordinates unless /DATA is set
If X and Y are not specified, and device has a cursor, then
TVBOX will draw a box at current cursor position
COLOR - intensity value(s) (0 - !D.N_COLORS) used to draw the box(es)
If COLORS is a scalar then all boxes are drawn with the same
color value. Otherwise, the Nth box is drawn with the
Nth value of color. Default = !P.COLOR.
OUTPUTS:
None
OPTIONAL KEYWORD INPUTS:
ANGLE - numeric scalar specifying the clockwise rotation of
the boxes or rectangles.
COLOR - Scalar or vector, overrides the COLOR input parameter
/DATA - if this keyword is set and non-zero, then the box width and
X,Y position center are interpreted as being in DATA
coordinates. Note that data coordinates must be previously
defined (e.g. with a PLOT or CONTOUR call).
Any keyword recognized by PLOTS is also recognized by TVBOX.
In particular, the color, linestyle, thickness and clipping of the boxes
is controlled by the COLOR, LINESTYLE, THICK and NOCLIP keywords.
(Clipping is turned off by default, set NOCLIP=0 to activate it.)
CALLS: ***
ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
CALLED BY:
REMOVE_CR
SIDE EFFECTS:
A square or rectangle will be drawn on the device
For best results WIDTH should be odd when using the default DEVICE
coordinates. (If WIDTH is even, the actual size of the box will be
WIDTH + 1, so that box remains centered.)
EXAMPLES:
(1) Draw a double thick box of width 13, centered at 221,256 in the
currently active window
IDL> tvbox, 13, 221, 256, thick=2
(2) Overlay a "slit" with dimension 52" x 2" on a previously displayed
image at a position angle (East of North) of 32 degrees. The
slit is to be centered at XC, YC and the plate scale
arcsec_per_pixel is known.
IDL> w = [2.,52.]/arcsec_per_pixel ;Convert slit size to pixel units
IDL> tvbox,w,XC,YC,ang=-32 ;Draw slit
RESTRICTIONS:
Allows use of only device (default) or data (if /DATA is set)
coordinates. Normalized coordinates are not allowed
PROCEDURES USED:
ZPARCHECK
REVISON HISTORY:
Written, W. Landsman STX Co. 10-6-87
Modified to take vector arguments. Greg Hennessy Mar 1991
Fixed centering of odd width W. Landsman Sep. 1991
Let the user specify COLOR=0, accept vector color, W. Landsman Nov. 1995
Fixed typo in _EXTRA keyword W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
Added ANGLE keyword W.Landsman February 2000
Make sure ANGLE is a scalar W. Landsman September 2001
Don't round coordinates if /DATA is set. M. Perrin August 2005
Use STRICT_EXTRA to flag valid keywords W. Landsman Sep 2005
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVBOXCRS
Purpose :
Interactively select a box on displayed images.
Explanation :
SELECT_BOX is called to select a box on a displayed image.
Use :
TVBOXCRS, [ X1, X2, Y1, Y2 [, PRINT_SWITCH ]] [, IMAGE, MX, MY, IX, IY ]
Inputs :
None required.
Opt. Inputs :
PRINT_SWITCH = Switch used to control printing the values of
X1,X2,Y1,Y2 to the screen. If not passed, then
assumed 0 (no printing) unless X1,X2 and Y1,Y2 are
not passed, in which case 1 (printing) is assumed.
IMAGE = The image to find positions on.
MX, MY = Size of displayed image.
IX, IY = Position of the lower left-hand corner of the image.
If the last five optional parameters are not passed, then they are
retrieved with GET_TV_SCALE. It is anticipated that these optional
parameters will only be used in extremely rare circumstances.
Outputs :
None required. IF the output parameters are not passed, then their
values are printed to the screen.
Opt. Outputs:
X1,X2,Y1,Y2 = The X,Y positions of the corners of the selected box.
Keywords :
DISABLE = If set, then TVSELECT not used.
The following keywords are only relevant when used on a graphics device
that supports windows:
INIT = If this keyword is set, X1, X2, and Y1, Y2 contain the
initial parameters for the box.
FIXED_SIZE = If this keyword is set, X1, X2, and Y1, Y2 describe the
initial size of the box. This size may not be changed by
the user.
Calls : ***
GET_TV_SCALE, SELECT_BOX, TRIM, TVSELECT, TVUNSELECT
CALLED BY:
TVSUBIMAGE
Common :
None.
Restrictions:
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, Nov. 1992.
Written :
William Thompson, GSFC, November 1992.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 25 June 1993.
Added INIT and FIXED_SIZE keywords.
Version 3, William Thompson, GSFC, 17 January 1997
Renamed to TVBOXCRS to avoid conflict with Astron routine
called TVBOX.
Version :
Version 3, 17 January 1997
[Previous]
[Next]
NAME:
TVCIRCLE
PURPOSE:
Draw circle(s) of specified radius at specified position(s)
EXPLANATION:
If a position is not specified, and device has a cursor, then a circle
is drawn at the current cursor position.
CALLING SEQUENCE:
TVCIRCLE, rad, x, y, color, [ /DATA, /FILL, _EXTRA = ]
INPUTS:
RAD - radius of circle(s) to be drawn, positive numeric scalar
OPTIONAL INPUT:
X - x position for circle center, vector or scalar
Y - y position for circle center, vector or scalar
If X and Y are not specified, and the device has a cursor,
then program will draw a circle at the current cursor position
COLOR - intensity value(s) (0 - !D.N_COLORS) used to draw the circle(s)
If COLOR is a scalar then all circles are drawn with the same
color value. Otherwise, the Nth circle is drawn with the
Nth value of color. Default = !P.COLOR.
OPTONAL KEYWORD INPUTS:
/DATA - if this keyword is set and non-zero, then the circle width and
X,Y position center are interpreted as being in DATA
coordinates. Note that data coordinates must be previously
defined (with a PLOT or CONTOUR call). TVCIRCLE will
internally convert to device coordinates before drawing the
circle, in order to maintain optimal smoothness.
/FILL - If set, fill the circle using POLYFILL
Any keyword recognized by PLOTS (or POLYFILL if /FILL is set)
is also recognized by TVCIRCLE. In particular, the color,
linestyle, thickness and clipping of the circles are controlled
by the COLOR, LINESTYLE, THICK and NOCLIP keywords. (Clipping
is turned off by default, set NOCLIP=0 to activate it.)
If POLYFILL is set then available keywords are LINE_FILL and
FILL_PATTERN.
OUTPUTS:
None
CALLED BY:
ATV, COMBINE_IMG, COMBINE_MVI, CW_SELFIELD, FIND_CHORD_CTR, IMAGE_REGISTER
MAKE_DAILY_IMAGE, MKMOVIE, MKMOVIE0 obsolete version of mkmoviepro, MKMOVIEWLC
MK_IMG, NRH_DISPLAY_IM, NRH_DISP_GRIMAGE, NRH_IMAGE, OPTIC_CIRC, POINTING3, RTMOVIE
STARFIELD, WRUNMOVIE [2]
RESTRICTIONS:
(1) Some round-off error may occur when non-integral values are
supplied for both the radius and the center coordinates
(2) TVCIRCLE does not accept /NORMAL coordinates, only data coordinates
(if /DATA is set) or device coordinates (the default)
(3) TVCIRCLE always draws a circle --- even if /DATA is set, and the
X and Y data scales are unequal. (The X data scale is used to
define the circle radius.) If this is not the behaviour
you want, then use TVELLIPSE instead.
EXAMPLE:
(1) Draw circles of radius 9 pixels at the positions specified by
X,Y vectors, using double thickness lines
IDL> tvcircle, 9, x, y, THICK = 2
Now fill in the circles using the LINE_FILL method
IDL> tvcircle, 9, x, y, /FILL, /LINE_FILL
METHOD:
The method used is that of Michener's, modified to take into account
the fact that IDL plots arrays faster than single points. See
"Fundamental of Interactive Computer Graphics" by Foley and Van Dam"
p. 445 for the algorithm.
REVISON HISTORY:
Original version written by B. Pfarr STX 10-88
Major rewrite adapted from CIRCLE by Allyn Saroyan LNLL
Wayne Landsman STX Sep. 91
Added DATA keyword Wayne Landsman HSTX June 1993
Added FILL keyword. R. S. Hill, HSTX, 4-Nov-1993
Always convert to device coords, add _EXTRA keyword, allow vector
colors. Wayne Landsman, HSTX, May 1995
Allow one to set COLOR = 0, W. Landsman, HSTX, November 1995
Check if data axes reversed. P. Mangifico, W. Landsman May 1996
Use strict_extra to check input keywords W. Landsman July 2005
Update documentation to note NOCLIP=0 option W.L. Oct. 2006
Make all integers default to LONG W. Landsman Dec 2006
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVDEVICE
Purpose :
Defines the default image display device or window.
Explanation :
Defines a given device and/or window as the default for image display.
Once this routine is called, the routine TVSELECT selects the image
display device/window, and TVUNSELECT returns to the previous
device/window.
Use :
TVDEVICE, WINDOW
TVDEVICE, DEVICE [, WINDOW ]
Inputs :
DEVICE = Character string containing the name of device to be used for
displaying images.
WINDOW = Index of window (i.e. 0, 1, 2, ...) to be used for displaying
images. Must refer to an already existing window.
Opt. Inputs :
None.
Outputs :
None, but various parameters in common block TV_WINDOW are modified.
Opt. Outputs:
None.
Keywords :
ENABLE = If set, then selecting the image display device via TVSELECT
and TVUNSELECT in enabled (default).
DISABLE = If set, then selecting the image display device via TVSELECT
and TVUNSELECT is disabled. DISABLE takes precedence over
ENABLE keyword.
Calls :
None.
CALLED BY:
EIS_IMAGE_TOOL [1], EIS_IMAGE_TOOL [2], IMAGE_TOOL, TVSCREEN, XCOR_CDS
Common :
TV_DEVICE contains various parameters used to communicate with the
routines TVSELECT and TVUNSELECT.
Restrictions:
Only works if TVDEVICE, TVSELECT and TVUNSELECT are used exclusively to
change between the image display and graphics device/window. Only
existing windows can be used. Device name must be passed as a
character string, and window number must be passed as an integer.
If only the window number is passed, then TVSELECT will only select
this window if the current graphics device is a windowing device.
If something goes wrong, the easiest way to clear it is to SET_PLOT
and/or WSET to the desired graphics device/window, and then call
TVDEVICE again.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, Feb. 1991.
Written :
William Thompson, GSFC, February 1991.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version :
Version 1, 11 May 1993.
[Previous]
[Next]
NAME:
TVELLIPSE
PURPOSE:
Draw an ellipse on the current graphics device.
CALLING SEQUENCE:
TVELLIPSE, rmax, rmin, xc, yc, [ pos_ang, color, COLOR= ,/DATA, NPOINTS=
LINESTYLE=, THICK =
INPUTS:
RMAX,RMIN - Scalars giving the major and minor axis of the ellipse
OPTIONAL INPUTS:
XC,YC - Scalars giving the position on the TV of the ellipse center
If not supplied (or if XC, YC are negative and /DATA is not set),
and an interactive graphics device (e.g. not postscript) is set,
then the user will be prompted for X,Y
POS_ANG - Position angle of the major axis, measured counter-clockwise
from the X axis. Default is 0.
COLOR - Scalar giving intensity level to draw ellipse. The color
can be specified either with either this parameter or with the
COLOR keyword. Default is !P.COLOR
CALLED BY:
CW_SCANSOURCE
OPTIONAL KEYWORD INPUT:
COLOR - Intensity value used to draw the circle, overrides parameter
value. Default = !P.COLOR
/DATA - if this keyword is set and non-zero, then the ellipse radii and
X,Y position center are interpreted as being in DATA
coordinates. Note that the data coordinates must have been
previously defined (with a PLOT or CONTOUR call).
NPOINTS - Number of points to connect to draw ellipse, default = 120
Increase this value to improve smoothness
Any keyword recognized by PLOTS is also recognized by TVELLIPSE.
In particular, the color, linestyle, thickness and clipping of
the ellipses are controlled by the COLOR, LINESTYLE, THICK and
NOCLIP keywords. (Clipping is turned off by default, set
NOCLIP=0 to activate it.)
RESTRICTIONS:
TVELLIPSE does not check whether the ellipse is within the boundaries
of the window.
The ellipse is evaluated at NPOINTS (default = 120) points and
connected by straight lines, rather than using the more sophisticated
algorithm used by TVCIRCLE
TVELLIPSE does not accept normalized coordinates.
TVELLIPSE is not vectorized; it only draws one ellipse at a time
EXAMPLE:
Draw an ellipse of major axis 50 pixels, minor axis 30 pixels, centered
on (250,100), with the major axis inclined 25 degrees counter-clockwise
from the X axis. Use a double thickness line and device coordinates
(default)
IDL> tvellipse,50,30,250,100,25,thick=2
NOTES:
Note that the position angle for TVELLIPSE (counter-clockwise from the
X axis) differs from the astronomical position angle (counter-clockwise
from the Y axis).
REVISION HISTORY:
Written W. Landsman STX July, 1989
Converted to use with a workstation. M. Greason, STX, June 1990
LINESTYLE keyword, evaluate at 120 points, W. Landsman HSTX Nov 1995
Added NPOINTS keyword, fixed /DATA keyword W. Landsman HSTX Jan 1996
Check for reversed /DATA coordinates P. Mangiafico, W.Landsman May 1996
Converted to IDL V5.0 W. Landsman September 1997
Work correctly when X & Y data scales are unequal December 1998
Removed cursor input when -ve coords are entered with /data
keyword set P. Maxted, Keele, 2002
Use _EXTRA keywords including NOCLIP W. Landsman October 2006
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVERASE
Purpose :
Erases image display screen.
Explanation :
If TVDEVICE has been called then erases special image display device or
window. Otherwise erases current window.
Use :
TVERASE
Inputs :
None.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
DISABLE = If set, then TVSELECT not used. Mainly included for
routines (such as EXPTV) which call TVERASE.
Calls : ***
TVSELECT, TVUNSELECT
CALLED BY:
EXPTV, PLOT_MONEXP_STD, WRITE_LAST_IMG [1], WRITE_LAST_IMG [2]
WRITE_SUMMARIES [1], WRITE_SUMMARIES [2], ch_ss
Common :
None.
Restrictions:
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, Feb., 1990.
W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
Written :
William Thompson, GSFC, February 1990.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version :
Version 1, 11 May 1993.
[Previous]
[Next]
NAME:
TVIMAGE
PURPOSE:
This purpose of TVIMAGE is to enable the TV command in IDL
to be a completely device-independent and color-decomposition-
state independent command. On 24-bit displays color decomposition
is always turned off for 8-bit images and on for 24-bit images.
The color decomposition state is restored for those versions of
IDL that support it (> 5.2). Moreover, TVIMAGE adds features
that TV lacks. For example, images can be positioned in windows
using the POSITION keyword like other IDL graphics commands.
TVIMAGE also supports the !P.MULTI system variable, unlike the
TV command. TVIMAGE was written to work especially well in
resizeable graphics windows. Note that if you wish to preserve
the aspect ratio of images in resizeable windows, you should set
the KEEP_ASPECT_RATIO keyword, described below. TVIMAGE works
equally well on the display, in the PostScript device, and in
the Printer and Z-Graphics Buffer devices. The TRUE keyword is
set automatically to the correct value for 24-bit images, so you
don't need to specify it when using TVIMAGE.
AUTHOR:
FANNING SOFTWARE CONSULTING:
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
CATEGORY:
Graphics display.
CALLING SEQUENCE:
TVIMAGE, image
INPUTS:
image: A 2D or 3D image array. It should be byte data.
x : The X position of the lower-left corner of the image.
This parameter is only recognized if the TV keyword is set.
If the Y position is not used, X is taken to be the image
"position" in the window. See the TV command documenation
for details.
y : The Y position of the lower-left corner of the image.
This parameter is only recognized if the TV keyword is set.
KEYWORD PARAMETERS:
BACKGROUND: This keyword specifies the background color. Note that
the keyword ONLY has effect if the ERASE keyword is also
set or !P.MULTI is set to multiple plots and TVIMAGE is
used to place the *first* plot.
ERASE: If this keyword is set an ERASE command is issued
before the image is displayed. Note that the ERASE
command puts the image on a new page in PostScript
output.
_EXTRA: This keyword picks up any TV keywords you wish to use.
HALF_HALF: If set, will tell CONGRID to extrapolate a *half* row
and column on either side, rather than the default of
one full row/column at the ends of the array. If you
are interpolating images with few rows, then the
output will be more consistent with this technique.
This keyword is intended as a replacement for
MINUS_ONE, and both keywords probably should not be
used in the same call to CONGRID.
KEEP_ASPECT_RATIO: Normally, the image will be resized to fit the
specified position in the window. If you prefer, you can
force the image to maintain its aspect ratio in the window
(although not its natural size) by setting this keyword.
The image width is fitted first. If, after setting the
image width, the image height is too big for the window,
then the image height is fitted into the window. The
appropriate values of the POSITION keyword are honored
during this fitting process. Once a fit is made, the
POSITION coordiates are re-calculated to center the image
in the window. You can recover these new position coordinates
as the output from the POSITION keyword.
MARGIN: A single value, expressed as a normalized coordinate, that
can easily be used to calculate a position in the window.
The margin is used to calculate a POSITION that gives
the image an equal margin around the edge of the window.
The margin must be a number in the range 0.0 to 0.333. This
keyword is ignored if the POSITION or OVERPLOT keywords are
used. It is also ignormed when TVImage is executed in a
multi-plot window, EXCEPT if it's value is zero. In this
special case, the image will be drawn into its position in
the multi-plot window with no margins whatsoever. (The
default is to have a slight margin about the image to separate
it from other images or graphics.
MINUS_ONE: The value of this keyword is passed along to the CONGRID
command. It prevents CONGRID from adding an extra row and
column to the resulting array, which can be a problem with
small image arrays.
NOINTERPOLATION: Setting this keyword disables the default bilinear
interpolation done to the image when it is resized. Nearest
neighbor interpolation is done instead. This is preferred
when you do not wish to change the pixel values of the image.
This keyword must be set, for example, when you are displaying
GIF files that come with their own non-IDL color table vectors.
NORMAL: Setting this keyword means image position coordinates x and y
are interpreted as being in normalized coordinates. This keyword
is only valid if the TV keyword is set.
OVERPLOT: Setting this keyword causes the POSITION keyword to be ignored
and the image is positioned in the location established by the
last graphics command. For example:
Plot, Findgen(11), Position=[0.1, 0.3, 0.8, 0.95]
TVImage, image, /Overplot
POSITION: The location of the image in the output window. This is
a four-element floating array of normalized coordinates of
the type given by !P.POSITION or the POSITION keyword to
other IDL graphics commands. The form is [x0, y0, x1, y1].
The default is [0.0, 0.0, 1.0, 1.0]. Note that this can
be an output parameter if the KEEP_ASPECT_RATIO keyword is
used.
TV: Setting this keyword makes the TVIMAGE command work much
like the TV command, although better. That is to say, it
will still set the correct DECOMPOSED state depending upon
the kind of image to be displayed (8-bit or 24-bit). It will
also allow the image to be "positioned" in the window by
specifying the coordinates of the lower-left corner of the
image. The NORMAL keyword is activated when the TV keyword
is set, which will indicate that the position coordinates
are given in normalized coordinates rather than device
coordinates.
Setting this keyword will ensure that the keywords
KEEP_ASPECT_RATIO, MARGIN, MINUS_ONE, MULTI, and POSITION
are ignored.
OUTPUTS:
None.
CALLS: ***
CMCONGRID, LOADCT, TVIMAGE_ERROR, strsplit
CALLED BY:
CIndex, XMAP [1], XMAP [2], XZOOM, xwhisker [1], xwhisker [2]
SIDE EFFECTS:
Unless the KEEP_ASPECT_RATIO keyword is set, the displayed image
may not have the same aspect ratio as the input data set.
RESTRICTIONS:
If the POSITION keyword and the KEEP_ASPECT_RATIO keyword are
used together, there is an excellent chance the POSITION
parameters will change. If the POSITION is passed in as a
variable, the new positions will be returned in the same variable
as an output parameter.
If a 24-bit image is displayed on an 8-bit display, the
24-bit image must be converted to an 8-bit image and the
appropriate color table vectors. This is done with the COLOR_QUAN
function. The TVIMAGE command will load the color table vectors
and set the NOINTERPOLATION keyword if this is done. Note that the
resulting color table vectors are normally incompatible with other
IDL-supplied color tables. Hence, other graphics windows open at
the time the image is display are likely to look strange.
EXAMPLE:
To display an image with a contour plot on top of it, type:
filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat')
image = BYTARR(360,360)
OPENR, lun, filename, /GET_LUN
READU, lun, image
FREE_LUN, lun
TVIMAGE, image, POSITION=thisPosition, /KEEP_ASPECT_RATIO
CONTOUR, image, POSITION=thisPosition, /NOERASE, XSTYLE=1, $
YSTYLE=1, XRANGE=[0,360], YRANGE=[0,360], NLEVELS=10
To display four images in a window without spacing between them:
!P.Multi=[0,2,2]
TVImage, image, Margin=0
TVImage, image, Margin=0
TVImage, image, Margin=0
TVImage, image, Margin=0
!P.Multi = 0
MODIFICATION HISTORY:
Written by: David Fanning, 20 NOV 1996.
Fixed a small bug with the resizing of the image. 17 Feb 1997. DWF.
Removed BOTTOM and NCOLORS keywords. This reflects my growing belief
that this program should act more like TV and less like a "color
aware" application. I leave "color awareness" to the program
using TVIMAGE. Added 24-bit image capability. 15 April 1997. DWF.
Fixed a small bug that prevented this program from working in the
Z-buffer. 17 April 1997. DWF.
Fixed a subtle bug that caused me to think I was going crazy!
Lession learned: Be sure you know the *current* graphics
window! 17 April 1997. DWF.
Added support for the PRINTER device. 25 June 1997. DWF.
Extensive modifications. 27 Oct 1997. DWF
1) Removed PRINTER support, which didn't work as expected.
2) Modified Keep_Aspect_Ratio code to work with POSITION keyword.
3) Added check for window-able devices (!D.Flags AND 256).
4) Modified PostScript color handling.
Craig Markwart points out that Congrid adds an extra row and column
onto an array. When viewing small images (e.g., 20x20) this can be
a problem. Added a Minus_One keyword whose value can be passed
along to the Congrid keyword of the same name. 28 Oct 1997. DWF
Changed default POSITION to fill entire window. 30 July 1998. DWF.
Made sure color decomposition is OFF for 2D images. 6 Aug 1998. DWF.
Added limited PRINTER portrait mode support. The correct aspect ratio
of the image is always maintained when outputting to the
PRINTER device and POSITION coordinates are ignored. 6 Aug 1998. DWF
Removed 6 August 98 fixes (Device, Decomposed=0) after realizing that
they interfere with operation in the Z-graphics buffer. 9 Oct 1998. DWF
Added a MARGIN keyword. 18 Oct 1998. DWF.
Re-established Device, Decomposed=0 keyword for devices that
support it. 18 Oct 1998. DWF.
Added support for the !P.Multi system variable. 3 March 99. DWF
Added DEVICE, DECOMPOSED=1 command for all 24-bit images. 2 April 99. DWF.
Added ability to preserve DECOMPOSED state for IDL 5.2 and higher. 4 April 99. DWF.
Added TV keyword to allow TVIMAGE to work like the TV command. 11 May 99. DWF.
Added the OVERPLOT keyword to allow plotting on POSITION coordinates
estabished by the preceding graphics command. 11 Oct 99. DWF.
Added automatic recognition of !P.Multi. Setting MULTI keyword is no
longer required. 18 Nov 99. DWF.
Added NOINTERPOLATION keyword so that nearest neighbor interpolation
is performed rather than bilinear. 3 Dec 99. DWF
Changed ON_ERROR condition from 1 to 2. 19 Dec 99. DWF.
Added Craig Markwardt's CMCongrid program and removed RSI's. 24 Feb 2000. DWF.
Added HALF_HALF keyword to support CMCONGRID. 24 Feb 2000. DWF.
Fixed a small problem with image start position by adding ROUND function. 19 March 2000. DWF.
Updated the PRINTER device code to take advantage of available keywords. 2 April 2000. DWF.
Reorganized the code to handle 24-bit images on 8-bit displays better. 2 April 2000. DWF.
Added BACKGROUND keyword. 20 April 2000. DWF.
Fixed a small problem in where the ERASE was occuring. 6 May 2000. DWF.
Rearranged the PLOT part of code to occur before decomposition state
is changed to fix Background color bug in multiple plots. 23 Sept 2000. DWF.
Removed MULTI keyword, which is no longer needed. 23 Sept 2000. DWF.
Fixed a small problem with handling images that are slices from 3D image cubes. 5 Oct 2000. DWF.
Added fix for brain-dead Macs from Ben Tupper that restores Macs ability to
display images. 8 June 2001. DWF.
Fixed small problem with multiple plots and map projections. 29 June 2003. DWF.
Converted all array subscripts to square brackets. 29 June 2003. DWF.
Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF.
Small modification at suggestion of Karsten Rodenacker to increase size of
images in !P.MULTI mode. 8 December 2004. DWF.
Minor modifications on Karsten Rodenacker's own account concerning margination
and TV behaviour. 8 December 2004. KaRo
[Previous]
[Next]
NAME:
TVLASER
PURPOSE:
Prints screen or image array onto a Postscript file or printer.
Information from FITS header is optionally used for labeling.
CALLING SEQUENCE:
TVLASER, [header, Image, BARPOS = ,CARROWS =, CLABELS = ,/COLORPS,
COMMENTS = ,CSIZE = ,CTITLE = , DX = , DY =, /ENCAP, FILENAME =
HEADER = ,/HELP, IMAGEOUT = ,/INTERP, /MAGNIFY, /NoCLOSE,
/NoDELETE, /NO_PERS_INFO, /NoEIGHT, /NoPRINT, /NoRETAIN,
/PORTRAIT, PRINTER = , /REVERSE, /SCALE, TITLE = , /TrueColor,
XDIM=, XSTART=, YDIM=, YSTART=, BOTTOMDW=, NCOLORSDW= ]
Note that the calling sequence was changed in May 1997
OPTIONAL INPUTS:
HEADER - FITS header string array. Object and astrometric info from
the FITS header will be used for labeling, if available
IMAGE - if an array is passed through this parameter, then this image
will be used rather than reading off the current window. This
allows easy use of large images. It is usually preferable
to optimally byte scale IMAGE before supplying it to TVLASER
OPTIONAL KEYWORD INPUT PARAMETERS:
BARPOS - A four- or five-element vector giving the position and
orientation of the color bar. The first four elements
[X0,Y0,XSize,YSize] indicate the position and size of the color
bar in INCHES, relative to origin of the displayed image.
(X0,Y0) are the position of the lower left corner and
(XSize,YSize) are the width and height. The fifth element is
optional, and if present, the color bar will be printed
horizontally rather than vertically. If BARPOS is set to
anything but a four- or five-element vector, the bar is NOT
printed. The default value is BARPOS = [-0.25, 0.0, 0.2, 2.0]
BOTTOMDW - The lowest value to use in building the density
wedge. Used with NCOLORSDW. Compatible with BOTTOM and
NCOLORS keywords of XLOADCT.
CARROWS - The color to print the North-East arrows. Default is dark.
Three types of values can be passed:
SCALAR: that value's color in the current color table
3-ELEMENT VECTOR: the color will be [R,G,B]
STRING: A letter indicating the color. Valid names are:
'W' (white), 'D' (dark/black), 'R' (red), 'G' (green),
'B' (blue), 'T' (turquoise), 'V' (violet), 'Y' (yellow),
If the keyword is set to a value of -1, the arrows are
NOT printed.
COLORPS - If present and non-zero, the idl.ps file is written using
color postscript.
COMMENTS - A string that will be included in the comment line below the
image. For multi-line comments you can either use "!C" in the
string as a carriage return {although the vertical spacing
might be a little off} or, preferably, make the COMMENTS a
string array with each line as a separate element.
CLABELS - Color to print the labels, same format as for CARROWS.
CSIZE - Color to print the size-scale bar and label, same format as for
CARROWS.
CTITLE - Color to print the title, same format as for CARROWS.
DX,DY - offsets in INCHES added to the position of the figure on the
paper. As is the case for the device keywords XOFFSET and
YOFFSET, when in landscape mode DX and DY are the same
*relative to the paper*, not relative to the plot (e.g., DX is
the horizontal offset in portrait mode, but the *vertical*
offset in landscape mode).
ENCAP - If present and non-zero, the IDL.PS file is written in
encapsulated postscript for import into LaTeX documents
FILENAME - scalar string giving name of output postscript file.
Default is idl.ps. Automatically sets /NODELETE
HEADER = FITS header. This is an alternative to supplying the FITS
header in the first parameter.
HELP - print out the sytax for this procedure.
INTERP - If present and non-zero, current color table will be
interpolated to fill the full range of the PostScript color
table (256 colors). Otherwise, the current color table will be
directly copied. You probably will want to use this if you
are using IMAGE keyword and a shared color table.
MAGNIFY - The net magnification of the entire figure. At this point,
the figure is not automatically centered on the paper if the
value of MAGNIFY is not equal to 1, but the DX and DY keywords
can be used to shift location. For example, to fit a full plot
on the printable area (8.5x8.5 inches) of the Tek PhaserIISD
color printer use: MAGNIFY=0.8, DX=0.5, DY=0.5.;
NCOLORSDW - The number of values to include in the density
wedge. Used with BOTTOMDW. Compatible with
BOTTOM/NCOLORS keywords of XLOADCT.
NoCLOSE - If present and non-zero, then the postscript file is not
closed (or printed), the device is set to 'PS', and the data
coordinate system is set to match the image size. This allows the
user to add additional plotting commands before printing. For
example, to include a 15 pixel circle around a source at
coordinates (150,160), around an image, im, with FITS header
array, h
IDL> tvlaser,h,im,/NoClose ;Write image & annotation
IDL> tvcircle,15,150,160,/data ;Draw circle
IDL> device,/close ;Close postscript file & print
NoDELETE - If present and non-zero, the postscript file is kept AND is
also sent to the printer
NoEIGHT - if set then only four bits sent to printer (saves space)
NO_PERS_INFO - if present and non-zero, output notation will NOT
include date/user block of information.
NoPRINT - If present and non-zero, the output is sent to a file (default
name 'idl.ps'), which is NOT deleted and is NOT sent to the
printer.
NoRETAIN - In order to avoid possible problems when using TVRD with
an obscured window, TVLASER will first copy the current window
to a temporary RETAIN=2 window. Set /NORETAIN to skip this
step and improve performance
PORTRAIT - if present and non-zero, the printer results will be in
portrait format; otherwise, they will be in landscape format.
If labels are requested, image will be in portrait mode,
regardless
PRINTER - scalar string giving the OS command to send a the postscript
file to the printer. Under Unix, the default value of PRINTER
is 'lpr ' while for other OS it is 'print '
REVERSE - if present and non-zero, color table will be fliped, so black
and white are reversed.
SCALE - if present and non-zero, image will be bytscaled before being
sent to postscript file.
TITLE - if present and non-zero, the string entered here will be the
title of the picture. Default is the OBJECT field in the
header (if present).
TRUECOLOR - if present and non-zero, the postscript file is created
using the truecolor switch (i.e. true=3). The colorbar is
not displayed in this mode.
XDIM,YDIM - Number of pixels. Default is from !d.x_size and !d.y_size,
or size of image if passed with IMAGE keyword.
XSTART,YSTART - lower left corner (default of (0,0))
OPTIONAL KEYWORD OUTPUT PARAMETER
IMAGEOUT = the image byte array actually sent to the postscript file.
CALLS: ***
ADSTRING, ARROWS, CONGRID [1], CONGRID [2], CONGRID [3], EXTAST, FDECOMP [1]
FDECOMP [2], FDECOMP [3], GETROT, PIXCOLOR, SXPAR [1], SXPAR [2], SXPAR [3], XYAD
ZOOM_XY, ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
CALLED BY:
XTV
SIDE EFFECTS:
A postscript file is created in the current directory. User must have
write privileges in the current directory. The file is named idl.ps
unless the FILENAME keyword is given. The file is directed to the
printer unless the /ENCAP, /NoCLOSE, or /NOPRINT keywords are given.
After printing, the file is deleted unless the /NODELETE or FILENAME
keywords are given.
PROCEDURE:
Read display or take IMAGE and then redisplay into a postscript file.
If a header exists, printout header information. If header has
astrometry, then print out orientation and scale information.
PROCEDURES USED:
ARROWS, EXTAST, FDECOMP, GETROT, PIXCOLOR, SXPAR(), XYAD, ZPARCHECK
*EXAMPLE:
1) Send a true color image (xsize,ysize,3) to a printer (i.e. print23l),
tvlaser,huv,cpic,/colorps,/truecolor,printer="print23l"
% TVLASER: Now printing image: $print23l idl.ps
MODIFICATION HISTORY:
Major rewrite from UIT version W. Landsman Dec 94
Massive rewrite. Added North-East arrows, pixel scale bar, color bar,
and keywords DX, DY, MAGNIFY, INTERP, HELP, and COMMENTS.
Created ablility to define colors for annotation and
text. Repositioned text labels. J.Wm.Parker, HITC, 5/95
Make Header and Image parameters instead of keywords. Add PRINTER
keyword. Include alternate FITS keywords. W. Landsman May 97
Copy to a RETAIN=2 window, work without FITS header W. Landsman June 97
Cleaner output when no astrometry in header W. Landsman June 97
Added /INFO to final MESSAGE W. Landsman July 1997
12/4/97 jkf/acc - added TrueColor optional keyword.
Added /NoClose keyword, trim Equinox format W. Landsman 9-Jul-1998
Don't display coordinate labels if no astrometry, more flexible
formatting of exposure time W. Landsman 30-Aug-1998
BottomDW and NColorsDW added. R. S. Hill, 1-Mar-1999
Apply func tab to color bar if not colorps. RSH, 21 Mar 2000
Fix problem with /NOCLOSE and unequal X,Y sizes W. Landsman Feb 2001
Use TVRD(True=3) if /TRUECOLOR set W. Landsman November 2001
[Previous]
[Next]
NAME:
TVLIST
PURPOSE:
Cursor controlled listing of image pixel values in a window.
CALLING SEQUENCE:
TVLIST, [image, dx, dy, TEXTOUT=, OFFSET= , ZOOM= ]
OPTIONAL INPUTS:
IMAGE - Array containing the image currently displayed on the TV.
If omitted, the byte pixel intensities are read from the TV
If the array does not start at position (0,0) on the window then
the OFFSET keyword should be supplied.
DX -Integer scalar giving the number of pixels in the X direction
to be displayed. If omitted then DX = 18 for byte images, and
DX = 14 for integer images. TVLIST will display REAL data
with more significant figures if more room is availble to
print.
DY - Same as DX, but in Y direction. If omitted, then DY = DX
OPTIONAL INPUT KEYWORDS:
OFFSET - 2 element vector giving the location of the image pixel (0,0)
on the window display. OFFSET can be positive (e.g if the
image is centered in a larger window) or negative (e.g. if the
only the central region of an image much larger than the window
is being displayed.
Default value is [0,0], or no offset.
ZOOM - Scalar specifying the magnification of the window with respect
to the image variable. Use, for example, if image has been
REBINed before display.
TEXTOUT - Optional keyword that determines output device.
The following dev/file is opened for output.
textout=1 TERMINAL using /more option (default)
textout=2 TERMINAL without /more option
textout=3 <program>.prt
textout=4 laser.tmp
textout=5 user must open file
textout=7 Append to an existing <program>.prt file if it
exists
textout = filename (default extension of .prt)
If TEXTOUT > 3 or set to a filename, then TVLIST will prompt for a
brief description to be included in the output file
OUTPUTS:
None.
PROCEDURE:
Program prompts user to place cursor on region of interest in
image display. Corresponding region of image is then displayed at
the terminal. A compression factor between the image array and the
displayed image is determined using the ratio of image sizes. If
necessary, TVLIST will divide all pixel values in a REAL*4 image by a
(displayed) factor of 10^n (n=1,2,3...) to make a pretty format.
SYSTEM VARIABLE:
The nonstandard system variable !TEXTOUT is used as an alternative to
the keyword TEXTOUT. The procedure ASTROLIB can be used to define
!TEXTOUT (and !TEXTUNIT) if necessary.
CALLS: ***
IMLIST, UNZOOM_XY
RESTRICTIONS:
TVLIST may not be able to correctly format all pixel values if the
dynamic range near the cursor position is very large.
Probably does not work under Mac IDL which does not allow the cursor
to be positioned with TVCRS
PROCEDURES CALLED:
IMLIST, UNZOOM_XY
REVISION HISTORY:
Written by rhc, SASC Tech, 3/14/86.
Added textout keyword option, J. Isensee, July, 1990
Check for readable pixels W. Landsman May 1992
Use integer format statement from F_FORMAT W. Landsman Feb 1994
Added OFFSET, ZOOM keywords W. Landsman Mar 1996
More intelligent formatting of longword, call TEXTOPEN with /STDOUT
W. Landsman April, 1996
Added check for valid dx value W. Landsman Mar 1997
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite to call IMLIST, recognize new integer data types
W. Landsman Jan 2000
Remove all calls to !TEXTUNIT W. Landsman Sep 2000
Always call UNZOOM_XY for MOUSSE compatibility W. Landsman Sep. 2004
[Previous]
[Next]
Name:
tvmulti
Purpose:
display multiple images in a single window or postscript page
with each images having a separate color table
Input Parameters:
image - 3 dimensional array (m,n,num_images)
ctables - array of color tables, can be absolute numbers or EIT
specific wavelengths
Output Parameters:
Keyword Parameters:
log - set if want alog10 scaling of image
post - set if want postscript output
row - set if want a single row of output (default is to let
routine determine image positions)
file - set for output PS file name
landscape - set for landscape PS plots
labels - array of labels corresponding to each image
below - set of want labels below image (default is above)
charsize - label character size
charthick - label character thickness
odd - set if want last row centered as opposed to default
title - set to figure title
tpos - set for position of title
tex - set for encapsulated postscript output
Calling Sequence:
tvmulti,image,ctable,[/post],[/below],[/landscape],[/row],$
[file=file],[labels=labels],[charsize=charsize],$
[charthick=charthick],[log=log],[odd=odd], [title=title]
[tpos=tpos], [tex=tex]
Method:
If postscript output - load appropriate color table, call
put to display image. If X output, break up color table into
num_images sections and load color table into each section,
then call put to display images
CALLS: ***
FILEPATH, LABEL_IMAGE, LOADCT, PS [1], PS [2], PSCLOSE [1], PSCLOSE [2], PUT, UNIQ [1]
UNIQ [2], UNIQ [3], is_member [1], is_member [2]
History:
1997 Feb 24 - J. Newmark
2000 Jul 07 - J. Newmark add TEX keyword for encapsulated PS output.
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVOUT
Purpose :
Outputs text onto images.
Explanation :
The routine XYOUTS is used to display the string at the device position
corresponding to the specified image pixel position.
Use :
TVOUT, XPOS, YPOS, STRING [, ARRAY, MX, MY, IX, IY ]
Inputs :
XPOS = X position of the string in pixels.
YPOS = Y position of the string in pixels.
STRING = Character string to be output to image.
Opt. Inputs :
ARRAY = Image array.
MX, MY = Size of displayed image.
IX, IY = Position of displayed image.
If the optional parameters are not passed, then they are retrieved with
GET_TV_SCALE. It is anticipated that these optional parameters will
only be used in extremely rare circumstances.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
ALIGNMENT= Alignment of the string as described in the IDL manual.
CHARSIZE = Character size to use in displaying strings. Normally 1.
COLOR = Color to display text in.
DISABLE = If set, then TVSELECT not used.
ORIENTATION = Text orientation in degrees.
And other keywords supported by XYOUTS
Calls : ***
GET_TV_SCALE, TVSELECT, TVUNSELECT
Common :
None.
Restrictions:
There must be enough space to display the string.
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, April 1991.
William Thompson, May 1992, modified to use GET_TV_SCALE.
William Thompson, Nov 1992, modified algorithm for getting the relative
character size.
Written :
William Thompson, GSFC, April 1991.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 29 October 1993.
Fixed bug with checking number of parameters.
Version 3, William Thompson, GSFC, 10 December 1999
Use _EXTRA to pass keywords to XYOUTS
Version :
Version 3, 10 December 1999
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVPLT
Purpose :
Plots points on displayed images.
Explanation :
The values MX, MY and IX, IY are used to convert the data coordinates
XVAL, YVAL to screen coordinates. Then OPLOT is used to plot the
points.
Use :
TVPLT, XVAL, YVAL [, IMAGE, MX, MY, IX, IY ]
Inputs :
XVAL,YVAL = The X,Y positions of the points to plot.
Opt. Inputs :
IMAGE = The image to plot over.
MX, MY = Size of displayed image.
IX, IY = Position of the lower left-hand corner of the image.
If the optional parameters are not passed, then they are retrieved with
GET_TV_SCALE. It is anticipated that these optional parameters will
only be used in extremely rare circumstances.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
DISABLE = If set, then TVSELECT not used.
Also, any plotting keyword, such as PSYM, COLOR, etc., can be used.
Calls :
GET_TV_SCALE, TVSELECT, TVUNSELECT
Common :
None.
Restrictions:
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Oct. 1987.
W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
William Thompson, May 1992, modified to use GET_TV_SCALE.
William Thompson, Oct 1992, added THICK keyword.
Written :
William Thompson, GSFC, October 1987.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, 08-Dec-2000, William Thompson, GSFC
Replace plotting keywords with _EXTRA mechanism.
Version :
Version 2, 08-Dec-2000
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVPOINTS
Purpose :
Selects a series of points from a displayed image.
Explanation :
Uses the cursor to select a series of points from a displayed image.
Called by such routines as TVPROF, POLY_VAL, etc. The TV cursor is
activated, and the user is prompted to enter in a series of points.
Use :
TVPOINTS, XVAL, YVAL, MX, MY, IX, IY
Inputs :
MX, MY = Size of displayed image.
SX, SY = Actual size of image.
IX, IY = Position of the lower left-hand corner of the image.
Opt. Inputs :
CLOSE_FLAG = If present, then last point is connected to first to form
a polygon.
Outputs :
XVAL,YVAL = The X,Y positions of the selected path.
Opt. Outputs:
None.
Keywords :
DISABLE = If set, then TVSELECT not used.
Calls : ***
ASK, TVSELECT, TVUNSELECT
CALLED BY:
POLY_VAL, TVPROF
Common :
None.
Restrictions:
Since this routine works interactively with the cursor, the image
should be displayed on the TV screen.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
The selected path is drawn on the image display screen.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Oct. 1987.
W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
Written :
William Thompson, GSFC, October 1987.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 30 November 1993.
Added waits between calls to CURSOR to avoid spurious points.
Version 3, William Thompson, GSFC, 14 April 2005
Fixed bug where pixel size computed with integer arithmetic
Version :
Version 3, 14 April 2005
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVPOS
Purpose :
Returns cursor positions on displayed images.
Explanation :
The values MX, MY and IX, IY are used to convert screen coordinates to
data coordinates.
Use :
TVPOS, [ XVAL, YVAL [, PRINT_SWITCH ]] [, IMAGE [, MX, MY, IX, IY ]]
TVPOS ;Prints position to screen
TVPOS, X, Y ;Save positions in arrays
TVPOS, X, Y, 1 ;Both saves and prints
TVPOS, IMAGE, /ZOOM ;Get position from zoomed image.
TVPOS, X, Y, IMAGE, /ZOOM ;These three are variations on the
TVPOS, X, Y, 1, IMAGE, /ZOOM ; three examples shown above.
Inputs :
None required.
Opt. Inputs :
PRINT_SWITCH = Switch used to control printing the values of
XVAL, YVAL to the screen. If not passed,
then assumed 0 (no printing) unless XVAL and YVAL are
not passed, in which case 1 (printing) is assumed.
IMAGE = The image to find positions on.
MX, MY = Size of displayed image.
IX, IY = Position of the lower left-hand corner of the image.
If the last five optional parameters are not passed, then they are
retrieved with GET_TV_SCALE. It is anticipated that these optional
parameters will only be used in extremely rare circumstances.
Outputs :
None required.
Opt. Outputs:
XVAL,YVAL = The X,Y positions of the selected points.
Keywords :
DISABLE = If set, then TVSELECT not used.
ZOOM = If set, then retrieve the position from a zoomed version of
the image. Can only be used if the IMAGE parameter was
passed.
WAIT = An integer that specifies the conditions under
which CURSOR returns. This parameter can be used
interchangeably with the keyword parameters listed
below that specify the type of wait. The default
value is 1. The table below describes each type of
wait
CALLED BY:
TVPROFILE, TVVALUE
NOTE: not all wait modes work with all display devices
Value Corresponding Keyword Action
------------------------------------------------
0 NOWAIT Return immediately
1 WAIT Return if button is down
2 CHANGE Return if a button is
pressed, released, or the
pointer is moved.
3 DOWN Return on button down
4 UP Return on button up
If the optional IMAGE parameter is passed, together with the ZOOM
keyword, then the following keyword parameters can be used to
adjust the scale of the temporary zoomed image:
NOSCALE = If set, then the image is not scaled.
MISSING = Value flagging missing pixels. These points are scaled to
zero.
MAX = The maximum value of IMAGE to be considered in scaling the
image, as used by BYTSCL. The default is the maximum value
of IMAGE.
MIN = The minimum value of IMAGE to be considered in scaling the
image, as used by BYTSCL. The default is the minimum value
of IMAGE.
TOP = The maximum value of the scaled image array, as used by
BYTSCL. The default is !D.N_COLORS-1.
BOTTOM = The minimum value of the scaled image array, as used by
BYTSCL. The default is 0.
VELOCITY = If set, then the image is scaled using FORM_VEL as a
velocity image. Can be used in conjunction with COMBINED
keyword. Ignored if NOSCALE is set.
COMBINED = Signals that the image is to be displayed in one of two
combined color tables. Can be used by itself, or in
conjunction with the VELOCITY or LOWER keywords.
LOWER = If set, then the image is placed in the lower part of the
color table, rather than the upper. Used in conjunction
with COMBINED keyword.
WIDGET = If set, WIDGET_EVENT(WIDGET) will be used to get
user input instead of the CURSOR procedure. Note that if
WAIT is set to 0, CURSOR is used after attempting
WIDGET_EVENT(WIDGET,/NOWAIT) if there is no pending event.
Note that the !ERR variable is set according to the
EVENT.PRESS tag, which means that !err doesn't represent
the *state* of the mouse buttons.
Calls : ***
GET_TV_SCALE, TRIM, TVSELECT, TVUNSELECT, TVZOOM
Common :
None.
Restrictions:
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
Using TVPOS with the /ZOOM keyword causes the WAIT keyword to be
ignored.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
Forces TVZOOM to use a new window for zoomed images.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Oct. 1987.
W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
William Thompson, May 1992, modified to use GET_TV_SCALE.
William Thompson, March 1993, added WAIT keyword.
Written :
William Thompson, GSFC, October 1987.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 20 May 1993.
Added ZOOM keyword.
Version 3, SVH Haugan, UiO, 22 May 1997
Added WIDGET keyword.
Version 4, William Thompson, GSFC, 3-Jan-2006
Added keyword BOTTOM
Version :
Version 4, 3-Jan-2006
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVPRINT
Purpose :
Sends the contents of a window to a PostScript printer.
Explanation :
Reads the contents of a graphics window and creates and prints a
PostScript file. The routine TVREAD is called to read the window. It
is (optionally) converted to a grey scale, and EXPTV is used to write
this to a PostScript file.
Use :
TVPRINT [, FILENAME ]
Inputs :
None required.
Opt. Inputs :
FILENAME = Name of the PostScript file that will be created and
printed (and saved). If not passed, then TEMPORARY.ps is
used (but not saved).
Outputs :
None.
Opt. Outputs:
None.
Keywords :
WINDOW = Which window to read from. If passed, then overrides the
TVSELECT routine.
DISABLE = If set, then the current graphics device/window is read.
Otherwise, TVSELECT is called to select the image display
device/window. Ignored if WINDOW keyword is passed.
PORTRAIT = If set, then plot done in portrait mode, using all of the
paper.
LANDSCAPE = If passed, then plot done in landscape mode, using all of
the paper. This is the default mode.
TEX = If set, then plot done in encapsulated landscape mode,
to be compatible with TeX. If this keyword is passed, then
an explicit filename must be passed. The file is not
printed.
COLOR = If set, then a color PostScript file is created. The
default is to convert to a greyscale image.
REVERSE = If set, then plot is done in inverse video. In other
words, white areas on the screen will appear dark, and visa
versa. Ignored if COLOR is set.
NOBOX = If set, then a box is not drawn around the printed image of
the X-window. The default is to draw a box.
TITLE = An optional text title to display with the image.
BELOW = If set, then the title is displayed below the image.
Normally, the title is displayed above the image.
LEFT = If set, then the title is displayed to the left of the
image. Overrides BELOW keyword.
RIGHT = If set, then the title is displayed to the right of the
image. Overrides BELOW and LEFT keywords.
CHARSIZE = Character size to use in displaying titles. Normally 1.
RELATIVE = Size of area to be used for displaying the image, relative
to the total size available. Must be between 0 and 1.
Default is 1. Can be used to allow enough space for the
optional title.
NOPRINT = If set, then the PostScript file is created, but not
printed. This requires that an explicit filename be
passed.
QUEUE = Print queue to send file to.
PCL = If set, then an HP LaserJet PCL file will be created
instead of a PostScript file. In this case, the default
file extension will be ".pcl" instead of ".ps". The TEX
and COLOR keywords will be ignored.
Calls : ***
EXPTV, FORM_FILENAME [1], FORM_FILENAME [2], LABEL_IMAGE, PCL [1], PCL [2]
PCLCLOSE [1], PCLCLOSE [2], PCLPLOT [1], PCLPLOT [2], PS [1], PS [2], PSCLOSE [1]
PSCLOSE [2], PSPLOT [1], PSPLOT [2], SETIMAGE, TVREAD [1], TVREAD [2], TVREAD [3]
Common :
None.
Restrictions:
Device must be capable of the TVRD function. Window must be completely
visible, with no portion off the end of the screen.
NOTE: This routine does not do a good job on line graphics. It works
best with images.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
A temporary file, "TEMPORARY.ps" will be created and deleted, unless an
explicit filename is passed.
The SETIMAGE routine is called to reset to the default. Any SETIMAGE
setting is lost.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, May 1992, from XPRINT.
William Thompson, June 1992, added color support.
William Thompson, December 1992, modified to use a better and faster
translation from colors to grey-scale, as suggested by Alan
Youngblood.
Written :
William Thompson, GSFC, May 1992
Modified :
Version 1, William Thompson, GSFC, 11 May 1993
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 24 August 1993
Added PCL keyword.
Version 3, William Thompson, GSFC, 30 June 1995
Added keywords TITLE, BELOW, LEFT, RIGHT, CHARSIZE
Utilize GREYSCALE and REVERSE keywords of TVREAD.
Version 4, William Thompson, GSFC, 16 May 2003
Add /PSEUDO to TVREAD() for TrueColor displays
Version :
Version 4, 16 May 2003
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVPROF
Purpose :
Uses the cursor to get a profile from a displayed image.
Explanation :
The TV cursor is activated, and the user is prompted to enter in a
series of points defining the path to take the profile along. This
procedure is completed by entering in the same point twice. Then
PROF is used to get the profile and positions XVAL, YVAL.
Use :
TVPROF, IMAGE, PROFILE, XVAL, YVAL [, MX, MY, IX, IY ]
Inputs :
IMAGE = The image to take the positions and values from.
Opt. Inputs :
MX, MY = Size of displayed image.
IX, IY = Position of the lower left-hand corner of the image.
If the optional parameters are not passed, then they are retrieved with
GET_TV_SCALE. It is anticipated that these optional parameters will
only be used in extremely rare circumstances.
Outputs :
PROFILE = The values of IMAGE along the path.
XVAL,YVAL = The X,Y positions of the selected path.
Opt. Outputs:
Keywords :
MISSING = Value representing missing points.
DISABLE = If set, then TVSELECT not used.
Calls : ***
GET_IM_KEYWORD, GET_TV_SCALE, PROF, TVPOINTS
Common :
None.
Restrictions:
Since this routine works interactively with the cursor, the image
must be displayed on the TV screen. It is best if the image is
displayed using EXPTV. But other methods of display are supported by
passing MX, MY, and IX, IY directly to the procedure.
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
The selected path is drawn on the image display screen.
Category :
Prev. Hist. :
W.T.T., Oct. 1987.
W.T.T., Jan. 1991, changed FLAG to keyword BADPIXEL.
William Thompson, May 1992, changed to call GET_TV_SCALE.
William Thompson, August 1992, renamed BADPIXEL to MISSING.
Written :
William Thompson, GSFC, October 1987.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version :
Version 1, 11 May 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVPROFILE
Purpose :
Interactively draw profile of an image in separate window.
Explanation :
Interactively draw row or column profiles of an image in a separate
window. A new window is created and the mouse location in the original
window is used to plot profiles in the new window. Pressing the left
mouse button toggles between row and column profiles. The right mouse
button exits.
Use :
TVPROFILE, Image
CALLED BY:
ITOOL_ZOOMMER
Example: Create and display an image and use the TVPROFILE routine on
it. Create and display the image by entering:
A = DIST(256)
EXPTV, A
Run the TVPROFILE routine by entering:
TVPROFILE, A
The TVPROFILE window should appear. Move the cursor over the original
image to see the profile at the cursor position. Press the left mouse
button to toggle between row and column profiles. Press the right
mouse button (with the cursor over the original image) to exit the
routine.
Inputs :
IMAGE = The variable that represents the image displayed. This data
need not be scaled into bytes. The profile graphs are made
from this array.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
WSIZE = The size of the TVPROFILE window as a fraction or multiple
of 640 by 512.
DISABLE = If set, then TVSELECT is not used.
NOWINDOW= If set, then the graph is made using the current graphics
device or window.
WIN_ID = ID of the graphic window in which the profile is
shown (unless NOWINDOW is set). If neither NOWINDOW
nor WIN_ID is set, the profile will be displayed in
a new window
QUIET = Set this keyword to suppress informative messages
WIDGET = If this keyword is not set and there are at least one
realized, managed widget on the screen, TVPROFILE will
try to find out (through FIND_DRAW_WIDGET) whether the
draw window is actually a widget.
If the draw window is actually a widget, WIDGET_EVENT()
WILL BE USED instead of the CURSOR procedure, UNLESS this
keyword is set to -1.
If WIDGET is set to -1, no search for a widget ID will be
performed.
If the widget ID of the draw window is known by the caller,
this keyword may be set to that ID to avoid searching for it.
Calls : ***
FIND_DRAW_WIDGET, GET_TV_SCALE, HAVE_WINDOWS [1], HAVE_WINDOWS [2]
SETWINDOW [1], SETWINDOW [2], TVPOS
Common :
None.
Restrictions:
The image must have been displayed with EXPTV or PUT.
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
Unless the keyword WIN_ID is set, a new window is created and
used for the profiles. When done, the new window is deleted.
If widgets are used, both DRAW_MOTION_EVENTS and DRAW_BUTTON_EVENTS
are set for the widget (they should be set already anyway..).
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, March 1993, from PROFILES by DMS, Nov, 1988.
Written :
William Thompson, GSFC, March 1993.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 1 September 1993.
Changed WSET to SETWINDOW in selected places.
Version 3, William Thompson, GSFC, 29 October 1993.
Added image value to display.
Version 4, November 15, 1995, Liyun Wang, GSFC/ARC
Added keywords WIN_ID and QUIET
Version 5, 22 May 1997, SVH Haugan, UiO
Added the use of WIDGETs.
Version 6, 03-Jun-2004, William Thompson
Allow the background color to be other than zero.
Version :
Version 6, 03-Jun-2004
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVREAD()
Purpose :
Reads contents of an image display screen into an array.
Explanation :
Reads the contents of an image display screen, or window, into an
array. Uses TVRD. Reads the entire window.
Use :
Result = TVREAD()
Result = TVREAD(RED,GREEN,BLUE)
Inputs :
None.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
RED, GREEN, BLUE = The active color tables in the selected
window/device.
Keywords :
WINDOW = Which window to read from. If passed, then overrides the
TVSELECT routine.
DISABLE = If set, then the current graphics device/window is read.
Otherwise, TVSELECT is called to select the image display
device/window. Ignored if WINDOW keyword is passed.
GREYSCALE = If set, then a greyscale approximation of the color image
is returned.
REVERSE = If set, then the image is returned in inverse video. Only
applicable if GREYSCALE is set.
TRUECOLOR = If set, then the result is returned as a TrueColor image
with dimensions (M,N,3). This is the default if the device
being read is a TrueColor device.
PSEUDOCOLOR = If set, then the routine COLOR_QUAN is called to convert
the image into an 8-bit image. Other keywords to
COLOR_QUAN can also be passed. Ignored if the image is
already 8-bit.
Calls : ***
BOOST_ARRAY [1], BOOST_ARRAY [2], BOOST_ARRAY [3], HAVE_WINDOWS [1]
HAVE_WINDOWS [2], TVSELECT, TVUNSELECT
CALLED BY:
CDS_THUMBNAIL, SNAP_MOVIE, TVPRINT, TVZOOM, TVZOOM2
Common :
None.
Restrictions:
Device must be capable of the TVRD function.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
None.
Prev. Hist. :
William Thompson, June 1991.
William Thompson, May 1992, added output parameters RED, GREEN, BLUE.
Written :
William Thompson, GSFC, June 1991
Modified :
Version 1, William Thompson, GSFC, 11 May 1993
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 30 June 1995
Added keywords GREYSCALE and REVERSE. The translation from
colors to greyscale is as suggested by Alan Youngblood of RSI.
Version 3, William Thompson, GSFC, 10 April 1997
Use pixmap to read even if window is obscured.
Version 4, William Thompson, GSFC, 16 April 2003
Added support for TrueColor displays.
Added keywords TRUECOLOR, PSEUDOCOLOR
Version 5, William Thompson, GSFC, 27 February 2006
Version :
Version 6, 27 Feb 2006
[Previous]
[Next]
NAME:
TVREAD
PURPOSE:
To get accurate screen dumps with the IDL command TVRD on 24-bit
PC and Macintosh computers, you have to be sure to set color
decomposition on. This program adds that capability automatically.
In addition, the program will optionally write BMP, GIF, JPEG,
PICT, PNG, and TIFF color image files of the screen dump.
AUTHOR:
FANNING SOFTWARE CONSULTING
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
CATEGORY:
Graphics
CALLING SEQUENCE:
image = TVREAD(xstart, ystart, ncols, nrows)
The returned image will be a 2D image on 8-bit systems and
a 24-bit pixel interleaved true-color image on 24-bit systems.
A -1 will be returned if a file output keyword is used (e.g., JPEG, TIFF, etc.).
OPTIONAL INPUTS:
XSTART -- The starting column index. By default, 0.
YSTART -- The starting row index. By default, 0.
NCOLS -- The number of columns to read. By default, !D.X_Size - XSTART
NROWS -- The number of rows to read. By default, !D.Y_Size - YSTART.
KEYWORD PARAMETERS:
BMP -- Set this keyword to write the screen dump as a color BMP file.
CANCEL -- An output keyword set to 1 if the user cancels out of a
filename dialog. Set to 0 otherwise.
COLORS -- If a 24-bit image has to be quantized, this will set the number
of colors in the output image. Set to 256 by default. Applies to BMP,
GIF, PICT, and PNG formats written from 24-bit displays.(See the
COLOR_QUAN documentation for details.)
CUBE -- If this keyword is set to a value between 2 and 6 the color
quantization will use a cubic method of quantization. Applies to BMP,
GIF, PICT, and PNG formats written from 24-bit displays.(See the
COLOR_QUAN documentation for details.)
DITHER -- If this keyword is set the quantized image will be dithered.
Applies to BMP, GIF, PICT, and PNG formats written from 24-bit displays.
(See the COLOR_QUAN documentation for details.)
FILENAME -- The base name of the output file. (No file extensions;
they will be added automatically.) This name may be changed by the user.
image = TVREAD(Filename='myfile', /JPEG)
No file will be written unless a file output keyword is used
(e.g., JPEG, TIFF, etc.) in the call. By default the FILENAME is
set to "idl". The file extension will be set automatically to match
the type of file created.
GIF -- Set this keyword to write the screen dump as a color GIF file.
JPEG -- Set this keyword to write the screen dump as a color JPEG file.
NODIALOG -- Set this keyword if you wish to avoid the DIALOG_PICKFILE
dialog that asks you to name the output file. This keyword should be
set, for example, if you are processing screens in batch mode.
ORDER -- Set this keyword to determine the image order for reading the
display. Corresponds to !Order and set to such as the default.
PICT -- Set this keyword to write the screen dump as a color PICT file.
PNG -- Set this keyword to write the screen dump as a color PNG file.
TIFF -- Set this keyword to write the screen dump as a color TIFF file.
TRUE -- Set this keyword to the type of interleaving you want. 1 = Pixel
interleaved, 2 = row interleaved, 3 = band interleaved.
QUALITY -- This keyword sets the amount of compression for JPEG images.
It should be set to a value between 0 and 100. It is set to 75 by default.
(See the WRITE_JPEG documentation for details.)
WID -- The index number of the window to read from. The current graphics window
(!D.Window) is selected by default. An error is issued if no windows are
currently open on a device that supports windows.
_EXTRA -- Any keywords that are appropriate for the WRITE_*** routines are
also accepted via keyword inheritance.
CALLS: ***
REVERSE, TVREAD2, TVREAD_ERROR_MESSAGE, WRITE_BMP, WRITE_GIF, WRITE_PICT, strsplit
CALLED BY:
CDS_THUMBNAIL, SNAP_MOVIE, TVPRINT, TVZOOM, TVZOOM2
COMMON BLOCKS:
None
RESTRICTIONS: Requires IDL 5.2 and higher.
MODIFICATION HISTORY:
Written by David W. Fanning, 9 AUG 2000.
Added changes to make the program more device independent. 16 SEP 2000. DWF.
Removed GIF file support for IDL 5.4 and above. 18 JAN 2001. DWF.
Added NODIALOG keyword. 28 MAR 2001. DWF.
Added an output CANCEL keyword. 29 AUG 2001. DWF.
Added ERROR_MESSAGE code to file. 17 DEC 2001. DWF.
Added ORDER keyword. 25 March 2002. DWF.
Now create 24-bit PNG files if reading from a 24-bit display. 11 May 2002. DWF.
Now create 24-bit BMP files if reading from a 24-bit display. 23 May 2002. DWF.
Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF.
Unleashed the GIF code for IDL 6.2 and above. 10 Nov 2005. DWF.
[Previous]
[Next]
NAME:
TVSCALE
PURPOSE:
This purpose of TVSCALE is to enable the TVSCL command in IDL
to be a completely device-independent and color-decomposition-
state independent command. On 24-bit displays color decomposition
is always turned off for 8-bit images and on for 24-bit images.
The color decomposition state is restored for those versions of
IDL that support it (> 5.2). Moreover, TVSCALE adds features
that TVSCL lacks. For example, images can be positioned in windows
using the POSITION keyword like other IDL graphics commands.
TVSCALE also supports the !P.MULTI system variable, unlike the
TVSCL command. TVSCALE was written to work especially well in
resizeable graphics windows. Note that if you wish to preserve
the aspect ratio of images in resizeable windows, you should set
the KEEP_ASPECT_RATIO keyword, described below. TVSCALE works
equally well on the display, in the PostScript device, and in
the Printer and Z-Graphics Buffer devices. The TRUE keyword is
set automatically to the correct value for 24-bit images, so you
don't need to specify it when using TVSCALE. In addition, you can
use the TOP and BOTTOM keywords to define a particular set of
number to scale the data to. The algorithm used is this:
TV. BytScl(image, TOP=top-bottom) + bottom
Note that if you scale the image between 100 and 200, that
there are 101 possible pixel values. So the proper way to
load colors would be like this:
LoadCT, NColors=101, Bottom=100
TVSCALE, image, Top=200, Bottom=100
Alternatively, you could use the NCOLORS keyword:
LoadCT, NColors=100, Bottom=100
TVSCALE, image, NColors=100, Bottom=100
AUTHOR:
FANNING SOFTWARE CONSULTING:
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
CATEGORY:
Graphics display.
CALLING SEQUENCE:
TVSCALE, image
INPUTS:
image: A 2D or 3D image array. It does not have to be byte data.
x : The X position of the lower-left corner of the image.
This parameter is only recognized if the TVSCL keyword is set.
y : The Y position of the lower-left corner of the image.
This parameter is only recognized if the TVSCL keyword is set.
KEYWORD PARAMETERS:
BACKGROUND: This keyword specifies the background color. Note that
the keyword ONLY has effect if the ERASE keyword is also
set or !P.MULTI is set to multiple plots and TVSCALE is
used to place the *first* plot.
BOTTOM: The image is scaled so that all displayed pixels have values
greater than or equal to BOTTOM and less than or equal to TOP.
The value of BOTTOM is 0 by default.
ERASE: If this keyword is set an ERASE command is issued
before the image is displayed. Note that the ERASE
command puts the image on a new page in PostScript
output.
_EXTRA: This keyword picks up any TV keywords you wish to use.
HALF_HALF: If set, will tell CONGRID to extrapolate a *half* row
and column on either side, rather than the default of
one full row/column at the ends of the array. If you
are interpolating images with few rows, then the
output will be more consistent with this technique.
This keyword is intended as a replacement for
MINUS_ONE, and both keywords probably should not be
used in the same call to CONGRID.
KEEP_ASPECT_RATIO: Normally, the image will be resized to fit the
specified position in the window. If you prefer, you can
force the image to maintain its aspect ratio in the window
(although not its natural size) by setting this keyword.
The image width is fitted first. If, after setting the
image width, the image height is too big for the window,
then the image height is fitted into the window. The
appropriate values of the POSITION keyword are honored
during this fitting process. Once a fit is made, the
POSITION coordiates are re-calculated to center the image
in the window. You can recover these new position coordinates
as the output from the POSITION keyword.
MARGIN: A single value, expressed as a normalized coordinate, that
can easily be used to calculate a position in the window.
The margin is used to calculate a POSITION that gives
the image an equal margin around the edge of the window.
The margin must be a number in the range 0.0 to 0.333. This
keyword is ignored if the POSITION keyword is used.
MAXVALUE: The data is linearly scaled between the MIN and MAX values,
if they are provided. MAX is set to MAX(image) by default.
MINVALUE: The data is linearly scaled between the MIN and MAX values,
if they are provided. MIN is set to MIN(image) by default.
MINUS_ONE: The value of this keyword is passed along to the CONGRID
command. It prevents CONGRID from adding an extra row and
column to the resulting array, which can be a problem with
small image arrays.
NCOLORS: If this keyword is supplied, the TOP keyword is ignored and
the TOP keyword is set equal to BOTTOM + NCOLORS - 1. This
keyword is provided to make TVSCALE easier to use with the
color-loading programs such as LOADCT:
LoadCT, 5, NColors=100, Bottom=100
TVScale, image, NColors=100, Bottom=100
NOINTERPOLATION: Setting this keyword disables the default bilinear
interpolation done to the image when it is resized. Nearest
neighbor interpolation is done instead. This is preferred
when you do not wish to change the pixel values of the image.
NORMAL: Setting this keyword means image position coordinates x and y
are interpreted as being in normalized coordinates. This keyword
is only valid if the TVSCL keyword is set.
OVERPLOT: Setting this keyword causes the POSITION keyword to be ignored
and the image is positioned in the location established by the
last graphics command. For example:
Plot, Findgen(11), Position=[0.1, 0.3, 0.8, 0.95]
TVScale, image, /Overplot
POSITION: The location of the image in the output window. This is
a four-element floating array of normalized coordinates of
the type given by !P.POSITION or the POSITION keyword to
other IDL graphics commands. The form is [x0, y0, x1, y1].
The default is [0.0, 0.0, 1.0, 1.0]. Note that this can
be an output parameter if the KEEP_ASPECT_RATIO keyword is
used.
TOP: The image is scaled so that all displayed pixels have values
greater than or equal to BOTTOM and less than or equal to TOP.
The value of TOP is !D.Table_Size by default.
TVSCL: Setting this keyword makes the TVIMAGE command work much
like the TVSCL command, although better. That is to say, it
will still set the correct DECOMPOSED state depending upon
the kind of image to be displayed (8-bit or 24-bit). It will
also allow the image to be "positioned" in the window by
specifying the coordinates of the lower-left corner of the
image. The NORMAL keyword is activated when the TV keyword
is set, which will indicate that the position coordinates
are given in normalized coordinates rather than device
coordinates.
Setting this keyword will ensure that the keywords
KEEP_ASPECT_RATIO, MARGIN, MINUS_ONE, MULTI, and POSITION
are ignored.
OUTPUTS:
None.
CALLS: ***
CMCONGRID, LOADCT, STR_SEP, TVSCALE_ERROR
SIDE EFFECTS:
Unless the KEEP_ASPECT_RATIO keyword is set, the displayed image
may not have the same aspect ratio as the input data set.
RESTRICTIONS:
If the POSITION keyword and the KEEP_ASPECT_RATIO keyword are
used together, there is an excellent chance the POSITION
parameters will change. If the POSITION is passed in as a
variable, the new positions will be returned as an output parameter.
If the image is 2D then color decomposition is turned OFF
for the current graphics device (i.e., DEVICE, DECOMPOSED=0).
If outputting to the PRINTER device, the aspect ratio of the image
is always maintained and the POSITION coordinates are ignored.
The image always printed in portrait mode.
EXAMPLE:
To display an image with a contour plot on top of it, type:
filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat')
image = BYTARR(360,360)
OPENR, lun, filename, /GET_LUN
READU, lun, image
FREE_LUN, lun
thisPosition = [0.1, 0.1, 0.9, 0.9]
TVSCALE, image, POSITION=thisPosition, /KEEP_ASPECT_RATIO
CONTOUR, image, POSITION=thisPosition, /NOERASE, XSTYLE=1, $
YSTYLE=1, XRANGE=[0,360], YRANGE=[0,360], NLEVELS=10
MODIFICATION HISTORY:
Written by: David Fanning, 27 May 1999 from TVIMAGE code.
Added MIN, MAX, and NCOLORS keywords 28 May 1999. DWF.
Added the OVERPLOT keyword to allow plotting on POSITION coordinates
estabished by the preceding graphics command. 11 Oct 99. DWF.
Added NOINTERPOLATION keyword so that nearest neighbor interpolation
is performed rather than bilinear. 3 Dec 99. DWF
Brought the TVSCALE code up to date with TVIMAGE code. 3 April 2000. DWF.
Brought the TVSCALE code up to date with TVIMAGE code. 6 May 2000. DWF.
Change MIN and MAX keywords to MINVALUE and MAXVALUE to prevent
ambiguous keyword errors. 27 July 2000. DWF.
Brought up to date with changes in TVImage. 23 Sept 2000. DWF.
Added fix for brain-dead Macs from Ben Tupper that restores Macs ability to display images. 8 June 2001. DWF.
Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF.
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVSCREEN
Purpose :
Create window 512 (or 256) pixels on a side for images.
Explanation :
WINDOW is called to open window #2 with XSIZE,YSIZE set to either 512
or 256 depending on the screen size. Then TVDEVICE is called to make
this the default for image display, and WSET is called to redirect
plots back into the previous window.
Use :
TVSCREEN
Inputs :
None.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
HAVE_WINDOWS [1], HAVE_WINDOWS [2], TVDEVICE
Common :
None.
Restrictions:
The current graphics device must support windows.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, Feb. 1990.
W.T.T., Feb. 1991., modified to use TVDEVICE.
W.T.T., Oct 1991, added test for X-display size.
William Thompson, December 1992, added support for DOS.
Written :
William Thompson, GSFC, February 1990.
Modified :
Version 1, William Thompson, GSFC, 11 May 1993.
Incorporated into CDS library.
Version :
Version 1, 11 May 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVSELECT
Purpose :
Select image display device/window defined by TVDEVICE.
Explanation :
Select the image display device and/or window as set by the routine
TVDEVICE. TVUNSELECT returns to the previous device/window.
If the TV device has already been selected, then no action is taken.
Use :
TVSELECT
Inputs :
None.
Opt. Inputs :
None.
Outputs :
None, but various parameters in common block TV_WINDOW are modified.
Opt. Outputs:
None.
Keywords :
DISABLE = If set, then no action is taken.
SAFE = If set, then SETPLOT is used instead of SET_PLOT, and
SETWINDOW instead of WSET. Generally used when called from
SETIMAGE.
Calls : ***
HAVE_WINDOWS [1], HAVE_WINDOWS [2], SETPLOT [1], SETPLOT [2], SETWINDOW [1]
SETWINDOW [2]
CALLED BY:
ADJUST_COLOR, BLINK_IMAGES, COLOR_BAR, COMBINE_COLORS, COMBINE_VEL, CONTV, EXPAND_TV
GET_TV_SCALE, INT_STRETCH, LABEL_IMAGE, LINECOLOR, LOADCT, LOAD_VEL, PUT, SCALE_TV
SETIMAGE, SHOW_COLORS, STORE_TV_SCALE, TVAXIS, TVBOXCRS, TVERASE, TVOUT, TVPLT, TVPOINTS
TVPOS, TVREAD [1], TVVALUE, TVZOOM, TVZOOM2, VEL_STRETCH
Common :
TV_DEVICE contains various parameters used to communicate with the
routines TVDEVICE and TVUNSELECT.
Restrictions:
Only works if TVDEVICE, TVSELECT and TVUNSELECT are used exclusively to
change between the image display and graphics device/window.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, Feb. 1991.
Written :
William Thompson, GSFC, February 1991.
Modified :
Version 1, William Thompson, GSFC, 5 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 1 September 1993.
Changed WSET to SETWINDOW, SET_PLOT to SETPLOT.
Added SAFE keyword.
Version :
Version 2, 1 September 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name : TVSUBIMAGE()
Purpose : Interactively selects a subimage from a displayed image.
Explanation : Uses TVBOXCRS to select a rectangular subregion of a displayed
image, and returns that subregion.
Use : Result = TVSUBIMAGE( IMAGE [, X1,X2,Y1,Y2 [, MX,MY,IX,IY ]] )
Inputs : IMAGE = Image to extract subimage from.
Opt. Inputs : MX, MY = Size of displayed image.
IX, IY = Position of the lower left-hand corner of the image.
If these optional parameters are not passed, then they are
retrieved with GET_TV_SCALE. It is anticipated that these
optional parameters will only be used in extremely rare
circumstances.
Outputs : The result of the function is the extracted subimage.
Opt. Outputs: X1,X2,Y1,Y2 = The X,Y positions of the corners of the
selected subimage.
Keywords : DISABLE = If set, then TVSELECT not used.
PRINT = If set, then a message is printed given the range
of the extracted subimage.
The following keywords are only relevant when used on a
graphics device that supports windows:
INIT = If this keyword is set, X1, X2, and Y1, Y2 contain
the initial parameters for the box.
FIXED_SIZE = If this keyword is set, X1, X2, and Y1, Y2
describe the initial size of the box. This size
may not be changed by the user.
Calls : ***
GET_TV_SCALE, TVBOXCRS
CALLED BY:
INDEX2MAP, MK_EIT_MAP, WRUNMOVIE [2]
Common : None.
Restrictions: It is important that the user select the graphics
device/window, and image region before calling this routine.
For instance, if the image was displayed using EXPTV,/DISABLE,
then this routine should also be called with the /DISABLE
keyword. If multiple images are displayed within the same
window, then use SETIMAGE to select the image before calling
this routine.
In general, the SERTS image display routines use several
non-standard system variables. These system variables are
defined in the procedure IMAGELIB. It is suggested that the
command IMAGELIB be placed in the user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this
software was obtained. Those routines have their own special
system variables.
Side effects: None.
Category : Utilities, Image_display.
Prev. Hist. : None.
Written : William Thompson, GSFC, 25 June 1993.
Modified : Version 1, William Thompson, GSFC, 25 June 1993.
Version 2, William Thompson, GSFC, 30 August 1993.
Renamed to TVSUBIMAGE.
Added checks on IMAGE parameter.
Version 3, Liyun Wang, GSFC/ARC, March 1, 1995
Added check on subimage limits
Version 4, William Thompson, GSFC, 17-Jan-1997
Changed to call TVBOXCRS
Version : Version 4, 17-Jan-1997
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVUNSELECT
Purpose :
Inverse to the TVSELECT routine.
Explanation :
Reset to the graphics device and/or window that was current when
TVSELECT was called.
Use :
TVUNSELECT
Inputs :
None.
Opt. Inputs :
None.
Outputs :
None, but various parameters in common block TV_WINDOW are modified.
Opt. Outputs:
None.
Keywords :
DISABLE = If set, then no action is taken.
SAFE = If set, then SETPLOT is used instead of SET_PLOT, and
SETWINDOW instead of WSET. Generally used when called from
SETIMAGE.
Calls : ***
HAVE_WINDOWS [1], HAVE_WINDOWS [2], SETPLOT [1], SETPLOT [2], SETWINDOW [1]
SETWINDOW [2]
CALLED BY:
ADJUST_COLOR, BLINK_IMAGES, COLOR_BAR, COMBINE_COLORS, COMBINE_VEL, CONTV, EXPAND_TV
GET_TV_SCALE, INT_STRETCH, LABEL_IMAGE, LINECOLOR, LOADCT, LOAD_VEL, PUT, SCALE_TV
SETIMAGE, SHOW_COLORS, STORE_TV_SCALE, TVAXIS, TVBOXCRS, TVERASE, TVOUT, TVPLT, TVPOINTS
TVPOS, TVREAD [1], TVVALUE, TVZOOM, TVZOOM2, VEL_STRETCH
Common :
TV_DEVICE contains various parameters used to communicate with the
routines TVDEVICE and TVSELECT.
Restrictions:
Only works if TVDEVICE, TVSELECT and TVUNSELECT are used exclusively to
change between the image display and graphics device/window.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
William Thompson, Feb. 1991.
Written :
William Thompson, GSFC, Feb. 1991.
Modified :
Version 1, William Thompson, GSFC, 5 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 1 September 1993.
Changed WSET to SETWINDOW, SET_PLOT to SETPLOT.
Added SAFE keyword.
Version :
Version 2, 1 September 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVVALUE
Purpose :
Interactively display the values in an image.
Explanation :
Instructions are printed and the pixel values are printed as the
cursor is moved over the image.
Press the left or center mouse button to create a new line of output,
saving the previous line.
Press the right mouse button to exit the procedure.
Use :
TVVALUE, IMAGE [, X, Y, VALUE ]
Inputs :
IMAGE = Image to get values from.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
X, Y = Pixel position of cursor for the last point selected.
VALUE = Value of image under cursor for the last point selected.
Keywords :
DISABLE = If set, then TVSELECT not used.
FONT = Font to use when displaying the TVVALUE widget. Only
meaningful when the graphics device supports widgets. If not
passed, then the first available 20 point font is used.
Calls : ***
GET_TV_SCALE, HAVE_WIDGETS [1], HAVE_WIDGETS [2], TVPOS, TVSELECT, TVUNSELECT
Common :
None.
Restrictions:
The image must have been displayed with EXPTV.
It is important that the user select the graphics device/window, and
image region before calling this routine. For instance, if the image
was displayed using EXPTV,/DISABLE, then this routine should also be
called with the /DISABLE keyword. If multiple images are displayed
within the same window, then use SETIMAGE to select the image before
calling this routine.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
None.
Prev. Hist. :
William Thompson, Feb. 1992.
William Thompson, May 1992, changed to call GET_TV_SCALE.
William Thompson, Nov 1992, changed way mouse buttons were addressed.
William Thompson, Nov 1992, rewrote based on standard routine RDPIX.
William Thompson, Mar 1993, changed to use TVPOS.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 5 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 12 May 1993.
Converted to use widgets when available. This makes it
compatible with IDL for Windows. Also added FONT keyword.
Version :
Version 2, 12 May 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVZOOM
Purpose :
Zooms into the current image display window.
Explanation :
Display part of an image (or graphics) from the current window expanded
in another window. The cursor is used to mark the center of the zoom.
This routine differs from the standard ZOOM routine in that the
currently selected image display window (TVDEVICE) is used.
If TVZOOM is called with the optional IMAGE parameter, then a widget is
created which allows the user to roam the image at true resolution,
instead of just the displayed resolution.
Use :
TVZOOM
TVZOOM, IMAGE [, X0, X1, Y0, Y1 ]
Inputs :
None required.
Opt. Inputs :
IMAGE
Outputs :
No explicit outputs. A new window is created and optionally destroyed
when the procedure is exited.
Opt. Outputs:
X0, X1, Y0, Y1 = The coordinates of the corners of the zoomed image.
Keywords :
FACT = Zoom expansion factor, default = 4.
INTERP = Set to interpolate, otherwise pixel replication is used.
XSIZE = X size of new window, if omitted, 250.
YSIZE = Y size of new window, default = 250.
CONTINUOUS = Keyword param which, if set obviates the need to press the
left mouse button. The zoom window tracks the mouse.
Only works well on fast computers.
KEEP = Keep the zoom window after exiting the procedure.
ZOOM_WINDOW= When used with KEEP, returns the index of the zoom window.
Otherwise, if KEEP is not set, then -1 is returned.
NEW_WINDOW = Normally, if ZOOM is called with /KEEP and then called
again, it will use the same window to display the zoomed
image. Calling ZOOM with /NEW_WINDOW forces it to create
a new window for this purpose.
DISABLE = If set, then TVSELECT is not called.
RECURSIVE = An internally used keyword to signal that TVZOOM is
calling itself recursively. This is used to support
Microsoft Windows. This keyword should not be used
externally to TVZOOM.
If the optional IMAGE parameter is passed, then the following
keyword parameters can be used to adjust the scale of the image:
NOSCALE = If set, then the image is not scaled.
MISSING = Value flagging missing pixels. These points are scaled to
zero.
MAX = The maximum value of IMAGE to be considered in scaling the
image, as used by BYTSCL. The default is the maximum value
of IMAGE.
MIN = The minimum value of IMAGE to be considered in scaling the
image, as used by BYTSCL. The default is the minimum value
of IMAGE.
TOP = The maximum value of the scaled image array, as used by
BYTSCL. The default is !D.N_COLORS-1.
BOTTOM = The minimum value of the scaled image array, as used by
BYTSCL. The default is 0.
VELOCITY = If set, then the image is scaled using FORM_VEL as a
velocity image. Can be used in conjunction with COMBINED
keyword. Ignored if NOSCALE is set.
COMBINED = Signals that the image is to be displayed in one of two
combined color tables. Can be used by itself, or in
conjunction with the VELOCITY or LOWER keywords.
LOWER = If set, then the image is placed in the lower part of the
color table, rather than the upper. Used in conjunction
with COMBINED keyword.
Calls : ***
BSCALE, CW_TVZOOM, GET_TV_SCALE, TVREAD [1], TVREAD [2], TVREAD [3], TVSELECT
TVUNSELECT, TVZOOM_EVENT, WIDGET_BASE, WIDGET_TEXT, XMANAGER, ZOOM
CALLED BY:
TVPOS
Common :
TVZOOM_COMMON is an internal common block.
Restrictions:
Only works with color systems. Using TVZOOM with the optional IMAGE
parameter requires that the graphics device supports widgets.
When the optional IMAGE parameter is passed, then TVZOOM should be
called with the same intensity scaling keyword settings that the image
was originally displayed with. There may still be some difference in
intensity between the original and zoomed images if the original image
was not displayed at full resolution.
This version of TVZOOM uses a version of ZOOM that is distributed with
IDL starting with version 3.1.1.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
When TVZOOM is reusing a zoom window from a previous call to
TVZOOM,/KEEP, then the XSIZE and YSIZE parameters are reset to the
actual size of the window.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Mar. 1990.
W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
Written :
William Thompson, GSFC, March 1990.
Modified :
Version 1, William Thompson, GSFC, 5 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 3 June 1993.
Added option of passing IMAGE array directly to routine.
Added DISABLE keyword.
Added RECURSIVE keyword.
Added dummy widget routines, added /NOSCALE to recursive call.
Version 3, William Thompson, GSFC, 3-Jan-2006
Added keyword BOTTOM
Version :
Version 3, 3-Jan-2006
[Previous]
[Next]
Project : SOHO - CDS
Name :
TVZOOM2
Purpose :
Zooms into the current image display window.
Explanation :
Display part of an image (or graphics) from the current window expanded
in another window. The cursor is used to mark the center of the zoom.
This routine differs from the standard ZOOM routine in that the
currently selected image display window (TVDEVICE) is used.
If TVZOOM is called with the optional IMAGE parameter, then a widget is
created which allows the user to roam the image at true resolution,
instead of just the displayed resolution.
Use :
TVZOOM2
TVZOOM2, IMAGE [, X0, X1, Y0, Y1 ]
Inputs :
None required.
Opt. Inputs :
IMAGE
Outputs :
No explicit outputs. A new window is created and optionally destroyed
when the procedure is exited.
Opt. Outputs:
X0, X1, Y0, Y1 = The coordinates of the corners of the zoomed image.
Keywords :
FACT = Zoom expansion factor, default = 4.
INTERP = Set to interpolate, otherwise pixel replication is used.
XSIZE = X size of new window, if omitted, 250.
YSIZE = Y size of new window, default = 250.
CONTINUOUS = Keyword param which, if set obviates the need to press the
left mouse button. The zoom window tracks the mouse.
Only works well on fast computers.
KEEP = Keep the zoom window after exiting the procedure.
ZOOM_WINDOW= When used with KEEP, returns the index of the zoom window.
Otherwise, if KEEP is not set, then -1 is returned.
NEW_WINDOW = Normally, if ZOOM is called with /KEEP and then called
again, it will use the same window to display the zoomed
image. Calling ZOOM with /NEW_WINDOW forces it to create
a new window for this purpose.
DISABLE = If set, then TVSELECT is not called.
RECURSIVE = An internally used keyword to signal that TVZOOM2 is
calling itself recursively. This is used to support
Microsoft Windows. This keyword should not be used
externally to TVZOOM2.
If the optional IMAGE parameter is passed, then the following
keyword parameters can be used to adjust the scale of the image:
NOSCALE = If set, then the image is not scaled.
MISSING = Value flagging missing pixels. These points are scaled to
zero.
MAX = The maximum value of IMAGE to be considered in scaling the
image, as used by BYTSCL. The default is the maximum value
of IMAGE.
MIN = The minimum value of IMAGE to be considered in scaling the
image, as used by BYTSCL. The default is the minimum value
of IMAGE.
TOP = The maximum value of the scaled image array, as used by
BYTSCL. The default is !D.N_COLORS-1.
BOTTOM = The minimum value of the scaled image array, as used by
BYTSCL. The default is 0.
VELOCITY = If set, then the image is scaled using FORM_VEL as a
velocity image. Can be used in conjunction with COMBINED
keyword. Ignored if NOSCALE is set.
COMBINED = Signals that the image is to be displayed in one of two
combined color tables. Can be used by itself, or in
conjunction with the VELOCITY or LOWER keywords.
LOWER = If set, then the image is placed in the lower part of the
color table, rather than the upper. Used in conjunction
with COMBINED keyword.
GROUP = Group ID of an upper widget which would be
desensitized if GROUP is set upon calling this
routine; useful when IMAGE is passed.
TITLE = Title of the parent widget (default to: 'TVZOOM2')
Calls : ***
BSCALE, CW_TVZOOM, GET_TV_SCALE, TVREAD [1], TVREAD [2], TVREAD [3], TVSELECT
TVUNSELECT, TVZOOM2_EVENT, WIDGET_BASE, WIDGET_TEXT, XMANAGER, ZOOM
CALLED BY:
EIS_IMAGE_TOOL_EVENT [1], EIS_IMAGE_TOOL_EVENT [2], IMAGE_TOOL_EVENT
Common :
TVZOOM_COMMON is an internal common block.
Restrictions:
Only works with color systems. Using TVZOOM2 with the optional IMAGE
parameter requires that the graphics device supports widgets.
When the optional IMAGE parameter is passed, then TVZOOM2 should be
called with the same intensity scaling keyword settings that the image
was originally displayed with. There may still be some difference in
intensity between the original and zoomed images if the original image
was not displayed at full resolution.
This version of TVZOOM2 uses a version of ZOOM that is distributed with
IDL starting with version 3.1.1.
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
When TVZOOM2 is reusing a zoom window from a previous call to
TVZOOM2,/KEEP, then the XSIZE and YSIZE parameters are reset to the
actual size of the window.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Mar. 1990.
W.T.T., Feb. 1991, modified to use TVSELECT, TVUNSELECT.
Written :
William Thompson, GSFC, March 1990.
Modified :
Version 1, William Thompson, GSFC, 5 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 3 June 1993.
Added option of passing IMAGE array directly to routine.
Added DISABLE keyword.
Added RECURSIVE keyword.
Added dummy widget routines, added /NOSCALE to recursive call.
Version 3, Liyun Wang, GSFC/ARC, November 2, 1995
Added TITLE keyword
Version 4, William Thompson, GSFC, 3-Jan-2006
Added keyword BOTTOM
Version 5, Zarro (ADNET/GSFC) 23-Sept-2006
Added CATCH call
Version :
Version 5
[Previous]
[Next]
PROJECT:
SDAC
NAME:
TWIDGET
PURPOSE:
This procedure provides a MOTIF interface for date or date&time selection.
CATEGORY:
widgets
CALLING SEQUENCE:
TWIDGET, RDATE [,/ALL, /TIMES, /YEAR, /MONTH,
/DAY, /DOY, /HOUR, /MIN, /SEC, MESSAGE=MESSAGE,
ERROR=ERROR, GROUP_LEADER=GROUP]
or
TWIDGET, RDATE [,/ALL, /TIMES, YEAR=[Y1,Y2], MONTH=[M1,M2],
/DAY, DOY=[D1,D2], /HOUR, /MIN, /SEC, MESSAGE=MESSAGE,
ERROR=ERROR, GROUP_LEADER=GROUP]
or
TWIDGET, RDATE [,YEAR=Y, MONTH=M, DAY=D, DOY=DOY, HOUR=H,
MIN=M, SEC=S, MESSAGE=MESSAGE,
/INIT, ERROR=ERROR, GROUP_LEADER=GROUP]
CALLED BY:
BCS, FCS, HFLARE, HXRBS, LISTBCS, WBDA [1], WBDA [2], cp_catwidget, cw_ut_range
hsi_cw_ut_range, option_changer [1], option_changer [2], spex_evnt [1]
spex_evnt [2], uvsp
EXAMPLES:
twidget, outtime=rtime1, group_leader=base, /all, error=error
OUTPUTS:
RDATE = structure = {date,year:0,month:0,day:0,doy:0,
hour:0,minute:0,sec:0}
CALLS: ***
COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3], HAVE_WINDOWS [1]
HAVE_WINDOWS [2], PARSE_ATIME [1], TWIDGET_EVENT, UT_2_YYDOY [1], XDEVICE
XMANAGER, XREGISTERED, YYDOY_2_UT, anytim [1], anytim [2], anytim [3], anytim [4]
anytim [5], parse_atime [2], ut_2_yydoy [2]
KEYWORD ARGUMENTS:
OUTTIME = Returns selected time in external ut format (7-element
array [hh,mm,ss,msec,dd,mm,yy]
ALL = If set, enable selection of year, month, day, (or day
of year if DOY is passed), hour, minute, and second.
TIMES = If set, enable selection of hour, minute, and second.
NOWILD =If set, then year, month, and day will not have 'all'
option.
YEAR = =1 means enable selection of year.
=N with /INIT means initialize year to N.
=[Y1,Y2] defines range of years allowed.
MONTH = =1 means enable selection of month.
=N with /INIT means initialize month to N.
=[M1,M2] defines range of months allowed.
DAY = =1 means enable selection of day.
=N with /INIT means initialize day to N.
DOY = =1 means enable selection of day of year..
=N with /INIT means initialize day of year to N.
=[D1,D2] defines range of days of year allowed.
HOUR = =1 means enable selection of hour.
=N with /INIT means initialize hour to N.
MIN = =1 means enable selection of minute.
=N with /INIT means initialize minute to N.
SEC = =1 means enable selection of second.
=N with /INIT means initialize second to N.
INIT = If set, initialize RDATE structure to values passed
in keywords YEAR, MONTH, etc. Do not bring up widget.
and return.
MESSAGE = String (scalar or array) containing message to print
in time selection widget box.
ERROR = On return, 0/1 means no error / error. Error is due to:
User aborted via CANCEL button.
Widgets not available.
TWIDGET already registered (in use).
TIME_INIT = Used only with INIT option. Contains time to initialize widget
to instead of using values in keywords YEAR, MONTH, etc.
OUTSEC = Returns selected time in seconds in addition to silly rdate structure
RESTRICTIONS:
needs X-windows
PROCEDURE:
Default is to enable selection of year, month, and day.
DOY keyword takes priority over MONTH and DAY keywords.
YEAR, MONTH, and DOY keywords can be passed as 2-element
arrays to define the range of allowed values or can simply
be turned on via the /keyword format (e.g. /YEAR).
Time selected is returned in the structure RDATE described above.
To initialize the time in RDATE, call TWIDGET with time elements
you want to set (e.g. YEAR=1980). and call with /INIT.
MODIFICATION HISTORY:
written 12/92 by Kim Tolbert (based on SDA written by D. Zarro)
Mod. 11/93 KT. Added nowild option, and corrected error when
hour=0 was specified (was using keyword_set)
Mod. Jul 1 94 by KT. Added outtime keyword. Returns selected
time in external ut format in addition to the rdate structure.
Version 4, richard.schwartz@gsfc.nasa.gov, 5-feb-1997, use parse_atime to convert final output.
Version 5, richard.schwartz@gsfc.nasa.gov, 24-sep-1997, anytim.pro supports
4 digit year strings, revised accordingly.
Version 6, richard.schwartz@gsfc.nasa.gov, 18-may-1998, make compatible with WIN.
11/10/99, Kim.
Added time_init keyword.
Added outsec keyword
Current selection in list widgets now highlighted.
xsize of text widget must be set explicitly in Windows.
Modal keyword set in xmanager call generates an error message. Set modal
in widget_base call if keyword group is set (required).
When wildcard dates are allowed, first year in list (which corresponds to
'all' in the widget is now 0 instead of 1979.
[Previous]
[Next]
Project : SOHO - CDS
Name : TYP()
Purpose : Translate keywords (/INT,/BYT etc) to IDL type numbers
Explanation : Returns an array with the IDL type numbers corresponding
to the keywords set. See e.g., MAKE_ARRAY(), DATATYPE,
and SIZE() for further explanation.
Use : T=TYP([/BYT,/INT,/LON,/NAT,/FLO,/DOU,/REA,/COM,/STR])
Inputs : Keywords only.
Opt. Inputs : None.
Outputs : Returns an array of TYPE NUMBERS.
Opt. Outputs: None.
Keywords : BYTe
INTeger
LONg
NATural numbers -- BYTes/INTegers/LONgs
FLOat
DOUble
REAl numbers -- BYTes/INTegers/LONgs/FLOats/DOUbles
COMplex
STRing
STC = structure
Calls : None.
CALLED BY:
CDS_LINEFIT_WRAP, CDS_READ_MISSING, CDS_SAVE_MISSING, CFITSLIST, CFIT_APATCH
CFIT_BLOCK, COPY_TAG_VALUES, CWQ_DSPWAV [1], CWQ_IMAGE [1], CWQ_SPECTR [1]
CWQ_WINSEL [1], CW_MOUSE, CW_PLOTZ [1], CW_PSELECT, CW_PZOOM [1], DSP_MOVIE
DSP_POINT, DSP_WAV, FIND_FILES, GT_BIMAGE, GT_CDS_TIME, GT_DETY, GT_HDR, GT_IIMAGE
GT_LAMBDA, GT_MIMAGE, GT_SCANP, GT_SCANT, GT_SCANX, GT_SCANY, GT_SOLARX, GT_SOLARY
GT_SPECTRUM, GT_VALID, GT_WAVEBAND, GT_WINDATA, GT_WINDESC, GT_WINDOW, PICKFITS
RD_ASCII [1], SFITSLIST, STRUNF, ST_WINDATA, TEXT_MATCH, XCDS_COSMIC, XCFIT
XCFIT_BLOCK, XDIFF, XPLOTSCALE, XTVSCALE, cw_plotz [2], cw_pzoom [2], cwq_dspwav [2]
cwq_image [2], cwq_spectr [2], cwq_winsel [2]
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities, Misc.
Prev. Hist. : None.
Written : SVH Haugan, UiO, 18-October-1995
Modified : Version 2, SVHH, 30 April 1996
Added structure data type.
Version : 2, 30 April 1996
[Previous]
[Next]
NAME:
type_conv
PURPOSE:
Perform a variable type conversion. It is used
in conjuction with the "INPUT" routine
INPUT/OUTPUT:
input_output - The value to be converted
INPUT:
sample_type - The variable type that needs to be
matched
OUTPUT:
type - The variable type (IDL convention)
CALLED BY:
input [1], input [2]
HISTORY:
Written 1988 by M.Morrison