r_coord $SSW/gen/idl/image/r_coord.pro
[Previous] [Next]
  NAME: r_coord

  PURPOSE: Given a linear array index and a centroid this will
           return the radial distance in pixels. This will work
	    on individual indices, but is more effectively used on
	    a whole array at once. A linear index can be generated 
	    using LINDGEN(xdim,ydim).

  CALLING SEQUENCE:  radius=r_coord(linind,imgwdth,cent)

  PARAMETERS:   linind   is the linear index into an array, FLOAT
                imgwdth  is the image width
                cent     is a two component vector with the centroid

  NOTES: Use on an image array returns a negative intensity image.

  RETURN TYPE: FLOAT

  CALLS: ***
	modd
 CALLED BY:
	background, rad_bck, set_back
  HISTORY: Drafted by A. McAllister, 2-dec-92.


RADEC $SSW/gen/idl_libs/astron/astro/radec.pro
[Previous] [Next]
 NAME:
	RADEC
 PURPOSE:
	To convert RA and Dec  from decimal to sexigesimal units.
 EXPLANATION: 
	The conversion is to sexigesimal hours for RA,  and sexigesimal 
	degrees for declination.

 CALLING SEQUENCE:
	radec, ra, dec, ihr, imin, xsec, ideg, imn, xsc, [/HOURS}

 INPUTS:
	ra   - right ascension, scalar or vector, in DEGREES unless the
              /HOURS keyword is set
	dec  - declination in decimal DEGREES, scalar or vector, same number
		of elements as RA

 OUTPUTS:
	ihr  - right ascension hours   (INTEGER*2)
	imin - right ascension minutes (INTEGER*2)
	xsec - right ascension seconds  (REAL*4 or REAL*8)
	ideg - declination degrees (INTEGER*2)
	imn  - declination minutes (INTEGER*2)
	xsc  - declination seconds (REAL*4 or REAL*8)

 CALLED BY:
	ADSTRING, ATV, QUERYGSC, QUERYUSNO, TICLABELS
 OPTIONAL KEYWORD INPUT:
       /HOURS - if set, then the input righ ascension should be specified in
              hours instead of degrees.
 RESTRICTIONS:
	RADEC does minimal parameter checking.

 REVISON HISTORY:
	Written by B. Pfarr, STX, 4/24/87
	Converted to IDL V5.0   W. Landsman   September 1997
       Added /HOURS keyword W. Landsman  August 2002


Radiospectrogram FITS File reader [1] $SSW/gen/idl/synoptic/rd_phnx.pro
[Previous] [Next]
 NAME:
       Radiospectrogram FITS File reader

 PURPOSE:
       Reads (solar) radio spectrograms from RAG-FITS files,
       including non-regular axes. 

 CALLING SEQUENCE:
       rd_phnx, filename [, spectrogram, time_axis,
       frequency_axis ]

 INPUT:
       filename: string containing the name of the file with extension
 OUTPUTS:
       image: 2D array containing the spectrogram.
       frequency_axis: 1D array containing the frequency axis, in MHz
       time_axis: 1D array containing the time in seconds from 1 Jan
                  1979 (can be converted in any other time formats
                  with Anytim). Can be set relative with the
                  RELATIVE_TIME keyword. Uses DATE_OBS to set the
                  correct time.
 KEYWORDS:
       AXIS_HEADER: returns a structure containing the axis binary
                    table header information
       MAIN_HEADER: returns a structure containing the main header
                    information 
       RELATIVE_TIME: If set, the time axis starts with zero instead
                      of starting with the value of DATE_OBS
 IMPLEMENTATION:
       The procedure has been tested on FITS from ETHZ and Potsdam

 MODIFICATION HISTORY
       Created: A. Csillaghy, ETHZ, October 1992
       For IDL Sun in May 1993, A.Cs.
       SILENT in june, 93, A.Cs
       DATAMIN, DATAMAX; When only filename provided, the header
               is read but not the array. Oct. 93, A.Cs
       RELATIVETIME in august 1995, ACs
       Read also compressed file in November 95, ACs
       Adaptation for IDL5/SSW/Ragview in March 98 -- ACs
       Adaptation for DATE-OBS keyword with time; Dec. 98, P.Hackenberg
       Extended to read "transposed" fits data and extensions with
               only time or frequency axis; Dec. 98, P.Hackenberg,
               AIP Potsdam
       Changed name from ragfitsread to radio_spectro_fits_read, 
               adapted for ssw Nov 1999, csillag@ssl.berkeley.edu
       Light version for Unix and PC in Jan/March 2000, csillag@ssl.berkeley.edu
       Modified to handle compressed files and rename, 6-Dec-2000, Zarro (EIT/GSFC)
 CALLS:


RANDOMP $SSW/gen/idl_libs/astron/math/randomp.pro
[Previous] [Next]
 NAME:
       RANDOMP
 PURPOSE:
       Generates an array of random numbers distributed as a power law.
 CALLING SEQUENCE:
       RANDOMP, X, Pow, N, [ RANGE_X = [low,high], SEED= ]'
 INPUTS:
       Pow:  Exponent of power law.
               The pdf of X is f_X(x) = A*x^pow, low <= x <= high
               ASTRONOMERS PLEASE NOTE:  
               pow is little gamma  = big gamma - 1 for stellar IMFs.
       N:    Number of elements in generated vector.

 OPTIONAL INPUT KEYWORD PARAMETER:
       RANGE_X:  2-element vector [low,high] specifying the range of 
               output X values; the default is [5, 100].

 OPTIONAL INPUT-OUTPUT KEYWORD PARAMETER:
       SEED:    Seed value for RANDOMU function.    As described in the 
               documentation for RANDOMU, the value of SEED is updated on 
               each call to RANDOMP, and taken from the system clock if not
               supplied.   This keyword can be used to have RANDOMP give 
               identical results on different runs.
 OUTPUTS:
       X:    Vector of random numbers, distributed as a power law between
               specified range
 CALLED BY:
	HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
 PROCEDURE:  
       "Transformation Method" for random variables is described in Bevington 
       & Robinson, "Data Reduction & Error Analysis for Physical Sciences", 2nd
       Edition (McGraw-Hill, 1992). p. 83.
       Output of RANDOMU function is transformed to power-law
       random variable.

 EXAMPLE:
       Create a stellar initial mass function (IMF) with 10000 stars
       ranging from 0.5 to 100 solar masses and a Salpeter slope.  Enter:

       RANDOMP,MASS,-2.35,10000,RANGE_X=[0.5,100]

 NOTES:
       Versions 5.1.1 and V5.2 of IDL have a bug in RANDOMU such that the SEED
       value is initialized to the same value at the start of each session,
       rather than being initialized by the system clock.    RANDOMP will be
       affected in a similar manner.
 MODIFICATION HISTORY:
       Written by R. S. Hill, Hughes STX, July 13, 1995
       July 14, 1995   SEED keyword added at Landsman's suggestion.
                    Documentation converted to standard format.  RSH
       Converted to IDL V5.0   W. Landsman   September 1997


RASTER_SIZE $SSW/gen/idl/image_tool/raster_size.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       RASTER_SIZE

 PURPOSE:
       Get raster size based on RASTER structure from GET_RASTER.

 EXPLANATION:

 CALLING SEQUENCE:
       RASTER_SIZE, raster, width=width, height=height

 INPUTS:
       RASTER -- A structure of type "CDS_RASTER" obtained by
                 GET_RASTER. It should have the following tags:

          RAS_ID     = Raster ID number.  If the requested raster
                       is not found, then a simpler structure is
                       returned, with this set to -1.
          DETECTOR   = Either "G" for GIS or "N" for NIS.
          RAS_DESC   = A short description of the raster, giving
                       its purpose.
          SLIT_NUM   = The ID number for the slit to be used.
          XSTEP      = The step size in the X direction, in
                       arcsec.
          YSTEP      = The step size in the Y direction, in
                       arcsec.
          NX         = The number of exposure positions in X.
          NY         = The number of exposure positions in Y.
          RAS_VAR    = Raster variation index.
          RV_DESC    = A short description of the raster
                       variation beyond what is given in the
                       associated fundamental raster description.
          EXPTIME    = Exposure time in seconds, to millisecond
                       accuracy.
          LL_ID      = Line list ID.  Alternatively, this can be
                       zero to signal that the raster is not
                       connected to a line list.
          LL_DESC    = A description of the line list, e.g.
                       "Temperature sensitive line pairs".
          N_LINES    = The number of lines.
          COMP_ID    = Compression method ID.
          COMP_OPT   = Compression option parameter.
          DW_ID      = Data extraction window list ID.
          DW_DESC    = A short description of the data window
                       list beyond what is given in the
                       associated line list description, e.g.
                       "Full slit, 10 pixels wide".
          W_WIDTH    = Width in pixels used to generate the windows
          W_HEIGHT   = Height in pixels used to generate the
                       windows. VDS only, for GIS this is set to zero
          VDS_ORIENT = VDS orientation, either 0 (row) or 1
                       (column).
          VDS_MAP    = VDS mapping mode: 2=Normal, 3=Accumulate.
          VDS_BACK   = Either 0 for off, or 1 for on,
                       representing whether or not VDS background
                       windows are being used.  For GIS window
                       lists this is 0.
          N_WINDOWS  = The number of windows.
          TEL_RATE   = Estimated required telemetry rate, as a
                       character representing Low/Medium/High
          DURATION   = Estimated duration of the raster, in
                       seconds.
          USABLE     = Either "Y" or "N" to signal whether or not
                                    the raster is usable.  Normally "Y".

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       WIDTH  -- East/West extent of the raster, in arcsecs
       HEIGHT -- North/South extent of the raster, in arcsecs

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       None.

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	GET_CDS_FOV, GET_CDS_POINT, XSTUDY
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Planning, image_tool

 PREVIOUS HISTORY:
       Written October 31, 1994, by Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:

 VERSION:
       Version 1, October 31, 1994


ratio_teem $SSW/gen/idl/spectra/ratio_teem.pro
[Previous] [Next]
NAME:
 ratio_teem
PURPOSE:
 Given two photon fluxes and responses, obtain t, em and uncertainties
CALLING SEQUENCE:
 ratio_teem, cnts1, cnts2, resp1, resp2, te_in, te, em, ste, sem, $
             unc1 = unc1, unc2 = unc2, dt=dt
INPUT:
 cnts1, cnts2= the photon fluxes in 2 channels, filters, or whatever
 resp1, resp2= the response in 2 channels, filters, or whatever, these
               must be defined on the same temperature array, and must
               be defined for the same units of EM.
 te_in = the input temperature array 
OUTPUT:
 te = T, in the units used for the response curves
 em = EM, in the units used for the response curves
 ste = uncertainty in te
 sem = uncertainty in em
KEYWORDS:
 unc1, unc2= uncertainty in cnts1 and cnts2, if not passed in,
          then sqrt(cnts/dt) is used
 dt = the interval times for the count rates, the default is 1.0 seconds
      this is needed for uncertainties
 CALLS: ***
	DERIV, INTERPOL
HISTORY:
 4-mar-1997, jmm


RD_ASCII [1] $SSW/gen/idl/io/rd_ascii.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : RD_ASCII

 Purpose     : Read sequential ASCII file

 Explanation : Reads an ASCII file and returns as a text array.

               It is possible to read parts of a file by specifying the
               first and last line numbers through the keyword LINES,
               e.g.:

               text = rd_ascii(file,lines=[1,10])

               will read lines 1 through 10. Lines are numbered from 1 and
               up. To read only one line, set LINES to the line number.

               This routine uses an internal buffer to speed up reading.
               This is achieved by using READU instead of READF, and by
               avoiding memory copying of large text array by allocating the
               whole text array once.  This results in a quite substantial
               speedup, of course somewhat depending on the characteristics
               of the given system.  In order to avoid too large internal
               buffers, an upper limit on the block size can be specified.
               The default is no -1, which means use a buffer the size of the
               file.

               If the file is larger than the block size, the routine reads
               the file twice, in blocks of the specified size. On the first
               pass, the lines are counted, and on the second pass, the lines
               are stored in the allocated array.

 Use         : output = rd_ascii(file)

 Inputs      : file = string file name

 Outputs     : output = string array with ASCII text

 Keywords    : LINES : Set to a line number to read just one line.
                       Set to a line number range, e.g., [1,N] to
                       read lines 1 trough N.

               BLOCKSIZE : Maximum buffer size. Default value -1, which
                           means use a buffer the size of the file.
                           No effect under VMS.

               ERROR : Set to a named variable that will be zero if no
                       error occurred, or 1 if an error did occur.

               STREAM : If set, then force a VMS file to be read in stream.
                        For internal use only, since it attempts to read all
                        VMS files this way first.  An error condition results
                        if this is set initially for a sequential file.

               LUN    : LUN used in open (output)

 CALLS: ***
	CHKLOG [1], CHKLOG [2], DEFAULT, OS_FAMILY, PARCHECK, RD_ASCII_FREE, TYP
 CALLED BY:
	ADD_METHOD, CDS_AR_OBS, CDS_WAVE_CAT, CFITSLIST, CHECK_FTP, CHECK_KAP, FIX_IAP
	FTP__DEFINE, GET_PROC, GET_SOHO_ROLL, GET_SSWDB, GHOST_BUSTER, GIF2PICT, GIS_HV_CAL
	HESSI_MODEL_COUNTS, HSI_SPECTROSCOPY_LIST, IAP2STC, JSMOVIE, JSMOVIE2
	KAP_CONTENTS, LIST_PRINTER_UNIX, MAKE_GOES_RESP, MK_CDS_DBASE, MK_CDS_PLAN
	MK_HEAD_CAT, MK_SOHO, MK_STUDY, NEW_EFFECTIVE_AREAS_CODE, NEW_FIG4_INPUTS
	OBS__DEFINE, PICKFITS, PRINT_GEV, PRINT_NAR, RD_ASCII_BYTE, RD_CHIANTI, READ_EPHEM
	READ_SEQFILE, SFITSLIST, SHOW_CDHS, SMART_FTP, SOCK_SSW, SOHO_CAMPAIGN, STUDY_BRIEF
	UPDATE_CAMPAIGN, WIDG_HELP, WIN_SPAWN, WRITE_ANOMALY, XDIFF, XIAP, XRECORDER, db_gbo
	del_blank_lines, del_comment_lines, eis_import_study [1], eis_import_study [2]
	fit_model_components, hessi_setup_info, hessi_var, hsi_params_write_pro
	hsi_plot_flux, hsi_ui_img, hsi_ui_spec, ihy_db, imspec [10], imspec [11]
	imspec [12], imspec [13], imspec [14], imspec [15], imspec [16], imspec [17]
	imspec [18], imspec [19], imspec [1], imspec [20], imspec [21], imspec [22]
	imspec [23], imspec [24], imspec [25], imspec [26], imspec [27], imspec [28]
	imspec [29], imspec [2], imspec [30], imspec [31], imspec [32], imspec [33]
	imspec [34], imspec [35], imspec [36], imspec [3], imspec [4], imspec [5]
	imspec [6], imspec [7], imspec [8], imspec [9], ospex_params_write_pro, remove_w_c
	strip_crt, which_hessi_version
 Restrictions: VMS: Due to a problem with variable length sequential files,
               no internal buffer is used, so BLOCKSIZE has no effect on such
               files.

               Other than that, none known, but the algorithm used for
               reading is rather complex. However, the routine reads all
               *.pro files in the CDS path correctly for any buffer size, so
               no obvious bugs should be present.

 Category    : I/O

 Written     : Version 1.0, DMZ (ARC) August 22 1994

 Modified    : Version 1.1, DMZ (ARC/GSFC) October 29 1994
               Fixed potential bug in irec

               Version 2, SVHH (UiO), 28 May 1996
                       Switched to new algorithm with buffered reads,
                       added LINES, ERROR and BLOCKSIZE keywords.
               Version 3, SVHH (UiO), 21 June 1996
                       VMS problem with variable length sequential files
                       reported by Richard Schwartz. Inserted the old version
                       of the routine as a VMS branch, but rearranged a
                       little bit to use larger buffer (1000 lines) and
                       to allow the LINES keyword to be used, although not in
                       any efficient way (all text is read in and then
                       truncated). This might be improved later.
                       For non-VMS the default block size changed to -1 (use
                       a buffer the size of the file).
               Version 3.1, RAS (GSFC), 21 June 1996
                       Added STREAM keyword and forced first VMS read to be
                       STREAM.  If the VMS file is a stream file the
                       LINES keyword is used efficiently since the readu
                       path is in effect.  Made sure that closed and freed
                       LUN on error.
                       There is still room for improvement in the VMS
                       sequential read on very large files, reading only the
                       desired lines, I will leave that to the next motivated
                       user.

		Version 4, Richard.Schwartz@gsfc.nasa.gov, 18 August 1998.
			Modify SEP_LEN variable under Windows if end of line sequence
			does not include the normal carriage return, line feed terminators.

               Version 5, Zarro (SM&A/GSFC), 15-Aug-99
                       Added LUN as output keyword
		Version 6, richard.schwartz@gsfc.nasa.gov, 11 July 2000.
			Protect against -1 reference in b array under windows test.

               Version 7, Zarro (EITI/GSFC) 7 Mar 2001
                       Added call to free_lun and close before each
                       return to ensure all opened files are closed

               Version 8, Zarro (EITI/GSFC) 26 Apr 2001
                       Added call to chklog, since RD_ASCII had
                       problems reading filenames with embedded environment
                       variables.


RD_ASCII_BUFF $SSW/gen/idl/io/rd_ascii_buff.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_ASCII_BUFF

 Purpose     : read ASCII buffer

 Category    : utility system

 Syntax      : IDL> out=rd_ascii_buff(lun,buffsize)

 Inputs      : LUN = logical unit number

 Opt. Inputs : BUFFSIZE = string buffer size to read [def=512]

 Keywords    : BYTE_READ = set to call RD_ASCII_BYTE

 CALLS: ***
	DPRINT, EXIST, RD_ASCII_BYTE, is_number [1], is_number [2]
 CALLED BY:
	HTTP__DEFINE, RD_ASCII_C, read_ftp
 History     : Written, 27 Dec 2001, D. Zarro (EITI/GSFC)
               Modified, 24 Nov 2005, Zarro (L-3Com/GSFC) 
                - added /byte_read

 Contact     : dzarro@solar.stanford.edu


RD_ASCII_BYTE $SSW/gen/idl/io/rd_ascii_byte.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_ASCII_BYTE

 Purpose     : read ASCII input as bytes
              (circumvents internal string buffer limits on some systems)

 Category    : utility system

 Syntax      : IDL> output=rd_ascii_byte(lun,buffize)

 Inputs      : LUN = logical unit number

 Opt. Inputs : BUFFSIZE = string buffer size to read [def=512]

 CALLS: ***
	CLOSE_LUN, EXIST, GET_TEMP_FILE, RD_ASCII [1], RD_ASCII [2], is_number [1]
	is_number [2]
 CALLED BY:
	RD_ASCII_BUFF
 History     : Written, 27 Nov 2005, D. Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


RD_ASCII_C $SSW/gen/idl/io/rd_ascii_c.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_ASCII_C

 Purpose     : read ASCII files which may be compressed

 Category    : utility system

 Syntax      : IDL> out=rd_ascii_c(file)

 Inputs      : FILE = filename to read

 Keywords    : ERR= error string
               BUFFSIZE = string buffer size to read [def=512]

 CALLS: ***
	EXIST, IS_COMPRESSED, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], RD_ASCII_BUFF, TRIM
 CALLED BY:
	RD_RSTN
 History     : Written, 12 Dec 2001, D. Zarro (EITI/GSFC)

 Contact     : dzarro@solar.stanford.edu


rd_atodat [1] $SSW/gen/idl/spectra/rd_atodat.pro
[Previous] [Next]
  NAME:
    rd_atodat
  PURPOSE:
    Read the atomic data files: ssec3.dat, casec3.dat, fesec3.dat, f26sec.dat

  CALLING SEQUENCE:
    ato_data = rd_atodat( infil )

  INPUTS:
    infil   =  Input file name
  OUTPUTS:
    Returned parameter (ato_data) is a structure containing the data 
    read from the file.
 CALLS: ***
	FILE_EXIST [2], STR2ARR [1], STR2ARR [2], file_exist [1], file_exist [3]
	rd_tfile [1], rd_tfile [2], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	get_atomic [1], get_atomic [2]
  MODIFICATION HISTORY:
    11-oct-93, Written, J. R. Lemen
     9-mar-94, JRL, Read density data from the end of data file
    11-mar-94, JRL, Read letter identifier in D.R. list.  This is
			to identify the q, k and j lines.
     6-oct-94, JRL, Added code to flag the statistical weight of the D.R. lines


RD_BUFF $SSW/gen/idl/io/rd_buff.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_BUFF

 Purpose     : read unformatted data buffer

 Category    : utility system

 Syntax      : IDL> out=rd_buff(lun,maxsize,chunk)

 Inputs      : LUN = logical unit number
               MAXSIZE = max size of file in bytes

 Opt. Inputs : CHUNK = chunk factor to break buffer into [def=10]

 CALLS: ***
	is_number [1], is_number [2]
 History     : Written, 3 April 2002, D. Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


Rd_fHeader [1] $SSW/gen/idl/fund_lib/yohkoh/rd_fheader.pro
[Previous] [Next]
       NAME:
               Rd_fHeader
       PURPOSE:
               Read and extract the file header section from
               requested file.
       CALLING SEQUENCE:
               Rd_fHeader, lun_filnam, file_header, ndset
       INPUT:
               lun_filnam      input file specification or the
                               unit number of an openned reformatted
                               file.
       Output:
               file_header     a logical record containning the
                               standard file header section.
               ndset           number of data sets contained within
                               the file (number of logical roadmap
                               records).
 CALLS: ***
	GEN_STRUCT [1], GEN_STRUCT [2], Rd_Pointer [1], Rd_Pointer [2], rdwrt [1]
	rdwrt [2], rdwrt [3]
 CALLED BY:
	BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], CkTimeNkey, GetNarOrb get nearest orbit
	Load_recs, RD_BDA [1], RD_BDA_DATA, RD_BDA_DP, RD_XDA [1], RD_XDA [2]
	Rd_NewOrb_p [1], Rd_NewOrb_p [2], ada2str, ads_into_att, ads_into_pnt
	filetimes [1], filetimes [2], kluge_att, mk_att [1], mk_att [2], mk_dset_str [1]
	mk_dset_str [2], mk_evn [1], mk_evn [2], mk_gx, mk_mo_log, mk_obs_str, mk_pnt, mk_sd2
	mk_sdc [2], mk_sdc [3], mk_sdc [4], mk_sdl, mk_sl [1], mk_sl [2], mk_sot, mk_ssl, mk_sxc
	mk_sxl, mk_week_file [1], mk_week_file [2], newsfd, nn_rd2_sxt_noaa
	nn_rd3_sxt_noaa, nn_rd_sxt_noaa, plot_gsn, pnt2atr, rd_gsn, rd_old_obs
	rd_roadmap [1], rd_sdl, rd_sld, rd_sls, rd_sot, rd_ssl, rd_week_file [1]
	rd_week_file [2], rd_week_file [3], rd_week_file [4], sav_bda, sav_bsc, sav_hxi
	sav_sda [1], sav_sda [2], sav_sda [3], weekid [2], wrt1orbit [1], wrt1orbit [2]
	ydb_exist [2], yoyo_man2
       History:
               written by Mons Morrison, Fall 90.
		12-Dec-91 (MDM) Changed to allow a vector of filenames
		25-May-01 (LWA) Made variable in "for" call a longword


rd_fits_ext $SSW/gen/idl/fits/rd_fits_ext.pro
[Previous] [Next]
 NAME:
  rd_fits_ext

 PURPOSE:
  Read a specified extension from a FITS file.  The extension can be
  specified by its EXTNAME, its EXTNO, and / or the instance of the
  given EXTNAME.

 CATEGORY: FITS, UTIL
 
 CALLING SEQUENCE:
  rd_fits_ext, FILE='some_fits_file.fits', setno=2, extname='rate', $
     /SILENT, HEADER=fits_extension_header, DATA=fits_extension_data

 INPUT KEYWORDS:
  FILE - Name of FITS file to read.

 OPTIONAL INPUT KEYWORDS:
  SILENT - set to deactivate printing error messages.
  Input Keywords for find_fits_ext.

 OUTPUT KEYWORDS:
  HEADER - header from requested extension of FITS file.
  DATA - requested extension from FITS file.

 OPTIONAL OUTPUT KEYWORDS:
  STATUS - keyword from mrdfits.
  ERR_CODE - set to [ 0 / 1 ] if an error [ did not / did ] occur
  ERR_MSG - string containing error message.  Null string if no
            errors occurred.
  Output keywords from find_fits_ext.

 CALLS: ***
	MRDFITS [1], MRDFITS [2], find_fits_ext
 CALLED BY
	fits2spectrum, hsi_spectrum_fitsread


RD_GOES $SSW/gen/idl/goes/rd_goes.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_GOES

 Purpose     : read GOES data

 Category    : synoptic gbo

 Syntax      : IDL> rd_goes,times,data,trange=trange

 Inputs      : None

 Outputs     : TIMES = time array (SECS79)
               DATA  = data array (# TIMES x 2)

 Keywords    : TRANGE=[TSTART, TEND] = time interval to select
               TAI = TIMES in TAI format
               NO_SEARCH = don't search each satellite

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], ANYTIM2UTC [1], ANYTIM2UTC [2], DELVARX [1], DELVARX [2]
	DELVARX [3], DELVARX [4], EXIST, GOES_SAT, HAVE_TAG, REM_TAG [1], REM_TAG [2]
	WHERE_VECTOR, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	delvarx [5], get_def_times, is_struct, rd_gxd [1], rd_gxd [2], rd_gxd [3]
 CALLED BY:
	GOES__DEFINE
 History     : Written 18 Feb 2001, D. Zarro, EITI/GSFC
               14-Dec-2005 - changed err message text

 Contact     : dzarro@solar.stanford.edu


RD_GOES_SDAC $SSW/gen/idl/goes/rd_goes_sdac.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_GOES_SDAC

 Purpose     : read GOES SDAC FITS data (a socket wrapper around GFITS_R)

 Category    : synoptic gbo

 Syntax      : IDL> rd_goes_sdac

 Inputs      : See GFITS_R keywords

 Outputs     : See GFITS_R keywords

 Keywords    : See GFITS_R keywords
               STIME, ETIME = start/end times to search
               REMOTE = force a network search

 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], ERR_STATE
	FILE_SINCE, GFITS_R, GOES_FITS_FILES, GOES_SAT, GOES_SERVER, GOES_TEMP_DIR, IS_BLANK
	IS_DIR, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MKLOG, MK_DIR, PR_SYNTAX, VALID_TIME
	WRITE_DIR, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], is_number [1], is_number [2]
 CALLED BY:
	GOES__DEFINE
 History     : Written 15 June 2005, D. Zarro, (L-3Com/GSFC)
               Modified 24 Nov 2005, Zarro (L-3Com/GSFC) 
                - preserve currently defined $GOES_FITS
               Modified 26 Dec 2005, Zarro (L-3Com/GSFC) 
                - support varied input time formats with anytim
               Modified 30 Dec 2005, Zarro (L-3Com/GSFC)
                - improved by only downloading required files
               Modified Election Night 7 Nov 2006, Zarro (ADNET/GSFC) 
                - check that $GOES_FITS is a valid archive 
               Modified 22 Jan 2007, Zarro (ADNET/GSFC)
                - corrected returned satellite number

 Contact     : dzarro@solar.stanford.edu


rd_goesp_ascii $SSW/gen/idl/solar/rd_goesp_ascii.pro
[Previous] [Next]
   Name: rd_goesp_ascii

   Purpose: read goes ascii particle files and return structure vector

   Input Parameters:
      t0, t1 - start and stop time desired  

   Output Parameters
      goesp - vector of goes particle structures between t0 and t1

   Keyword Parameters:
      goes8, goes9 - data set (satellite) to use - default=GOES9
      remove_bad - switch, if set, remove bad/missing data records
      files (output) - list of ascii file names read
      plabels (output) - lables for Protons;  output.p    (6,nn)
      elabels (output) - lables for Electrons;output.elec (3,nn) 
      labels_only - (switch) - if set, just define PLABLES and ELABLES
                               and exit without reading files 
      short_labels - (switch) - if set, labels are short version

   Calls: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2]
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], file_exist [1], file_exist [3], get_logenv [1], get_logenv [2]
	reltime [1], reltime [2], sel_timrange [1], sel_timrange [2], set_logenv [1]
	set_logenv [2], ssw_deltat, str_replace [1], str_replace [2], table2struct
	timegrid
 CALLED BY:
	plot_goesp
   History: 
     19-nov-1997 - S.L.Freeland 
     17-jul-2000 - S.L.Freeland - add PLABELS and ELABLES output keywords
     18-Jul-2000 - S.L.Freeland - add /LABELS_ONLY ; make default GOES8 
                                  following demise of GOES9
     19-Oct-2001 - S.L.Freeland - include the current (imcomplete)
                                  files if t1=today
      8-Mar-2002 - S.L.Freeland - add /SHORT_LABELS keyword and function
      6-Apr-2003 - S.L.Freeland - add /GOES10 & /GOES12 keyword+function


rd_goesx_ascii $SSW/gen/idl/solar/rd_goesx_ascii.pro
[Previous] [Next]
   Name: rd_goesx_ascii

   Purpose: read goes ascii xray files (SEC) and return structure vector

   Input Parameters:
      t0, t1 - start and stop time desired  

   Output Parameters
      goesx - vector of goes xray structures between t0 and t1

   Keyword Parameters:
      goes{8,9,10,12}- data set (satellite) to use - default=/GOES10
      remove_bad - switch, if set, remove bad/missing data records
      files (output) - list of ascii file names read
      elabels (output) - text descriptors of energy bands (plott annotate..) 
      labels_only - (switch) - if set, just define PLABLES and ELABLES
                               and exit without reading files 

   Calls: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2]
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], file_exist [1], file_exist [3], get_logenv [1], get_logenv [2]
	reltime [1], reltime [2], sel_timrange [1], sel_timrange [2], set_logenv [1]
	set_logenv [2], sort_index [1], sort_index [2], ssw_deltat, table2struct, timegrid
 CALLED BY:
	goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4], goes_plot [5]
   History:
      16-Dec-2002 - S.L.Freeland - XRay counterpart from  rd_goesp_ascii
       6-Apr-2002 - S.L.Freeland - fix GOES12 related typo (add quotes)
      22-jun-2006 - S.L.Freeland - add GOES11 (replace G10 as XR 2ndary default)


rd_gxd [1] $SSW/gen/idl/fund_lib/yohkoh/rd_gxd.pro
[Previous] [Next]
NAME:
	rd_gxd
PURPOSE:
	Read the GXD type files (GOES 3 sec light curve data files for
	S/C 6,7,8,9, or derived 1 minute average data files).  Default is
	to read 3 sec data for spacecraft 7.
CALLING SEQUENCE:
	rd_gxd, roadmap(0),  roadmap(n), gxd_data
	rd_gxd, '1-dec-91', '30-dec-91', gxd_data
	rd_gxd,      weeks,       years, gxd_data
INPUT:
		  INPUT CAN BE OF TWO FORMS

		  (A) Input starting and ending times
	input1	- Starting time in either (i) standard string format,
		  or (ii) a structure with .time and .day fields
		  (the 7 element time vector form is not allowed)
	input2	- Ending time.  If ending time is omitted, the
		  ending time is set to 24 hours after starting time.

		  (B) Input can be a vector of week/year number
	input1	- a vector of the week numbers to read
	input2	- a vector of the year of the week to be read
		  if the weeks vector is all within one year, the
		  year parameter can be a scalar.
OUTPUT:
	data	- the data structure containing the data in the files
		  See the structure definition for further information
 CALLS: ***
	anytim2ints [1], anytim2ints [2], get_goes_defsat [1], get_goes_defsat [2]
	rd_week_file [1], rd_week_file [2], rd_week_file [3], rd_week_file [4]
	strlastchar [1], strlastchar [2], week2ex [1], week2ex [2]
 CALLED BY:
	AR_AREAS, AR_SPECTRUM, GOES2DPE, GOES_SAFE, GOES_TEK [1], GOES_TEK [2]
	HSI_SSR_FILL_PER_ORBIT [2], NEUPERT_PLOT, OBS_PLOT, QUICK_DPE, RD_GOES
	SXT_COVERAGE, eit_proton_summary, goes_plot [1], goes_plot [2], goes_plot [3]
	goes_plot [4], goes_plot [5], goes_reducer [1], hsi_ssr_fill_per_orbit [1]
	mk_week_file [1], mk_week_file [2], multi_hda2hxi, rd_sxtgoes
OPTIONAL KEYWORD INPUT:
	goes6	- If set, use 3 sec data for GOES spacecraft 6
	goes7	- If set, use 3 sec data for GOES spacecraft 7
	goes8	- If set, use 3 sec data for GOES spacecraft 8
	goes9	- If set, use 3 sec data for GOES spacecraft 9
       goes10  - If set, use 3 sec data for GOES 10
       goes12  - If set, use 3 sec data for GOES 12
	one_minute- If set, use 1 minute average light curve data derived
		  from 3 sec digitial data.
	five_minute- If set, use 5 minute average light curve data derived
		  from 3 sec digitial data.

	indir	- Input directory of data files.  If not present, use
		  $DIR_GEN_xxx logical directory
	vnum	- The file version number to use.  If not present, a call
		  to WEEKID is made and that latest version is used.
	nearest	- If set, then the time span is adjusted a day at a time
		  until it finds some data.  It decrements the starting
		  date by a day and increments the ending date by a day
		  up to 14 days (28 day total span)
       full_weeks - If set, then do not extract the entries that just
                 cover the times covered in the start/end time.  Return
                 all data for weeks covered by the start/end time. This
                 allows a user to have start and end time be the same
                 and still get some data.
OPTIONAL KEYWORD OUTPUT:
	status	- The read status
		  Some data is available if (status le 0)
			 0 = no error
			 1 = cannot find the file
			 2 = cannot find data in the time period
			-1 = found data, but had to go outside of the requested
			     period (only true if /NEAREST is used).  
HISTORY:
	Written 15-Apr-93 by M.Morrison
	15-Aug-94 (MDM) - Added ;+ to the header
       29-aug-95 (SLF) - Added ONE_MINUTE and FIVE_MINUTE keyword and function
        2-apr-96 (SLF) - Add GOES8 and GOES9 support
	30-Oct-96 (RDB) - Default to GOES9 if start date is after 1-Jul-96
       21-Jul-98 (SLF) - update for GOES10
        8-APR-2003  (SLF) - update for GOES12
       16-Apr-2003 (SLF) - enhanced time dependent defaults a bit
       17-Jan-2006 (DMZ) - added _EXTRA for pass thru keywords


RD_IMAGE_FITS $SSW/gen/idl/image_tool/rd_image_fits.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       RD_IMAGE_FITS

 PURPOSE:
       Driver program of FXREAD and CDS_IMAGE to read any FITS file

 EXPLANATION:

 CALLING SEQUENCE:
       rd_image_fits, data_file, image, header, min=min, max=max, $
                      image_max=image_max, image_min=image_min $
                      [,errmsg=errmsg]

 INPUTS:
       DATA_FILE - name of FITS file

 OPTIONAL INPUTS:
       COLUMN - Column number of data in FITS binary table. This parameter
                has no effect on "plain" FITS files, and will cause CDS_IMAGE
                to be called directly with its value if passed.
       GROUP  - Group ID of the group leader.

 OUTPUTS:
       IMAGE  - A 2-D image array
       HEADER - Header of the image

 OPTIONAL OUTPUTS:
       DATA_INFO - A structure that indicates name and column number of all
                   images contained in one FITS file. This is generally for
                   FITS files with a binary table. It show have the following
                   tags:

                      BINARY  - Integer scalar with value 1/0 indicating if
                                the data_file contains binary table or not
                      COL     - Integer vector that indicates all column
                                numbers for the data
                      LABEL   - String vector showing the label of data in
                                each column
                      CUR_COL - Current column of data being read

       IMG_UTC - UTC at which the observation was made
       IMG_CSI - Part of CSI structure, containing the following tags:
                 XU0, YU0, X0, Y0, XV0, YV0, SRX, SRY, FLAG
       ORIGIN - The value of the first point along each of the axes
                of image array, in absolute coordinates (e.g., arcsec)
       SPACING - The pixel spacing along each axis, i.e., value (in
                 absolute system) per image data pixel. It is the
                 scaling factor we use in CSI (srx and sry, etc).

 KEYWORD PARAMETERS:
       None.

 CALLS: ***
	ARR2STR [1], Arr2Str [2], Bell, CDS_IMAGE, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILEPATH, FXBCLOSE [1], FXBCLOSE [2], FXBFIND [1], FXBFIND [2]
	FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXHREAD [1], FXHREAD [2], FXKVALUE, FXPAR [1]
	FXPAR [2], FXREAD [1], FXREAD [2], GET_OBS_DATE, ITOOL_SET_CSI, NUM_CHK, PB0R
	POPUP_MSG, ROT, SEP_FILENAME, TRIM, USE_EARTH_VIEW, USE_SOHO_VIEW, VALID_NUM [1]
	VALID_NUM [2], VALID_NUM [3], XSEL_ITEM, concat_dir [4]
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:

 PREVIOUS HISTORY:
       Extracted from IMAGE_TOOL.PRO, February 27, 1995, Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, GSFC/ARC, February 27, 1995
       Version 2, Liyun Wang, GSFC/ARC, May 11, 1995
          Rotated loaded image if keyword CROTA or CROTA1 is found in the
             header and its value is not zero
       Version 3, April 1, 1996, Liyun Wang, GSFC/ARC
          Modified so that point of view is set based on the loaded image
       Version 4, July 30, 1996, Liyun Wang, NASA/GSFC
          Fixed a bug occurred when dealing with compressed FITS files
       Version 5, 10-Jul-2003, William Thompson, GSFC
               Look for CROTA2 as well, to be more standards compliant

 VERSION:
       Version 5, 10-Jul-2003


RD_IMAGE_GIF $SSW/gen/idl/image_tool/rd_image_gif.pro
[Previous] [Next]
 PROJECT:
       SOHO

 NAME:	
       RD_IMAGE_GIF

 PURPOSE:
       To read a GIF file and to get related obs time 

 EXPLANATION:
       
 CALLING SEQUENCE: 
       rd_image_gif, file, data, obs_time=obs_time

 INPUTS:
       FILE - GIF file name

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       DATA   - 2-Dim Image data being read

 OPTIONAL OUTPUTS:
       OBS_TIME - Observation time associated with the image
       MINIMUM  - Minimum value in the image aaary
       MAXIMUM  - Maximum value in the image aaary
       COLOR_TABLE - Nx3 array for color table in RGB system
       STATUS  - Status of loading the GIF file. 1 for success and 0 
                 for failure
       ERROR   - Named variable containing error message. If no error
                 occurs, a null string is returned
 KEYWORD PARAMETERS: 
       None.

 CALLS: ***
	FILE_EXIST [2], GET_UTC, READ_GIF, TRIM, VALID_TIME, XACK, XANSWER, XINPUT
	file_exist [1], file_exist [3]
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written May 8, 1995, Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, GSFC/ARC, May 8, 1995
       Version 2, October 27, 1995, Liyun Wang, GSFC/ARC
          Made the starting search directory to be current working directory
       Version 3, November 2, 1995, Liyun Wang, GSFC/ARC
          Changed to a procedure to be consistant with RD_IMAGE_FITS
          Modified so that filename needs to be supplied

 VERSION:
       Version 3, November 2, 1995


rd_ionbal [1] $SSW/gen/idl/spectra/rd_ionbal.pro
[Previous] [Next]
  NAME:
    rd_ionbal
  PURPOSE:
    Read ascii files containing ionization balance calculations.
  CALLING SEQUENCE:
    bal_data = rd_ionbal(infil)	; Reads first calculation in file
    bal_data = rd_ionbal(infil,1)	; Reads 2nd calculation (if any) in file.
  INPUTS:
    infil	= File name of ionization balance file (ascii)
  OPTIONAL INPUTS:
    calculation = 0 	(default) to read the first calculation, 1 for 2nd, etc.
  OUTPUT:
    Returns a data structure containing the contents of the 
    requested calculation.  Returns Log10(Abun) vs Log10(Temp)
  METHOD:
    rd_ionbal reads the BCS format of ionization balance files.  rd_ionbal
    makes use of the point_lun procedure to parse the file.

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], FILE_EXIST [2], STR2ARR [1]
	STR2ARR [2], break_file [4], file_exist [1], file_exist [3]
 CALLED BY:
	get_ionbal [1], get_ionbal [2]
  MODIFICATION HISTORY:
    11-oct-93, J. R. Lemen (LPARL), Written


rd_mdi [1] $SSW/gen/idl/fund_lib/soho/rd_mdi.pro
[Previous] [Next]
   Name: rd_mdi

   Purpose: simple mdi front end to mreadfits; ssw-rationalize output

   Input Parameters:
      files - list of one or more mdi fits files

   Output Paramters:
      index - the structure equivilent header vector
      data  - optional output 2D or 3D data

   
   Calling Sequence:
     rd_mdi, filelist, index [,data ] [,outsize=outsize] [,/noscale]

 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], gt_tagval [1]
	gt_tagval [2], mdi_struct [1], mdi_struct [2], mdi_struct [3], mreadfits
 CALLED BY:
	mdi_write_genxcat
   History:
      7-April-1998 - S.L.Freeland - handle the large SOI versions
      24-April-1998 - Zarro, - added check for vector index
       7-Nov-1998 - S.L.Freeland - pass NODATA->mreadfits based on n_param
      12-nov-1998 - S.L.Freeland - added call to struct2ssw prior to exit
      24-Nov-1999 - S.L.Freeland - pass unrecognized keywords->mreadfits
                                   via inheritance.
      28-Mar-2001 - Zarro (EITI/GSFC) - added catch for REFTIME if
                                        DATE_OBS is blank


Rd_NewOrb_p [1] $SSW/gen/idl/fund_lib/yohkoh/rd_neworb_p.pro
[Previous] [Next]
	Name:
		Rd_NewOrb_p
 CALLS: ***
	OBS_STRUCT [1], OBS_STRUCT [2], Rd_Pointer [1], Rd_Pointer [2], Rd_fHeader [1]
	Rd_fHeader [2], Rd_fHeader [3], rdwrt [1], rdwrt [2], rdwrt [3]
 CALLED BY:
	GetNarOrb get nearest orbit, ads_into_att, ads_into_pnt, kluge_att, mk_att [1]
	mk_att [2], mk_gx, mk_pnt, mk_week_file [1], mk_week_file [2], pnt2atr, rd_old_obs
	rd_week_file [1], rd_week_file [2], rd_week_file [3], rd_week_file [4]
	weekid [2], ydb_exist [2]
	History:
		written by MDM March-91


Rd_Pointer [1] $SSW/gen/idl/fund_lib/yohkoh/rd_pointer.pro
[Previous] [Next]
	NAME:
		Rd_Pointer
	PURPOSE:
		Read and extract the pointer section from requested
		file.
	CALLING SEQUENCE:
		Rd_Pointer, lun_filnam, pointer, recsize
	INPUT:
		lun_filnam	input file specification or the
				unit number of an openned reformatted
				file.
	Output:
		pointer a logical record containning the pointer
			section. 
		recsize	VMS record size			
 CALLS: ***
	GEN_STRUCT [1], GEN_STRUCT [2], rdwrt [1], rdwrt [2], rdwrt [3]
 CALLED BY:
	RD_ADA, RD_BDA_DP, RD_HXA, RD_XDA [1], RD_XDA [2], Rd_NewOrb_p [1], Rd_NewOrb_p [2]
	Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], ckcopy, kluge_att, mk_att [1]
	mk_att [2], mk_evn [1], mk_evn [2], mk_gx, mk_pnt, mk_week_file [1]
	mk_week_file [2], pnt2atr, rd_gsn, rd_old_obs, rd_roadmap [1], rd_sdl, rd_sld, rd_sls
	rd_sot, rd_ssl, rd_week_file [1], rd_week_file [2], rd_week_file [3]
	rd_week_file [4], ref_bad, sav_bda, sav_bsc, sav_hxi, sav_sda [1], sav_sda [2]
	sav_sda [3], weekid [2], wrt1orbit [1], wrt1orbit [2], ydb_exist [2]
	yo_file_check [1], yo_file_check [2], ys_file_check [1], ys_file_check [2]
	History:
		written by Mons Morrison, Fall 90.
		12-Dec-91 (MDM) Changed to allow a vector of filenames


rd_rdb [1] $SSW/gen/idl/genutil/rd_rdb.pro
[Previous] [Next]
NAME:
	rd_rdb
PURPOSE:
	To read an RDB file (text file with TAB delimiters).  Optionally
	put the information into a structure with tag names equal to the
	column label.
SAMPLE CALLING SEQUENCE:
	mat = rd_rdb('/data14/morrison/raw_hc_detune/400c3100_01h.28679/record.rdb')
	mat = rd_rdb(infil, 'DATAMEAN', timarr, data)
	mat = rd_rdb(infil, /struct)
	mat = rd_rdb(infil, item, timarr, data)
INPUT:
	infil	- The input file(s)
OPTIONAL INPUT:
	item	- The label which needs to be extracted into an array
OUTPUT:
	returns a 2-D string array of the RDB file contents.  OPtionally
		  return a structure
	timarr	- A time structure array (with .TIME and .DAY tags)
	data	- The values for "item"
 CALLS: ***
	MAKE_STR [1], MAKE_STR [2], anytim2ints [1], anytim2ints [2], data_type [1]
	data_type [2], rd_tfile [1], rd_tfile [2], str_replace [1], str_replace [2]
	where_arr [1], where_arr [2]
OPTIONAL KEYWORD INPUT:
	struct	- If set, then return a structure with tags equal to the
		  column labels.
HISTORY:
	Written 18-Jun-96 by M.Morrison
	12-Jul-96 (MDM) - Corrected structure option when input is an array
	18-Sep-96 (MDM) - Adjusted to allow for "#" in the field/tag names
			- Corrected for reading structures without "REF_T"
	 6-Nov-96 (MDM) - Added documentation information
	19-Feb-99 (MDM) - Added NOCOMMENT option (defaults to "\")
			- Further mods to skip comment lines


RD_RSTN $SSW/gen/idl/synoptic/rd_rstn.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_RSTN

 Purpose     : read RSTN radio data

 Category    : synoptic gbo

 Syntax      : IDL> rd_rstn,files,times,data

 Inputs      : FILES = RSTN file names

 Outputs     : TIMES = time array
               DATA  = data array (# TIMES x 8)
               FREQ  = frequency string
               TAI = return time in TAI, else UTC

 Keywords    : TSTART, TEND = time sub-interval to select

 CALLS: ***
	ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, DELVARX [1], DELVARX [2]
	DELVARX [3], DELVARX [4], EXIST, PR_SYNTAX, RD_ASCII_C, WHERE_TIMES, delvarx [5]
	get_uniq
 CALLED BY:
	RSTN__DEFINE
 History     : Written 8 April 2000, D. Zarro, SM&A/GSFC

 Contact     : dzarro@solar.stanford.edu


RD_SPIRIT $SSW/gen/idl/synoptic/rd_spirit.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RD_SPIRIT

 Purpose     : read SPIRIT data

 Category    : Ancillary GBO Synoptic 

 Syntax      : IDL> rd_spirit,file,data,header=header

 CALLS: ***
	IS_STRING, PR_SYNTAX
 History     : Written 11 Nov 2005, D. Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


RD_TEXT $SSW/gen/idl/io/rd_text.pro
[Previous] [Next]

  Name:
       RD_TEXT


 PURPOSE:   read an ascii file into an IDL session


 CATEGORY:  GEN, STRING, TEXT, I/O
       

 CALLING SEQUENCE:    text = rd_text( file )


 CALLED BY:


 CALLS: ***
	READ_SEQFILE
 INPUTS:
       file - scalar string, full filename

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       The result is text array with the file contents.

 OPTIONAL OUTPUTS:
	ERROR - set if there was a problem.

 CALLED BY:
	CLEAN_JOURNAL, CONT_EDGES, FSOC, PROCESS_SLLD_DBASE, RD_NEAR_PIN [1]
	RD_NEAR_PIN [2], RD_TGRS_SPEX [1], RD_TGRS_SPEX [2]
	Returns the current chianti version number warns, get_ovsa_log, get_survey
	setup_spex [1], setup_spex [2], todays_targets
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Tries to use RD_ASCII. If that fails it reads 10 lines at a 
	time until an ioerror occurs.

 MODIFICATION HISTORY:
	ras, use read_seqfile to protect against rd_ascii problems
	with exported vms disks, 4-dec-1996 


rd_tfile [1] $SSW/gen/idl/io/rd_tfile.pro
[Previous] [Next]
   Name: rd_tfile

   Purpose: read/return contents of text file - optionally interpret
	     and convert text table data
		
   Input 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)

   Output Parameters:
      function returns file contents (string array(list) or matrix)
		if convert is set, auto-convert to numeric data type
      
   Keyword Parameters:
      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
      header    - output string(array) containing header lines
      hskip	 - header skip (sets skip to -1)
      first_char_comm - if set, only apply "nocomment" flag when the
		   comment character is the first character
   
   Calling Sequence:
						;      RETURNS
      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: ***
	STR2ARR [1], STR2ARR [2]
 CALLED BY:
	CAT_DIRECTORY, DATA_PATHS, DSNFIL_TRIM, DSN_FINAL, EDGES_HVSPEC, EIT_SUB_SC_PIXEL
	EVAL_LINE_COMPLEX, Energy_res [2], FIND_CAT, FIND_PROC, GO_DSN_FINAL [1]
	GO_DSN_FINAL [2], HESSI FRAMEWORK TEMPLATE CLASS [2]
	HESSI FRAMEWORK TEMPLATE CLASS [3], HESSI_SHUTTERS, HESSI_SPEX [1]
	HESSI_SPEX [2], HSI_DRM_MOD CLASS, HSI_DRM_MOD_CONTROL__DEFINE
	HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4], HXT_FLARE_POS, JITTER_HTML
	MDI_SUMMARY, MLSO_SYN_READER, NEAR_CONJ, NORH_PR_EVX [1], NORH_PR_EVX [2]
	NORP_RD_AVG [1], NORP_RD_AVG [2], NORP_RD_DAILY [1], NORP_RD_DAILY [2], ORBIT_DN
	ORB_EXTRAP, PARSE_GROSSC_ATTITUDE, PRINT_OP, RD_BCSCAL [1], RD_BCSCAL [2]
	READ_ANALIST, READ_GDFILE_GD, ROLL_PLOT, SPEX__DEFINE, SXT_ECLIPSE, TOK_RD_DAILY
	TYKW_RD_DAILY, UNIX_CMD [1], UNIX_CMD [2], UPDATE_LINE_TEMPLATES
	UPDATE_SXT_CO_INDEX, YOHKOH_TERM_PREDICT, avsig_1 [1], cal_fig_mich
	calc_mtm_therm, calc_rad_loss, cfl_summary [1], cfl_summary [2]
	check_compile [1], check_compile [2], check_log [1], check_log [2]
	check_oldprocess [1], check_oldprocess [2], check_oldprocess [3]
	check_oldprocess [4], check_process [1], check_process [2], cont2time [1]
	cont2time [2], copy_visible, ctraj2orbit, daily_forecast [2], disk_hog [1]
	disk_hog [2], disk_monitor [1], disk_monitor [2], disp_therm_rs232, do_demo [1]
	do_demo [2], doc_head [1], doc_head [2], doc_head [3], doc_library2 [1]
	doc_library2 [2], dpc_decode, emi_plot [1], extract_val, file_append [1]
	file_append [2], file_diff, fitstap2tap [1], fitstap2tap [2], fl_mktext
	fl_sxtobsnar [1], fl_sxtobsnar [2], flares2disk, ftp_copy [1], ftp_copy [2]
	ftp_copy2sites, ftp_copy_new, genx2html [1], genx2html [2], get_ads [1]
	get_hk_mnem, get_ksc_holiday, get_mk3 [1], get_mk3 [2], get_sdm_val
	get_tty_type [1], get_tty_type [2], get_uvxsections, go_batch [1], go_batch [2]
	go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_yo_prod_batch
	gtab_patrols, gtt_wave_tru, help_windows, hsi_clk_delta_read
	hsi_flare_position_image [1], hsi_flare_position_image [2]
	hsi_full_sun_image [1], hsi_full_sun_image [2], hsi_locate_flare [1]
	hsi_locate_flare [3], hsi_rd_durevt, hsi_rd_orbevt [1], hsi_rd_orbevt [2]
	hsi_rd_trackfile, hsi_rdstatevectorfile, hsi_read_vcfiletimes
	hsi_write_decimation_settings, html_basics, html_doc, html_form_addtime [1]
	html_form_addtime [2], html_form_addtime [3], html_get_files, html_linklist
	html_remove_template, hxt_rdpara, id2nam, idl_server_control, image2movie
	ip_que_dmpver, keyword_db, laststat [1], laststat [2], list_nrt_times
	lists2matrix [2], main_execute [1], main_execute [2], make_ssw_mirror
	map_env2dir, mdimrot, mdipdist, mdiprot, mk_bad_pix_map_load, mk_hst_summary
	mk_limb_pixmap, mk_mdi_fits, mk_mdi_iap, mk_pix [1], mk_pix [2], mk_pubydb
	mk_sfc [1], mk_sfc [2], mk_spd, mk_ssc_batch [1], mk_ssc_batch [2], mk_vcr
	mk_ydb_list, mk_ydbtape [1], mk_ydbtape [2], mo_check, mo_patch, mobad_summ
	modvolume_inf [1], modvolume_inf [2], mon_sci5k, new_dpath [1], new_dpath [2]
	nob_img_copy, nobeyama_update, norh_t2azel, nts_copy [1], nts_copy [2]
	oneline [1], oneline [2], oneline_event [1], oneline_event [2], op_rd_special
	op_term_score, page_fmt, password_info, pl_monitor_center, plot_loi_summary [1]
	plot_loi_summary [2], pr_visible, print_ogsel
	pro loadoptextfiletimeOGverboseverbose
	pro plotogonalgdogtimeogfemtimefemflgstarttimestarttimeendtimeendtimepsps
	quick_hkplot [1], quick_hkplot [2], rd_atodat [1], rd_atodat [2], rd_dpc_table
	rd_egse_hk_txt, rd_exec_synop_index, rd_fdss_durevt_fil, rd_fdss_grndtrk_fil
	rd_fdss_orbevt_fil, rd_fdss_viewpd_fil, rd_guf_ascii, rd_pnt_hist
	rd_raw_station_plan, rd_rdb [1], rd_rdb [2], rd_selsis, rd_taer, rd_tfiles
	rd_therm_rs232, rd_tr_seq_head, rd_ulin_col, rd_ydbtap, rd_ydbtapedir
	read_sooncheck, redo_disploi, redo_mon_sci5k, ref_term [2], reg_check, rmosaic [1]
	rmosaic [2], rmosaic [3], sea, search [1], search [2], search_obs, selsisi_copy
	set_logenv [1], set_logenv [2], set_logvms, set_logwindows, sfc_check
	soon_cadence, soon_catstat, soon_com2html, soon_search [1], soon_search [3]
	soon_table, special_movie, ssw_contrib_info, ssw_getapplet, ssw_install [1]
	ssw_install [2], ssw_install_explinkages, ssw_javamovie, ssw_move
	ssw_set_chianti, ssw_strfind, ssw_swmap_info, ssw_swmap_uniqinfo
	ssw_upgrade [1], ssw_upgrade [2], sswdb_info, sswdb_upgrade, sswloc
	strpair2struct, struct_where, sxt2file, sxt2mpeg, sxt_html, sxt_plan, sxt_prep [1]
	sxt_prep [2], sxt_prep [3], sxt_ssn2fits [1], sxt_where, table2struct
	tbb_info [1], tbb_info [2], teambb [1], teambb [2], term_times, tfile__define
	tim2dbase, timeline, topsdb [1], topsdb [2], tr_decode_head [1]
	tr_decode_head [2], tr_list_frames, tr_mk_seq_alph, tr_summary_head
	trace_do_data_requests, trace_dph2struct [1], trace_recent_movie_summary
	trace_request_summary, trace_submit_request, trace_success_file, trace_where
	ucon_path, url_decode, v_orbital, video_title, web_seq, wrt_fits_bin_exten [2]
	wrt_sci160k_img, wwwidl_server_check, wwwidl_watchdog [1], wwwidl_watchdog [2]
	xcheckip, xdisp_fits, xdisp_sci5k, xdisp_trace [1], xdisp_trace2, xdisp_trace3
	xgen_widget, xhkplot, xsearch_obs, xset_chain [1], xset_chain [2], xsw2tree
	xsw2tree_event, xswlist [2], ydb_install [1], ydb_install [2], ydb_use
	ys_contrib [1], ys_contrib [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)


rd_tfiles $SSW/gen/idl/io/rd_tfiles.pro
[Previous] [Next]
NAME:
	rd_tfiles
PURPOSE:
	Allow an array of input files and then basically call RD_TFILE
SAMPLE CALLING SEQUENCE:
	out = rd_tfiles(filenames)
	out = rd_tfiles(filenames, ncols, nocomment='#')
INPUT:
	filenames- Files to read
OPTIONAL INPUT:
	ncols	- Number of columns to read
	skip	- Number of lines of header to skip
OPTIONAL KEYWORD OUTPUT:
	filemap	- An array mapping which lines came from which
		  files.  The length is identical to the output
		  and the integer value is the subscript into
		  the input filename array
 CALLS: ***
	rd_tfile [1], rd_tfile [2], str2cols [1], str2cols [2], strnocomment
 CALLED BY:
	rd_fdss, rd_raw_station_plan, ssw_sec_aktxt2struct, ssw_swmap_bestof
	tr_rd_inventory
HISTORY:
	Written 26-Nov-97 by M.Morrison
	 1-Dec-97 (MDM) - Added FILEMAP output option
	15-Apr-98 (MDM) - Added COLPOS passtrough


rd_ulin_col $SSW/gen/idl/io/rd_ulin_col.pro
[Previous] [Next]
NAME:
	rd_ulin_col
PURPOSE:
	Generic text file reader which has columns identified
	in the second line by "------" string
 CALLS: ***
	STR2ARR [1], STR2ARR [2], rd_tfile [1], rd_tfile [2], remtab [1], remtab [2]
	str2cols [1], str2cols [2]
 CALLED BY:
	keyword_db, timeline, tr_head_info, tr_lut_conv, tr_tab_head, trace_dph2struct [1]
HISTORY:
	Written 6-Oct-97 by M.Morrison
	29-Oct-97 (MDM) - Corrected error (ncol=7 hardwired)
			- Added /NOHEAD option
	11-Feb-99 (MDM) - Added first_char_comm


rd_week_file [1] $SSW/gen/idl/fund_lib/yohkoh/rd_week_file.pro
[Previous] [Next]
NAME:
	rd_week_file
PURPOSE:
	Read the weekly files which do not have orbit pointers (EVN, FEM,
	NAR, GEV, and GXT)
CALLING SEQUENCE:
	rd_week_file, roadmap(0),  roadmap(n), 'FEM', fem_data
	rd_week_file, '1-dec-91', '30-dec-91', 'EVN', evn_data
	rd_week_file,      weeks,       years, 'GEV', gev_data
INPUT:
		  INPUT CAN BE OF TWO FORMS

		  (A) Input starting and ending times
	input1	- Starting time in either (i) standard string format,
		  or (ii) a structure with .time and .day fields
		  (the 7 element time vector form is not allowed)
	input2	- Ending time.  If ending time is omitted, the
		  ending time is set to 24 hours after starting time.

		  (B) Input can be a vector of week/year number
	input1	- a vector of the week numbers to read
	input2	- a vector of the year of the week to be read
		  if the weeks vector is all within one year, the
		  year parameter can be a scalar.
	data_type - The type of data to read.  Either EVN, FEM, NAR,
		  GEV or GXT
OUTPUT:
	data	- the data structure containing the data in the files
		  See the structure definition for further information
	orb_pointer - the set of orbit pointers from the files
 CALLS: ***
	ATT_STRUCT [1], ATT_STRUCT [2], EVN_STRUCT, Ex2Int [1], Ex2Int [2], FEM_OLD_STRUCT
	FEM_STRUCT, GBO_STRUCT [1], GBO_STRUCT [2], GET_NBYTES, Int2Ex [1], Int2Ex [2]
	OBS_STRUCT [1], OBS_STRUCT [2], ORB_STRUCT, PNT_STRUCT, Rd_NewOrb_p [1]
	Rd_NewOrb_p [2], Rd_Pointer [1], Rd_Pointer [2], Rd_fHeader [1], Rd_fHeader [2]
	Rd_fHeader [3], SXT_STRUCT, anytim2ex [1], anytim2ex [2], anytim2ints [1]
	anytim2ints [2], anytim2weeks [1], anytim2weeks [2], ex2fid [1], ex2fid [2]
	file_compress [1], file_compress [2], file_list [1], file_list [2]
	file_uncompress [1], file_uncompress [2], fmt_tim [1], fmt_tim [2], gt_day [1]
	gt_day [2], int2secarr [1], int2secarr [2], is_member [1], is_member [2]
	rdwrt [1], rdwrt [2], rdwrt [3], sel_timrange [1], sel_timrange [2]
	str_copy_tags [1], str_copy_tags [2], str_copy_tags [3], str_copy_tags [4]
	wc_where [1], wc_where [2], weekid [1], weekid [2], weekid [3]
 CALLED BY:
	mk_gx, mk_week_file [1], mk_week_file [2], rd_atr, rd_att, rd_fem, rd_gbl, rd_gol
	rd_guf, rd_gxd [1], rd_gxd [2], rd_gxd [3], rd_gxt, rd_obs, rd_orb, rd_pnt, rd_sxg
	weekid [2], ydb_exist [2], yopos [1], yopos [2]
OPTIONAL KEYWORD INPUT:
	indir	- Input directory of data files.  If not present, use
		  $DIR_GEN_xxx logical directory
	vnum	- The file version number to use.  If not present, a call
		  to WEEKID is made and that latest version is used.
	nearest	- If set, then the time span is adjusted a day at a time
		  until it finds some data.  It decrements the starting
		  date by a day and increments the ending date by a day
		  up to 14 days (28 day total span)
	full_weeks - If set, then do not extract the entries that just
		  cover the times covered in the start/end time.  Return
		  all data for weeks covered by the start/end time. This
		  allows a user to have start and end time be the same
		  and still get some data.
       nobackup - If set, then do not back up a week if the start
                  time is within 90 minutes of the first day of the week.
OPTIONAL KEYWORD OUTPUT:
	status	- The read status
		  Some data is available if (status le 0)
			 0 = no error
			 1 = cannot find the file
			 2 = cannot find data in the time period
			99 = cannot recognize the data_type (prefix)
			-1 = found data, but had to go outside of the requested
			     period (only true if /NEAREST is used).
	ibyt	- The byte position within the file where the data was extracted
	filename- The name of the file which was read
RESTRICTIONS:
	Assumes that all files have the same data structure version.
HISTORY:
	Written 5-Apr-93 by M.Morrison
	 6-Apr-93 (MDM) - Modification to not change the input variable type
	 7-Apr-93 (MDM) - Added /FULL_WEEKS option
	12-Apr-93 (MDM) - Modification to allow first week to be missing
	13-Apr-93 (MDM) - Modified to work with the weekly files that have
			  orbit pointers
	15-Apr-93 (MDM) - Expanded to handle PNT, G6D, G7D
			- Expanded to handle the new OBS files
			  (OBD, OSF, OSP, OWH)
			- Removed the "ndatasets-1" restriction, made it
			  "ndatasets" (-1 was a carry over from RD_PNT)
	16-Apr-93 (MDM) - Some debugging statement
	19-Apr-93 (MDM) - Expanded to handle NEL files
	20-Apr-93 (MDM) - Expanded to handle OGB files
	21-Apr-93 (MDM) - Renamed OGB to GOL
			- Added ORB_POINTER so that the FIDs can be passed
			  out for the OBS file reads
	13-May-93 (MDM) - Expanded to handle NTS files
	14-May-93 (MDM) - Removed the special handling of OBS directory
	17-May-93 (MDM) - Minor modification
	20-May-93 (MDM) - Allowed 7-element array external time representation
			  as input.
	12-Jul-93 (MDM) - Use TEMPORARY function some more
	16-Apr-93 (MDM) - Expanded to handle ATR and ATT files
	11-Aug-93 (MDM) - Added IBYT and FILENAME output parameters
			- Modification so that if the input times match, it
			  will increment the end time by one second because
			  otherwise the /FULL_WEEK option will not work.
	 9-Mar-94 (SLF) - GUF (Ulysees Ephemeris) support
	29-Aug-94 (MDM) - Added /QSTOP option
       29-Aug-94 (MDM) - Added /NOBACKUP option to NOT back up a week
                         when start time is within 90 minutes of the first
                         day of the week - it is passed to ANYTIM2WEEKS
       25-Oct-94 (SLF) - allow use of compressed files
        8-Dec-94 (MDM) - Patch for cases where there is no data but there
                         is an orbit pointer entry
	19-Dec-94 (MDM) - Modified to correct a problem caused by the modification
			  to MK_WEEK_FILE which used a different NEWORB_P
			  structure for all weekly files.
	23-Mar-95 (MDM) - Modified to accept new version of FEM structure
       29-aug-95 (SLF) - Add GOES averages (g61/g71/g65/g75)
        1-apr-96 (SLF) -
	29-Aug-96 (RDB) - Added ORB file (orbital position file)
       21-Jul-98 (SLF) - GOES 10
	17-Dec-99 (GLS) - Y2K FIX - Modified test of input1 to accomodate Y2K values
       18-Jan-2001 (SLF) - made loop counter LONG
	19-Jun-2001, Paul Hick; fixed two obscure bugs triggered when specifying
		input times as week/year.


rd_week_file [2] $SSW/gen/idl/goes/sock_goes.pro
[Previous] [Next]
NAME:
	rd_week_file
PURPOSE:
	Read the weekly files which do not have orbit pointers (EVN, FEM,
	NAR, GEV, and GXT)
CALLING SEQUENCE:
	rd_week_file, roadmap(0),  roadmap(n), 'FEM', fem_data
	rd_week_file, '1-dec-91', '30-dec-91', 'EVN', evn_data
	rd_week_file,      weeks,       years, 'GEV', gev_data
INPUT:
		  INPUT CAN BE OF TWO FORMS

		  (A) Input starting and ending times
	input1	- Starting time in either (i) standard string format,
		  or (ii) a structure with .time and .day fields
		  (the 7 element time vector form is not allowed)
	input2	- Ending time.  If ending time is omitted, the
		  ending time is set to 24 hours after starting time.

		  (B) Input can be a vector of week/year number
	input1	- a vector of the week numbers to read
	input2	- a vector of the year of the week to be read
		  if the weeks vector is all within one year, the
		  year parameter can be a scalar.
	data_type - The type of data to read.  Either EVN, FEM, NAR,
		  GEV or GXT
OUTPUT:
	data	- the data structure containing the data in the files
		  See the structure definition for further information
	orb_pointer - the set of orbit pointers from the files
 CALLS: ***
	ATT_STRUCT [1], ATT_STRUCT [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CHMOD, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DPRINT, EVN_STRUCT
	Ex2Int [1], Ex2Int [2], FEM_OLD_STRUCT, FEM_STRUCT, FILE_EXIST [2]
	FIND_COMPRESSED, GBO_STRUCT [1], GBO_STRUCT [2], GET_NBYTES, GOES_SERVER
	GOES_TEMP_DIR, IS_DIR, Int2Ex [1], Int2Ex [2], LOCAL_NAME, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], MK_DIR, OBS_STRUCT [1], OBS_STRUCT [2], ORB_STRUCT
	PNT_STRUCT, Rd_NewOrb_p [1], Rd_NewOrb_p [2], Rd_Pointer [1], Rd_Pointer [2]
	Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], SOCK_COPY, SOCK_FIND, SOCK_GOES
	SXT_STRUCT, UNIQ [1], UNIQ [2], UNIQ [3], YDB_PATH, anytim2ex [1], anytim2ex [2]
	anytim2ints [1], anytim2ints [2], anytim2weeks [1], anytim2weeks [2]
	break_file [4], concat_dir [4], data_type [1], data_type [2], ex2fid [1]
	ex2fid [2], file_exist [1], file_exist [3], file_list [1], file_list [2]
	fmt_tim [1], fmt_tim [2], gt_day [1], gt_day [2], int2secarr [1], int2secarr [2]
	is_member [1], is_member [2], rdwrt [1], rdwrt [2], rdwrt [3], sel_timrange [1]
	sel_timrange [2], str_copy_tags [1], str_copy_tags [2], str_copy_tags [3]
	str_copy_tags [4], str_replace [1], str_replace [2], tim2orbit [1]
	tim2orbit [2], wc_where [1], wc_where [2], week_loop [1], week_loop [2]
	week_loop [3], weekid [1], weekid [2], weekid [3], ydb_exist [1], ydb_exist [2]
	ydb_exist [3], ydb_exist [4]
 CALLED BY:
	mk_gx, mk_week_file [1], mk_week_file [2], rd_atr, rd_att, rd_fem, rd_gbl, rd_gol
	rd_guf, rd_gxd [1], rd_gxd [2], rd_gxd [3], rd_gxt, rd_obs, rd_orb, rd_pnt, rd_sxg
	weekid [2], ydb_exist [2], yopos [1], yopos [2]
OPTIONAL KEYWORD INPUT:
	indir	- Input directory of data files.  If not present, use
		  $DIR_GEN_xxx logical directory
	vnum	- The file version number to use.  If not present, a call
		  to WEEKID is made and that latest version is used.
	nearest	- If set, then the time span is adjusted a day at a time
		  until it finds some data.  It decrements the starting
		  date by a day and increments the ending date by a day
		  up to 14 days (28 day total span)
	full_weeks - If set, then do not extract the entries that just
		  cover the times covered in the start/end time.  Return
		  all data for weeks covered by the start/end time. This
		  allows a user to have start and end time be the same
		  and still get some data.
       nobackup - If set, then do not back up a week if the start
                  time is within 90 minutes of the first day of the week.
OPTIONAL KEYWORD OUTPUT:
	status	- The read status
		  Some data is available if (status le 0)
			 0 = no error
			 1 = cannot find the file
			 2 = cannot find data in the time period
			99 = cannot recognize the data_type (prefix)
			-1 = found data, but had to go outside of the requested
			     period (only true if /NEAREST is used).
	ibyt	- The byte position within the file where the data was extracted
	filename- The name of the file which was read
RESTRICTIONS:
	Assumes that all files have the same data structure version.
HISTORY:
	Written 5-Apr-93 by M.Morrison
	 6-Apr-93 (MDM) - Modification to not change the input variable type
	 7-Apr-93 (MDM) - Added /FULL_WEEKS option
	12-Apr-93 (MDM) - Modification to allow first week to be missing
	13-Apr-93 (MDM) - Modified to work with the weekly files that have
			  orbit pointers
	15-Apr-93 (MDM) - Expanded to handle PNT, G6D, G7D
			- Expanded to handle the new OBS files
			  (OBD, OSF, OSP, OWH)
			- Removed the "ndatasets-1" restriction, made it
			  "ndatasets" (-1 was a carry over from RD_PNT)
	16-Apr-93 (MDM) - Some debugging statement
	19-Apr-93 (MDM) - Expanded to handle NEL files
	20-Apr-93 (MDM) - Expanded to handle OGB files
	21-Apr-93 (MDM) - Renamed OGB to GOL
			- Added ORB_POINTER so that the FIDs can be passed
			  out for the OBS file reads
	13-May-93 (MDM) - Expanded to handle NTS files
	14-May-93 (MDM) - Removed the special handling of OBS directory
	17-May-93 (MDM) - Minor modification
	20-May-93 (MDM) - Allowed 7-element array external time representation
			  as input.
	12-Jul-93 (MDM) - Use TEMPORARY function some more
	16-Apr-93 (MDM) - Expanded to handle ATR and ATT files
	11-Aug-93 (MDM) - Added IBYT and FILENAME output parameters
			- Modification so that if the input times match, it
			  will increment the end time by one second because
			  otherwise the /FULL_WEEK option will not work.
	 9-Mar-94 (SLF) - GUF (Ulysees Ephemeris) support
	29-Aug-94 (MDM) - Added /QSTOP option
       29-Aug-94 (MDM) - Added /NOBACKUP option to NOT back up a week
                         when start time is within 90 minutes of the first
                         day of the week - it is passed to ANYTIM2WEEKS
       25-Oct-94 (SLF) - allow use of compressed files
        8-Dec-94 (MDM) - Patch for cases where there is no data but there
                         is an orbit pointer entry
	19-Dec-94 (MDM) - Modified to correct a problem caused by the modification
			  to MK_WEEK_FILE which used a different NEWORB_P
			  structure for all weekly files.
	23-Mar-95 (MDM) - Modified to accept new version of FEM structure
       29-aug-95 (SLF) - Add GOES averages (g61/g71/g65/g75)
        1-apr-96 (SLF) -
	29-Aug-96 (RDB) - Added ORB file (orbital position file)
       21-Jul-98 (SLF) - GOES 10
	17-Dec-99 (GLS) - Y2K FIX - Modified test of input1 to accomodate Y2K values
       18-Jan-2001 (SLF) - made loop counter LONG
	19-Jun-2001, Paul Hick; fixed two obscure bugs triggered when specifying
		input times as week/year.
       22-May-2002, Zarro (L-3Com/GSFC) - made socket compatible


RDFITS_STRUCT $SSW/gen/idl_libs/astron/fits/rdfits_struct.pro
[Previous] [Next]
 NAME:
      RDFITS_STRUCT
 PURPOSE:
      Read an entire FITS file (all extensions) into a single IDL structure. 
 EXPLANATION:
      Each header, image or table array is placed in a separate structure 
      tag.

 CALLING SEQUENCE:
      RDFITS_STRUCT, filename, struct, /SILENT, /HEADER_ONLY ]

 INPUT:
      FILENAME = Scalar string giving the name of the FITS file.  
                 One can also specify a gzip (.gz) compressed file 

 OPTIONAL KEYWORD: 
      /HEADER_ONLY - If set, then only the FITS headers (and not the data)
                are read into the structure.
      /SILENT - Set this keyword to suppress informational displays at the
               terminal.
 OUTPUT:
      struct = structure into which FITS data is read.   The primary header
             and image are placed into tag names HDR0 and IM0.   The ith
             extension is placed into the tag names HDRi, and either TABi
             (if it is a binary or ASCII table) or IMi (if it is an image
             extension)

             If /HEADER_ONLY is set, then struct will contain tags HDR0, HDR1
             ....HDRn containing all the headers of a FITS file with n 
             extensions
 PROCEDURES USED:
       FITS_OPEN, FITS_READ, FITS_CLOSE

 METHOD:
       The file is opened with FITS_OPEN which return information on the 
       number and type of each extension.    The CREATE_STRUCT() function
       is used iteratively, with FITS_READ calls to build the final structure.

 EXAMPLE:
       Read the FITS file 'm33.fits' into an IDL structure, st

       IDL> rdfits_struct, 'm33.fits', st
       IDL> help, /str, st                   ;Display info about the structure

 CALLS: ***
	FITS_CLOSE, FITS_OPEN, FITS_READ
 RESTRICTIONS:
       Does not handle random groups or variable length binary tables
 MODIFICATION HISTORY:
       Written K. Venkatakrishna, STX April 1992
       Code cleaned up a bit  W. Landsman  STX  October 92
       Modified for MacOS     I.  Freedman  HSTX April 1994
       Work under Windows 95  W. Landsman   HSTX  January 1996
       Use anonymous structures, skip extensions without data WBL April 1998
       Converted to IDL V5.0, W. Landsman, April 1998
       OS-independent deletion of temporary file  W. Landsman  Jan 1999
       Major rewrite to use FITS_OPEN and CREATE_STRUCT() W. Landsman Sep 2002
       Added /HEADER_ONLY keyword   W. Landsman  October 2003
       Do not copy primary header into extension headers W. Landsman Dec 2004
       Do not modify NAXIS when using /HEADER_ONLY W. Landsman Jan 2005


RDFLOAT $SSW/gen/idl_libs/astron/misc/rdfloat.pro
[Previous] [Next]
 NAME:
      RDFLOAT
 PURPOSE:
      Quickly read a numeric ASCII data file into IDL floating/double vectors.
 EXPLANATION:
      Columns of data may be separated by tabs or spaces.      This 
      program is fast but is restricted to data files where all columns can 
      be read as floating point (or all double precision).   

      Use READCOL if  greater flexibility is desired.   Use READFMT to read a 
      fixed-format ASCII file.   Use FORPRINT to print columns of data.

 CALLING SEQUENCE:
      RDFLOAT, name, v1, [ v2, v3, v4, v5, ...  v19] 
                         COLUMNS, /DOUBLE, SKIPLINE = , NUMLINE = ]

 INPUTS:
      NAME - Name of ASCII data file, scalar string.  

 OPTIONAL INPUT KEYWORDS:
      COLUMNS - Numeric scalar or vector specifying which columns in the file
               to read.    For example, if COLUMNS = [3,7,11] then the first
               output variable (v1) would contain column 3, the second would
               contain column 7 and the third would contain column 11.   If
               the number of elements in the COLUMNS vector is less than the
               number of output parameters, then consecutive columns are 
               implied.    For example, if 3 output parameters are supplied
               (v1,v2,v3) and COLUMNS = 3, then columns 3,4, and 5 will be
               read.   
      SKIPLINE - Integer scalar specifying number of lines to skip at the top
              of file before reading.   Default is to start at the first line.
      NUMLINE - Integer scalar specifying number of lines in the file to read.  
             Default is to read the entire file
      /DOUBLE - If this keyword is set, then all variables are read in as
              double precision.
      /SILENT - Set this keyword to suppress any informative messages

 OUTPUTS:
      V1,V2,V3,...V19 - IDL vectors to contain columns of data.
               Up to 19 columns may be read.  All output vectors are of type
               float, unless the /DOUBLE keyword is set, 

 EXAMPLES:
      Each row in a file 'position.dat' contains a star number and 6 columns
      of data giving an RA and Dec in sexigesimal format.   Read into IDL 
      variables.     

       IDL> rdfloat,'position.dat',ID,hr,min,sec,deg,dmin,dsec  

       All output vectors will be floating point.    To only read the 
       declination vectors (Deg,dmin,dsec)

       IDL> rdfloat,'position.dat',deg,dmin,dsec,col=4

 CALLS: ***
	NUMLINES [1], NUMLINES [2], strsplit
 RESTRICTIONS:
      (1) All rows in the file must be formatted identically (except for 
          those skipped by SKIPLINE).    RDFLOAT reads the first line of 
          the data (after SKIPLINE) to determine the number of columns of 
          data.
      (2) Cannot be used to read strings
 PROCEDURES USED:
      NUMLINES()
 MINIMUM IDL VERSION:
      V5.3 (uses STRSPLIT() )
 REVISION HISTORY:
      Written         W. Landsman                 September 1995
      Call NUMLINES() function                    February 1996
      Read up to 19 columns                       August 1997
      Converted to IDL V5.0   W. Landsman         September 1997
      Allow to skip more than 32767 lines  W. Landsman  June 2001
      Added /SILENT keyword   W. Landsman         March 2002
      Added COLUMNS keyword, use STRSPLIT    W. Landsman May 2002
      Use SKIP_LUN if V5.6 or later    W. Landsman Nov 2002


RDPLOT $SSW/gen/idl_libs/astron/plot/rdplot.pro
[Previous] [Next]
 NAME:
   RDPLOT

 PURPOSE:
   Like CURSOR but with a full-screen cursor and continuous readout option

 EXPLANATION:
   This program is designed to essentially mimic the IDL CURSOR command,
   but with the additional options of continuously printing out the data
   values of the cursor's position, and using a full-screen cursor rather 
   than a small cross cursor.  The full screen cursor uses OPLOT and 
   X-windows graphics masking to emulate the cursor.
      One difference is that IF the PRINT keyword is set but the DOWN,
   WAIT, CHANGE, or NOWAIT keywords are not set, then the leftmost mouse
   button will print a "newline" line-feed, but not exit.

 CALLING SEQUENCE:
   RDPLOT [, X, Y] [, WaitFlag] [, /DATA | /DEVICE | /NORMAL]
      [, /NOWAIT | /WAIT | /DOWN | /CHANGE] 
      [, /FULLCURSOR] [, /NOCLIP] [, /CROSS] [, /ACCUMULATE]
      [, ERR=, PRINT=, XTITLE=, YTITLE=, XVALUES=, YVALUES=
       , LINESTYLE=, THICK=, COLOR=, BACKGROUND=]

 REQUIRED INPUTS:
   None.

 OPTIONAL INPUTS: 
   WAITFLAG = Uses the same table as the intrinsic CURSOR command, But note
	that unlike the CURSOR command, there is no UP keyword.
		WaitFlag=0 sets the NOWAIT keyword
		WaitFlag=1 sets the WAIT keyword {default}
		WaitFlag=2 sets the CHANGE keyword
		WaitFlag=3 sets the DOWN keyword

 OPTIONAL OUTPUTS:
    X - a named variable to receive the final cursor X position, scalar
        or vector (if /ACCUMULATE is set)
    Y - a named variable to receive the final cursor Y position, scalar
        or vector (if /ACCUMULATE is set)
 OPTIONAL KEYWORD INPUT PARAMETERS:
   /DATA - data coordinates are displayed and returned.
   /DEVICE - device coordinates are displayed and returned.
   /NORMAL - normal coordinates are displayed and returned.
      Default is to use DATA coordinates if available (see notes).
   /NOWAIT = if non-zero the routine will immediately return the cursor's
      present position.
   /WAIT - if non-zero will wait for a mouse key click before returning.  If
      cursor key is already down, then procedure immediately exits.
   /DOWN - equivalent to WAIT *except* that if the mouse key is already down
      when the procedure is called, the procedure will wait until the mouse
      key is clicked down again.
   /CHANGE - returns when the mouse is moved OR a key is clicked up or down.
   PRINT = if non-zero will continuously print out (at the terminal) the data 
      values of the cursor's position.  If PRINT>1, program will printout a 
      brief header describing the mouse button functions.  However, note that 
      the button functions are overridden if any of the DOWN, WAIT, or
      CHANGE values are non-zero.
   XTITLE = label used to describe the values of the abscissa if PRINT>0.
   YTITLE = label used to describe the values of the ordinate if PRINT>0.
   XVALUES = a vector corresponding to the values to be printed when the
	PRINT keyword is set.  This allows the user the option of printing
	out other values rather than the default X coordinate position of
	the cursor.  E.g., if XVALUES is a string vector of dates such as
	['May 1', 'May 2', ...], then those dates will be printed rather than
	the X value of the cursor's position: if X=1 then 'May 2' would be
	printed, etc.  This requires that the values of the X coordinate read
	by the cursor must be positive (can't access negative elements).
       If XVALUES=-1, then NO values for X will be printed.
   YVALUES = analogous to the XVALUES keyword.
   /FULLCURSOR - if non-zero default cursor is blanked out and full-screen 
      (or full plot window, depending on the value of NOCLIP) lines are
      drawn; their intersecton is centered on the cursor position.
   /NOCLIP - if non-zero will make a full-screen cursor, otherwise it will
      default to the value in !P.NOCLIP.
   LINESTYLE = style of line that makes the full-screen cursor.
   THICK = thickness of the line that makes the full-screen cursor.
   COLOR = color of the full-screen cursor.
   BACKGROUND = color of the background of the plot device.  If this has
      been set to !P.BackGround, then this keyword is unnecessary.
   CROSS = if non-zero will show the regular cross AND full screen cursors.
   /ACCUMULATE - all of the positions for which the left button was
      clicked are stored in the X and Y variables.  Has no effect if X and Y 
      are not present.

 OPTIONAL KEYWORD OUTPUT PARAMETER:
   ERR = returns the most recent value of the !mouse.button value.

 NOTES:
   Note that this procedure does not allow the "UP" keyword/flag...which 
   doesn't seem to work too well in the origianl CURSOR version anyway.

   If a data coordinate system has not been established, then RDPLOT will
   create one identical to the device coordinate system.   Note that this
   kluge is required even if the user specified /NORMAL coordinates, since
   RDPLOT makes use of the OPLOT procedure.  This new data coordinate system
   is effectively "erased" (!X.CRange and !Y.CRange are both set to zero)
   upon exit of the routine so as to not change the plot status from the
   user's point of view.

   Only tested on X-windows systems.  If this program is interrupted, the
   graphics function might be left in a non-standard state; in that case,
   run the program RESET_RDPLOT to return the standard graphics functions,
   or type the command:   DEVICE, /CURSOR_CROSS, SET_GRAPHICS=3, BYPASS=0

   Robishaw added /ACCUMULATE keyword to pass back all the positions at
   which the mouse was left-clicked.  In addition, the value of the exit
   click is returned unless the cursor did not change position between the
   last left-click and the exit click.

 BUGS:
   NOTE: (1/27/05) The bugs below have been fixed by Robishaw and tested
   on Solaris, Linux and OS-X.

   It is assumed that the current background of the plot is correctly
   defined by the value in !P.Background.  Otherwise, the color of the
   long cursor probably will not be correct.  Sometimes the color doesn't
   work anyway, and I'm not sure why.
   NOTE: Robishaw fixed this 1/27/05.

   There may be some cases (e.g., when THICK>1 and NOCLIP=0) when the
   full-screen cursor is not correctly erased, leaving "ghost images" on the
   plot.  It just seems that the screen updates get slow or the positions
   ambiguous with a thick line and the cursor off the plot.
   NOTE: Robishaw fixed this 1/27/05.

 PROCEDURE:
   Basically is a bells-n-whistles version of the CURSOR procedure.  All
   the details are covered in the above discussion of the keywords.

 CALLS: ***
	RESET_RDPLOT
 EXAMPLES:
   A silly, but informative one:
   Months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', $
             'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
   plot, indgen(12), xrange=[-5, 15]
   rdplot, /FULL, /PRINT, XTITLE='Month: ', YTITLE='Y-value per month = ', $
      xvalues=Months

   If your plot has a non-black background color, be sure to set either
   !p.background or the BACKGROUND keyword.  Here are examples of how to
   use a blue full-screen cursor on a plot with a red background and
   yellow axes and data. First, deal with color decomposition off:
   device, decomposed=0
   tvlct, [255,255,0], [0,255,0], [0,0,255], 1
   plot, randomn(seed,1024), XSTYLE=19, PSYM=3, COLOR=2, BACK=1
   rdplot, /PRINT, /FULL, THICK=5, /NOCLIP, BACK=1, COLOR=3

   For decomposition on (TrueColor or DirectColor only):
   device, decomposed=1
   plot, randomn(seed,1024), XSTYLE=19, PSYM=3, COLOR=65535l, BACK=255l
   rdplot, /PRINT, /FULL, THICK=5, /NOCLIP, BACK=255l, COLOR=16711680l

 MODIFICATION HISTORY:
   Written (originally named CURFULL) by J.Wm.Parker  1993 Nov 22 
   Created data coordinates if not already present, W. Landsman Nov. 93
   Added continuous printout of data values, COLOR and FULLCURSOR keywords
      (so that default is that it acts just like the cursor command).
      Changed name from CURFULL to RDPLOT.   J.Wm.Parker  1994 Apr 20
   Modified (with some translation table assistance from the IDL support 
      group) to correctly plot the crosshair with the desired IDL 
      color using the device's translation table to determine the XOR 
      function and using the BYPASS function.  Added the RESET_RDPLOT
      procedure to cleanup crashes that might occur while running
      RDPLOT.  Other minor changes/bug fixes.  J.Wm.Parker  1994 May 21
   Modified DOWN, WAIT, CHANGE functions to behave more similar to the
      generic CURSOR procedure.   J.Wm.Parker  1995 April 24
   Added XVALUES, YVALUES keywords and cleanup.   J.Wm.Parker  1995 April 24
   Convert to IDL V5.0,  W. Landsman    July 1998
   Change !D.NCOLORS to !D.TABLE_SIZE for 24 bit displays W. Landsman May 2000
   Skip translation table for TrueColor visuals   W. Landsman  March 2001
   Fixed /FULLCURSOR ghosts. Fixed to properly deal with background colors
      in 24-bit visual classes (TrueColor and DirectColor).  Added
      BACKGROUND keyword. Tim Robishaw 2005 Jan 27       
   Added /ACCUMULATE keyword. T. Robishaw 2006 Nov 8
   Corrected following problems. When /CHANGE and /PRINT were set,
      returned X & Y were different than those printed.  When /PRINT and
      /NOWAIT were set, or /PRINT and /WAIT were set and the routine was
      entered with a mouse button clicked, nothing was printed. When
      /PRINT and /DOWN were set, if routine was started with button down,
      advertised behavior was that routine would exit on next down click;
      in practice if cursor was not moved, successive down clicks had no
      effect.  Now, if X is passed as an output variable, requires that Y
      is also passed, like CURSOR.  Bottom line is that RDPLOT now really
      does behave like CURSOR and when /PRINT is set, the values printed
      correspond to those returned in X & Y.  T. Robishaw 2006 Nov 12
   Fixed misbehavior when color decomposition was set to off for
      TrueColor and DirectColor.  Now thoroughly tested on PseudoColor
      displays as well as both decomposition states for TrueColor and
      DirectColor.  Also made the default cursor color white when
      decomposition is on (this has been its default value for
      decomposition off). T. Robishaw 2006 Nov 16


RDPSF $SSW/gen/idl_libs/astron/idlphot/rdpsf.pro
[Previous] [Next]
 NAME:
       RDPSF
 PURPOSE:
       Read the FITS file created by GETPSF in the DAOPHOT sequence 
 EXPLANATION:
       Combines the Gaussian with the residuals to create an output PSF array.

 CALLING SEQUENCE:
       RDPSF, PSF, HPSF, [ PSFname]

 OPTIONAL INPUTS
       PSFname - string giving the name of the FITS file containing the PSF
               residuals

 OUTPUTS
       psf - array containing the actual PSF
       hpsf - header associated with psf

 PROCEDURES CALLED:
       DAO_VALUE(), MAKE_2D, SXADDPAR, READFITS(), SXPAR()
 REVISION HISTORY:
       Written W. Landsman              December, 1988
       Checked for IDL Version 2, J. Isensee & J. Hill, December, 1990
       Converted to IDL V5.0   W. Landsman   September 1997
 CALLS:


rdwrt [1] $SSW/gen/idl/fund_lib/yohkoh/rdwrt.pro
[Previous] [Next]
NAME:
	rdwrt
PURPOSE:
	All input and output to the reformatted data files is done
	by this routine.
INPUT:
	code		'W' for write, 'R' for read
	lun		logical unit of file to write to
	ibyt		starting byte to write data to
	rsiz		record size of output file (in bytes)
INPUT/OUTPUT:
	data		data array to read/write
OPTIONAL INPUT:
	qupdate_ibyt	If set, the value "ibyt" is updated to the current 
			position within the file
	qdebug		If set, a debut line is printed
 CALLS: ***
	IS_LENDIAN, dec2sun [1], dec2sun [2], yoh_ieee2vax [1], yoh_ieee2vax [2]
	yoh_vax2ieee [1], yoh_vax2ieee [2]
 CALLED BY:
	RD_ADA, RD_ADA_DATA, RD_BDA [1], RD_BDA_DATA, RD_BDA_DP, RD_BSC_DATA, RD_CBA_DATA
	RD_HDA_DATA, RD_HXA, RD_HXI_DATA, RD_SDA_DATA [1], RD_SDA_DATA [2], RD_STR_DATA
	RD_SXL_DATA, RD_WDA_DATA, RD_XDA [1], RD_XDA [2], Rd_NewOrb_p [1], Rd_NewOrb_p [2]
	Rd_Pointer [1], Rd_Pointer [2], Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3]
	ads_into_att, ads_into_pnt, data_compress [1], data_compress [2]
	data_compress [3], kluge_att, mk_att [1], mk_att [2], mk_evn [1], mk_evn [2]
	mk_fem_file [1], mk_fem_file [2], mk_gbl, mk_gev [1], mk_gev [2], mk_gsn_obs, mk_gx
	mk_nar [1], mk_nar [2], mk_orb_file, mk_pnt, mk_sd2, mk_sdl, mk_sl [1], mk_sl [2]
	mk_sot, mk_ssl, mk_sxc, mk_sxl, mk_week1_file, mk_week_file [1], mk_week_file [2]
	pnt2atr, rd_dsktapdir, rd_gsn, rd_obs_entry, rd_roadmap [1], rd_sdl, rd_sld, rd_sls
	rd_sot, rd_ssl, rd_week_file [1], rd_week_file [2], rd_week_file [3]
	rd_week_file [4], sav_bda, sav_bsc, sav_hxi, sav_sda [1], sav_sda [2], sav_sda [3]
	sxt_patch_att, weekid [2], wrt1cba, wrt1orbit [1], wrt1orbit [2], wrtsxtmap
	ydb_exist [2]
OPTIONAL KEYWORD INPUT:
	quiet		If set, do not print error messages when writing
			does not end of a record boundary
HISTORY:
	Written Jun 1991 by M.Morrison
	19-Oct-91 (MDM) Added option of byte swapping if on Sun system
	 9-Nov-91 (MDM) Made swaping occur always unless it is run on
			a VMS or ULTRIX machine
	12-Dec-91 (MDM) Used "dec2sun" instead of "vax2sun" and "sun2vax"
	21-May-92 (MDM) Modified so that the input variable "data" is not
			changed for the cases where the machine writing the
			data is non-DEC (since it must do byte swapping before
			the write)
	12-Oct-92 (MDM) Removed check to see where pointer was left from
			the last read/write
			Added QUIET option so that funny shaped images
			can be saved with SAV_SDA.
	13-Apr-93 (MDM) Added calls to YOH_IEEE2VAX and YOH_VAX2IEEE to
			convert the REALs when on the VMS machine
	 8-Jun-93 (MDM) Added the capability to override the default which
			is to convert the REAL*4 values from VAX to IEEE
			format before writing, and then back again during
			reading.
	 3-Aug-93 (MDM) Expanded the list of operating systems that do not
			swap bytes to include 'OSF' (and vms and ultrix)
	 9-Sep-95 (ATP) Expanded list of operating systems that do not
			swap bytes to include 'linux' (i386)
       25-May-98 (DMZ) Further expanded noswap list to Windows systems
       15-Jan-00 (DMZ) Added ON_IOERROR check and ERR keyword
	29-Dec-06 (ROM) Added DARWIN to the list of noswap OS
        2-Jan-07 - S.L.Freeland - 29-dec change caused problems on 
                   Macs w/ppc - modified to use 'is_lendian.pro' for
                   auto extension (use calclulation, not OS list)


RDWRT_BUFF $SSW/gen/idl/io/rdwrt_buff.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RDWRT_BUFF

 Purpose     : read & write unformatted data buffer

 Category    : utility system

 Syntax      : IDL> rdwrt_buff,ilun,olun,chunk

 Inputs      : ILUN = logical unit to read from
               OLUN = logical unit to write to
               MAXSIZE = max size in bytes to read/write 

 Keywords    : BUFFSIZE = buffer size to read/write [def = 1 MB]
               COUNTS = bytes actually read/written
               ERR = error string
               PROGRESS = set for progress meter
               CANCELLED = 1 if reading was cancelled
               SLURP = read without buffering
               OMESSSAGE = output message (if /VERBOSE)

 CALLS: ***
	ALLOW_WINDOWS, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DPRINT, ERR_STATE
	EXIST, IS_STRING, PROGMETER, XKILL, XTEXT, delvarx [5], is_number [1], is_number [2]
	widget_valid
 CALLED BY:
	HTTP__DEFINE
 History     : Written, 6 May 2002, D. Zarro (L-3Com/GSFC)
             : Modified, 20 Sept 2003, D. Zarro (L-3Com/GSFC) 
               - added extra error checks
               Modified, 26 Dec 2005, Zarro (L-3Com/GSFC) 
               - improved /VERBOSE output
               Modified, 12 Nov 2006, Zarro (ADNET/GSFC)
               - moved X-windows check into CASE statement
               Modified, 21 Jan 2007, Zarro (ADNET/GSFC)
               - fixed /PROGRESS

 Contact     : dzarro@solar.stanford.edu


READ_DEFAULT $SSW/gen/idl/util/read_default.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	
	READ_DEFAULT
 Purpose     :	
	Prompts for a variable with a default value.
 Explanation :	
	Reads in a variable from the terminal.  If nothing is typed in, then
	the default is used. 
 Use         :	
	READ_DEFAULT, PROMPT, ANSWER, DEFAULT
 Inputs      :	
	PROMPT	= Prompt to READ_DEFAULT for input.
	DEFAULT	= Default answer if nothing typed in.
 Opt. Inputs :	

 Outputs     :	
	ANSWER	= Answer, either typed in or default.	
 Opt. Outputs:	
	None.
 Keywords    :	
	None.
 Calls       : ***
	TRIM
 CALLED BY:
	WCS_FIT_GRISM
 Common      :	
	None.
 Restrictions:	
	None.
 Side effects:	
	None.
 Category    :	
	Utilities, User_interface.
 Prev. Hist. :	
	W.T.T., Oct. 1989.
 Written     :	
	William Thompson, GSFC, October 1989.
 Modified    :	
	Version 1, William Thompson, GSFC, 9 July 1993.
		Incorporated into CDS library.
 Version     :	
	Version 1, 9 July 1993.


READ_EIT_FILE $SSW/gen/idl/image_tool/read_eit_file.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : READ_EIT_FILE

 Purpose     : read EIT files 

 Category    : planning

 Syntax      : data=read_eit_file(file)

 Inputs      : FILE = EIT filename

 Opt. Outputs: DATA = EIT data array

 Keywords    : HEADER = EIT file header
               INDEX = index structure (only returned if READ_EIT used)

 CALLS: ***
	ADD_PATH [1], ADD_PATH [2], DATATYPE [1], DATATYPE [2], DATATYPE [3]
	FIND_COMPRESSED, FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2], FXREAD [1]
	FXREAD [2], HAVE_PROC, IS_DIR, MK_EIT_ENV, PR_SYNTAX, RM_FILE, read_eit
 CALLED BY:
	PLOT_CDS_POINT [1], PLOT_CDS_POINT [2]
 History     : Written 21 May 1998 D. Zarro, SAC/GSFC
	       	Version 2, 17-Jun-1997, William Thompson, GSFC
			Corrected bug with binned EIT files.
              	Version 3, 7-Jun-1998, Zarro (SM&A/GSFC)
                       Added check for compressed EIT files
              	Version 4, 20-Nov-2001, Zarro (EITI/GSFC)
                       Added check for READ_EIT in !path
              
 Contact     : dzarro@solar.stanford.edu


read_ftp $SSW/gen/idl/sockets/read_ftp.pro
[Previous] [Next]
 READ_FTP

 Syntax:
   READ_FTP, remote_host [, files] [, directory] [,/FILE] [,DATA=variable]
              [,USER=string] [,PASS=string] [,/PTR]

 Arguments
   remote_host - Name of the remote host (ftp server) that you want
                 to connect to, or a complete ftp location such as for example:
                      ftp://ftp.rsinc.com/pub/gzip/README.GZIP

   directory - Remote directory where the files reside on the ftp
               server

   files - A single filename or an array of filenames to be
           retrieved.

 Keywords
   FILE - Set this keyword to make a local copy of the file to be
          transferred.  The local file will have the same name as the
          remote file and will be placed in the current working
          directory.

   DATA - Set this to a named variable that will contain either a
          byte array or an array of pointers to byte arrays with the
          transferred data.  If there is more than one file, an array
          of pointers is returned, one for each file.
          Note that when downloading large files using /FILE
          instead will require much less memory since the entire file
          is not stored in a variable in that case.

   PTR  - Set this keyword to return an array of pointers
          even when there is only one file.

   USER - Specify user name to connect to server with.  Default is:
          anonymous.

   PASS - Specify password to use when connecting.  Default is:
          test@test.com.

   ASCII - return data in ASCII format

   CLOBBER - clobber existing files when downloading

   OUT_DIR - local download directory [def = current]

   RSIZE  - size (bytes) of remote files

 HISTORY - 1-Jan-06, Zarro (L-3Com/GSFC)- adapted and modified from: 
           http://www.rsinc.com/services/techtip.asp?ttid=3537
           24-Dec-06, Zarro (ADNET/GSFC) - added RSIZE


 Examples of use.
 1) Retrieve and print the contents of ftp://ftp.rsinc.com/pub/gzip/README.GZIP:
   IDL> READ_FTP, 'ftp://ftp.rsinc.com/pub/gzip/README.GZIP', DATA=data
   IDL> help, data
          DATA            BYTE      = Array[2134]
   IDL> print, string(data)
     ------------------------------------------------------------------------------
     README file: Research Systems Anonymous FTP site (ftp.rsinc.com)
                   pub directory
                   gzip directory
   ------------------------------------------------------------------------------
   ...

 2) Retrieve some files from podaac.jpl.nasa.gov and store the files
    in the current working directory:

    IDL> files = string(lindgen(10)+50,format='(%"MGB370.%3.3d.gz")')
    IDL> READ_FTP, 'podaac.jpl.nasa.gov', files,  $
    IDL>
    'pub/sea_surface_height/topex_poseidon/mgdrb/data/MGB_370', /FILE

 CALLS:
 CALLED BY
	FTP__DEFINE, SOCK_LIST


read_genxcat $SSW/gen/idl/io/read_genxcat.pro
[Previous] [Next]

    Purpose: read a catalog which uses 'genx' (or 'geny') format files

    Input Parameters:
      t0 - start time for search
      t1 - stop time for search

    Output Parameters:
      outdata - output catalog data between t0 and t1

    Keyword Parameters:
      TOPDIR - parent directories where catalogs reside
      STATUS - success status 1=success=records between t0,t1
      DELTAT - output - deltaT seconds between t0 and output
      COUNT  - output - number of output records returned  
      ERROR - output - (boolean) if set, problem with at least one restgen
  
 CALLED BY:
	get_solar_indices, lapalma_cat, mdi_cat, mk_att [1], mk_att [2], read_lapalma
	sxt_uvf_info [1], sxt_uvf_info [3], trace_cat
    History:
      9-Mar-1998 - S.L.Freeland - long planned 'gen' function
                   finally implemented for TRACE  
     23-Apr-1998 - dont clobber input (t0x,t1x)
                   handle last file properly when no times are passed
     15-Jun-1998 - S.L.Freeland - use another 'temporary' call
     25-Jun-1998 - S.L.Freeland - protect against no data between t0,t1
                   add DELTAT , STATUS, and COUNT keywords
     19-Jul-1998 - S.L.Freeland - pre make array instead of concatenation
      4-Aug-1998 - S.L.Freeland - copy_struct -> template (allow diff structs)
     10-Sep-1998 - S.L.Freeland - use file name NEXXX (number of structures)
                                  to presize output if available
     11-sep-1998 - S.L.Freeland - call 'rd_genx' directly with /FAST switch
      7-Nov-1998 - S.L.Freeland - define catfiles from common if possible
     11-Nov-1998 - S.L.Freeland - increased backward look to (look at
                                  maximum fid dtime (catalog "cadence")
     16-dec-1998 - S.L.Freeland - fix cadence bug (when /init not set)
     11-aug-1999 - S.L.Freeland - permit catalogs without binary format
                                  (ex: date_obs only)
      2-dec-1999 - R.D.Bentley  - Took out the hardwired LOUD
     13-mar-2000 - S.L.Freeland - allow 'time/mjd'
      2-May-2000 - S.L.Freeland - limit number of files to backup
     15-Jan-2002 - S.L.Freeland - extend to 'geny' catalogs
     20-Mar-2002 - S.L.Freeland - allow GENY to have different anonymous structures
     24-Mar-2002 - L.W.Acton - Changed "for" variables to longword type
     19-Feb-2004 - S.L.Freeland - protect against "missing" files
                                  (may occur if catalog regenerated in-situ
                                   and update occurs between reads...)
  
    Restrictions:
       catalog files have GMT of first record embedded in file name

    Calls: ***
	BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
	FILE2TIME, FILE_EXIST [2], RD_GENX, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], break_file [4], concat_dir [4], curdir [1], curdir [2], data_chk [1]
	data_chk [2], delvarx [5], extract_fid, file_exist [1], file_exist [3]
	file_list [1], file_list [2], get_logenv [1], get_logenv [2], last_nelem
	required_tags, restgenx, sel_timrange [1], sel_timrange [2], ssw_deltat
	str_copy_tags [1], str_copy_tags [2], str_copy_tags [3], str_copy_tags [4]
	strextract, tim2dset [1], tim2dset [2], timegrid, totvect


READ_KEY [1] $SSW/gen/idl/util/read_key.pro
[Previous] [Next]
 NAME:
	READ_KEY
 PURPOSE:
	To read a keystroke and return its ASCII equivalent
 EXPLANATION:
	If an ESCAPE sequence was produced and  the sequence is
	recognized (e.g. up arrow), then a code is returned.

 CALLING SEQUENCE:
	key = READ_KEY(Wait)

 INPUTS:
	Wait  -  The wait flag.  If non-zero, execution is halted until a
	         key is struck.  If zero, execution returns immediately and
	         a zero is returned if there was no keystroke waiting in the
	         keyboard buffer.  If not specified, zero is assumed.

 OUTPUT:
	Returned - The key struck.  The ASCII code for non-escape sequences.
	           Escape sequence equivalents:
			Up Arrow     --  128
			Down Arrow   --  130
			Left Arrow   --  129
			Right Arrow  --  131
			Else         --    0

	The return value is a byte value.

 CALLED BY:
	SELECT_O [1], SELECT_O [2], SELECT_O [3], SELECT_X
 MODIFICATION HISTORY:
	Written by Michael R. Greason, STX, 22 June 1990.
	Rewritten for a SUN workstation.  MRG, STX, 23 August 1990.
	Converted to IDL V5.0   W. Landsman   September 1997


READ_KEY [2] $SSW/gen/idl_libs/astron/misc/read_key.pro
[Previous] [Next]
 NAME:
	READ_KEY
 PURPOSE:
	To read a keystroke and return its ASCII equivalent
 EXPLANATION:
	If an ESCAPE sequence was produced and  the sequence is
	recognized (e.g. up arrow), then a code is returned.

 CALLING SEQUENCE:
	key = READ_KEY(Wait)

 INPUTS:
	Wait  -  The wait flag.  If non-zero, execution is halted until a
	         key is struck.  If zero, execution returns immediately and
	         a zero is returned if there was no keystroke waiting in the
	         keyboard buffer.  If not specified, zero is assumed.

 OUTPUT:
	Returned - The key struck.  The ASCII code for non-escape sequences.
	           Escape sequence equivalents:
			Up Arrow     --  128
			Down Arrow   --  130
			Left Arrow   --  129
			Right Arrow  --  131
			Else         --    0

	The return value is a byte value.

 CALLED BY:
	SELECT_O [1], SELECT_O [2], SELECT_O [3], SELECT_X
 MODIFICATION HISTORY:
	Written by Michael R. Greason, STX, 22 June 1990.
	Rewritten for a SUN workstation.  MRG, STX, 23 August 1990.
	Converted to IDL V5.0   W. Landsman   September 1997


READ_SEQFILE $SSW/gen/idl/io/read_seqfile.pro
[Previous] [Next]

  Name:
       READ_SEQFILE


 PURPOSE:   read an ascii file into an IDL session


 CATEGORY:  i/o
       BATSE

 CALLING SEQUENCE:    read_seqfile, lines, file


 CALLED BY:


 CALLS:
	RD_ASCII [1], RD_ASCII [2]
 INPUTS:
       file - scalar string, full filename

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       lines - text array with file contents

 OPTIONAL OUTPUTS:
	ERROR - set if there was a problem.

 CALLED BY:
	ANNOUNCEMENTS, BATSE_ONTIMES, BURST_FLARE, CH2KVT_GAIN, EVAL_SHERB
	EXTRACT_TRIGGERS, FLDISPLAY, FLIST, FSPLOT, F_COMPOSITE, GET_DISCSP511, GET_LAD_GAIN
	GET_SLLD, GET_SPEC_CAL, GET_SPEC_GAIN, HESSI_FIGURE4_INPUTS [1]
	HESSI_FIGURE4_INPUTS [2], HESSI_READ_SPEC, HXRFITS_ARCHIVE, Help_spex [1]
	Help_spex [2], LAD_PHA_EDGES, MK_DISCSP_CAL, QLDISPLAY, RAWDUMP, RD_TEXT, READ_COEF
	READ_HESI_DAT, READ_HESSI_DAT, SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1]
	SPEX_PROC [2], UPDATE_HTML, batse_menu, pro ratesdump, rd_hxt_drm [1]
	rd_hxt_drm [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Tries to use RD_ASCII. If that fails it reads 10 lines at a time until an ioerror occurs.

 MODIFICATION HISTORY:
	akt, 1994
   	ras, 9 May 1995, put in on_ioerror to fix some wierd osf bug
	ras, use rd_ascii unless there is an error, 13 Sep 1996


READCOL [1] $SSW/gen/idl/io/readcol.pro
[Previous] [Next]
 NAME:
       READCOL
 PURPOSE:
       Read a free-format ASCII file with columns of data into IDL vectors 
 EXPLANATION:
       Lines of data not meeting the specified format (e.g. comments) are 
       ignored.  Columns may be separated by commas or spaces.

       Use READFMT to read a fixed-format ASCII file.   Use RDFLOAT for
       much faster I/O (but less flexibility).    Use FORPRINT to write 
       columns of data (inverse of READCOL).    

 CALLING SEQUENCE:
       READCOL, name, v1, [ v2, v3, v4, v5, ...  v25 , COMMENT=
           DELIMITER= ,FORMAT = , /DEBUG ,  /SILENT , SKIPLINE = , NUMLINE = ]

 INPUTS:
       NAME - Name of ASCII data file, scalar string.  In VMS, an extension of 
               .DAT is assumed, if not supplied.

 OPTIONAL INPUT KEYWORDS:
       FORMAT - scalar string containing a letter specifying an IDL type
               for each column of data to be read.  Allowed letters are 
               A - string data, B - byte, D - double precision, F- floating 
               point, I - integer, L - longword, Z - longword hexadecimal, 
               and X - skip a column.

               Columns without a specified format are assumed to be floating 
               point.  Examples of valid values of FMT are

       'A,B,I'        ;First column to read as a character string, then 
                       1 column of byte data, 1 column integer data
       'L,L,L,L'       ;Four columns will be read as longword arrays.
       ' '             ;All columns are floating point

       If a FORMAT keyword string is not supplied, then all columns are 
       assumed to be floating point.

       /SILENT - Normally, READCOL will display each line that it skips over.
               If SILENT is set and non-zero then these messages will be 
               suppressed.
       /DEBUG - If this keyword is non-zero, then additional information is
                printed as READCOL attempts to read and interpret the file.
       COMMENT - single character specifying comment signal.   Any line 
                beginning with this character will be skipped.   Default is
                no comment lines.
       DELIMITER - single character specifying delimiter used to separate 
                columns.   Default is either a comma or a blank.
       SKIPLINE - Scalar specifying number of lines to skip at the top of file
               before reading.   Default is to start at the first line.
       NUMLINE - Scalar specifying number of lines in the file to read.  
               Default is to read the entire file

 OUTPUTS:
       V1,V2,V3,...V25 - IDL vectors to contain columns of data.
               Up to 25 columns may be read.  The type of the output vectors
               are as specified by FORMAT.

 CALLED BY:
	STEREO_LOOP, eit_norm_response [1]
 EXAMPLES:
       Each row in a file position.dat contains a star name and 6 columns
       of data giving an RA and Dec in sexigesimal format.   Read into IDL 
       variables.   (NOTE: The star names must not include the delimiter 
       as a part of the name, no spaces or commas as default.)

       IDL> FMT = 'A,I,I,F,I,I,F'
       IDL> READCOL,'position.dat',F=FMT,name,hr,min,sec,deg,dmin,dsec  

       The HR,MIN,DEG, and DMIN variables will be integer vectors.

       Alternatively, all except the first column could be specified as
       floating point.

       IDL> READCOL,'position.dat',F='A',name,hr,min,sec,deg,dmin,dsec 

       To read just the variables HR,MIN,SEC
       IDL> READCOL,'position.dat',F='X,I,I,F',HR,MIN,SEC

 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], NUMLINES [1], NUMLINES [2]
	REMCHAR [1], REMCHAR [2], REMCHAR [3], STRNUMBER [1], STRNUMBER [2], STRNUMBER [3]
	STRNUMBER [4], strsplit
 RESTRICTIONS:
       This procedure is designed for generality and not for speed.
       If a large ASCII file is to be read repeatedly, it may be worth
       writing a specialized reader.

       Columns to be read as strings must not contain the delimiter character
       (i.e. commas or spaces by default).   Either change the default 
       delimiter with the DELIMITER keyword, or use READFMT to read such files.

       Numeric values are converted to specified format.  For example,
       the value 0.13 read with an 'I' format will be converted to 0.

 PROCEDURES CALLED
       GETTOK(), NUMLINES(), REPCHR(), STRNUMBER()

 MINIMUM IDL VERSION:
       V5.3 (Uses STRSPLIT)
 REVISION HISTORY:
       Written         W. Landsman                 November, 1988
       Modified             J. Bloch                   June, 1991
       (Fixed problem with over allocation of logical units.)
       Added SKIPLINE and NUMLINE keywords  W. Landsman    March 92
       Read a maximum of 25 cols.  Joan Isensee, Hughes STX Corp., 15-SEP-93.
       Call NUMLINES() function W. Landsman          Feb. 1996
       Added DELIMITER keyword  W. Landsman          Nov. 1999
       Fix indexing typos (i for k) that mysteriously appeared W. L. Mar. 2000
       Hexadecimal support added.  MRG, RITSS, 15 March 2000.
       Default is comma or space delimiters as advertised   W.L. July 2001
       Faster algorithm, use STRSPLIT if V5.3 or later  W.L.  May 2002


READCOL [2] $SSW/gen/idl_libs/astron/misc/readcol.pro
[Previous] [Next]
 NAME:
       READCOL
 PURPOSE:
       Read a free-format ASCII file with columns of data into IDL vectors 
 EXPLANATION:
       Lines of data not meeting the specified format (e.g. comments) are 
       ignored.  Columns may be separated by commas or spaces.

       Use READFMT to read a fixed-format ASCII file.   Use RDFLOAT for
       much faster I/O (but less flexibility).    Use FORPRINT to write 
       columns of data (inverse of READCOL).    

 CALLING SEQUENCE:
       READCOL, name, v1, [ v2, v3, v4, v5, ...  v25 , COMMENT=, /NAN
           DELIMITER= ,FORMAT = , /DEBUG ,  /SILENT , SKIPLINE = , NUMLINE = ]

 INPUTS:
       NAME - Name of ASCII data file, scalar string.  

 OPTIONAL INPUT KEYWORDS:
       FORMAT - scalar string containing a letter specifying an IDL type
               for each column of data to be read.  Allowed letters are 
               A - string data, B - byte, D - double precision, F- floating 
               point, I - integer, L - longword, Z - longword hexadecimal, 
               and X - skip a column.

               Columns without a specified format are assumed to be floating 
               point.  Examples of valid values of FMT are

       'A,B,I'        ;First column to read as a character string, then 
                       1 column of byte data, 1 column integer data
       'L,L,L,L'       ;Four columns will be read as longword arrays.
       ' '             ;All columns are floating point

       If a FORMAT keyword string is not supplied, then all columns are 
       assumed to be floating point.

       /SILENT - Normally, READCOL will display each line that it skips over.
               If SILENT is set and non-zero then these messages will be 
               suppressed.
       /DEBUG - If this keyword is non-zero, then additional information is
                printed as READCOL attempts to read and interpret the file.
       COMMENT - single character specifying comment character.   Any line 
                beginning with this character will be skipped.   Default is
                no comment lines.
       DELIMITER - Character(s) specifying delimiter used to separate 
                columns.   Usually a single character but, e.g. delimiter=':,'
                specifies that either a colon or comma as a delimiter. 
                The default delimiter is either a comma or a blank.                   
       /NAN - if set, then an empty field will be read into a floating or 
                double numeric variable as NaN; by default an empty field is 
                converted to 0.0.
       /PRESERVE_NULL - If set, then spaces are considered to be valid fields,
                useful if the columns contain missing data.   Note that between
                April and December 2006, /PRESERVE_NULL was the default.
       SKIPLINE - Scalar specifying number of lines to skip at the top of file
               before reading.   Default is to start at the first line.
       NUMLINE - Scalar specifying number of lines in the file to read.  
               Default is to read the entire file

 OUTPUTS:
       V1,V2,V3,...V25 - IDL vectors to contain columns of data.
               Up to 25 columns may be read.  The type of the output vectors
               are as specified by FORMAT.

 CALLED BY:
	STEREO_LOOP, eit_norm_response [1]
 EXAMPLES:
       Each row in a file position.dat contains a star name and 6 columns
       of data giving an RA and Dec in sexigesimal format.   Read into IDL 
       variables.   (NOTE: The star names must not include the delimiter 
       as a part of the name, no spaces or commas as default.)

       IDL> FMT = 'A,I,I,F,I,I,F'
       IDL> READCOL,'position.dat',F=FMT,name,hr,min,sec,deg,dmin,dsec  

       The HR,MIN,DEG, and DMIN variables will be integer vectors.

       Alternatively, all except the first column could be specified as
       floating point.

       IDL> READCOL,'position.dat',F='A',name,hr,min,sec,deg,dmin,dsec 

       To read just the variables HR,MIN,SEC
       IDL> READCOL,'position.dat',F='X,I,I,F',HR,MIN,SEC

 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], NUMLINES [1], NUMLINES [2]
	REMCHAR [1], REMCHAR [2], REMCHAR [3], STRNUMBER [1], STRNUMBER [2], STRNUMBER [3]
	STRNUMBER [4], strsplit
 RESTRICTIONS:
       This procedure is designed for generality and not for speed.
       If a large ASCII file is to be read repeatedly, it may be worth
       writing a specialized reader.

       Columns to be read as strings must not contain the delimiter character
       (i.e. commas or spaces by default).   Either change the default 
       delimiter with the DELIMITER keyword, or use READFMT to read such files.

       Numeric values are converted to specified format.  For example,
       the value 0.13 read with an 'I' format will be converted to 0.

 PROCEDURES CALLED
       GETTOK(), NUMLINES(), STRNUMBER()
       The version of STRNUMBER() must be after August 2006.
 NOTES:
       Under V6.1 or later, READCOL uses the SCOPE_VARFETCH function rather 
       than EXECUTE().    This is faster and allows readcol.pro to be used
       in the IDL Virtual machine.
 REVISION HISTORY:
       Written         W. Landsman                 November, 1988
       Modified             J. Bloch                   June, 1991
       (Fixed problem with over allocation of logical units.)
       Added SKIPLINE and NUMLINE keywords  W. Landsman    March 92
       Read a maximum of 25 cols.  Joan Isensee, Hughes STX Corp., 15-SEP-93.
       Call NUMLINES() function W. Landsman          Feb. 1996
       Added DELIMITER keyword  W. Landsman          Nov. 1999
       Fix indexing typos (i for k) that mysteriously appeared W. L. Mar. 2000
       Hexadecimal support added.  MRG, RITSS, 15 March 2000.
       Default is comma or space delimiters as advertised   W.L. July 2001
       Faster algorithm, use STRSPLIT if V5.3 or later  W.L.  May 2002
       Accept null strings separated by delimiter ,e.g. ',,,'
       Use SCOPE_VARFETCH instead of EXECUTE() for >V6.1  W.L. Jun 2005
       Added compile_opt idl2   W. L.  July 2005
       Added the NaN keyword   W. L      August 2006
       Added /PRESERVE_NULL keyword  W.L.  January 2007


READER__DEFINE $SSW/gen/idl/objects/reader__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : READER__DEFINE

 Purpose     : Define a READER object

 Explanation : defines a READER class that figures out 
               appropriate reader based on filename.
               Default reader is a FITS reader

 Category    : objects
               
 Syntax      : IDL> reader=obj_new('reader')

 CALLS: ***
	FILE_BREAK, FREE_VAR, HAVE_METHOD, HAVE_TAG, IS_BLANK, PTR_ALLOC, READER::CLEANUP
	READER::GET_CLASS, READER::GET_PREFIX, READER::INIT, READER::READ
 History     : Written 28 Feb 2001, D. Zarro (EITI/GSFC)
               Changed the chk in ::get_class from _? to _+ acs 2004-05-03
               Added call to FILE_BREAK, 1-April-04, Zarro (L-3Com/GSFC)
               Added SPIRIT CLASS, 11-Nov-2005, Zarro (L-3Com/GSFC)
               22-Feb-06, Zarro (L-3Com/GSFC) - undid change by ACS

 Contact     : dzarro@solar.stanford.edu


READFITS [1] $SSW/gen/idl/fits/readfits.pro
[Previous] [Next]
 NAME:
       READFITS
 PURPOSE:
       Read a FITS file into IDL data and header variables. 
 EXPLANATION:
       READFITS() can also read gzip or Unix compressed FITS files.
       See http://idlastro.gsfc.nasa.gov/fitsio.html for other ways of
       reading FITS files with IDL.   

 CALLING SEQUENCE:
       Result = READFITS( Filename/Fileunit,[ Header, heap, /NOSCALE, EXTEN_NO=,
                     NSLICE=, /SILENT , STARTROW =, NUMROW = , HBUFFER=,
                     /CHECKSUM, /COMPRESS, /No_Unsigned, NaNVALUE = ]

 INPUTS:
       Filename = Scalar string containing the name of the FITS file  
                 (including extension) to be read.   If the filename has
                  a *.gz extension, it will be treated as a gzip compressed
                  file.   If it has a .Z extension, it will be treated as a
                  Unix compressed file.
                                   OR
       Fileunit - A scalar integer specifying the unit of an already opened
                  FITS file.  The unit will remain open after exiting 
                  READFITS().  There are two possible reasons for choosing 
                  to specify a unit number rather than a file name:
          (1) For a FITS file with many extensions, one can move to the 
              desired extensions with FXPOSIT() and then use READFITS().  This
              is more efficient than repeatedly starting at the beginning of 
              the file.
          (2) For reading a FITS file across a Web http: address after opening
              the unit with the SOCKET procedure 

 OUTPUTS:
       Result = FITS data array constructed from designated record.
                If the specified file was not found, then Result = -1

 OPTIONAL OUTPUT:
       Header = String array containing the header from the FITS file.
              If you don't need the header, then the speed may be improved by
              not supplying this parameter.    Note however, that omitting 
              the header can imply /NOSCALE, i.e. BSCALE and BZERO values
              may not be applied.
       heap = For extensions, the optional heap area following the main
              data array (e.g. for variable length binary extensions).

 OPTIONAL INPUT KEYWORDS:
       /CHECKSUM - If set, then READFITS() will call FITS_TEST_CHECKSUM to 
                verify the data integrity if CHECKSUM keywords are present
                in the FITS header.   Cannot be used with the NSLICE, NUMROW
                or STARTROW keywords, since verifying the checksum requires 
               that all the data be read.  See FITS_TEST_CHECKSUM() for more
               information.

       /COMPRESS - Signal that the file is gzip compressed.  By default, 
               READFITS will assume that if the file name extension ends in 
               '.gz' then the file is gzip compressed.   The /COMPRESS keyword
               is required only if the the gzip compressed file name does not 
               end in '.gz' or .ftz
              

       EXTEN_NO - non-negative scalar integer specifying the FITS extension to
               read.  For example, specify EXTEN = 1 or /EXTEN to read the 
               first FITS extension.   
   
        HBUFFER - Number of lines in the header, set this to slightly larger
                than the expected number of lines in the FITS header, to 
               improve performance when reading very large FITS headers. 
               Should be a multiple of 36 -- otherwise it will be modified
               to the next higher multiple of 36.   Default is 180

       /NOSCALE - If present and non-zero, then the ouput data will not be
                scaled using the optional BSCALE and BZERO keywords in the 
                FITS header.   Default is to scale.

       /NO_UNSIGNED - By default, if the header indicates an unsigned integer 
               (BITPIX = 16, BZERO=2^15, BSCALE=1) then FITS_READ will output 
               an IDL unsigned integer data type (UINT).   But if /NO_UNSIGNED
               is set, then the data is converted to type LONG.  

       NSLICE - An integer scalar specifying which N-1 dimensional slice of a 
                N-dimensional array to read.   For example, if the primary 
                image of a file 'wfpc.fits' contains a 800 x 800 x 4 array, 
                then 

                 IDL> im = readfits('wfpc.fits',h, nslice=2)
                           is equivalent to 
                 IDL> im = readfits('wfpc.fits',h)
                 IDL> im = im[*,*,2]
                 but the use of the NSLICE keyword is much more efficient.

       NUMROW -  Scalar non-negative integer specifying the number of rows 
                 of the image or table extension to read.   Useful when one 
                 does not want to read the entire image or table.   This
                 keyword is only for extensions and is ignored for primary
                 arrays.

       POINT_LUN  -  Position (in bytes) in the FITS file at which to start
                 reading.   Useful if READFITS is called by another procedure
                 which needs to directly read a FITS extension.    Should 
                 always be a multiple of 2880, and not be used with EXTEN_NO
                 keyword.

       /SILENT - Normally, READFITS will display the size the array at the
                 terminal.  The SILENT keyword will suppress this

        STARTROW - Non-negative integer scalar specifying the row
               of the image or extension table at which to begin reading. 
               Useful when one does not want to read the entire table.  This
               keyword is ignored when reading a primary data array.

       NaNVALUE - This keyword is included only for backwards compatibility
                  with routines that require IEEE "not a number" values to be
                  converted to a regular value.

 CALLED BY:
	C2_CALIBRATE, C3_CALIBRATE, CAT_PHASER, COMB_FULL_EQ, CONGRID [1], CONGRID [3]
	DEMO_4TH_PIX, EIT_DISPLAY, EIT_IMAGE, EIT_PA_PROCESS, EIT_PA_VIEW, EIT_POSTAGE
	EIT_PREP, EIT_SUB_UTIL_FILE, EVAL_SHERB, FITSRGB_to_TIFF, FITS_HDR_LIST
	FITS_HDR__READ [1], FIX_OBESUMERROR, GENERIC_MOVIE, GET_AVGSPEC, GET_PT, GFITS_R
	LASCO_IMAGE, LASCO_READFITS [1], LASER8, MAKE_BKGD, MKDI_C1, MKMOVIE
	MKMOVIE0 obsolete version of mkmoviepro, MK_ALL_MIN, MK_DAILY_C1_MED
	MK_DAILY_MIN, MK_IMAGE, MK_IMG, MK_MONTHLY_MIN, MOVIE_MAKER, NORH_RD_IMG [1]
	NORH_RD_IMG [2], NORH_RD_TCX [1], NORH_RD_TCX [2], NORH_RD_TSX [1]
	NORH_RD_TSX [2], NSTAR, RDPSF, RD_HXRBS_FITS, READFITSL, READ_CONT_FITS, READ_DISCSC
	READ_DISCSP_FITS, READ_MER, READ_SHER, READ_SHERB, READ_STTE, READ_TTS_FITS
	REMOVE_CR, RTMOVIE, SCORE_BPROJ, SHOW_SYNOPTIC, SUBSTAR, SUMER_DISTORT_COR
	SXIG12_READ [1], SXIG12_READ [2], SXIG12_READ_ONE [1], SXIG12_READ_ONE [2]
	SXT_IMAGE, SYNSCAN, TRACE_MOSAIC_IMAGE, TRACE_SSWHERE [1], T_APER, T_GETPSF, T_GROUP
	T_NSTAR, T_SUBSTAR, VIEW_TRACE_MOSAIC, WEBGET, WLOADC, WRITE_LAST_IMG [2], XSM_PREP
	ZCLIP, ZPICK, c2_vig1, cal_fig_pol, carrmapdisp, carrmapmaker2
	cmap2gif ftsfile maxdmind ROOTroot CONTROLcontrol, cr_rem_file
	data_sum2fits, eit_find_last_cal, eit_findcalgroup, eit_getlimb, eit_lzsort
	eit_norm_response [1], eit_parms, eit_readcal, eitoversxt, fixinate_eit
	fixinate_trace, fpc1_phot, ft_sumread_fits, img_read, las_exp_norm, laser8ew
	mk_minim, mreadfits, plot_fov [1], polariz, rd_goes_fits, read_eits
	smei_frm_flatfield, smei_frm_read, smei_fts_read, smei_htm_testcase
	smei_sky_read, smei_star_remove, smei_star_standard, smei_zodiac_remove, sxt2eit
	trace_sswhere [2], trace_sswhere [3], trace_sswhere [4], viewlist, wso_read
	zreadfits
 EXAMPLE:
       Read a FITS file test.fits into an IDL image array, IM and FITS 
       header array, H.   Do not scale the data with BSCALE and BZERO.

              IDL> im = READFITS( 'test.fits', h, /NOSCALE)

       If the file contains a FITS extension, it could be read with

              IDL> tab = READFITS( 'test.fits', htab, /EXTEN )

       The function TBGET() can be used for further processing of a binary 
       table, and FTGET() for an ASCII table.
       To read only rows 100-149 of the FITS extension,

              IDL> tab = READFITS( 'test.fits', htab, /EXTEN, 
                                   STARTR=100, NUMR = 50 )

       To read in a file that has been compressed:

              IDL> tab = READFITS('test.fits.gz',h)

 ERROR HANDLING:
       If an error is encountered reading the FITS file, then 
               (1) the system variable !ERROR_STATE.CODE is set negative 
                   (via the MESSAGE facility)
               (2) the error message is displayed (unless /SILENT is set),
                   and the message is also stored in !!ERROR_STATE.MSG
               (3) READFITS returns with a value of -1
 CALLS: ***
	IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4]
	SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
	WHERENAN [1], WHERENAN [2], WHERENAN [3], WHERENAN [4]
 RESTRICTIONS:
       (1) Cannot handle random group FITS

 NOTES:
       (1) If data is stored as integer (BITPIX = 16 or 32), and BSCALE
       and/or BZERO keywords are present, then the output array is scaled to 
       floating point (unless /NOSCALE is present) using the values of BSCALE
       and BZERO.   In the header, the values of BSCALE and BZERO are then 
       reset to 1. and 0., while the original values are written into the 
       new keywords O_BSCALE and O_BZERO.     If the BLANK keyword was
       present, then any input integer values equal to BLANK in the input
       integer image are unchanged by BSCALE or BZERO
       
       (2) The use of the NSLICE keyword is incompatible with the NUMROW
       or STARTROW keywords.

       (3) READFITS() underwent a substantial rewrite in February 2000 to 
       take advantage of new features in IDL V5.3
            1. The /swap_if_little_endian keyword is now used to OPENR rather
                than calling IEEE_TO_HOST for improved performance
            2. The /compress keyword is now used with OPENR to allow gzip files
                to be read on any machine architecture.
            3. Removed NANvalue keyword, since in V5.3, NaN is recognized on
                all machine architectures
            4. Assume unsigned integers are always allowed
            5. Use STRJOIN to display image size
            6. Use !ERROR_STATE.MSG rather than !ERR_STRING
      

       (4) On some Unix shells, one may get a "Broken pipe" message if reading
        a Unix compressed (.Z) file, and not reading to the end of the file 
       (i.e. the decompression has not gone to completion).     This is an 
        informative message only, and should not affect the output of READFITS.   
 PROCEDURES USED:
       Functions:   SXPAR()
       Procedures:  MRD_SKIP, SXADDPAR, SXDELPAR
 MINIMUM IDL VERSION:
       V5.3 (Uses STRJOIN, /COMPRESS keyword to OPENR)

 MODIFICATION HISTORY:
       Original Version written in 1988, W.B. Landsman   Raytheon STX
       Revision History prior to October 1998 removed          
       Major rewrite to eliminate recursive calls when reading extensions
                  W.B. Landsman  Raytheon STX                    October 1998
       Add /binary modifier needed for Windows  W. Landsman    April 1999
       Read unsigned datatypes, added /no_unsigned   W. Landsman December 1999
       Output BZERO = 0 for unsigned data types   W. Landsman   January 2000
       Update to V5.3 (see notes)  W. Landsman                  February 2000
       Fixed logic error in use of NSLICE keyword  W. Landsman  March 2000
       Fixed byte swapping for Unix compress files on little endian machines
                                    W. Landsman    April 2000
       Added COMPRESS keyword, catch IO errors W. Landsman September 2000
       Option to read a unit number rather than file name W.L    October 2001
       Fix undefined variable problem if unit number supplied W.L. August 2002
       Don't read entire header unless needed   W. Landsman  Jan. 2003
       Added HBUFFER keyword    W. Landsman   Feb. 2003
       Added CHECKSUM keyword   W. Landsman   May 2003
       Restored NaNVALUE keyword for backwards compatibility,
               William Thompson, 16-Aug-2004, GSFC
       Recognize .ftz extension as compressed  W. Landsman   September 2004
       Fix unsigned integer problem introduced Sep 2004 W. Landsman Feb 2005
       Don't modify header for unsigned integers, preserve double precision
           BSCALE value  W. Landsman March 2006
       Use gzip instead of compress for Unix compress files W.Landsman Sep 2006
       Call MRD_SKIP to skip bytes on different file types W. Landsman Oct 2006


READFITS [2] $SSW/gen/idl_libs/astron/fits/readfits.pro
[Previous] [Next]
 NAME:
       READFITS
 PURPOSE:
       Read a FITS file into IDL data and header variables. 
 EXPLANATION:
       READFITS() can also read gzip or Unix compressed FITS files.
       See http://idlastro.gsfc.nasa.gov/fitsio.html for other ways of
       reading FITS files with IDL.   

 CALLING SEQUENCE:
       Result = READFITS( Filename/Fileunit,[ Header, heap, /NOSCALE, EXTEN_NO=,
                     NSLICE=, /SILENT , STARTROW =, NUMROW = , HBUFFER=,
                     /CHECKSUM, /COMPRESS, /No_Unsigned, NaNVALUE = ]

 INPUTS:
       Filename = Scalar string containing the name of the FITS file  
                 (including extension) to be read.   If the filename has
                  a *.gz extension, it will be treated as a gzip compressed
                  file.   If it has a .Z extension, it will be treated as a
                  Unix compressed file.
                                   OR
       Fileunit - A scalar integer specifying the unit of an already opened
                  FITS file.  The unit will remain open after exiting 
                  READFITS().  There are two possible reasons for choosing 
                  to specify a unit number rather than a file name:
          (1) For a FITS file with many extensions, one can move to the 
              desired extensions with FXPOSIT() and then use READFITS().  This
              is more efficient than repeatedly starting at the beginning of 
              the file.
          (2) For reading a FITS file across a Web http: address after opening
              the unit with the SOCKET procedure 

 OUTPUTS:
       Result = FITS data array constructed from designated record.
                If the specified file was not found, then Result = -1

 OPTIONAL OUTPUT:
       Header = String array containing the header from the FITS file.
              If you don't need the header, then the speed may be improved by
              not supplying this parameter.    Note however, that omitting 
              the header can imply /NOSCALE, i.e. BSCALE and BZERO values
              may not be applied.
       heap = For extensions, the optional heap area following the main
              data array (e.g. for variable length binary extensions).

 OPTIONAL INPUT KEYWORDS:
       /CHECKSUM - If set, then READFITS() will call FITS_TEST_CHECKSUM to 
                verify the data integrity if CHECKSUM keywords are present
                in the FITS header.   Cannot be used with the NSLICE, NUMROW
                or STARTROW keywords, since verifying the checksum requires 
               that all the data be read.  See FITS_TEST_CHECKSUM() for more
               information.

       /COMPRESS - Signal that the file is gzip compressed.  By default, 
               READFITS will assume that if the file name extension ends in 
               '.gz' then the file is gzip compressed.   The /COMPRESS keyword
               is required only if the the gzip compressed file name does not 
               end in '.gz' or .ftz
              

       EXTEN_NO - non-negative scalar integer specifying the FITS extension to
               read.  For example, specify EXTEN = 1 or /EXTEN to read the 
               first FITS extension.   
   
        HBUFFER - Number of lines in the header, set this to slightly larger
                than the expected number of lines in the FITS header, to 
               improve performance when reading very large FITS headers. 
               Should be a multiple of 36 -- otherwise it will be modified
               to the next higher multiple of 36.   Default is 180

       /NOSCALE - If present and non-zero, then the ouput data will not be
                scaled using the optional BSCALE and BZERO keywords in the 
                FITS header.   Default is to scale.

       /NO_UNSIGNED - By default, if the header indicates an unsigned integer 
               (BITPIX = 16, BZERO=2^15, BSCALE=1) then FITS_READ will output 
               an IDL unsigned integer data type (UINT).   But if /NO_UNSIGNED
               is set, then the data is converted to type LONG.  

       NSLICE - An integer scalar specifying which N-1 dimensional slice of a 
                N-dimensional array to read.   For example, if the primary 
                image of a file 'wfpc.fits' contains a 800 x 800 x 4 array, 
                then 

                 IDL> im = readfits('wfpc.fits',h, nslice=2)
                           is equivalent to 
                 IDL> im = readfits('wfpc.fits',h)
                 IDL> im = im[*,*,2]
                 but the use of the NSLICE keyword is much more efficient.

       NUMROW -  Scalar non-negative integer specifying the number of rows 
                 of the image or table extension to read.   Useful when one 
                 does not want to read the entire image or table.   This
                 keyword is only for extensions and is ignored for primary
                 arrays.

       POINT_LUN  -  Position (in bytes) in the FITS file at which to start
                 reading.   Useful if READFITS is called by another procedure
                 which needs to directly read a FITS extension.    Should 
                 always be a multiple of 2880, and not be used with EXTEN_NO
                 keyword.

       /SILENT - Normally, READFITS will display the size the array at the
                 terminal.  The SILENT keyword will suppress this

        STARTROW - Non-negative integer scalar specifying the row
               of the image or extension table at which to begin reading. 
               Useful when one does not want to read the entire table.  This
               keyword is ignored when reading a primary data array.

       NaNVALUE - This keyword is included only for backwards compatibility
                  with routines that require IEEE "not a number" values to be
                  converted to a regular value.

 CALLED BY:
	C2_CALIBRATE, C3_CALIBRATE, CAT_PHASER, COMB_FULL_EQ, CONGRID [1], CONGRID [3]
	DEMO_4TH_PIX, EIT_DISPLAY, EIT_IMAGE, EIT_PA_PROCESS, EIT_PA_VIEW, EIT_POSTAGE
	EIT_PREP, EIT_SUB_UTIL_FILE, EVAL_SHERB, FITSRGB_to_TIFF, FITS_HDR_LIST
	FITS_HDR__READ [1], FIX_OBESUMERROR, GENERIC_MOVIE, GET_AVGSPEC, GET_PT, GFITS_R
	LASCO_IMAGE, LASCO_READFITS [1], LASER8, MAKE_BKGD, MKDI_C1, MKMOVIE
	MKMOVIE0 obsolete version of mkmoviepro, MK_ALL_MIN, MK_DAILY_C1_MED
	MK_DAILY_MIN, MK_IMAGE, MK_IMG, MK_MONTHLY_MIN, MOVIE_MAKER, NORH_RD_IMG [1]
	NORH_RD_IMG [2], NORH_RD_TCX [1], NORH_RD_TCX [2], NORH_RD_TSX [1]
	NORH_RD_TSX [2], NSTAR, RDPSF, RD_HXRBS_FITS, READFITSL, READ_CONT_FITS, READ_DISCSC
	READ_DISCSP_FITS, READ_MER, READ_SHER, READ_SHERB, READ_STTE, READ_TTS_FITS
	REMOVE_CR, RTMOVIE, SCORE_BPROJ, SHOW_SYNOPTIC, SUBSTAR, SUMER_DISTORT_COR
	SXIG12_READ [1], SXIG12_READ [2], SXIG12_READ_ONE [1], SXIG12_READ_ONE [2]
	SXT_IMAGE, SYNSCAN, TRACE_MOSAIC_IMAGE, TRACE_SSWHERE [1], T_APER, T_GETPSF, T_GROUP
	T_NSTAR, T_SUBSTAR, VIEW_TRACE_MOSAIC, WEBGET, WLOADC, WRITE_LAST_IMG [2], XSM_PREP
	ZCLIP, ZPICK, c2_vig1, cal_fig_pol, carrmapdisp, carrmapmaker2
	cmap2gif ftsfile maxdmind ROOTroot CONTROLcontrol, cr_rem_file
	data_sum2fits, eit_find_last_cal, eit_findcalgroup, eit_getlimb, eit_lzsort
	eit_norm_response [1], eit_parms, eit_readcal, eitoversxt, fixinate_eit
	fixinate_trace, fpc1_phot, ft_sumread_fits, img_read, las_exp_norm, laser8ew
	mk_minim, mreadfits, plot_fov [1], polariz, rd_goes_fits, read_eits
	smei_frm_flatfield, smei_frm_read, smei_fts_read, smei_htm_testcase
	smei_sky_read, smei_star_remove, smei_star_standard, smei_zodiac_remove, sxt2eit
	trace_sswhere [2], trace_sswhere [3], trace_sswhere [4], viewlist, wso_read
	zreadfits
 EXAMPLE:
       Read a FITS file test.fits into an IDL image array, IM and FITS 
       header array, H.   Do not scale the data with BSCALE and BZERO.

              IDL> im = READFITS( 'test.fits', h, /NOSCALE)

       If the file contains a FITS extension, it could be read with

              IDL> tab = READFITS( 'test.fits', htab, /EXTEN )

       The function TBGET() can be used for further processing of a binary 
       table, and FTGET() for an ASCII table.
       To read only rows 100-149 of the FITS extension,

              IDL> tab = READFITS( 'test.fits', htab, /EXTEN, 
                                   STARTR=100, NUMR = 50 )

       To read in a file that has been compressed:

              IDL> tab = READFITS('test.fits.gz',h)

 ERROR HANDLING:
       If an error is encountered reading the FITS file, then 
               (1) the system variable !ERROR_STATE.CODE is set negative 
                   (via the MESSAGE facility)
               (2) the error message is displayed (unless /SILENT is set),
                   and the message is also stored in !!ERROR_STATE.MSG
               (3) READFITS returns with a value of -1
 CALLS: ***
	IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4]
	SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
	WHERENAN [1], WHERENAN [2], WHERENAN [3], WHERENAN [4]
 RESTRICTIONS:
       (1) Cannot handle random group FITS

 NOTES:
       (1) If data is stored as integer (BITPIX = 16 or 32), and BSCALE
       and/or BZERO keywords are present, then the output array is scaled to 
       floating point (unless /NOSCALE is present) using the values of BSCALE
       and BZERO.   In the header, the values of BSCALE and BZERO are then 
       reset to 1. and 0., while the original values are written into the 
       new keywords O_BSCALE and O_BZERO.     If the BLANK keyword was
       present, then any input integer values equal to BLANK in the input
       integer image are unchanged by BSCALE or BZERO
       
       (2) The use of the NSLICE keyword is incompatible with the NUMROW
       or STARTROW keywords.

       (3) READFITS() underwent a substantial rewrite in February 2000 to 
       take advantage of new features in IDL V5.3
            1. The /swap_if_little_endian keyword is now used to OPENR rather
                than calling IEEE_TO_HOST for improved performance
            2. The /compress keyword is now used with OPENR to allow gzip files
                to be read on any machine architecture.
            3. Removed NANvalue keyword, since in V5.3, NaN is recognized on
                all machine architectures
            4. Assume unsigned integers are always allowed
            5. Use STRJOIN to display image size
            6. Use !ERROR_STATE.MSG rather than !ERR_STRING
      

       (4) On some Unix shells, one may get a "Broken pipe" message if reading
        a Unix compressed (.Z) file, and not reading to the end of the file 
       (i.e. the decompression has not gone to completion).     This is an 
        informative message only, and should not affect the output of READFITS.   
 PROCEDURES USED:
       Functions:   SXPAR()
       Procedures:  MRD_SKIP, SXADDPAR, SXDELPAR
 MINIMUM IDL VERSION:
       V5.3 (Uses STRJOIN, /COMPRESS keyword to OPENR)

 MODIFICATION HISTORY:
       Original Version written in 1988, W.B. Landsman   Raytheon STX
       Revision History prior to October 1998 removed          
       Major rewrite to eliminate recursive calls when reading extensions
                  W.B. Landsman  Raytheon STX                    October 1998
       Add /binary modifier needed for Windows  W. Landsman    April 1999
       Read unsigned datatypes, added /no_unsigned   W. Landsman December 1999
       Output BZERO = 0 for unsigned data types   W. Landsman   January 2000
       Update to V5.3 (see notes)  W. Landsman                  February 2000
       Fixed logic error in use of NSLICE keyword  W. Landsman  March 2000
       Fixed byte swapping for Unix compress files on little endian machines
                                    W. Landsman    April 2000
       Added COMPRESS keyword, catch IO errors W. Landsman September 2000
       Option to read a unit number rather than file name W.L    October 2001
       Fix undefined variable problem if unit number supplied W.L. August 2002
       Don't read entire header unless needed   W. Landsman  Jan. 2003
       Added HBUFFER keyword    W. Landsman   Feb. 2003
       Added CHECKSUM keyword   W. Landsman   May 2003
       Restored NaNVALUE keyword for backwards compatibility,
               William Thompson, 16-Aug-2004, GSFC
       Recognize .ftz extension as compressed  W. Landsman   September 2004
       Fix unsigned integer problem introduced Sep 2004 W. Landsman Feb 2005
       Don't modify header for unsigned integers, preserve double precision
           BSCALE value  W. Landsman March 2006
       Use gzip instead of compress for Unix compress files W.Landsman Sep 2006
       Call MRD_SKIP to skip bytes on different file types W. Landsman Oct 2006


READFMT $SSW/gen/idl_libs/astron/misc/readfmt.pro
[Previous] [Next]
 NAME:
     READFMT
 PURPOSE:
       Quickly read a fixed format ASCII data file into IDL variables. 
 EXPLANATION:
       Lines of data not meeting the specified format (e.g. comments) are
       ignored.  
      
       To read a free format ASCII data file use the procedures 
       READCOL or RDFLOAT.     To print (formatted or free) columns of data
       use the procedure FORPRINT.   

 CALLING SEQUENCE:
       READFMT, name, fmt, v1,[ v2, v3, v4, ..., v25 , 
                          /SILENT, /DEBUG, SKIPLINE= , NUMLINE =]

 INPUTS:
       NAME - Name of ASCII data file.  An extension of .DAT is assumed,
               if not supplied.
       FMT - scalar string containing a valid FORTRAN read format.
               Must include a field length specification.   Cannot include
               internal parenthesis.  A format field must be included for 
               each output vector.   Multiple format fields are allowed, but
               the repetition factor must be less than 100, (.i.e. 19X is 
               allowed but 117X is illegal) 

       Examples of valid FMT values are
               FMT = 'A7,3X,2I4'  or FMT = '1H ,5I7,2A7'
       Examples of INVALID FMT values are
               FMT = 'A7,B3'           ;'B' is not a valid FORTRAN format
               FMT = 'A7,2(I3,F5.1)'   ;Internal parenthesis not allowed
               FMT = 'A7,F,I'          ;Field length not included

 OUTPUTS:
       V1,V2,V3,V4... - IDL vectors to contain columns of data.
               Up to 25 output vectors may be read.  The type of the output 
               vectors are specified by FMT.

 OPTIONAL KEYWORD INPUTS:
       /SILENT - If this keyword is set and non-zero, then certain terminal
               output is suppressed while reading the file
       /DEBUG - Set this keyword to display additional information while
               reading the file.
       SKIPLINE - Scalar specifying number of lines to skip at the top of
               file before reading. Default is to start at first line
       NUMLINE - Scalar specifying number of lines in the file to read.
               Default is to read the entire file 

 CALLED BY:
	CNVRT_ABC [2]
 EXAMPLES:
       Each row in a fixed-format file POSITION.DAT contains a 5 character 
       star name  and 6 columns of data giving an RA and Dec in sexigesimal 
       format.   A possible format for such data might be

       IDL> FMT = 'A5,2I3,F5.1,2x,3I3'    
       and the file could be quickly read with

       IDL> READFMT,'POSITION', fmt, name, hr, min, sec, deg, dmin, dsec 
    
       NAME will be a string vector,SEC will be a floating point vector, and
       the other vectors will be of integer type.

 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], NUMLINES [1], NUMLINES [2]
	REMCHAR [1], REMCHAR [2], REMCHAR [3], STRNUMBER [1], STRNUMBER [2], STRNUMBER [3]
	STRNUMBER [4], ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
 RESTRICTIONS:
       This procedure is designed for generality and not for speed.
       If a large ASCII file is to be read repeatedly, it may be worth
       writing a specialized reader.

 NOTES:
       When reading a field with an integer format I<n>, the output vector is
               byte  - if n = 1
               integer*2 - if 1 < n < 5
               integer*4  - in all other cases
       Octal ('O') and hexadecimal ('Z') formats are read into longwords

 PROCEDURE CALLS:
       GETTOK(), NUMLINES(), REMCHAR, ZPARCHECK

 REVISION HISTORY:
       Written         W. Landsman                 November, 1988
       Added SKIPLINE and NUMLINE keywords         March 92
       Allow up to 25 columns to be read           June 92
       Call NUMLINES() function                    Feb 1996
       Converted to IDL V5.0   W. Landsman   September 1997
       Recognize 'O' and 'Z' formats  W. Landsman   September 1997


reads $SSW/gen/idl_fix/soft/old222/reads.pro
[Previous] [Next]
   Name: reads

   Purpose: emulate IDL supplied <reads> for old idl versions

   Input Paramters:
      inbuffer string/string array to read from 

   Output Parameters:
      outarray output string/string array
   
   Keyword Paramters:
      format - if present, std idl format used when reading inbuffer into 
		outarray 


 CALLS: ***
	ARR2STR [1], Arr2Str [2], SCRATCHF
   Restrictions:
      uses execute statement, so no recursive calls allowed 

   History:
      14-apr-1993 SLF (expanded on R.Schwartz version)
      Upgraded to use system independent file names and deletion method
      and allow up to 16 output parameters


REARRANGE $SSW/gen/idl/util/rearrange.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	
	REARRANGE()
 Purpose     :	
	Rearranges the dimensions in an array (ala TRANSPOSE).
 Explanation :	
	Rearranges the dimensions in an array.  The concept is similar to
	TRANSPOSE or ROTATE, but generalized to N dimensions.
 Use         :	
	Result = REARRANGE(ARRAY,DIMENSIONS)

 CALLED BY:
	CDS_CLEAN_SPIKE, CDS_ENG_N1_RD, CDS_NEW_SPIKE, FIND_COSMIC_RAYS, GT_WINDATA
	NIS_CALIB, READSUMCOL, VDS_CALIB, VDS_DEBIAS, WCS_SIMPLIFY, WR_MOVIE
	EXAMPLE:  If ARRAY has the dimensions NI x NJ x NK, then

			RESULT = REARRANGE(ARRAY, [3,1,2])

		  will have the dimensions NK x NI x NJ.

 Inputs      :	
	ARRAY		= Input array to be rearranged.
	DIMENSIONS	= Array containing the order of the original dimensions
			  once they are rearranged.  Each dimension is
			  specified by a number from 1 to N.  If any dimension
			  is negative, then the order of the elements is
			  reversed in that dimension.
 Opt. Inputs :	
	None.
 Outputs     :	
	The result of the function is ARRAY with the dimensions rearranged into
	the order specified by DIMENSIONS.
 Opt. Outputs:	
	None.
 Keywords    :	
	None.
 Env. Vars.  :
	SSW_EXTERNAL = Points to a sharable object file containing associated C
		       software callable by CALL_EXTERNAL.  If this environment
		       variable exists, then the routine uses CALL_EXTERNAL to
		       perform the rearrangement.  Otherwise the rearrangement
		       is performed within IDL, which is slower.

		       For backwards compatibility, the software will also look
		       for the environment variable CDS_EXTERNAL if it doesn't
		       find SSW_EXTERNAL

	SSW_EXTERNAL_PREFACE = On some operating systems, such as older
		       versions of SunOS, this needs to be set to the
		       underscore character "_".  Otherwise, it doesn't need to
		       be defined.
 Calls       : ***
	REVERSE
 Common      :	
	None.
 Restrictions:	
	DIMENSIONS cannot contain the same dimensions more than once each.
	Each dimension must be accounted for.

	This routine is not very fast for large arrays, unless SSW_EXTERNAL is
       defined so that CALL_EXTERNAL is used.
 Side effects:	
	None.
 Category    :	
	Utilities, Arrays.
 Prev. Hist. :	
	William Thompson, February 1993.
	William Thompson, 30 June 1993, modified to allow dimensions to be
		reversed.
 Written     :	
	William Thompson, GSFC, February 1993.
 Modified    :	
	Version 1, William Thompson, GSFC, 9 July 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 24 August 1994.
		Combined pure IDL and CALL_EXTERNAL versions into one routine.
		Ported CALL_EXTERNAL software to OSF.
	Version 3, William Thompson, GSFC, 27 December 1994
		Fixed bug where trailing dimensions with one element were lost.
	Version 4, William Thompson, GSFC, 16 July 1998
		Look for SSW_EXTERNAL evar before CDS_EXTERNAL
		Check for SSW_EXTERNAL_PREFACE instead of !version.os
	Version 5, William Thompson, GSFC, 14 August 2000
		Using TRANSPOSE where possible.
 Version     :	
	Version 5, 14 August 2000


REBIN_FID $SSW/gen/idl/time/rebin_fid.pro
[Previous] [Next]
 Project     : HESSI

 Name        : REBIN_FID

 Purpose     : Rebin files read by FIND_FID

 Category    : HESSI, GBO, utility

 Explanation : 

 Syntax      : IDL> rebin_fid,tstart,tend,factor,files

 Inputs      : TSTART = search start time
               TEND   = search end time
               FACTOR = factor to rebin files by

 Opt. Inputs : None

 Outputs     : FILES = found files (rounded to nearest day)

 Opt. Outputs: None

 Keywords    : Same as FIND_FID
               OUTDIR = output directory for rebinned files
               CLOBBER = clobber existing rebinned files.

 CALLS: ***
	APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHK_DIR [1]
	CHK_DIR [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DELVARX [1]
	DELVARX [2], DELVARX [3], DELVARX [4], ESPAWN, EXIST, FIND_FID, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], PR_SYNTAX, REBIN_GIF, VALID_GIF, break_file [4]
	concat_dir [4], data_chk [1], data_chk [2], delvarx [5]
 Common      : None

 Restrictions: Unix systems only.
               Currently only GIF supported

 Side effects: None

 History     : Version 1,  14-April-1999,  D.M. Zarro (SM&A/GSFC),  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


REBIN_GIF $SSW/gen/idl/image/rebin_gif.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : REBIN_GIF

 Purpose     : rebin GIF file by given factor

 Category    : imaging

 Explanation : 

 Syntax      : IDL>rebin_gif,old,new,factor

 Inputs      : OLD = old filename
               NEW = new filename
               FACTOR = rebin factor = fx or [fx,fy]
               SMOOTH = smooth image
               PIXELS = if set, factor is interpreted as pixel values

 Opt. Inputs : None

 Outputs     : new rebinned GIF file

 Opt. Outputs: None

 Keywords    : SIZE = new output pixel size
               PIXELS = interpret factor as pixels

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONGRID [1], CONGRID [2]
	CONGRID [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], READ_GIF, TEST_OPEN, TRIM, WRITE_GIF, break_file [4]
 CALLED BY:
	REBIN_FID
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  14-Aug-1997,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


REBIN_MAP $SSW/gen/idl/mapping/rebin_map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : REBIN_MAP

 Purpose     : Rebin an image map to new dimensions

 Category    : imaging

 Explanation : Rebin a map to user-specified dimensions and
               compute new output pixel spacings

 Syntax      : gmap=rebin_map(map,gx,gy)

 Inputs      : MAP = image map structure
               GX,GY = new dimensions

 Outputs     : GMAP = rebinned map

 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], EXIST, MERGE_STRUCT, MK_MAP_XP, MK_MAP_YP
	PR_SYNTAX, REPACK_MAP, REP_TAG_VALUE, UNPACK_MAP, VALID_MAP
 CALLED BY:
	GRID_MAP
 History     : Written 22 August 1997, D. Zarro, ARC/GSFC

 Contact     : dzarro@solar.stanford.edu


RECOMPILE $SSW/gen/idl/system/recompile.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : RECOMPILE

 Purpose     : recompile a routine

 Category    : utility

 Explanation : a shell around RESOLVE_ROUTINE (> vers 4) that checks
               if compiled routine is not recursive, otherwise 
               recompile will stop suddenly.

 Syntax      : IDL> recompile,proc

 Inputs      : PROC = procedure name


 Keywords    : /IS_FUNCTION - set if routine is a function
               /SKIP - set to skip if already compiled
               /QUIET - set to not show compile messages

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DPRINT, HAVE_PROC, IS_BLANK
	WAS_CALLED, break_file [4]
 CALLED BY:
	GOES__DEFINE, MK_PLAN_RECOVER, XMANAGER_COM
 Side effects: PROC is recompiled

 History     : 1-Sep-1996,  Zarro (ARC/GSFC)  Written
               20-May-1999, Zarro (SM&A/GSFC) - added /SKIP 
               12-Aug-2000, Zarro (EIT/GSFC) - added /QUIET
               7-Sept-2001, Zarro (EIT/GSFC) - added check for 
                existing file

 Contact     : DZARRO@SOLAR.STANFORD.EDU


RECPOL [1] $SSW/gen/idl/fund_lib/jhuapl/recpol.pro
[Previous] [Next]
 NAME:
       RECPOL
 PURPOSE:
       Convert 2-d rectangular coordinates to polar coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       recpol, x, y, r, a
 INPUTS:
       x, y = vector in rectangular form.           in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angle is in degrees, else radians.
 OUTPUTS:
       r, a = vector in polar form: radius, angle.  out
 CALLS: ***
	ARRAY_JHUAPL [1], ARRAY_JHUAPL [2], ISARRAY [1], ISARRAY [2], ISARRAY [3]
 CALLED BY:
	GET_SUN [1], GET_SUN [2], SPHDIST, SUN [1], SUN [2]
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Aug, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 13 Feb, 1991 --- added /degrees.
       R. Sterner, 30 Dec, 1991 --- simplified.
       R. Sterner, 25 May, 1993 --- Fixed atan (0,0) problem.

 Copyright (C) 1986, 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.
	Converted to IDL V5.0   W. Landsman   September 1997


RECPOL [2] $SSW/gen/idl_libs/astron/jhuapl/recpol.pro
[Previous] [Next]
 NAME:
       RECPOL
 PURPOSE:
       Convert 2-d rectangular coordinates to polar coordinates.
 CATEGORY:
 CALLING SEQUENCE:
       recpol, x, y, r, a
 INPUTS:
       x, y = vector in rectangular form.           in
 KEYWORD PARAMETERS:
       Keywords:
         /DEGREES means angle is in degrees, else radians.
 OUTPUTS:
       r, a = vector in polar form: radius, angle.  out
 CALLS: ***
	ARRAY_JHUAPL [1], ARRAY_JHUAPL [2], ISARRAY [1], ISARRAY [2], ISARRAY [3]
 CALLED BY:
	GET_SUN [1], GET_SUN [2], SPHDIST, SUN [1], SUN [2]
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner. 18 Aug, 1986.
       Johns Hopkins University Applied Physics Laboratory.
       RES 13 Feb, 1991 --- added /degrees.
       R. Sterner, 30 Dec, 1991 --- simplified.
       R. Sterner, 25 May, 1993 --- Fixed atan (0,0) problem.

 Copyright (C) 1986, 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.
	Converted to IDL V5.0   W. Landsman   September 1997


RECTSTRIPE $SSW/gen/idl/display/rectstripe.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	RECTSTRIPE

 Purpose     :	Plot a solid rectagle of arbitary size with stripes.

 Explanation : Plot a solid rectagle of arbitary size with stripes.

 Use         :	RECTSTRIPE, x, y, [KEYWORDS]

 Inputs      :	x	2 element vector which specifies the X coordinates
			of the opposing corners of the rectagle to be plotted.
			If no value is specified for y, then this must
			consist of an array of 2 vectors where each vector
			consists of two elements which specify the X and Y
			coordinate of one of the opposing corners of the 
			rectangle to be plotted.

 Opt. Inputs : y	2 element vector which specifies the Y coordinates
			of the opposing corners of the rectagle to be plotted.

 Outputs     :	None.

 Opt. Outputs:	None.

 Keywords    : color	2 element vector which specifies to the colors to
			use when drawing the rectangle.  The first element
			is the background color and the second element is
			the stripe color.

		width	Stripe width in pixels.

		device	When set, assumes that the coordinates are in the
			device coordinate scheme.  Otherwise, it is assumed
			that the coordinates are in the data coordinate
			scheme.

		horizontal	If set, the stripes will be drawn horizontally

		vertical	If set, the stripes will be drawn vertically

 CALLED BY:
	PLOT_DSN_27
 Common      :	None.

 Restrictions:	Routine currently uses only DEVICE and DATA coordinates.

 Side effects:	Plots rectangle to current display window.

 Category    :	Graphics

 Prev. Hist. :	None.

 Written     :	Ronald Yurow (EITI)

 Modified:   : Ronald Yurow, EITI, October 4, 2001
                  Initial Release

 Version     :	Version 1, October 4, 2001


REDUCE $SSW/gen/idl/util/reduce.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	REDUCE()

 Purpose     :	Reduce an array by box averaging to a more useful size.

 Category    :	

 Explanation :	Uses the REBIN function to reduce the size of the array by an
		integer amount.  Allows one to reduce the array, even if the
		reduction amount does not evenly divide into the array size.
		Optionally, the user can choose to let the computer pick the
		reduction amount.

 Syntax      :	A_NEW = REDUCE( ARRAY  [, I_REDUCE  [, J_REDUCE ]] )

 Examples    :	

 Inputs      :	ARRAY = Array to be reduced.  Can be one- or two-dimensional.

 Opt. Inputs :	I_REDUCE = Size of box in the first dimension to average over.
			   If not passed, then the procedure selects what it
			   thinks is a suitable value.

		J_REDUCE = Size of box in the second dimension.  If not passed,
			   then it has the same value as I_REDUCE.

 Outputs     :	The output of the function is the reduced array.

 Opt. Outputs:	None.

 Keywords    :	AVERAGE	= If set, then the pixels are averaged together.  The
			  default is to simply subsample the image.

               TOTAL   = If set, then the pixels are summed together.  This is
                         equivalent to using /AVERAGE and multiplying by the
                         degree of reduction.

		MISSING = When used in conjunction with /AVERAGE, sets the
			  value specifying missing pixels.  Pixels set to this
			  value are not included in the average.  (The AVERAGE
			  function is used instead of REBIN.)

 Calls       : ***
	AVERAGE, DATATYPE [1], DATATYPE [2], DATATYPE [3], WHERE_MISSING
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	
	William Thompson	Applied Research Corporation
	May, 1987		8201 Corporate Drive
				Landover, MD  20785

 History     :	Version 1, 14 June 1996, William Thompson, GSFC
			Incorporated into CDS library
			Use LONG instead of FIX
		Version 2, 17 December 1997, William Thompson, GSFC
			Added keyword AVERAGE.
		Version 3, 24-Jul-1998, William Thompson, GSFC
			Added keyword MISSING
               Version 4, 28-Jul-2004, William Thompson, GSFC
                       Added keyword TOTAL
               Version 5, 11-May-2005, William Thompson, GSFC
                       Handle NaN values

 Contact     :	WTHOMPSON


REDUCE_MAP $SSW/gen/idl/mapping/reduce_map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : REDUCE_MAP

 Purpose     : create a low resolution map by removing pixels

 Category    : imaging

 Explanation : 

 Syntax      : rmap=reduce_map(map,fx,fy)

 Examples    :

 Inputs      : MAP = image map structure
               FX = factor to reduce X-resolution by (e.g. .5)
               FY = factor to reduce Y-resolution by

 Opt. Inputs : None

 Outputs     : IMAP = low resolution map

 Opt. Outputs: None

 Keywords    : ERR = error strings

 CALLS: ***
	EXIST, GET_MAP_PROP, NINT [1], NINT [2], PR_SYNTAX, REPACK_MAP, REP_TAG_VALUE
	VALID_MAP
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written 22 Nov 1998, D. Zarro, SM&A/SAC

 Contact     : dzarro@solar.stanford.edu


REFORM_2 $SSW/gen/idl/util/reform_2.pro
[Previous] [Next]
 PROJECT:
	SSW
 NAME:
	REFORM_2

 PURPOSE:
	This function uses reform to reformat the first input array to the same size
	as the second input array.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	Result = Reform_2( arr1, arr2 )

 CALLS:
	none
 INPUTS:
       Arr1
		Arr2

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	arr1 and arr2 must have the same number of elements.

 PROCEDURE:
	Uses the IDL reform function with /overwrite and size(/dim) to dimension ARR1 to the
	same size as ARR2

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 21-feb-03


REGIS [1] $SSW/gen/idl/display/regis.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : REGIS

 Purpose     : Sets graphics device to REGIS mode.

 Explanation : SETPLOT is called to save and set the system variables.

 Use         : REGIS

 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.  are used (i.e.
		those routines that use SETPLOT) 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, GSFC, 27 April 1993.
			Incorporated into CDS library.

 Version     : Version 1, 27 April 1993.


REGRESS $SSW/gen/idl/fitting/regress2.pro
[Previous] [Next]
 NAME:
	REGRESS
 PURPOSE:
	Multiple linear regression fit.
	Fit the function:
	Y(i) = A0 + A(0)*X(0,i) + A(1)*X(1,i) + ... + 
		A(Nterms-1)*X(Nterms-1,i)
 CATEGORY:
	G2 - Correlation and regression analysis.
 CALLING SEQUENCE:
	Coeff = REGRESS(X,Y,W,YFIT,A0,SIGMA,FTEST,R,RMUL,CHISQ,SIGMA0)
 INPUTS:
	X = array of independent variable data.  X must 
		be dimensioned (Nterms, Npoints) where there are Nterms 
		coefficients to be found (independent variables) and 
		Npoints of samples.
	Y = vector of dependent variable points, must 
		have Npoints elements.
	W = vector of weights for each equation, must 
		be a Npoints elements vector.  For no 
		weighting, set w(i) = 1., for instrumental weighting 
		w(i) = 1/standard_deviation(Y(i)), for statistical 
		weighting w(i) = 1./Y(i)

 OUTPUTS:
	Function result = coefficients = vector of 
		Nterms elements.  Returned as a column 
		vector.

 OPTIONAL OUTPUT PARAMETERS:
	Yfit = array of calculated values of Y, Npoints 
		elements.
	A0 = Constant term.
	Sigma = Vector of standard deviations for 
		coefficients.
	Ftest = value of F for test of fit.
	Rmul = multiple linear correlation coefficient.
	R = Vector of linear correlation coefficient.
	Chisq = Reduced weighted chi squared.
       SIGMA0 = standard deviation for A0
 CALLS: ***
	REGRESS2
 CALLED BY:
	Determine Drift Rate, hsi_visibility_fit, mk_synsfc_coeff [1]
	mk_synsfc_coeff [2]
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None.
 RESTRICTIONS:
	None.
 PROCEDURE:
	Adapted from the program REGRES, Page 172, 
		Bevington, Data Reduction and Error Analysis for the 
		Physical Sciences, 1969.

 MODIFICATION HISTORY:
	Written, DMS, RSI, September, 1982.
	Modified, SMR, RSI, March, 1991, made single variable regression not
		fail on the invert command.
       Modified, DMZ, ARC, May 1991, to compute standard deviation on A0


REGRESS_FIT $SSW/gen/idl/fitting/regress_fit.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	REGRESS_FIT

 Purpose     :	Linear regression routine for functions with constant term

 Explanation :	This subroutine performs the same function as subroutine FITTER
		with the proviso that the function to be fitted consists of a
		constant DC-level term A0 and terms PAR(I) multiplying
		nontrivial functions FDER(X,I) in the variable X.  This allows
		a more efficient computation to be made.

 Use         :	REGRESS_FIT, X, Y, FDER, A0, PARAM  [, PERR ]

 Inputs      :	X	= Positions.
		Y	= Data values.
		FDER	= Array of partial derivatives of fitted function
			  w.r.t. PARAM (not A0).  This array will have the
			  dimensions: FDER( N_ELEMENTS(X) , N_ELEMENTS(PARAM) )

 Opt. Inputs :	None.

 Outputs     :	A0	= Constant DC-level term.
		PARAM	= Returned parameters of fit.

 Opt. Outputs:	PERR	= Errors in PARAM.

 Keywords    :	POISSON	= If set, then a Poisson error distribution is
			  assumed, and the weights are set accordingly to 1/Y.
		ERROR	= Array of errors.  The weights are set accordingly to
			  1/ERROR^2.  Overrides POISSON.
		WEIGHT	= Array of weights to use in fitting.  Overrides
			  POISSON and ERROR.
		CHISQR	= Returned value of chi-squared.  Only relevant if
			  ERROR passed explicitly.
		CMATRIX	= Correlation matrix.

 Calls       : ***
	AVG [1], AVG [2], FITTER
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Utilities, Curve_fitting

 Prev. Hist. :	William Thompson, June 1991, modified to use keywords.

 Written     :	William Thompson, GSFC, June 1991

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated into CDS library
		Version 2, William Thompson, GSFC, 13 December 1996
			Renamed to REGRESS_FIT

 Version     :	Version 2, 13 December 1996


reltime [1] $SSW/gen/idl/genutil/reltime.pro
[Previous] [Next]
   Name: reltime

   Purpose: return relative UT time or time range (default is offset from NOW)

   Input Parameters:
      reftime - reference time - default REFTIME is NOW (current UT)

   Calling Sequence:
      relt=reltime( [reftime,] [hour=hour, day=day, /yesterday,/tomorrow] )  

   Keyword Parameters:
      hours - offset in hours (neg OK)
      days  - offset in days  (neg OK)
      minutes - offest in minutes (neg OK)
      yesterday, tommorrow, daybefore, dayafter - obvious
      day_only - dont return the time (just relative day)
      out_style - output time style per anytim.pro OUT_STYLE keyword 
                   { 'ccsds', 'yohkoh', 'ecs', 'utc_int', 'vms', 'int'...etc }

   Calling Examples:
     IDL> print,reltime('1-feb-94 12:30', hour = -12, out='ecs')
        1994/02/01 00:30:00.000

      now=reltime(/now)                ; current UT
      sixhoursago=reltime(hour=-6)     ; 6 hours ago
      tomorrow=reltime(day=1)          ; 24 hours from now
      relref=reltime(REFTIME, days=-2, out='ccsds') ; REFTIME-24hr in CCSDS
      yest=reltime(/yesterday)		; 24 hours ago ut 
      tom=reltime(/tomorrow)		; 24 hours from now

   Method: keyword inheritance, calls timegrid.pro

 CALLS: ***
	data_chk [1], data_chk [2], fmt_tim [1], fmt_tim [2], gt_day [1], gt_day [2]
	str2number [1], str2number [2], strsplit, ut_time [1], ut_time [2], wc_where [1]
	wc_where [2]
 CALLED BY:
	GOES_TEK [1], QUICKSTRAY [2], eit_fulldisk, eit_mirror, flare_hist, ftp_list_since
	get_goes_defsat [1], get_goes_defsat [2], go_sxt_sss2secondary
	go_yo_prod_batch, lasco_time2file, lasco_time2nrlwww, les_archive_info
	mdi_time2file, mk_ssc_batch [1], mk_ssc_batch [2], plot_ace, plot_goesp
	rd_goesp_ascii, rd_goesx_ascii, ref_term [2], save_idl_routines, ssc_files [1]
	ssc_files [2], ssc_files [3], ssw_apkpbar, ssw_get_sources, ssw_getcme_cactus
	ssw_getdst, ssw_time2filelist, sxt_files, sxt_uvf_info [1], sxt_uvf_info [3]
	trace_last_movie_queue, trace_wave2point, yohkoh_files
   History:
      Circa 1-Jun-1997 S.L.Freeland
           19-May-1998 S.L.Freeland - pass HOUR or DAY-> timegrid
                                      add /NOW keyword allow proper spelling
                                      for /tomorrow 
            7-Apr-1999 S.L.Freeland - fix problem when REFTIME passed
      09-May-2003, William Thompson - Use ssw_strsplit instead of strsplit
       8-Apr-2005, S.L.Freeland -added MINUTES keyword+function
           


REM_ANON_TAG $SSW/gen/idl/struct/rem_anon_tag.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	REM_ANON_TAG

 Purpose     :	Find and remove anonymous structure tags from within structure

 Explanation :	Need this to enable concatanating structures

 Use         : NEW_STRUCT=REM_ANON_TAG(STRUCT)

 Inputs      :	STRUCT = input structure

 Opt. Inputs :	None.

 Outputs     :	NEW_STRUCT = new structure

 Opt. Outputs:	None.

 Keywords    :	None.

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3]
	DELVARX [4], EXIST, MERGE_STRUCT, REM_TAG [1], REM_TAG [2], REP_STRUCT_NAME
	REP_TAG_VALUE, delvarx [5]
 CALLED BY:
	GT_CDS_QL
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC)

 Version     :	Version 1.0, 7 June 1997


rem_blanks $SSW/gen/idl/string/rem_blanks.pro
[Previous] [Next]
 Project     : HESSI

 Name        : rem_blanks

 Purpose     : remove blank elements from string array

 Category    : string utility 

 Syntax      : IDL> out=rem_blanks(array)

 Inputs      : ARRAY = array to process

 Outputs     : OUT = processed array

 Keywords    : COUNT = # of non-blanks

 CALLS: ***
	EXIST, IS_STRING
 CALLED BY:
	EIT__DEFINE, MAP__DEFINE, gzip
 History     : Written 20 June 2000, D. Zarro (EIT/GSFC)
               Modified 27 Dec 2005, Zarro (L-3Com/GSFC) - added COUNT

 Contact     : dzarro@solar.stanford.edu


REM_COM $SSW/gen/idl/util/rem_com.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	REM_COM()

 Purpose     :	Finds elements unique to second vector.

 Explanation :	Returns indeces of all those elements which are unique to the second vector,
               removing any duplicate elements or any that are also present in the first 
               vector.

 Use         : <indeces = rem_com( vec1, vec2)>

 Inputs      : vec1 = array of values;
               vec2 = array of values.

 Opt. Inputs : None.

 Outputs     : Array of indeces into vec2 poitnign to unique elements.

 Opt. Outputs:	None.

 Keywords    : None.

 Calls       : ***
	REM_DUP [1], REM_DUP [2], REM_DUP [3]
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Command preparation.

 Prev. Hist. :	None.

 Written     :	Version 0.00, Martin Carter, RAL, 14/10/94

 Modified    :	Version 0.01, Martin Carter, RAL, 28/11/94
                            Added proforma.

 Version     :	Version 0.01, 28/11/94


REM_DUP [1] $SSW/gen/idl/util/rem_dup.pro
[Previous] [Next]
 NAME:	
	REM_DUP
 PURPOSE:  
	Function to remove duplicate values from a vector.

 CALLING SEQUENCE:
	result = rem_dup( a, [ flag ] )

 INPUTS:
	a - vector of values from which duplicates are to be found
	flag - (optional) if supplied then when duplicates occur,
		the one with the largest value of flag is selected.
		If not supplied the the first occurence of the value
		in a is selected.     Should be a vector with the same
               number of elements as a.

 OUTPUT:
	A vector of subscripts in a is returned.  Each subscript
	points to a selected value such that a(rem_dup(a,flag))
	has no duplicates.

 CALLS: ***
	BSORT [1], BSORT [2], BSORT [3], BSORT [4]
 CALLED BY:
	ARRAY_XOR, DBHELP [1], DBHELP [2], DBHELP [3], FIND_COMMON, FTDELROW, GROUP
	MAKE_ION_LIST, MK_HEAD_CAT, REM_COM, SEL_LINE_EVENT, SHOW_FITS_HDR, TBDELROW, TFTD
	ch_ss
 SIDE EFFECTS:
	The returned subscripts will sort the values in a in ascending
	order with duplicates removed.

 EXAMPLES:

	Remove duplicate values in vector a.
	 	a = a( rem_dup(a) )

	Remove duplicates in vector WAVE.  When duplicate values
	are found, select the one with the largest intensity, INTE.

		sub = rem_dup( wave, inte)
		wave = wave( sub )
		inte = inte( sub )

 NOTES:
	The UNIQ function in the User's Library uses a faster algorithm,
	but has no equivalent of the "flag" parameter

 MODIFICATION HISTORY:
	D. Lindler  Mar. 87
	11/16/90 JKF ACC - converted to IDL Version 2.
	August 1997  -- Changed loop index to type LONG
	October 1997 -- Also changed NGOOD index to LONG
	Converted to IDL V5.0   W. Landsman   October 1997


REM_DUP [2] $SSW/gen/idl_libs/astron/misc/rem_dup.pro
[Previous] [Next]
 NAME:	
	REM_DUP
 PURPOSE:  
	Function to remove duplicate values from a vector.

 CALLING SEQUENCE:
	result = rem_dup( a, [ flag ] )

 INPUTS:
	a - vector of values from which duplicates are to be found
	flag - (optional) if supplied then when duplicates occur,
		the one with the largest value of flag is selected.
		If not supplied the the first occurence of the value
		in a is selected.     Should be a vector with the same
               number of elements as a.

 OUTPUT:
	A vector of subscripts in a is returned.  Each subscript
	points to a selected value such that a(rem_dup(a,flag))
	has no duplicates.

 CALLS: ***
	BSORT [1], BSORT [2], BSORT [3], BSORT [4]
 CALLED BY:
	ARRAY_XOR, DBHELP [1], DBHELP [2], DBHELP [3], FIND_COMMON, FTDELROW, GROUP
	MAKE_ION_LIST, MK_HEAD_CAT, REM_COM, SEL_LINE_EVENT, SHOW_FITS_HDR, TBDELROW, TFTD
	ch_ss
 SIDE EFFECTS:
	The returned subscripts will sort the values in a in ascending
	order with duplicates removed.

 EXAMPLES:

	Remove duplicate values in vector a.
	 	a = a( rem_dup(a) )

	Remove duplicates in vector WAVE.  When duplicate values
	are found, select the one with the largest intensity, INTE.

		sub = rem_dup( wave, inte)
		wave = wave( sub )
		inte = inte( sub )

 NOTES:
	The UNIQ function in the User's Library uses a faster algorithm,
	but has no equivalent of the "flag" parameter

 MODIFICATION HISTORY:
	D. Lindler  Mar. 87
	11/16/90 JKF ACC - converted to IDL Version 2.
	August 1997  -- Changed loop index to type LONG
	October 1997 -- Also changed NGOOD index to LONG
	Converted to IDL V5.0   W. Landsman   October 1997


REM_DUP_TAG $SSW/gen/idl/struct/rem_dup_tag.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	REM_DUP_TAG

 Purpose     :	remove duplicate tags from a structure

 Explanation :	

 Use         : NEW_STRUCT=REM_DUP_TAG(STRUCT)

 Inputs      :	STRUCT = input structure (array or scalar)

 Opt. Inputs :	None.

 Outputs     :	NEW_STRUCT = new structure

 Opt. Outputs:	None.

 Keywords    :	NAME = new name for output structure

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3]
	DELVARX [4], EXEC_STRUCT, EXIST, MERGE_STRUCT, PAIR_STRUCT, UNIQ [1], UNIQ [2]
	UNIQ [3], delvarx [5]
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Structure handling

 Prev. Hist. :	None.

 Written     :	Dominic Zarro (ARC), April 7, 1997
		Version 1.1: Fixed vectorization bug. Craig DeForest (Stanford), May 13, 1997
		Version 2, 14 Oct 1998, Zarro -- converted to CREATE_STRUCT

 Version     :	Version 2


rem_elem [1] $SSW/gen/idl/util/rem_elem.pro
[Previous] [Next]
   Name: rem_elem

   Purpose: return subscripts of input array remaining after elements in
	     a second array are removed

   Input Parameters:
      inarray - array to search/remove from
      remarray - array of elements to search/remove from inarray

   Output Parameters:
      count - number of elements (subscripts) returned

   Calling Sequence:
      ss = rem_elem(inarray,remarray) ; subscripts remaining or -1

 CALLED BY:
	LIST_OP [1], LIST_OP [2], SPEX_FITINT__DEFINE, SPEX_FIT__DEFINE, WHERE_WITHIN
	XSTRUCT, dir_since, fitshead2struct, html_get_files, is_bestnode [1]
	is_bestnode [2], mk_spd, mk_trace_i1, mk_ydb_list, mk_ydbtab, mk_ydbtape [1]
	mk_ydbtape [2], mobad_summ, new_dpath [1], new_dpath [2], path_ucon, pathfix
	plotman, quick_hkplot [1], quick_hkplot [2], ref_term [2], set_fastpath [1]
	set_fastpath [2], sfc_check, soon_table, spex_gen_strategy_holder
	ssw_build_trace, ssw_check_contrib, ssw_conflicts, ssw_instr_info, ssw_set_instr
	sswdb_info, struct2ssw, timeavg [1], timeavg [2], timeline, topsdb [1], topsdb [2]
	web_seq, where_arr [1], where_arr [2], xhkplot, xset_chain [1], xset_chain [2]
   History:
      slf, 20-jan-1993
      slf,  7-feb-1993 - documentation carification and variable name change
      Kim Tolbert, 30-Jan-2007, made rem_arr_cnt a LONG, for huge arrays


REM_MAP_LIMB $SSW/gen/idl/mapping/rem_map_limb.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : REM_MAP_LIMB

 Purpose     : remove above limb pixels from a map

 Category    : imaging

 Explanation : 

 Syntax      : rmap=rem_map_limb(map)

 Examples    :

 Inputs      : MAP = image map

 Opt. Inputs : None

 Outputs     : RMAP = MAP with above limb points set to zero

 Opt. Outputs: None

 Keywords    : ERR = error string
               MISSING = values to set deleted data
               DISK = remove on disk pixels instead

 CALLS: ***
	EXIST, GET_MAP_TIME, GET_MAP_XP, GET_MAP_YP, PB0R, PR_SYNTAX, TAG_EXIST [1]
	TAG_EXIST [2], VALID_MAP
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written 26 Feb 1998, D. Zarro, SAC/GSFC

 Contact     : dzarro@solar.stanford.edu


REM_MULT_CHAR $SSW/gen/idl/string/rem_mult_char.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : REM_MULT_CHAR()
               
 Purpose     : Function to remove multiple characters from a string. 
               
 Explanation : Same as STRCOMPRESS only works on all characters.
               
 Use         : result = rem_mult_char(string [, char ,/all])  

    
 Inputs      : string - string variable in which to compress all multiple
                        characters
               
 Opt. Inputs : char   - character, multiple occurrences of which are to be
                        replaced. Default is space
               
 Outputs     : Function returns compressed string
               
 Opt. Outputs: None
               
 Keywords    : ALL - if present all occurrences of the named character will
                     be deleted.

 Calls       : ***
	STR_SEP
 CALLED BY:
	ANYNAME2STD, CDS_SLINE_DATA, SHOW_DATAWIN
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, string
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 6-Mar-95
               
 Modified    : Handle edge effects.  CDP, 10-mar-95

 Version     : Version 2, 10-Mar-95


REM_SEQ $SSW/gen/idl/util/rem_seq.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : REM_SEQ

 Purpose     : remove runs of sequential array elements to a single value

 Category    : Utility

 Explanation : None

 Syntax      : IDL> new = rem_seq(array,value)

 Inputs      : ARRAY = array of values to check
               VALUE = value to remove
               (e.g. entering a value of 4 reduces a sequence of -4,-4,-4 
                to -4)
               If value not entered then all sequential elements will be
               reduced

 Opt. Inputs : None

 Outputs     : Reduced array

 Opt. Outputs: None

 Keywords    : None

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, UNIQ [1], UNIQ [2], UNIQ [3]
 CALLED BY:
	WRITE_IAP
 Common      : None

 Restrictions: Input should be an array

 Side effects: None

 History     : Version 1,  29-July-1997,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


REM_TAG [1] $SSW/gen/idl/struct/rem_tag.pro
[Previous] [Next]
 Project     : HESSI

 Name        : REM_TAG

 Purpose     : remove tags from a structure

 Syntax      : NEW_STRUCT=REM_TAG(STRUCT,TAG)

 Inputs      : STRUCT = input structure (array or scalar)
             : TAG = array of tag names or indexes to remove

 Outputs     : NEW_STRUCT = new structure

 Keywords    : NAME = new name for structure (use with care)

 Category    : Structure handling

 Written     : 1-Dec-02, Zarro (EER/GSFC)

 Modified    : 24-Dec-04, Zarro (L-3Com/GSFC) 
                - vectorized, and removed dangerous /free_mem
               01-Feb-05, Csillaghy (Univ. Applied Sciences NW Switzerland)
                - changed n_elements( struct ) to size(struct /dim ), see at the end.
 CALLS:
 CALLED BY
	CH_WRITE_FITS, DEF_CDS_STUDY, DEF_INST_PLAN, EIS_RASTER_BROWSER [1]
	FITS WRITER CLASS FOR RHESSI IMAGES, GEN__DEFINE, GOES__DEFINE
	HESSI IMAGE CLASS DEFINITION [1], HESSI IMAGE FILE CLASS DEFINITION [1]
	HESSI IMAGE RAW CLASS DEFINITION [2]
	HESSI IMAGE STRATEGY CLASS DEFINITION, HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE, HSI_SRM__DEFINE
	JOIN_STRUCT [1], MAKE_CHIANTI_SPEC, MK_CDS_STUDY, MK_NEW_MAP, MK_OLD_MAP
	MK_PLAN_CONV, NANCAY__DEFINE, PLOT_MAP, RD_GOES, REM_ANON_TAG, REP_PROP
	REP_TAG_NAME, REP_TAG_VALUE, SHOW_SYNOP__DEFINE, SPECTROGRAM CLASS DEFINITION
	SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SPLIT_STRUCT, STRIP_STRUCT, ST_SUMER
	WCS_FIND_PIXEL_LIST, WCS_FIND_POSITION, WCS_FIND_SPECTRUM, WCS_FIND_TABLE
	WCS_FIND_TIME, WCS_RECTIFY, WTITLE, XPS_SETUP, XREPORT_EDIT, XSTUDY, XYPLOT__DEFINE
	ch_ss, convert YohkohSXT history record  more legible form
	eis_raster_browser [2], eit_struct, hsi_corr_widget, hsi_image__getaxis [2]
	hsi_imagemisc_widget, hsi_imagesize_widget, hsi_params2script
	hsi_params_2_top_struct, hsi_params_write_pro, hsi_show_flags [2]
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
	ospex_params_write_pro, plotman, read_soon, spex_merge_plots, str_sub2top
	str_top2sub


REM_TAG [2] $SSW/gen/idl/struct/rem_tag2.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	REM_TAG

 Purpose     :	remove a tag from a structure

 Use         : NEW_STRUCT=REM_TAG(STRUCT,TAG)

 Inputs      :	STRUCT = input structure (array or scalar)
             : TAG = array of tag names to remove

 Outputs     :	NEW_STRUCT = new structure

 Opt. Outputs:	None.

 Keywords    :	NAME = new name for output structure

 Category    :	Structure handling

 Written     :	Dominic Zarro (ARC)

 Modified    : Version 2, S.V.H. Haugan (UiO), 13 June 1996
                       Stopped using undocumented REMOVE keyword that
                       tripped an internal bug in normal create_struct
                       calls.
               Version 3, Zarro (GSFC) 16 June 1996 -- cleaned up
               Version 4, Zarro (GSFC) 8 Oct 1998 -- use CREATE_STRUCT
               Version 5, Zarro (EIT/GSFC) 30 Sept 2000 
                          -- added recursion
                          -- disabled NAME keyword
               Modified, 1-Dec-02, Zarro (EER/GSFC) 
                       made NO_RECURSE the default
               10-Jan-03, Zarro (EER/GSFC) - added call to improved 
                REM_TAG for newer versions of IDL.

 CALLS:
 CALLED BY
	CH_WRITE_FITS, DEF_CDS_STUDY, DEF_INST_PLAN, EIS_RASTER_BROWSER [1]
	FITS WRITER CLASS FOR RHESSI IMAGES, GEN__DEFINE, GOES__DEFINE
	HESSI IMAGE CLASS DEFINITION [1], HESSI IMAGE FILE CLASS DEFINITION [1]
	HESSI IMAGE RAW CLASS DEFINITION [2]
	HESSI IMAGE STRATEGY CLASS DEFINITION, HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE, HSI_SRM__DEFINE
	JOIN_STRUCT [1], MAKE_CHIANTI_SPEC, MK_CDS_STUDY, MK_NEW_MAP, MK_OLD_MAP
	MK_PLAN_CONV, NANCAY__DEFINE, PLOT_MAP, RD_GOES, REM_ANON_TAG, REP_PROP
	REP_TAG_NAME, REP_TAG_VALUE, SHOW_SYNOP__DEFINE, SPECTROGRAM CLASS DEFINITION
	SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SPLIT_STRUCT, STRIP_STRUCT, ST_SUMER
	WCS_FIND_PIXEL_LIST, WCS_FIND_POSITION, WCS_FIND_SPECTRUM, WCS_FIND_TABLE
	WCS_FIND_TIME, WCS_RECTIFY, WTITLE, XPS_SETUP, XREPORT_EDIT, XSTUDY, XYPLOT__DEFINE
	ch_ss, convert YohkohSXT history record  more legible form
	eis_raster_browser [2], eit_struct, hsi_corr_widget, hsi_image__getaxis [2]
	hsi_imagemisc_widget, hsi_imagesize_widget, hsi_params2script
	hsi_params_2_top_struct, hsi_params_write_pro, hsi_show_flags [2]
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
	ospex_params_write_pro, plotman, read_soon, spex_merge_plots, str_sub2top
	str_top2sub


REMCHAR [1] $SSW/gen/idl/string/remchar.pro
[Previous] [Next]
 NAME:
	REMCHAR
 PURPOSE:
	Remove all appearances of character (char) from string (st)

 CALLING SEQUENCE:
	REMCHAR, ST, CHAR

 INPUT-OUTPUT:
	ST  - String from which character will be removed, scalar or vector  
 INPUT:
	CHAR- Single character to be removed from string or all elements of a
		string array 

 CALLED BY:
	CHECK_CONFLICT, EIT_DAILY, EXTAST, FITSDIR, FTHELP, FXTPIO_READ, FXTPIO_WRITE
	HESSI SOHDATA CLASS DEFINITION, HSI_CHK_DUPLICATE, IRAFDIR, KAP_DATE, KAP_VERS
	PURPOSE, QUERYVIZIER, READCOL [1], READCOL [2], READCOL [3], READFMT, RTMVIPLAY [1]
	RTMVIPLAY [2], RTMVIPLAYPNG, TBHELP, TFTD, XDIFF
 EXAMPLE:
	If a = 'a,b,c,d,e,f,g' then 

	IDL> remchar,a, ','

      will give a = 'abcdefg'

 REVISIONS HISTORY
	Written D. Lindler October 1986
	Test if empty string needs to be returned   W. Landsman  Feb 1991
	Work on string arrays    W. Landsman   August 1997
	Converted to IDL V5.0   W. Landsman   September 1997


REMCHAR [2] $SSW/gen/idl_libs/astron/misc/remchar.pro
[Previous] [Next]
 NAME:
	REMCHAR
 PURPOSE:
	Remove all appearances of character (char) from string (st)

 CALLING SEQUENCE:
	REMCHAR, ST, CHAR

 INPUT-OUTPUT:
	ST  - String from which character will be removed, scalar or vector  
 INPUT:
	CHAR- Single character to be removed from string or all elements of a
		string array 

 CALLED BY:
	CHECK_CONFLICT, EIT_DAILY, EXTAST, FITSDIR, FTHELP, FXTPIO_READ, FXTPIO_WRITE
	HESSI SOHDATA CLASS DEFINITION, HSI_CHK_DUPLICATE, IRAFDIR, KAP_DATE, KAP_VERS
	PURPOSE, QUERYVIZIER, READCOL [1], READCOL [2], READCOL [3], READFMT, RTMVIPLAY [1]
	RTMVIPLAY [2], RTMVIPLAYPNG, TBHELP, TFTD, XDIFF
 EXAMPLE:
	If a = 'a,b,c,d,e,f,g' then 

	IDL> remchar,a, ','

      will give a = 'abcdefg'

 REVISIONS HISTORY
	Written D. Lindler October 1986
	Test if empty string needs to be returned   W. Landsman  Feb 1991
	Work on string arrays    W. Landsman   August 1997
	Converted to IDL V5.0   W. Landsman   September 1997


REMOVE [1] $SSW/gen/idl/util/remove.pro
[Previous] [Next]
 NAME:
       REMOVE
 PURPOSE:
       Contract a vector or up to 7 vectors by removing specified elements   
 CALLING SEQUENCE:
       REMOVE, index, v1,[ v2, v3, v4, v5, v6, v7]     
 INPUTS:
       INDEX - scalar or vector giving the index number of elements to
               be removed from vectors.  Duplicate entries in index are
               ignored.    An error will occur if one attempts to remove
               all the elements of a vector.

 INPUT-OUTPUT:
       v1 - Vector or array.  Elements specifed by INDEX will be 
               removed from v1.  Upon return v1 will contain
               N fewer elements, where N is the number of values in
               INDEX.

 OPTIONAL INPUT-OUTPUTS:
       v2,v3,...v7 - additional vectors containing
               the same number of elements as v1.  These will be
               contracted in the same manner as v1.

 CALLED BY:
	CHIANTI_DEM, CH_SYNTHETIC, CH_XMENU_SEL, FTOTAL, HSI_APP100_UNPACK_TIME, NSTAR
	PKFIT [1], PKFIT [2], QUERYVIZIER, SPEX_FIT__DEFINE, SRCOR, SUBSTAR, T_SUBSTAR
	UPD_PLAN, UPD_SOHO_DET, XCOLORS [2], hsi_get_flare_flags, hsi_params_write_pro
	ospex_params_write_pro
 EXAMPLES:
       (1) If INDEX = [2,4,6,4] and V = [1,3,4,3,2,5,7,3] then after the call

               IDL> remove,index,v      

       V will contain the values [1,3,3,5,3]

       (2) Suppose one has a wavelength vector W, and three associated flux
       vectors F1, F2, and F3.    Remove all points where a quality vector,
       EPS is negative

               IDL> bad = where( EPS LT 0, Nbad)
               IDL> if Nbad GT 0 then remove, bad, w, f1, f2, f3

 METHOD:
       If more than one element is to be removed, then HISTOGRAM is used
       to generate a 'keep' subscripting vector.    To minimize the length of 
       the subscripting vector, it is only computed between the minimum and 
       maximum values of the index.   Therefore, the slowest case of REMOVE
       is when both the first and last element are removed.

 REVISION HISTORY:
       Written W. Landsman        ST Systems Co.       April 28, 1988
       Cleaned up code          W. Landsman            September, 1992
       Converted to IDL V5.0   W. Landsman   September 1997
       Major rewrite for improved speed   W. Landsman    April 2000


REMOVE [2] $SSW/gen/idl_libs/astron/misc/remove.pro
[Previous] [Next]
 NAME:
       REMOVE
 PURPOSE:
       Contract a vector or up to 7 vectors by removing specified elements   
 CALLING SEQUENCE:
       REMOVE, index, v1,[ v2, v3, v4, v5, v6, v7]     
 INPUTS:
       INDEX - scalar or vector giving the index number of elements to
               be removed from vectors.  Duplicate entries in index are
               ignored.    An error will occur if one attempts to remove
               all the elements of a vector.

 INPUT-OUTPUT:
       v1 - Vector or array.  Elements specifed by INDEX will be 
               removed from v1.  Upon return v1 will contain
               N fewer elements, where N is the number of values in
               INDEX.

 OPTIONAL INPUT-OUTPUTS:
       v2,v3,...v7 - additional vectors containing
               the same number of elements as v1.  These will be
               contracted in the same manner as v1.

 CALLED BY:
	CHIANTI_DEM, CH_SYNTHETIC, CH_XMENU_SEL, FTOTAL, HSI_APP100_UNPACK_TIME, NSTAR
	PKFIT [1], PKFIT [2], QUERYVIZIER, SPEX_FIT__DEFINE, SRCOR, SUBSTAR, T_SUBSTAR
	UPD_PLAN, UPD_SOHO_DET, XCOLORS [2], hsi_get_flare_flags, hsi_params_write_pro
	ospex_params_write_pro
 EXAMPLES:
       (1) If INDEX = [2,4,6,4] and V = [1,3,4,3,2,5,7,3] then after the call

               IDL> remove,index,v      

       V will contain the values [1,3,3,5,3]

       (2) Suppose one has a wavelength vector W, and three associated flux
       vectors F1, F2, and F3.    Remove all points where a quality vector,
       EPS is negative

               IDL> bad = where( EPS LT 0, Nbad)
               IDL> if Nbad GT 0 then remove, bad, w, f1, f2, f3

 METHOD:
       If more than one element is to be removed, then HISTOGRAM is used
       to generate a 'keep' subscripting vector.    To minimize the length of 
       the subscripting vector, it is only computed between the minimum and 
       maximum values of the index.   Therefore, the slowest case of REMOVE
       is when both the first and last element are removed.

 REVISION HISTORY:
       Written W. Landsman        ST Systems Co.       April 28, 1988
       Cleaned up code          W. Landsman            September, 1992
       Converted to IDL V5.0   W. Landsman   September 1997
       Major rewrite for improved speed   W. Landsman    April 2000


REMOVE_BLANK_LINES $SSW/gen/idl/string/remove_blank_lines.pro
[Previous] [Next]
 NAME:

           REMOVE_BLANK_LINES()

 PROJECT

           SOLAR-B/EIS

 EXPLANATION

           Remove blank lines from a string array

 INPUTS

           array - a string array

 HISTORY

     V0.1, Written 28-June-2006, John Rainnie


REMOVE_PATH $SSW/gen/idl/fund_lib/sdac/remove_path.pro
[Previous] [Next]

 NAME: 
	REMOVE_PATH

 PURPOSE:
	This procedure removes directories with the input string
	from the software path.

 CATEGORY:
	GEN

 CALLING SEQUENCE:
 	REMOVE_PATH, TEST_STRING
	
	E.G.
	remove_path, 'schwartz' 

 	!path will not have any elements with the string 'schwartz'

 CALLS: ***
	ARR2STR [1], Arr2Str [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], OS_FAMILY
	STR_SEP
 INPUTS:
       Search_string- remove directories with this substring

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	OLD_PATH- the inititial !path
 CALLED BY:
	HESSI_DEV, hessi_version
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Cleaned documentation, RAS, June 1996
	Version 2, richard.schwartz@gsfc.nasa.gov, 2-sep-1998.  Made Windows and MacOS compatible.


remove_w_c $SSW/gen/idl/genutil/remove_w_c.pro
[Previous] [Next]
 Project      : HESSI

 Name         : remove_w_c.pro

 Purpose      : Read in a file, change all characters to lower case, delete whitespaces, and write to an output file.

 Explanation  : This is a sub-routine for xdiff.pro. When comparing two files
                sometimes you want to ignore whitespaces and case differences.

 Use          : del_blank_lines,'<infile>',  '<outfile>',  '<error>'

 Inputs       : '<infile>'     : the name of the input file
              : '<outfile>' : the name of the output file
              : '<error>'      : error flag

 Opt. Inputs  : None.

 Outputs      : None.

 Opt. Outputs : None.

 Keywords     : w : delete whitespaces
              : c : change all characters to lower case

 Calls        : ***
	DEFAULT, RD_ASCII [1], RD_ASCII [2]
 CALLED BY:
	XDIFF
 Common       : None.

 Restrictions : None.

 Side effects : Creates temporary files.

 Category     : Utility

 Written      : Xiaolin Li, 30 August 2002

 Version      : 1, 30 August 2002


remtab [1] $SSW/gen/idl/string/remtab.pro
[Previous] [Next]
NAME:
	remtab
PURPOSE:
	To remove the tabs from a line
	but to maintain the positions where the characters were
	Assumes tabs are every 8 columns
INPUT:
	in_str	- input string or string array
OUTPUT:
	out_str	- output string or string array
 CALLED BY:
	DETAB, disp_therm_rs232, doc_head [1], doc_head [2], doc_head [3]
	mk_bad_pix_map_load, rd_exec_synop_index, rd_pkt_head [1], rd_pkt_head [2]
	rd_tr_seq_head, rd_ulin_col, rd_video_menu, reg_check, rmosaic [1], rmosaic [2]
	rmosaic [3], str2cols [1], str2cols [2], str2html [1], str2html [2], str2html [3]
	sxt_plan, timeline, topsdb [1], topsdb [2], web_seq, where_table [1]
	where_table [2], where_table [3], xdisp_fits, xdisp_trace [1], xdisp_trace2
	xdisp_trace3, xgen_widget, xset_chain [1], xset_chain [2]
HISTORY:
	Written 1988 by M.Morrison
               2-Jun-94 (SLF) allow string arrays - skip lines w/no tabs
			       ues lookup for substituion for speed


rename [1] $SSW/gen/idl/system/rename.pro
[Previous] [Next]
   Name: rename 

   Purpose: rename unix files (new string replaces old string)

   Input Parameters
      old - pattern to replace
      new - new pattern to insert (default is null)

   Keyword Parameters:
      filt - file filter - replace done on subset matching this pattern
	      normally, old pattern is used for file matching
	      include wild cards on one or both sides
      lowcase - if set, convert to lower case
      upcase  - if set, convert to upper case
   
 CALLS: ***
	str_replace [1], str_replace [2]
 CALLED BY:
	check_log [1], check_log [2], renbad, selsisi_copy
   Restrictions: unix only

   Caution: make sure your pattern only occurs where you expect it!!
            all occureneces are replaced

   History - slf, Feb 1992
	      slf, 10-Oct-1992 - add lowcase/upcase keywords
	      slf, 16-mar-1993 - allow directory renames (eliminate ':')


REP_FITS_HEAD $SSW/gen/idl/fits/rep_fits_head.pro
[Previous] [Next]
 Project     : HESSI

 Name        : REP_FITS_HEAD

 Purpose     : Replace FITS header information. 
               Equivalent programs that do this often get the
               character spacings wrong, which upsets
               some less tolerant FITS readers.

 Category    : FITS, Utility

 Syntax      : IDL> rep_fits_head,head,key,value

 Inputs      : HEAD = FITS header 
               KEY    = key name to replace
               VALUE  = value to replace with

 Outputs     : HEAD= modified header

 CALLS: ***
	EXIST, IS_BLANK, PR_SYNTAX, TRIM
 CALLED BY:
	ROT_FITS_HEAD
 History     : Written, 3-Jan-2005, Zarro (L-3Com/GSFC)
               
 Contact     : dzarro@solar.stanford.edu


rep_logenv $SSW/gen/idl/system/strrep_logenv.pro
[Previous] [Next]
   Name: rep_logenv

   Purpose: replace environmental translation with envionmental

   Input Parameters:
      inarray - string array (ex: file name list or path name list)
      environ - 

 CALLS: ***
	GET_DELIM, STRREP_LOGENV, data_chk [1], data_chk [2], get_logenv [1]
	get_logenv [2], str_replace [1], str_replace [2], strjustify
   Restrictions:
      Assume translation in same column for all inarray for now

   History:
      18-feb-1996 S.L.Freeland - shorten displayed path and file information
      15-Jul-1996 S.L.Freeland - double delimiters->one delimiter
      20-Feb-1998 S.L.Freeland - default to 1st character match 


REP_PROP $SSW/gen/idl/mapping/rep_prop.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : REP_PROP

 Purpose     : replace a property value in a map object

 Category    : imaging, objects, maps

 Explanation : 

 Syntax      : rep_prop,map,property=value

 CALLED BY:
	ADD_PROP
 Examples    : rep_prop,map,units='arcsecs'

 Inputs      : MAP = map structure
               PROPERTY = property name
               VALUE = property value

 Opt. Inputs : None
;
 Outputs     : MAP = new map with property added

 Opt. Outputs: 

 Keywords    : See inputs

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_MAP_PROP, PR_SYNTAX, REM_TAG [1]
	REM_TAG [2], REP_TAG_VALUE, VALID_MAP
 Common      : None

 Restrictions: Cannot have two properties with same name

 Side effects: None

 History     : Written 22 April 1999, D. Zarro, SM&A/GSFC

 Contact     : dzarro@solar.stanford.edu


REP_STRUCT_NAME $SSW/gen/idl/struct/rep_struct_name.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	REP_STRUCT_NAME

 Purpose     :	Replace structure name 

 Use         : NEW_STRUCT=REP_STRUCT_NAME(STRUCT,NEW_NAME)

 Inputs      :	STRUCT = input structure
             : NEW_NAME= new structure name

 Outputs     :	NEW_STRUCT = new structure

 Category    :	Structure handling

 Written     : 7 July 1995, Zarro (ARC/GSFC)

 Modified    : 4 Jan 2005, Zarro (L-3Com/GSFC) - vectorized
 CALLS:
 CALLED BY
	DEF_CDS_STUDY, REM_ANON_TAG


REP_TAG_NAME $SSW/gen/idl/struct/rep_tag_name.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	REP_TAG_NAME

 Purpose     :	replace tag name in a structure

 Use         : NEW_STRUCT=REP_TAG_NAME(STRUCT,OLD_NAME,NEW_NAME)

 Inputs      :	STRUCT = input structure
             : OLD_NAME  = old name (can be index)
             : NEW_NAME = new name

 Outputs     :	NEW_STRUCT = new structure

 Keywords    :	NO_RECURSE = do not recurse 

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], EXIST, GET_RID, GET_TAG_INDEX, HAVE_TAG, IS_BLANK, IS_STRING
	PR_SYNTAX, REM_TAG [1], REM_TAG [2], REP_TAG_VALUE, STRUP, is_number [1]
	is_number [2], is_struct
 CALLED BY:
	DEF_INST_PLAN, FIX_EXTRA, GET_FITS_CDELT
	HESSI CLEAN ALGORITHM CLASS DEFINITION, HESSI PIXON CLASS DEFINITION
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, PLOT_MAP
	PLOT_MAP2 WARNINGTEMPORARY FIX ONLY FOR 16 bit ZBuffer support
	SPECTROGRAM CLASS DEFINITION, TAG_PREFIX, UPD_SCI_PLAN, XCAMP, XCDS_BOOK
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1], str_sub2top
 Restrictions:	Restricted to changing single tags

 Category    :	Structure handling

 Written     :	Dominic Zarro (ARC)

 Version     :	Version 1.0, 4 May 1995
               Version 2.0, 23 March 1998 -- added nested search
               Version 3.0, 8 Oct 1998 -- converted to use CREATE_STRUCT
		Version 4.0, 10-Dec-1998, William Thompson, GSFC
			Fixed bug in v3 when structure index passed
               Modified, 1-Mar-1999, Zarro (SM&A/GSFC) 
                       Added check for numeric tag index        
               Modified, 28-Sep-00, Zarro (EIT/GSFC)
                       Fixed recursion problem
                       Disabled NAME keyword
               Modified, 1-Dec-02, Zarro (EER/GSFC) 
                       Made NO_RECURSE the default
               Modified, 26-Dec-04, Zarro (L-3Com/GSFC)
                       Vectorized


REP_TAG_VALUE $SSW/gen/idl/struct/rep_tag_value.pro
[Previous] [Next]
 Project     :	SDAC

 Name        :	REP_TAG_VALUE

 Purpose     :	replace tag value in a structure

 Use         : NEW_STRUCT=REP_TAG_VALUE(STRUCT,TAG_VALUE,TAG_NAME)

 Inputs      :	STRUCT = input structure
             : TAG_VALUE = value to give tag
             : TAG_NAME = string tag name to modify (or index value)

 Outputs     :	NEW_STRUCT = new structure

 Keywords    :	NO_COPY = do not make copy of input TAG_VALUE
                         (it will be destroyed after input)
               NO_ADD  = do not add new tag if not present
               RECURSE = recurse on structure tags

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], EXIST, GET_RID, GET_TAG_INDEX, HAVE_TAG, IS_STRING
	PR_SYNTAX, REM_TAG [1], REM_TAG [2], STRUP, is_number [1], is_number [2], is_struct
	tag_index [1], tag_index [2]
 CALLED BY:
	BBSO__DEFINE, BOOST_TAG, BREAK_MAP, DEF_INST_PLAN, DROT_MAP, DROT_RASTER
	EIT_PARTIAL, EIT_PREP, GEN__DEFINE, GRID_MAP
	HESSI IMAGE STRATEGY CLASS DEFINITION, HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE, INTER_MAP
	ITOOL_PICKFILE, KPNO__DEFINE, MAP__DEFINE, MDI_COPY, MERGE_MAP, MK_CDS_PLAN
	MK_PLAN_CONV, MK_PLAN_CORR, MK_PLAN_CUSTOM, MK_RASTER, MK_SOHO, MK_SOHO_CUSTOM
	MK_SOHO_EDP, MK_STUDY, NEW_EDIT_ITEM, NIS_MRGDATA, PLOT_MAP
	PLOT_MAP2 WARNINGTEMPORARY FIX ONLY FOR 16 bit ZBuffer support, REBIN_MAP
	REDUCE_MAP, REM_ANON_TAG, REM_TAG [2], REPACK_MAP, REP_PROP, REP_TAG_NAME
	RESPACE_MAP, ROT_MAP, SHOW_RES_STC, SHOW_SYNOP__DEFINE
	SPECTROGRAM CLASS DEFINITION, SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SUB_MAP
	VDS_DEBIAS, WCS_FIND_PIXEL_LIST, XCAMP, XCAT, XCLONE_PLAN, XGET_SYNOPTIC, XIAP, XINPUT
	XLIST, XPROGRAM_ADD, XREPORT, XREPORT_EDIT, XSEL_LIST [1], XSEL_LIST [2], XSM_VALID
	XSTUDY, XTEXT, XYPLOT__DEFINE, eit_struct, hsi_image__getaxis [2], hsi_image_plot
	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_ui_img
	hsi_ui_lc, hsi_ui_spec, iperr_sea, plotman, read_trace, spex_convert_results [1]
	spex_convert_results [2], spex_merge_plots, str_tagarray2scalar
 Restrictions:	Restricted to changing single tags

 Category    :	Structure handling

 Written     :	Dominic Zarro (ARC)

 Version     :	Version 1.0, 4 May 1995
               Version 2.0, 23 March 1998 -- added nested search
               Version 3.0, 8 Oct 1998 -- converted to use CREATE_STRUCT
		Version 4.0, 10-Dec-1998, William Thompson, GSFC
			Fixed bug in v3 when structure index passed
               Modified, 1-Mar-1999, Zarro (SM&A/GSFC) 
                       Added check for numeric tag index        
               Modified, 28-Sep-00, Zarro (EIT/GSFC)
                       Fixed recursion problem, added /NO_ADD
                       Disabled NAME keyword
               Modified, 1-Dec-02, Zarro (EER/GSFC) 
                       Made NO_RECURSE the default
               Modified, 25-Dec-04, Zarro (L-3Com/GSFC)
                       Vectorized


REPACK_MAP $SSW/gen/idl/mapping/repack_map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : REPACK_MAP

 Purpose     : Pack pixel coordinate arrays into image map

 Category    : imaging

 Syntax      : rmap=repack_map(map,xp,yp)

 Inputs      : MAP = map structure
               XP,YP = 2-d coordinate arrays

 Opt. Inputs : None

 Outputs     : RMAP = repacked map

 CALLS: ***
	EXIST, GET_ARR_CENTER, REP_TAG_VALUE, VALID_MAP
 CALLED BY:
	BREAK_MAP, DROT_MAP, INTER_MAP, MERGE_MAP, REBIN_MAP, REDUCE_MAP, ROT_MAP, SUB_MAP
 History     : Written 22 Feb 1998, D. Zarro, SAC/GSFC

 Contact     : dzarro@solar.stanford.edu


REPCHAR $SSW/gen/idl/string/repchar.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : REPCHAR()
               
 Purpose     : Replaces a character within a string by another.
               
 Explanation : All occurrences of the specified character within a string 
               are replaced by the specified character (a space by default).
               
 Use         : IDL> new = repchar(old,out_char [,in_char])
    
 Inputs      : old      - string in which to replace character.
               out_char - character to be replaced

 Opt. Inputs : in_char  - character to be inserted in place of out_char.
                          (Default is a space)
               
 Outputs     : Function returns suitably adapted string.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
 CALLED BY:
	ANYNAME2STD, CAT_FITS, CHIANTI_NE, CHIANTI_TE, GET_OBS_DATE, GET_UDP_HEAD
	ITOOL_GET_TIME, LIST_FITS, MK_HELP_STC, NORH_PR_EVX [1], NORH_PR_EVX [2]
	RD_LINE_LIST, TP_GWIN_LOGIC, TP_VWIN_LOGIC, VAL2STRING, eis_db_save_gui [1]
	eis_db_save_gui [2], hsi_params_write_pro, ospex_params_write_pro
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, string
               
 Prev. Hist. : R. Sterner.  Oct, 1986.

 Written     : CDS version by C D Pike, RAL, 24-Jun-94
               
 Modified    : 

 Version     : Version 1, 24-Jun-94


REPCHR [1] $SSW/gen/idl/string/repchr.pro
[Previous] [Next]
 NAME:
       REPCHR
 PURPOSE:
       Replace all occurrences of one character with another in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       new = repchr(old, c1, [c2])
 INPUTS:
       old = original text string.          in
       c1 = character to replace.           in
       c2 = character to replace it with.   in
            default is space.
 KEYWORD PARAMETERS:
 OUTPUTS:
       new = edited string.                 out
 CALLED BY:
	ADXY, CREATE_STRUCT [1], CREATE_STRUCT [2], CURVAL, Change_Selection
	DT_TM_MAK [1], DT_TM_MAK [2], DT_TM_MAK [3], HESSI SOHDATA CLASS DEFINITION
	Initialize Selection [2], NORH_CREATE_STRUCT [1], NORH_CREATE_STRUCT [2]
	NORH_FITS_INTERP [1], NORH_FITS_INTERP [2], READCOL [3], Selection delete
	fits_interp, put selection
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  28 Oct, 1986.
       Johns Hopkins Applied Physics Lab.
       RES 1 Sep, 1989 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1986, 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.
	Converted to IDL V5.0   W. Landsman   September 1997


REPCHR [2] $SSW/gen/idl_libs/astron/jhuapl/repchr.pro
[Previous] [Next]
 NAME:
       REPCHR
 PURPOSE:
       Replace all occurrences of one character with another in a text string.
 CATEGORY:
 CALLING SEQUENCE:
       new = repchr(old, c1, [c2])
 INPUTS:
       old = original text string.          in
       c1 = character to replace.           in
       c2 = character to replace it with.   in
            default is space.
 KEYWORD PARAMETERS:
 OUTPUTS:
       new = edited string.                 out
 CALLED BY:
	ADXY, CREATE_STRUCT [1], CREATE_STRUCT [2], CURVAL, Change_Selection
	DT_TM_MAK [1], DT_TM_MAK [2], DT_TM_MAK [3], HESSI SOHDATA CLASS DEFINITION
	Initialize Selection [2], NORH_CREATE_STRUCT [1], NORH_CREATE_STRUCT [2]
	NORH_FITS_INTERP [1], NORH_FITS_INTERP [2], READCOL [3], Selection delete
	fits_interp, put selection
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner.  28 Oct, 1986.
       Johns Hopkins Applied Physics Lab.
       RES 1 Sep, 1989 --- converted to SUN.
       R. Sterner, 27 Jan, 1993 --- dropped reference to array.

 Copyright (C) 1986, 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.
	Converted to IDL V5.0   W. Landsman   September 1997


REPLICATE2 $SSW/gen/idl/util/replicate2.pro
[Previous] [Next]
 Project     : RHESSI

 Name        : REPLICATE2

 Purpose     : same as REPLICATE, but accepts vector dimensional input

 Category    : utility

 Syntax      : IDL> output=replicate2(input,dims)

 Inputs      : INPUT = input array
               DIMS = vector of dimensions to replicate to, e.g., [2,3,4]

 Outputs     : OUTPUT = replicated input

 Keywords    : None

 CALLS: ***
	EXIST, SINCE_VERSION [1], SINCE_VERSION [2]
 CALLED BY:
	ADD_TAG [1], JOIN_STRUCT [1], REM_TAG [1]
 History     : 2-Feb-2005,  D.M. Zarro (L-3Com/GSFC)  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


REPRODUCE $SSW/gen/idl/util/reproduce.pro
[Previous] [Next]
 Project     : HESSI

 Name        : REPRODUCE

 Purpose     : Reproduce any input any number of times
               (REPLICATE and REBIN have almost the same
                functionality, but have problems with array
                and string inputs)

 Category    : Utility
                   
 Inputs      : SOURCE = input (e.g. ['a','b','c'])
               TIMES = times to reproduce (e.g. 3)

 Outputs     : RESULT = replicated source 
               (e.g. [['a','b','c'],['a','b','c'],['a','b','c']]

 Keywords    : None

 CALLS: ***
	EXIST
 CALLED BY:
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [2]
	HESSI IMAGE STRATEGY CLASS DEFINITION, HSI_DECIM_CORRECTION [1]
	HSI_DECIM_CORRECTION [2], HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE, HSI_VIS_GEN
	Pileup_countrate_Build_Piler, Pileup_countrate_PULSE_CONVOLVE
	SPECPLOT__DEFINE, SPECTROGRAM CLASS DEFINITION, array_insert
	hsi_image__getaxis [2], hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 History     : Written, 4-June-2001,  D.M. Zarro (EITI/GSFC) 
               Based upon a clever idea by R. Schwartz

 Contact     : DZARRO@SOLAR.STANFORD.EDU


REPSTR [1] $SSW/gen/idl/string/repstr.pro
[Previous] [Next]
 NAME:
	REPSTR
 PURPOSE:
	Replace all occurences of one substring by another.
 EXPLANATION:
	Meant to emulate the string substitution capabilities of text editors
 CALLING SEQUENCE:
	result = repstr( obj, in, out )

 INPUT PARAMETERS:
	obj    = object string for editing, scalar or array
	in     = substring of 'obj' to be replaced, scalar 

 OPTIONAL INPUT PARMETER:
	out    = what 'in' is replaced with, scalar.   If not supplied
		then out = '', i.e. 'in' is not replaced by anything. 

 OUTPUT PARAMETERS:
	Result returned as function value.  Input object string
	not changed unless assignment done in calling program.

 CALLED BY:
	CAT_FITS, CDS_ADEF_PARSEFILE, CH_LINE_LIST, CONVERT_TERMS, CONVERT_TERMS_ALL
	DSP_AUX, DSP_WAV, EXTAST, Files_Handling [1], Files_Handling [2], LIST_FITS
	MK_CDS_ANALYSIS, QUERYSIMBAD, QUERYVIZIER, TFTD, hsi_params_write_pro
	ospex_params_write_pro
 PROCEDURE:
	Searches for 'in', splits 'obj' into 3 pieces, reassembles
	with 'out' in place of 'in'.  Repeats until all cases done.

 EXAMPLE:
	If a = 'I am what I am' then print,repstr(a,'am','was')
	will give 'I was what I was'.

 MODIFICATION HISTORY:
	Written by Robert S. Hill, ST Systems Corp., 12 April 1989.
	Accept vector object strings, W. Landsman   HSTX,   April, 1996
	Converted to IDL V5.0   W. Landsman   September 1997
       Convert loop to LONG, vectorize STRLEN call W. Landsman June 2002
       Correct bug in optimization, case where STRLEN(OBJ) EQ
         STRLEN(IN), C. Markwardt, Jan 2003
       Fixed problem when multiple replacements extend the string length
                 D. Finkbeiner, W. Landsman  April 2003
       Allow third parameter to be optional again W. Landsman  August 2003
       Remove limitation of 9999 characters, C. Markwardt Dec 2003


REPSTR [2] $SSW/gen/idl_libs/astron/misc/repstr.pro
[Previous] [Next]
 NAME:
	REPSTR
 PURPOSE:
	Replace all occurences of one substring by another.
 EXPLANATION:
	Meant to emulate the string substitution capabilities of text editors
 CALLING SEQUENCE:
	result = repstr( obj, in, out )

 INPUT PARAMETERS:
	obj    = object string for editing, scalar or array
	in     = substring of 'obj' to be replaced, scalar 

 OPTIONAL INPUT PARMETER:
	out    = what 'in' is replaced with, scalar.   If not supplied
		then out = '', i.e. 'in' is not replaced by anything. 

 OUTPUT PARAMETERS:
	Result returned as function value.  Input object string
	not changed unless assignment done in calling program.

 CALLED BY:
	CAT_FITS, CDS_ADEF_PARSEFILE, CH_LINE_LIST, CONVERT_TERMS, CONVERT_TERMS_ALL
	DSP_AUX, DSP_WAV, EXTAST, Files_Handling [1], Files_Handling [2], LIST_FITS
	MK_CDS_ANALYSIS, QUERYSIMBAD, QUERYVIZIER, TFTD, hsi_params_write_pro
	ospex_params_write_pro
 PROCEDURE:
	Searches for 'in', splits 'obj' into 3 pieces, reassembles
	with 'out' in place of 'in'.  Repeats until all cases done.

 EXAMPLE:
	If a = 'I am what I am' then print,repstr(a,'am','was')
	will give 'I was what I was'.

 MODIFICATION HISTORY:
	Written by Robert S. Hill, ST Systems Corp., 12 April 1989.
	Accept vector object strings, W. Landsman   HSTX,   April, 1996
	Converted to IDL V5.0   W. Landsman   September 1997
       Convert loop to LONG, vectorize STRLEN call W. Landsman June 2002
       Correct bug in optimization, case where STRLEN(OBJ) EQ
         STRLEN(IN), C. Markwardt, Jan 2003
       Fixed problem when multiple replacements extend the string length
                 D. Finkbeiner, W. Landsman  April 2003
       Allow third parameter to be optional again W. Landsman  August 2003
       Remove limitation of 9999 characters, C. Markwardt Dec 2003


REPVEC [1] $SSW/gen/idl/util/repvec.pro
[Previous] [Next]
 NAME:
	REPVEC
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
   POSITIONAL PARAMETERS:
   KEYWORDS PARAMETERS:
 OUTPUTS:
   POSITIONAL PARAMETERS:
   KEYWORDS PARAMETERS:
 CALLS: ***
	MAKVEC
 CALLED BY:
	MK_GRID_COORDS [1], MK_GRID_COORDS [2], MK_GRID_COORDS2
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 EXAMPLE:
 MODIFICATION HISTORY:
       July, 1992. - Written by GLS, LMSC.


required_tags $SSW/gen/idl/struct/required_tags.pro
[Previous] [Next]
   Name: required_tags
  
   Purpose: check input structure of fits header for 'required' tags
     
   Input Parameters:
      index - IDL structures or FITS header array (input to gt_tagval)
      taglist - array or comma delimited list of tags to 

   Output:
      function returns boolean (true =1=> all required tags present)
                                false=0=> at least one required tag missing)  

   Keyword Parameters:
      /xxx, /yyy /(etc) - optionally supply tags via keyword switches
      ssw_standard - if set, check against a minimalist SSW standard set  
      missing_tags (output) - list of missing tags, if any

   Calling Sequence:
      ok=required_tags(index,'date_obs,crpix1,cdelt1')      ; tags in struct?
      ok=required_tags(index,/date_obs,/crpix1,/cdelt1)     ; same
      ok=required_tags(header,/date_obs,/crpix1,/cdelt1)    ; same for FITs
                                                            ; header  
 CALLS: ***
	ARR2STR [1], Arr2Str [2], BOX_MESSAGE, STR2ARR [1], STR2ARR [2], data_chk [1]
	data_chk [2], gt_tagval [1], gt_tagval [2]
 CALLED BY:
	GET_FITS_TIME, RESTORE_LOW8 [1], RESTORE_LOW8 [3], TRACE_PREP, ch_check_str, ch_ss
	checkdata, convert YohkohSXT history record  more legible form, decode_gev
	fits2rm, index2fov, lcur_image, mwritefits, plot_ace, plot_goesp, read_genxcat
	read_soon, read_trace, rest_low8_cube [1], rest_low8_cube [2], rest_low8_ffi
	return  a solar disk mask using SSW standard keywords
	return solar disk mask constrained by XY limits using SSW standards
	ssw_gxd_remove_flares, ssw_nar2armurl, ssw_pos2zenith, ssw_subimage
	ssw_track_fov, sswstruct_fill [1], sxt_get_grill [1], sxt_get_grill [2]
	sxt_his2dbase, sxt_is_synsfc, sxt_mksdc_history, time_window, trace_cat2data
	trace_cen2pix, trace_comsmic_norm, trace_cosmic2filename, trace_data_filter
	trace_get_vignette, trace_index2macrofov, trace_movie_context
	trace_prioritize_um, trace_sub2point, trace_uniq_movies, trace_wave2point
	write_genxcat, write_trace, write_trace_bin, yo_index2path, yo_sethisflags
   History:
      9-March-1998 - S.L.Freeland - written to simplify some common checks
     18-Jul-2000   - S.L.Freeland - suppress warning message unless /LOUD set


RES_MED [1] $SSW/gen/idl/fund_lib/sdac/resistant_mean.pro
[Previous] [Next]
NAME:
 RES_MED
PURPOSE
 Compute the median of an array, which may be of even length. 
Calling sequence  
 MID_VALUE = RES_MED(A)
Outputs
 The median of array A
Author:
 H.T. Freudenreich, ?/89
 renamed res_med by ras, 8-sep-1997,
 med() is too short for a function name under ssw until
 everyone is at version 5, included here since it is only
 used inside of resistant_mean and version 5(4?) supports
 the /even keyword in Median().
 CALLS:


RES_MED [2] $SSW/gen/idl/util/resistant_mean.pro
[Previous] [Next]
NAME:
 RES_MED
PURPOSE
 Compute the median of an array, which may be of even length. 
Calling sequence  
 MID_VALUE = RES_MED(A)
Outputs
 The median of array A
Author:
 H.T. Freudenreich, ?/89
 renamed res_med by ras, 8-sep-1997,
 med() is too short for a function name under ssw until
 everyone is at version 5, included here since it is only
 used inside of resistant_mean and version 5(4?) supports
 the /even keyword in Median().
 CALLS:


RESET [2] $SSW/gen/idl/system/reset.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : 
	RESET
 Purpose     : 
	Resets system variables to their default values.
 Explanation : 
	Resets the system variables for the currently selected device, and
	sets the following system variables to their default settings:

		!LINETYPE	!PSYM		!NOERAS
		!X.TITLE	!Y.TITLE	!P.TITLE
		!XTICKS		!YTICKS

	The routine SETPLOT is called to reinitialize the relevant system 
	parameters for the selected device.  Then the above mentioned system
	variables are set to their defaults.

 Use         : 
	RESET
 Inputs      : 
	None.
 Opt. Inputs : 
	None.
 Outputs     : 
	None.
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : ***
	SETPLOT [1], SETPLOT [2]
 CALLED BY:
	DSPEXP, Data Display, fig_tsmean [1], fig_tsmean [2]
 Common      : 
	None, but this routine calls SETPLOT which uses the PLOTFILE common 
	block.
 Restrictions: 
	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: 
	None.
 Category    : 
	Utilities, Devices.
 Prev. Hist. : 
	William Thompson, January 23, 1989.
	William Thompson, January 1993, changed to use current system variable
		names.
 Written     : 
	William Thompson, GSFC, 23 January 1989.
 Modified    : 
	Version 1, William Thompson, GSFC, 27 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 27 April 1993.


RESET_NETWORK $SSW/gen/idl/sockets/reset_network.pro
[Previous] [Next]
 Project     : HESSI
                  
 Name        : RESET_NETWORK
               
 Purpose     : reset network state by clearing last saved
               network state.
                             
 Category    : system utility sockets
               
 Syntax      : IDL> reset_network
                   
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], delvarx [5]
 History     : 6 May 2002, Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


RESET_XY [1] $SSW/gen/idl/fund_lib/sdac/reset_xy.pro
[Previous] [Next]
 Project: 
	SDAC

 NAME: 
	RESET_XY

 PURPOSE:
	This procedure resets saved !x, !y, and !p values to enable active switching
	and overplotting between graphics windows.

 CATEGORY:
	GRAPHICS

 CALLING SEQUENCE:
	RESET_XY, Winsav
	
	or

	RESET_XY, Bang_x, Bang_y, P_clip

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 INPUTS:
	Winsav: a structure with tags {winsav, x:!x, y:!y, clip:!p.clip}

	or

       Bang_x: Saved !x 
	Bang_y: Saved !y
	P_clip: Saved !p.clip

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	SPEX_THISTORY [1], SPEX_THISTORY [2], spex_spec_plot [1], spex_spec_plot [2]
	spex_spec_plot [3], spex_spec_plot [4]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	The system variables controlling plotting are changed.

 RESTRICTIONS:
	none

 PROCEDURE:
	The values are used to construct a plot with /nodata to reset 
	all the needed system variable elements.

 MODIFICATION HISTORY:
	RAS, 12-april-1996
	Version 2, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation


Resistant_Mean [1] $SSW/gen/idl/fund_lib/sdac/resistant_mean.pro
[Previous] [Next]
NAME:
 Resistant_Mean

PURPOSE:
 An outlier-resistant determination of the mean and its standard deviation.
 It trims away outliers using the median and the median absolute deviation.

CALLING SEQUENCE:
 RESISTANT_MEAN,VECTOR,SIGMA_CUT, MEAN,SIGMA,NUM_REJECTED

INPUT ARGUMENT:
 VECTOR    = Vector to average
 SIGMA_CUT = Data more than this number of standard deviations from the
             median is ignored. Suggested values: 2.0 and up.
	      maximum value of sigma_cut is 6.79.

OUTPUT ARGUMENT:
 MEAN  = the mean
 SIGMA = the standard deviation of the mean
 NUM_REJECTED = the number of points trimmed
KEYWORDS:
 WUSED = indices used for mean in array Y

SUBROUTINE CALLS:
 MED, which calculates a median, replaced with RES_MED
	richard.schwartz@gsfc.nasa.gov, 8-sep-1997

AUTHOR: H. Freudenreich, STX, 1989; Second iteration added 5/91.
 CALLS: ***
	AVG [1], AVG [2]
 CALLED BY:
	AVERAGE_STEPS, GOES_DEGLITCH, MAP_DISCLA2CONT, MELD_DISCSP [1], N511_VS_HVSPEC
	OCC_AVG, PLOT_CRAB, RES_MED [1], RES_MED [2], edge_products
MODIFICATION HISTORY:
	mod, ras,  28-sep-1995, report elements used
	richard.schwartz@gsfc.nasa.gov, 8-sep-1997
	richard.schwartz@gsfc.nasa.gov, 4-dec-1997
	protect against negative revised sigma.


Resistant_Mean [2] $SSW/gen/idl/util/resistant_mean.pro
[Previous] [Next]
NAME:
 Resistant_Mean

PURPOSE:
 An outlier-resistant determination of the mean and its standard deviation.
 It trims away outliers using the median and the median absolute deviation.

CALLING SEQUENCE:
 RESISTANT_MEAN,VECTOR,SIGMA_CUT, MEAN,SIGMA,NUM_REJECTED

INPUT ARGUMENT:
 VECTOR    = Vector to average
 SIGMA_CUT = Data more than this number of standard deviations from the
             median is ignored. Suggested values: 2.0 and up.
	      maximum value of sigma_cut is 6.79.

OUTPUT ARGUMENT:
 MEAN  = the mean
 SIGMA = the standard deviation of the mean
 NUM_REJECTED = the number of points trimmed
KEYWORDS:
 WUSED = indices used for mean in array Y

SUBROUTINE CALLS:
 MED, which calculates a median, replaced with RES_MED
	richard.schwartz@gsfc.nasa.gov, 8-sep-1997

AUTHOR: H. Freudenreich, STX, 1989; Second iteration added 5/91.
 CALLS: ***
	AVG [1], AVG [2]
 CALLED BY:
	AVERAGE_STEPS, GOES_DEGLITCH, MAP_DISCLA2CONT, MELD_DISCSP [1], N511_VS_HVSPEC
	OCC_AVG, PLOT_CRAB, RES_MED [1], RES_MED [2], edge_products
MODIFICATION HISTORY:
	mod, ras,  28-sep-1995, report elements used
	richard.schwartz@gsfc.nasa.gov, 8-sep-1997
	richard.schwartz@gsfc.nasa.gov, 4-dec-1997
	protect against negative revised sigma.


RESISTANT_Mean [3] $SSW/gen/idl_libs/astron/robust/resistant_mean.pro
[Previous] [Next]
 NAME:
    RESISTANT_Mean  

 PURPOSE:
    Outlier-resistant determination of the mean and standard deviation. 
 
 EXPLANATION:
    RESISTANT_Mean trims away outliers using the median and the median 
    absolute deviation.    An approximation formula is used to correct for
    the truncation caused by trimming away outliers

 CALLING SEQUENCE:
    RESISTANT_Mean, VECTOR, Sigma_CUT, Mean, Sigma_Mean, Num_RejECTED

 INPUT ARGUMENT:
       VECTOR    = Vector to average
       Sigma_CUT = Data more than this number of standard deviations from the
               median is ignored. Suggested values: 2.0 and up.

 OUTPUT ARGUMENT:
       Mean  = the mean of the input vector, numeric scalar
 OPTIONAL OUTPUTS:
	Sigma_Mean = the approximate standard deviation of the mean, numeric 
            scalar.  This is the Sigma of the distribution divided by sqrt(N-1)
            where N is the number of unrejected points. The larger
            SIGMA_CUT, the more accurate. It will tend to underestimate the 
            true uncertainty of the mean, and this may become significant for 
            cuts of 2.0 or less. 
       Num_RejECTED = the number of points trimmed, integer scalar

 CALLS: ***
	AVG [1], AVG [2]
 CALLED BY:
	AVERAGE_STEPS, GOES_DEGLITCH, MAP_DISCLA2CONT, MELD_DISCSP [1], N511_VS_HVSPEC
	OCC_AVG, PLOT_CRAB, RES_MED [1], RES_MED [2], edge_products
 EXAMPLE:
       IDL> a = randomn(seed, 10000)    ;Normal distribution with 10000 pts
       IDL> RESISTANT_Mean,a, 3, mean, meansig, num    ;3 Sigma clipping    
       IDL> print, mean, meansig,num
 
       The mean should be near 0, and meansig should be near 0.01 ( =
        1/sqrt(10000) ).     
 PROCEDURES USED:
       AVG() - compute simple mean
 REVISION HISTORY:
       Written, H. Freudenreich, STX, 1989; Second iteration added 5/91.
       Use MEDIAN(/EVEN)    W. Landsman   April 2002
       Correct conditional test, higher order truncation correction formula
                R. Arendt/W. Landsman   June 2002
       New truncation formula for sigma H. Freudenriech  July 2002
       Divide Sigma_mean by Num_good rather than Npts W. Landsman/A. Conley
                          January 2006


RESPACE_MAP $SSW/gen/idl/mapping/respace_map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : RESPACE_MAP

 Purpose     : Rebin an image map to new pixel spacing  

 Category    : imaging

 Explanation : Rebin a map to user-specified spacings and
               compute new output dimensions

 Syntax      : gmap=respace_map(map,sx,sy)

 Inputs      : MAP = image map structure
               SX,SY = new (x,y) spacing

 Outputs     : GMAP = rebinned map

 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], EXIST, MERGE_STRUCT, NINT [1], NINT [2]
	PR_SYNTAX, REP_TAG_VALUE, TRIM, UNPACK_MAP, VALID_MAP
 CALLED BY:
	GRID_MAP
 History     : Written 22 March 1998, D. Zarro, SAC/GSFC
		P. Saint-Hilaire, 2007/01/04: added keyword INTERACTIVE (if not set, program will no longer prompt user)

 Contact     : dzarro@solar.stanford.edu


RESPOND_WIDG $SSW/gen/idl/widgets/respond_widg.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	RESPOND_WIDG

 Purpose     :	Widget to prompt user for (e.g.) a "YES" or "NO" response.

 Explanation :	
	Creates a widget to prompt user for a "YES" or "NO" response as a
	default.  But you may pass your own button names with the BUTTONS
	keyword.

 Use         :	
   var = respond_widg, [message=message, buttons=buttons, /column,
			/row, group_leader=group]

 Inputs      :	
	MESSAGE : 	String or string vector with message to be 
		    	displayed in widget
			The default message is 'Respond YES or NO '	
	BUTTONS :	String vector where each element will be a button
			You may have as many elements as will fit.
	TITLE   :	string to appear as widget's banner
	COLUMN  :	if set then the buttons will be verically placed
	ROW	:	if set then the buttons will be horizontally placed
				(/ROW is the default and it overrides /COLUMN)
	GROUP_LEADER : 	Causes the widgets destruction if parent is killed
	XOFFSET :       X-POSITION OF BASE IN PIXEL UNITS
	YOFFSET :       Y-POSITION OF BASE IN PIXEL UNITS

 Opt. Inputs :	None.

 Outputs     :	
	Returns a -1 if program fails else it returns the index number of 
	the button that was selected, as determined by the array BUTTONS.
       Indexes start at 0.  
	If you passed this array then you already know your values.
	If you use the default BUTTONS array then 
		   0 if "YES" was selected
	           1 if "NO" was selected

 Opt. Outputs:	None.

 Keywords    :	None.

 Calls       : ***
	RESPOND_EVENT, WIDGET_MBASE, XMANAGER
 CALLED BY:
	CAL_SHER, CPDIFF, CPDISPLAY, CPMOVIE, CPMOVIE_DO, CPMOVIE_EV, CPTV, EIT_SUBFIELD
	EIT_SUB_FIXOFF, EIT_SUB_PRINT, EIT_SUB_ROTATE, HXISLIFE, HXISLIMB, HXISSURF
	HXISWIDGET, HXISWIDG_EV, MDisp, POINT [1]
	Radio Astronomy Group View RAG View [1]
	Radio Astronomy Group View RAG View [2], SPEX_BACKGROUND [1]
	SPEX_BACKGROUND [2], SUBFIELD_EV, point [2], spec_plot [1], spec_plot [2]
	spec_plot [3], spec_plot [4], spex_intervals [1], spex_intervals [2]
	spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3], spex_spec_plot [4]
	uvsp
 Common      :	RESPOND_WIDGET

 Restrictions:	
	Must have X windows device.

 Side effects:	None.

 Category    :	Utilities, User_interaction

 Prev. Hist. :	
	FEB 1993 - Elaine Einfalt (HSTX)

 Written     :	Elaine Einfalt, GSFC (HSTX), February 1993

 Modified    :	Version 1, Elaine Einfalt, GSFC (HSTX), February 1993

 Version     :	Version 1, February 1993

 Version     : Version 2, July 1996 - Richard Schwartz (added xoffset and yoffset keywords)
	      : June 2004 - einfalt - moved the /modal from xmanager to base
				      via the routine WIDGET_MBASE 


REST_MASK $SSW/gen/idl/util/rest_mask.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       REST_MASK()

 PURPOSE: 
       Return the index excluding those given in SUBINDEX.

 EXPLANATION:
       
 CALLING SEQUENCE: 
       Result = REST_MASK(array, subindex)

 INPUTS:
       ARRAY    -- An array of any kind of data type
       
       SUBINDEX -- Integer vector containing indices which will be excluded
                   from ARRAY

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RESULT   -- Indices of ARRAY with SUBINDEX excluded

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       None.

 CALLS:
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	ARRAY_XOR, HSI_COINCIDENCE_CHECK, RM_PATH [1], RM_PATH [2], STRIP_STRUCT
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written October 19, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Change test when string array is input.  CDP, 23-Apr-97
       Version 3, SVHH, 23 April 1997
               New algorithm, independent of data type (works for
               NaN values as well).

 VERSION:
       Version 3, 23 April 1997


restenv [1] $SSW/gen/idl/genutil/restenv.pro
[Previous] [Next]
   Name: restenv

   Purpose: restore environment (UNIX environmentals/VMS logicals)
            (which were stored by previous call to saveenv)

   History:
      9-Jan-1994 (SLF)

   Method:
      calls set_logenv.pro to update envrionment

 CALLS: ***
	get_logenv [1], get_logenv [2], set_logenv [1], set_logenv [2]
   Common Blocks:
      saveenv_blk (store environmentals and translation)


restgen [1] $SSW/gen/idl/io/restgen.pro
[Previous] [Next]
   Name: restgen

   Purpose:
      read & restore parameters (idl variables) from a generic file
      [front end to rd_genx - reads files written by savegen.pro]

   Output Parameters
      p0,p1,p2...p15 - variables to restore from file

   Optional Keyword Parameters
      file   - (Input) generic file name [default='save.genx']
      struct - (Output) entire data structure from generic file
      text   - (Output) optional text section from file (if it exists)
      header - (Output) system imposed file header (added via wrt_genx)
      quiet  - (input)  if set, inhibit some messages
      inquire - (input) if set, display summary of generic file
      nodata  - (input) if set, dont read data section (just header and text)
      
   Calling Sequence:
      restgen,v1, [,v2...v15 , file=filename, text=text, header=header, /inq]
                  [,struct=struct, /nodata]
		    
   Calling Examples:
      restgen, a, b, c, text=text		; restore 'save.genx' 
      restgen, file='newdat',/inquire,/nodata  ; show summary of 'newdat.genx'
      restgen, struct=struct			; file contents as structure
      restgen, head=head,text=text		; just header and text 
      [see documentation for savegen.pro]

 CALLS: ***
	RD_GENX
 CALLED BY:
	BCS_COMP, BUILD_DRM_MER_CONT, CF_174LG, CF_177LG, CF_180LG, CF_765LG, CF_770LG
	CF_GIS1A, CF_GIS1B, CF_GIS1C, CF_GIS2A [1], CF_GIS4A, CF_GIS4B, CF_GIS4C
	EIS_LIST_EXPER [1], EIS_LIST_EXPER [2], FIRST_LIGHT [1], FIRST_LIGHT [2]
	GET_SUMER_FILES, GE_WINDOW [1], GOES_MEWE_TEM, GOES_TF, GOES_TF_COEFF
	HESSI_FLARE_SPECTRUM, HESSI_MODEL_COUNTS
	HW_SYNSPEC__DEFINE defines the class HW_SYNSPEC Objects of this [1]
	HW_SYNSPEC__DEFINE defines the class HW_SYNSPEC Objects of this [2]
	HXA2HXAXY [1], HXA2HXAXY [2], LOG_DERIV, LWA_TE, MAKE_GOES_RESP, N511_VS_HVSPEC
	NEW_EFFECTIVE_AREAS_CODE, SPEX_DATA_GENX [1], SPEX_DATA_GENX [2]
	SPEX_DRM_GENX [1], SPEX_DRM_GENX [2], SXT_DRDT, SXT_POWL, SXT_POWL_EBAR
	SXT_POWL_NN, SXT_TE, SXT_TEEM2 [1], SXT_TEEM2 [2], SXT_TEEM2 [3], SXT_THERM
	SXT_THERM_EBAR, SXT_WEIGHT, UPDATE_KAP, UPDATE_TERM, XCDS_BOOK, XCPT
	XR_RD_ABUNDANCE, atr2hxa_dbase, cam_run_sum, ccd_sunc [1], ccd_sunc [2], ch_ss
	compare_resp, eit_eff_area, eit_genx_cat, fl_goesplot [1], fl_goesplot [2]
	fl_goesplot [3], fl_summary [1], fl_summary [2], fl_summary [3], fl_suntoday [1]
	fl_suntoday [2], fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2]
	full_graph_gif, genx2html [1], genx2html [2], genx_newver [1], genx_newver [2]
	get_mwlt_roll, go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_nvs5
	hxt_count, hxt_ratio, jitter_gif_xyimg, linflx [1], linflx [2], list_mo_log [1]
	list_mo_log [2], make_goes_chianti_response [1]
	make_goes_chianti_response [2], make_goes_chianti_response [3]
	make_goes_chianti_response [4], merc_lwa, merc_pix, merge_genxcat, mk_mo_disk
	mk_mo_disk2, mk_mo_list, mk_mo_log, mk_pix [1], mk_pix [2], mk_sdm, mk_trace_i1
	mo2wks, mo_prep, model_spec, path_data [1], path_data [2], plot_eit_flux
	plot_new_respon, pmtras_analysis, rd_dpc_table, rd_dt_genx, rd_mapfile [1]
	rd_mapfile [2], rd_modb, read_hessi_4_ospex, read_hessi_4_spex [1]
	read_hessi_4_spex [2], read_spartan, res_freq, seq_run_sum [1], seq_run_sum [2]
	sfc_prep [1], sfc_prep [2], show_hxafid, show_pix [1], show_pix [2]
	show_pix_event [1], show_pix_event [2], show_pix_event [3], show_pixf
	sun_today [1], sun_today [2], sun_today [3], sxl2radiance, sxt_dn_int
	sxt_eff_area, sxt_etemp, sxt_flux [1], sxt_flux [2], sxt_flux [3], sxt_fsp_resp
	sxt_mornint, sxt_mwave, sxt_resp_inp, sxt_summary, sxt_t6_resp0, term_score2
	timeline, topsdb [1], topsdb [2], trace_recent_movie_summary, trace_t_resp
	trace_uv_resp, wbs_grs_response [1], wbs_grs_response [2], web_seq
	wrt_fits_bin_exten [2], xlinflx, xr_mk_abun_file, xset_chain [1], xset_chain [2]
   History: 
      11-Jan-91 S.L. Freeland - written
	8-Nov-91 MDM expanded from 10 to 15 parameters
      29-jan-93 slf, added quiet keyword
      24-mar-93 slf, documentation , protect file input from clobber
		      added inquire and nodata keywords
      30-Mar-94 slf, minor docmentation fixes
      17-May-94 ras, fix double period bug in filename construction
      24-May-96 SLF, work around bug in findfile (semicolon file names)


restgenx $SSW/gen/idl/io/restgenx.pro
[Previous] [Next]
   Name: restgenx

   Purpose: update of 'restgen' to handle pointers, objects, etc.

   Input Parameters:
      p0,p1...pn - variables to restore (assume written via 'savegenx.pro')

   Keyword Parameters:
      file     - input file name;  default 'save.geny' (per savegenx.pro)
      inquire  - switch: if set, check defined parameters 
      quiet    - switch: if set, then /INQUIRE is quiet 
      _extra  - all other keywords passed to RSI 'restore' via inheritance
      ndefined - (OUTPUT) number of parameters saved (only if /INQUIRE set)

   Calling Sequence:
      IDL> restgenx, file='file', p1 [,p2,p3,..pN] [,/inquire] [,/quiet]

   Calling Examples:
     IDL> restgenx, file='test',/inquire, ndef=nn ; what's in 'test.geny'?
     IDL> restgenx, file='test', x,y,z            ; 1st 3 par. from 'test.geny'

 CALLED BY:
	HESSI, SPEX_READ_FIT_RESULTS, get_gevloc_data, hsi_pixon_smooth_patterns
	mk_syn_sfc [1], mk_syn_sfc [2], obj_restore, plotman_widget, read_genxcat
	ssw_fs_cat2db, trace_get_vignette, trace_movie_index [1]
	trace_movie_index [2], trace_movies_prioritize [1]
	trace_movies_prioritize [2], trace_uv_resp, yo_xda2legacy
   History:
      4-November-1999 - S.L.Freeland - permit modern RSI data pntr/object...

   Method:
      Setup and call RSI 'restore' 
      Retrieve contents written via 'savegenx'

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BOX_MESSAGE, FILE_EXIST [2], data_chk [1], data_chk [2]
	file_exist [1], file_exist [3]
   Restrictions:
      Need further consideration of restgenx/restgen integration...


RESTORE_ANALYSIS $SSW/gen/idl/fitting/restore_analysis.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : RESTORE_ANALYSIS()
               
 Purpose     : Restore a CFIT ANALYSIS structure with data
               
 Explanation : Restores all the data associated with a CFIT ANALYSIS
               structure saved by SAVE_ANALYSIS.
               
 Use         : ANALYSIS = RESTORE_ANALYSIS( [ ANALYSIS | FILENAME ] )
    
 Inputs      : When called with no parameters, the user is prompted for the
               file name of the saved data.

 Opt. Inputs : ANALYSIS : Component fitting system (CFIT) analysis structure,
                          containing the file name to be restored. Also, it
                          is assumed that all handles etc in this structure
                          are valid for storing the restored data.

                          Thus ANA = RESTORE_ANALYSIS(ANA) may be used as a
                          "revert to last saved version" command.

                          If the /OTHER switch is set, the user is prompted
                          for a different file (through PICKFILE).
                          
                          Using this calling method is effectively a
                          "recycling" of the ANALYSIS structure as a
                          "container" for data.

               FILENAME : File name of the previously saved data. A new
                          analysis structure will be generated and returned
                          with the saved data.
                          
 Outputs     : Returns a CFIT ANALYSIS structure.
               
 Opt. Outputs: None.
               
 Keywords    : VERBOSE : Propagated to the RESTORE command.

               OTHER : Set to always prompt the user for a file name.

 Calls       : ***
	BIGPICKFILE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHK_DIR [1]
	CHK_DIR [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], DEFAULT, EXIST, MK_ANALYSIS
	TEST_OPEN, break_file [4]
 CALLED BY:
	XCDS_ANALYSIS, XCFIT_BLOCK
 Common      : None.
               
 Restrictions: Must have widgets to use pickfile.
               
 Side effects: None.
               
 Category    : Line fitting.
               
 Prev. Hist. : None.

 Written     : SVH Haugan, UiO, 25 September 1997
               
 Modified    : Not yet. 

 Version     : 1, 25 September 1997


restore_idl_routines $SSW/gen/idl/system/restore_idl_routines.pro
[Previous] [Next]

   Name: restore_idl_routines

   Purpose: restore IDL binary routine files written via save_idl_routines

   Input Parameters:
      NONE
 
   Keyword Parameters:
      pattern - desired pattern to restore 
               (assumed same pattern as used in save_idl_routine.pro call)
      status - boolean success (0 implies file not found)
      loud - if set, be more verbose
      _extra - other keyword passed to 'restore'

 CALLS: ***
	BOX_MESSAGE, FILE_EXIST [2], file_exist [1], file_exist [3], last_nelem
	save_idl_routines
   History:
      19-October-1999 - S.L.Freeland - Written


RESTORE_OVERFLOW $SSW/gen/idl/fund_lib/sdac/restore_overflow.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME:   
	RESTORE_OVERFLOW

 PURPOSE:
	This procedure controls the correction of counter overflow in BATSE and HXT  data.

 CATEGORY: 
	BATSE, HXT,  TELEMETRY, UTILITY, INSTRUMENT


 CALLING SEQUENCE:
	RESTORE_OVERFLOW, Data, Det_sorted

 CALLED BY:
	fdbread, fs_acc, fs_acc_cont, fs_acc_discsp
	read_4_spex
 CALLS TO:
	jumper, jumper2

 INPUTS:
       Data      - array of counts (nchan x det_id x time_bins), 
		    fltarr or lonarr, signed but otherwise uncorrected
	Det_sorted- aspect ordered detector ids, of 0-7, from most to least sunward 

 OUTPUTS:
       data arrays corrected for two byte overflow

 KEYWORDS:
 	MAXINDEX - values after this index in BATSE arrays are zero,
		   used with common block arrays in fs_saveaccum.pro
 CALLS: ***
	CHECKVAR [1], FCHECK, JUMPER, Jumper2, checkvar [2], printx [1], printx [2]
 CALLED BY:
	AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], FDBREAD, FIX_CONT, FIX_CONT2, FIX_DISCSP
	FIX_DISCSP2, FS_ACC, READ_DISCLA, read_batse_4_spex [1], read_batse_4_spex [2]
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none
 COMMONS:
	RESTORE_OVERFLOW
 Procedure:
	Data is accumulated in two-byte registers and thus suffers frequent
	counter-overflow.  This routine is used to correct the counts returned by
	telemetry for this overflow.
 
  Given data(or any) rates with possible overflow, use jumper to reconstruct rates.
  This code assumes that data have not been modified by livet. 
  HISTORY:
	Originally RESET and BATSE_OVERFLOW.
  Modification history:  AES 6/30/94  Channels are now identified starting
                         from 0.  I.e., old channel 4 is now channel 3.  
                         This affects only the channel ID the user sees,
                         not the code.
  
	Version 2	  ras, 15-dec-1995, added nonzero test inside to avoid
			  creating doubling the size of the data area needed
			  in the main routines
	Version 3	  ras, 30-jan-1996, added hxt cal data, 10 channels, 64 detectors
	Version 4, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation


RESTORE_PLOTVAR $SSW/gen/idl/utplot/restore_plotvar.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME: 
	RESTORE_PLOTVAR

 PURPOSE:
	This procedure reloads system variable structures from stored values.

 CATEGORY:
	Graphics, Utplot

 CALLING SEQUENCE:
	Restore_plotvar

 CALLS:
	STORE_PLOTVAR
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	SET_UTAXIS
 COMMON BLOCKS:
	STORE_PLOTVAR_COMMON

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, ~1990
	Version 2, Documented, richard.schwartz@gsfc.nasa.gov, 23-mar-1998.
	Version 3, richard.schwartz@gsfc.nasa.gov, 10-jun-1998.
		Ensure variables in common are defined prior to usage.


restsys [1] $SSW/gen/idl/io/restsys.pro
[Previous] [Next]
   Name: restsys

   Purpose: restore idl system variables using values saved via savesys.pro
            (values from Yohkoh system variables:ys_idlsys_temp,ys_idlsys_init)

   Input Keyword Parameters:
      all -   if set, restore all (writeable) idl system variables 
      aplot -  if set, restore all plot related variables (!x,!y,!z,!p)
      x,y,z - if set, restore specified axis variable (!x, !y, and/or !z)
      c,order,map,more - restore associated system variable(s)
      init  - if set, restore specified variables to startup values

   Calling Examples:
      restsys,/x,/y             ; restore !x, !y (from !ys_idlsys_temp)
      restsys,/p                ; save !p
      restsys,/aplot            ; save !x,!y,!z,!p
      restsys,/all              ; save above plus some others (!c, !map..)
      restsys,/init,/all	 ; startup values (from !ys_idlsys_init)

      Generally, a routine would use this routine paired with savesys.pro

        pro junk,a,b,c
        savesys,/aplot          ; save plot variables
        <change !x,!y,!p>       ; routine plays with global variables
        restsys,/aplot          ; restore plot values
        return


 CALLED BY:
	DRAW_GRID [1], DRAW_GRID [2], FIRST_LIGHT [1], FIRST_LIGHT [2]
	HSI_CWTOOLS_LINESET, HSI_FORWARDFIT, NORH_GRID [1], NORH_GRID [2], PLOT_CLON
	POLAR_GRID, SXT_GRID [1], SXT_GRID [2], SXT_GRID [3], TV_SYNOP, event_movie [1]
	event_movie [2], goes_summary, goes_widget, last_lc, lcur_image, plot_nar [1]
	plot_nar [2], sun_grid
   Side Effects:
      def_yssysv.pro is called if it has not been done already
      
 CALLS: ***
	def_yssysv [1], def_yssysv [2]
   Common Blocks:
      def_yssysv_blk	- determine if Yohkoh system variables are defined

   History:
      21-Apr-1993 (SLF)
      22-apr-1993 (SLF) ; remove !more references


return a solar disk mask using SSW standard keywords $SSW/gen/idl/solar/solar_mask.pro
[Previous] [Next]
   Name: return  a solar disk mask using SSW standard keywords

   Input Parameters:
      index - structure or fits header
      data  - optional data to mask

   Keyword Parameters:
      ss - if set, function returns SS (SubSript) vector, not array mask
      pad - if defined, pad the limb with this (can be negative) - pixel units
      rpad - alternative to PAD in units of R
      annulus - if set, two element array - annulus inner and outer diam
                Units = R
      mask_data - if set, function returns masked data instead of boolean

   Output:
      function returns bit mask size of data array or subscripts if /ss is set

   History:
     19-Oct-1998 - S.L.Freeland - logic from ssw_limbstuff et al
      2-Dec-1999 - S.L.Freeland - eliminate variable/function conflict(mask)
     20-Jun-2000 - S.L.Freeland - enable ANNULUS keyword and function
     30-Aug-2004 - R.D.Bentley - extract time with GET_FITS_TIME - more forgiving

   Calling Examples:
      IDL> diskmask=solar_mask(index,data)                   ; inside limb   
      IDL> abovelimbmask=solar_mask(index,data,/outside)     ; outside limb
      IDL> annulus=solar_mask(index,data,annulus=[.9,1.1])   ; annulus

   Method:
      call L.Wang 'cir_mask' using crpix et at

 CALLS: ***
	BOX_MESSAGE, CIR_MASK, GET_FITS_TIME, GET_SUN [1], GET_SUN [2], SOLAR_MASK
	anytim2ints [1], anytim2ints [2], gt_tagval [1], gt_tagval [2], required_tags
  Restrictions:


return solar disk mask constrained by XY limits using SSW standards $SSW/gen/idl/ssw_util/ssw_mask_image.pro
[Previous] [Next]
   Name: return solar disk mask constrained by XY limits using SSW standards 

   Input Parameters:
      index - structure or fits header (read_trace, read_eit, read_sxt...)
      data  - optional data to mask 

   Keyword Parameters:
      ss - if set, function returns SS (SubSript) vector, not array mask
      pad - if defined, pad the limb with this - in pixel units
      xcen_limits - [xcen0,xcen1] - (EW) limits in arcsec from sun center
      xpix_limits - [x0,x1]       - limits in pixels
      ycen_limits - [ycen0,ycen1] - (NS) limits in arcsec from sun center
      ypix_limits - [y0,y1]       - limits in pixels

   Output:
      function returns bit mask size of data array or subscripts if /ss is set

   History:
     19-Oct-1998 - S.L.Freeland - logic from ssw_limbstuff et al
      2-Dec-1999 - S.L.Freeland - eliminate variable/function conflict(mask)
      3-Dec-1999 - S.L.Freeland - extension of 'solar_mask.pro' to XY
  
   Method:

 CALLS: ***
	BOX_MESSAGE, GET_SUN [1], GET_SUN [2], SSW_MASK_IMAGE, gt_tagval [1]
	gt_tagval [2], required_tags
  Restrictions:
    input requires ssw compliant pointing tags (crpix,cdelt...)


REV_SWAP [1] $SSW/gen/idl/system/rev_swap.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	REV_SWAP

 Purpose     :	Swaps data between reverse network and host byte order.

 Explanation :	This routine takes data with bytes in reverse network
		(little-endian) order, as used by DEC computers and PCs, and
		converts it to the correct byte order for the current host.
		Conversely, it can also convert data in host to reverse network
		order.

 Use         :	REV_SWAP, DATA

 Inputs      :	DATA	= Data in reverse network order.

 Opt. Inputs :	None.

 Outputs     :	DATA	= The byte swapped data is returned in place of the
			  input array. 

 Opt. Outputs:	None.

 Keywords    :	None.

 Calls       : ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	CAT_OPEN [1]
 Common      :	The common block REV_SWAP_CMN is used internally to keep track
		of whether the current computer uses network or reverse network
		byte order.

 Restrictions:	Only the byte order of the data is affected.  No other
		conversions, such as for example IEEE to host floating point
		formats, are performed on the data.  If such conversions are
		necessary, then the call to REV_SWAP can be followed up with
		either IEEE_TO_HOST or HOST_TO_IEEE.

 Side effects:	None.

 Category    :	Utilities, Operating_system.

 Prev. Hist. :	None.

 Written     :	William Thompson, GSFC, 10 February 1994

 Modified    :	Version 1, William Thompson, GSFC, 10 February 1994

 Version     :	Version 1, 10 February 1994


REVERSE $SSW/gen/idl_fix/soft/old350/reverse.pro
[Previous] [Next]
 NAME:
	REVERSE

 PURPOSE:
	Reverse the order of rows or columns in an array or vector.

 CATEGORY:
	Array manipulation.

 CALLING SEQUENCE:
	Result = REVERSE(Array [, Subscript_Index])

 INPUTS:
	Array:	The array or vector containing the original data.

 OPTIONAL INPUT PARAMETERS:
 Subscript_Index:  If this parameter is omitted or 1, the first subscript is
		reversed (i.e., rows are reversed).  Set this parameter to
		2 to reverse columns.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	REVERSE returns a copy of the original array that is reversed about 
	one of its dimensions.

 CALLED BY:
	AMEDIAN, ASCII_RATES, ASC_HEX_2B, ATV, AVERAGE, BATSE_FLARES_WEEK, BIN2DEC, BOUST
	BUILD_SSX, CAT_OPEN [1], CDS_IMAGE, CHKARG, COLORBAR [1], COLORBAR [2], CONGRID [1]
	CONGRID [2], COVER_PAGE [1], COVER_PAGE [2], CSPLINE, CvPrecess, CvSky
	CvSky_Galactic, DAILY_PLOT, DCT, DECODE, DECOMP_R, DLCALCHEK, EIS_CAT [1], EIS_CAT [2]
	EIS_IMAGE_TOOL_EVENT [1], EIS_IMAGE_TOOL_EVENT [2], EIT_DISPLAY, EIT_SUBFIELD
	EIT_SUB_UTIL_FILE, FIELDLINE, FINDLOCK, FIND_EDGE_INTERCEPT, FIND_FILE_DUR
	FIND_IX, FITS2TIFF, FIT_SPEC, FLAREMETER, FSC_FILESELECT, FSC_PSCONFIG__DEFINE
	FTSORT, GETFLARE, GETGNP, GETOFF, GETROT, GET_GDFILE, GET_ORBIT [1], GET_ORBIT [2]
	GET_ORBIT_CDF, GET_ORBIT_CDF2, GET_ORBIT_FITS, GET_PROC, GET_RECENT_FILE, GET_REGN
	GET_SC_ATT [1], GET_SC_ATT [2], GET_UVSP, GRAD, G_OF_T, GetColors, HCIE_ZONE [2]
	HREVERSE, IMAGE_TOOL_EVENT, INRANGE [1], INRANGE [2], INRANGE [3], INTEGRAL_CALC
	ITOOL_RD_FITS, Image Spline Interpolation, JUMPER_SHER, LIST_PRINTER_UNIX
	LOAD_VEL, LZ_START_DATE [2], LZ_START_DATE3, Load_sher, MAKE_CHIANTI_SPEC
	MAKE_DAILY_IMAGE, MAP_DISCLA2CONT, MASK_OFF, MEMORY_INTRVLS, MKMOVIE, MK_CDS_PLAN
	MK_DAILY_MED, MK_GIF, MK_ORB_WEEK, MOVIE_MAKER, MULTI_INTERP, MULTI_SMOOTH
	NOFILL_ARE, OPLOT_IMAGE, OVSA__DEFINE, PCA, PLOT_EXPINT, PLOT_SPLAN, PlotPlanarCut
	PlotSolarDisk, PlotSynopticMap, QD_ELONG, QD_POSANG, RAT2POWL2, RATIO_PLOTTER [1]
	READ_FULL_ATT, READ_SC_ATT, REARRANGE, RESOLVE_NEW_OBS, RSTRMID, RSTRPOS, RemoteView
	RemoteView_Display2D, RemoteView_Display3D, SAVEIMAGE, SCANPATH, SCHEDULE
	SELECT_X, SETSCALE [1], SETSCALE [2], SHOWIMAGE, SHOW_SYNOP__DEFINE, SNU
	SOXS_CZT_DRM, SPEC_SENSITIVITY, SSW_WRITE_GIF, STEREO_LOOP, STR_LASTPOS [1]
	SUBFIELD_EV, SUTHERLAND, SYNOP_DB__DEFINE, Shers_load [1], THERMAL_KEV, TOP20
	TP_COLTABLE, TVREAD [2], TVREAD [3], TWO_PHOTON, TimeXAxis, VDS_BURNIN_NEW
	VDS_CALIB, WIDG_HELP, WUPTIME, XCAMP, XCAT, XCDS_ANALYSIS, XCFIT_BLOCK, XCOLORS [1]
	XCOLORS [2], XCOLORS [4], XLOAD, XLOADCT [1], ZPAD, bits [1], bits [2], carrmapdisp
	carrmapmaker2, ch_ss, cmap2gif ftsfile maxdmind ROOTroot CONTROLcontrol
	cnvtimstr, ctraj2orbit, cw_edroplist, cw_ffield, destr_bilin [2], disk_hog [1]
	disk_hog [2], eis_lines_gui [1], eis_lines_gui [2], eis_timeline_plot_gui [1]
	eis_timeline_plot_gui [2], eit_degrid_smooth, even_light, evt_grid, fit_bsc
	fit_bsc_as, fit_bsc_plot, freebound_ion, get_survey, getbrr_spec, glidbacksub
	go_sxt_sss2secondary, goes_summary, hcie_zone [1], hide_env, hsi_format_flare
	inv_gsvdcsq, itoh, laser8ew, last_lc, lastgki, make_spartan_pb, mk_bad_pix_map_load
	mk_gif_mag_index, mk_gset, mk_tiffb, mk_tiffp, new_version [1], new_version [2]
	op_pass_sheets [1], op_pass_sheets [2], orcent, ovsa_interact, pass_sheets
	plot_bda, plot_eit_filters, plotman_create_files_event, pmtras_analysis
	pref_deldir, pro tyoshidacolorrorogogobobo, pro_list [1], pro_list [2]
	qImage_cw_Ellipse, qView_Save2File, rad_spoke, ratio_plotter [2], rdspc
	read_batse_4_spex [1], read_batse_4_spex [2]
	rt_carrmapmaker yymmdd num_r rad limb wlimb hdr disp saveset nextrot
	sfc_prep [1], sfc_prep [2], smei_frm_where, smei_orbits_stat, sobel_scale
	spatial_filter, srsp_get_obseq, ssw_flare_locator, ssw_track_fov
	str_lastpos [2], strlastchar [1], strlastchar [2], strposn, sumer_destretch
	sxt_get_grill [1], sxt_get_grill [2], tem_thermal_power, timeline2html
	trace_make_tma, trace_movie_index [1], trace_movie_index [2]
	trace_movies_prioritize [1], trace_movies_prioritize [2]
	trace_prioritize_um, trace_recent_movie_summary, trace_special_movie [1]
	trace_special_movie [2], trace_special_movie [3], trace_special_movie2
	usno_test, wedge_bounding_box, where_title [1], where_title [2], wso_read
	wso_write, xanal_emi, xdisp_fits, xdisp_sci5k, xdisp_trace [1], xdisp_trace [2]
	xdisp_trace2, xrd_trace, xsxt_prep_event
 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	Only works for 1-, 2-, or 3-dimensional arrays.

 PROCEDURE:
	Uses the ROTATE function.

 MODIFICATION HISTORY:
	Old.
	Apr, 1991, DMS,	Added 3D reversing.
       Sept, 1992 Mark L. Rivers, added simple return for scaler argument


REVERSE_COLORS $SSW/gen/idl/display/reverse_colors.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS/SUMER

 NAME:
       REVERSE_COLORS

 PURPOSE: 
       Reverse the current color table

 CATEGORY:
       Graphics, utility
 
 SYNTAX: 
       reverse_colors

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	CW_LOADCT
 COMMON:
       colors

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       Current color table is changed

 HISTORY:
       Version 1, April 1, 1996, Liyun Wang, GSFC/ARC. Written

 CONTACT:
       Liyun Wang, GSFC/ARC (Liyun.Wang.1@gsfc.nasa.gov)


REWIND [1] $SSW/gen/idl/system/rewind.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	REWIND

 Purpose     :	Emulates the VMS REWIND function in Unix.

 Explanation :	Emulates the VMS REWIND function in the Unix environment.

		**Unix only**

 Use         :	REWIND, UNIT

 Inputs      :	UNIT = Tape unit number.  Tape drives are selected via the UNIX
		       environment variables "MT1", "MT2", etc.  The desired
		       tape drive is thus specified by numbers, as in VMS.
		       Must be from 0 to 9.

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	None.

 Keywords    :	None.

 Calls       : ***
	CHECK_TAPE_DRV [1], CHECK_TAPE_DRV [2]
 CALLED BY:
	FXTAPEREAD, RD_EXB, mt
 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. :	VERSION 1, R. W. Thompson 11/30/89
		William Thompson, Apr 1991, rewrote to better emulate VMS
			version.

 Written     :	R. W. Thompson, GSFC/IUE, 30 November 1989.

 Modified    :	Version 1, William Thompson, GSFC, 21 December 1993.
			Rewrote to use IOCTL.

 Version     :	Version 1, 21 December 1993.


RFITS [1] $SSW/gen/idl/genutil/rfits.pro
[Previous] [Next]
 NAME:
        RFITS
 PURPOSE:
        Reads a standard FITS disk file into an array.
 CATEGORY:
        Input/Output.
 CALLING SEQUENCE:
        result = rfits(filename)
 INPUTS:
        filename = string containing the file name.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
        index = nonnegative integer. If this parameter is present, a period
              and the index number are appended to the filename (e.g., '.34').
              This option makes handling of data in the MCCD file naming
              convention easier.
        scale = if set, floating point array is returned, reflecting
                that true value = read value * bscale + bzero.
	 nodata = If set, then just read the headers
 OUTPUTS:
        result = byte, integer, or long array, containing the FITS data array.
               The dimensionality of result reflects the structure of the FITS
               data.  If keyword scale is set, then floating point array.
 OPTIONAL (KEYWORD) OUTPUT PARAMETERS:
        date_obs = date of observation (string).
        time_obs = time of observation (string).
        header = string vector, containing the full FITS header (each element
                 of the vector contains one FITS keyword parameter).
 CALLS: ***
	dec2sun [1], dec2sun [2], yoh_ieee2vax [1], yoh_ieee2vax [2]
 CALLED BY:
	BFITS, RFITS2 [1], RFITS2 [2], RMOVIE, TEMP_CUBE, bbso_name_fix, cal_fig_mich
	check_dumps [1], check_ff_load, disp_sci5k, disp_synop, fits_disp_month [1]
	fits_disp_month [2], gbo_pfi, kp_name_fix, lastgki, mk_ascii_list, mk_dpc_image
	mk_ff_load, mk_limb_pixmap, mk_list_image, mk_list_load, mk_mdi_fits, mk_mdi_load
	mon_health [1], mon_health [2], msok_poi_copy [1], msok_poi_copy [2]
	mwlt_tape2jpeg, new_disp_sci5k [1], new_disp_sci5k [2], new_mon_health [1]
	new_mon_health [2], nob_name_fix, norik_name_fix, perf_vwbin, raw_list2pixmap
	rd_trace_i0 [1], rd_trace_i0 [2], read_mdi, rt_fits, rt_mag, set_list_addr, sun_grid
	synop_movie, tr_scan_images, trace_rd_jpeg, wrt_fits_bin_exten [1]
	wrt_sci160k_img, xdisp_fits, xdisp_sci5k
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
        None.
 RESTRICTIONS:
        Only simple FITS files are read. FITS extensions (e.g., groups and
        tables) are not supported.
 MODIFICATION HISTORY:
        JPW, Nov, 1989.
        nn, jan, 1992, to add the option to return array containing
                       true values calculated from bscale and bzero.
	MDM (16-Sep-92) - Added code to do byte swapping when the output
			  array is integer*2 or integer*4 and reading on a
			  DEC machine.
	MDM (16-May-93) - Expanded to handle REAL*4 and REAL*8 data types.
	MDM (27-Jan-94) - Corrected so that it could handle long 1 dimensional
			  arrays (replaced FIX with LONG)
       DMZ (6-Apr-94)  - added DEC/OSF check
	SLF (7-Apr-94)  - fixed typo
	MDM (13-Oct-95) - Added /QSTOP
			- Allowed NAXIS = 0 and not crash the reader
	MDM (22-Aug-96) - Added /nodata
       AAP (19-Feb-98) - Added 'linux' to the swap_os
       SLF (19-Feb-98) - call 'is_lendian' (single point 'swap_os' function)


RFITS2 [1] $SSW/gen/idl/genutil/rfits2.pro
[Previous] [Next]
 NAME:
        RFITS2
 PURPOSE:
        Reads multiple standard fits or compressed fits files into array
 CALLING SEQUENCE:
        result = rfits2(filename)
 INPUTS:
        files= string or string array containing the file name(s)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
        index = nonnegative integer. If this parameter is present, a period
              and the index number are appended to the filename (e.g., '.34').
              This option makes handling of data in the MCCD file naming
              convention easier.
        scale = if set, floating point array is returned, reflecting
                that true value = read value * bscale + bzero.
	 xsize = the images can be resized to this value as each image is read.
	 ysize = the images can be resized to this value as each image is read.
		If xsize is passed, but ysize is not, then ysize=xsize.
	 nodata= If set, then just read the headers
 OUTPUTS:
        result = byte, integer, or long array, containing the FITS data array.
               The dimensionality of result reflects the structure of the FITS
               data.  If keyword scale is set, then floating point array.
 OPTIONAL (KEYWORD) OUTPUT PARAMETERS:
        date_obs = date of observation (string).
        time_obs = time of observation (string).
        head     = string vector, containing the full FITS header (each element
                 of the vector contains one FITS keyword parameter).
 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], FILE_EXIST [2], RFITS [1], RFITS [2]
	RFITS [3], SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], data_type [1], data_type [2]
	file_exist [1], file_exist [3], file_uncompress [1], file_uncompress [2]
 CALLED BY:
	ALIGN1BIGGRAM, edac_summary, fits2time [1], fits2time [2], fits2time [3]
	focus_trace_flt, get1gbo, get_gbo_pfi, get_selsis, lastgbo, mon_health [1]
	mon_health [2], new_edac_summary, new_mon_health [1], new_mon_health [2]
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
        None.
 RESTRICTIONS:
        Only simple FITS files are read. FITS extensions (e.g., groups and
        tables) are not supported.
 MODIFICATION HISTORY:
	SLF - 7-Jul-1993 - handle compressed fits data
	21-Jul-93 (MDM) - The FITS header was not being assembled properly for
			  multiple file extraction
	 7-Oct-93 (SLF) - Use home directory for temporary (uncompressed) files
	 8-Oct-93 (SLF) - try DIR_GBO_SC first, HOME if it does not exist
	28-Jul-94 (MDM) - Added XSIZE and YSIZE
       15-sep-94 (SLF) - past date_obs and time_obs out correctly
	30-Apr-96 (MDM) - Modified to allocate the memory on the first
			  at the beginning and to insert the data into it
			  (rather than to constantly append)
			- Added /qdebug
	22-Aug-96 (MDM) - Added /nodata


RINTER [1] $SSW/gen/idl_libs/astron/image/rinter.pro
[Previous] [Next]
 NAME:
      RINTER
 PURPOSE:
      Cubic interpolation of an image at a set of reference points.
 EXPLANATION:
      This interpolation program is equivalent to using the intrinsic 
      INTERPOLATE() function with CUBIC = -0.5.   However,
      RINTER() has two advantages: (1) one can optionally obtain the 
      X and Y derivatives at the reference points, and (2) if repeated
      interpolation is to be applied to an array, then some values can
      be pre-computed and stored in Common.   RINTER() was originally  
      for use with the DAOPHOT procedures, but can also be used for 
      general cubic interpolation.

 CALLING SEQUENCE:
      Z = RINTER( P, X, Y, [ DFDX, DFDY ] )
               or
      Z = RINTER(P, /INIT)

 INPUTS:                 
      P  - Two dimensional data array, 
      X  - Either an N element vector or an N x M element array,
               containing X subscripts where cubic interpolation is desired.
      Y -  Either an N element vector or an N x M element array, 
               containing Y subscripts where cubic interpolation is desired.

 OUTPUT:
      Z -  Result = interpolated vector or array.  If X and Y are vectors,
              then so is Z, but if X and Y are arrays then Z will be also.
              If P is DOUBLE precision, then so is Z, otherwise Z is REAL.

 OPTIONAL OUTPUT:
      DFDX - Vector or Array, (same size and type as Z), containing the 
               derivatives with respect to X
      DFDY - Array containing derivatives with respect to Y

 CALLED BY:
	CROSSCORR [1], DAO_VALUE, GETPSF, crosscorr [2]
 OPTIONAL KEYWORD INPUT:
     /INIT - Perform computations associated only with the input array (i.e. 
             not with X and Y) and store in common.    This can save time if
             repeated calls to RINTER are made using the same array.  
        
 EXAMPLE:
      suppose P is a 256 x 256 element array and X = FINDGEN(50)/2. + 100.
      and Y = X.  Then Z will be a 50 element array, containing the
      cubic interpolated points.

 SIDE EFFECTS:
      can be time consuming.

 RESTRICTION:
      Interpolation is not possible at positions outside the range of 
       the array (including all negative subscripts), or within 2 pixel
       units of the edge.  No error message is given but values of the 
       output array are meaningless at these positions.

 PROCEDURE:
       invokes CUBIC interpolation algorithm to evaluate each element
       in Z at virtual coordinates contained in X and Y with the data
       in P.                                                          

 COMMON BLOCKS:
       If repeated interpolation of the same array is to occur, then
       one can save time by initializing the common block RINTER.    

 REVISION HISTORY:
       March 1988 written W. Landsman STX Co.
       Checked for IDL Version 2, J. Isensee, September, 1990
       Corrected call to HISTOGRAM, W. Landsman November 1990
       Converted to IDL V5.0   W. Landsman   September 1997
       Fix output derivatives for 2-d inputs, added /INIT W. Landsman May 2000
       


rm2fits $SSW/gen/idl/fits/rm2fits.pro
[Previous] [Next]
 Name: rm2fits

 Category: FITS, UTIL

 Purpose: Write a response matrix to a FITS file.  Aims for OGIP
 CAL-GEN-92-002 compliance.

 Calling sequence:  rm2fits, 'file.fits', photon_edges, matrix, LO_THRES=1e-6

 Inputs:
 file - name of FITS file to write.
 e_bins - Energy boundaries for photon side of response matrix,
          2 x n_photon bins
 rm - response matrix, dimensioned n_detector channels x n_photon bins

 Outputs:

 Input keywords:
 WRITE_PRIMARY_HEADER - set this keyword to write a primary header to
                        file.  This will overwrite any existing file.
 PRIMARY_HEADER - primary header for the FITS file.  Only used if
                  WRITE_PRIMARY_HEADER is set.
 DET_CHANNELS - energy boundaries for detector channels - 2xn_channels
 LO_THRES - cutoff value below which rm elements will not be stored
 MINCHANNEL - Minimum channel number - defaults to 1
 MAXCHANNEL - Maximum channel number - defaults to n_channels
 PRIMARY_HEADER - primary header for the FITS file.  If this is set,
                  a new file with name = file will be written.  This
                  will overwrite any files.  If not set and file
                  already exists, the extension will be appended to
                  the file.
 EXTENSION_HEADER - extension header for the FITS file.
 MULTIDETECTOR - Set this if the rm is 2-D, but is an array of the diagonal
                 responses from multiple detectors.

 Output keywords:
 RMF_HEADER - Response Matrix extension header written
 ERR_MSG = error message.  Null if no error occurred.
 ERR_CODE - 0/1 if [ no error / an error ] occurred during execution.

 Calls: ***
	FXADDPAR [1], FXADDPAR [2], FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1]
	FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1], FXBWRITE [2]
	FXHMAKE [1], FXHMAKE [2], FXWRITE [1], FXWRITE [2], MWRFITS, N_DIMENSIONS, TRIM
	merge_fits_hdrs, mk_rmf_hdr, wrt_ebounds_ext
 CALLED BY:
	hsi_spectrum__filewrite, hsi_spectrum__fitswrite
 MODIFICATION HISTORY:
 12-December-2001, Paul BIlodeau - made lo_thres keyword inactive due
   to bug in reading some FITS files written with it.
 11-January-2002, Paul Bilodeau - added capability to store diagonal
   (vector) response matrices.
 8-aug-2002, Paul Bilodeau - added capability to store 3
    dimensional matrices, but not with the LO_THRES keyword.
 18-nov-2002, Paul Bilodeau - changed error message handling:  rely
   on subroutines to print their own error messages, use GOTO's, and
   removed CATCH statement.
 4-Mar-2003, Paul Bilodeau - add MULTIDETECTOR keyword to resolve
   ambiguity when storing diagonal responses from multiple
   detectors.
 25-Jun-2004, Kim Tolbert - added rmf_header keyword to return rm ext header
 11-Sep-2004, Sandhia Bansal - The array "channels" should be offset by
                first element of tlmin4 before calling wrt_ebounds_ext.
              Now storing f_chan and n_chan in long variables.


RM_FILE $SSW/gen/idl/system/rm_file.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : RM_FILE

 Purpose     : delete a file in OS independent way

 Category    : OS

 Explanation : uses openr,/del

 Syntax      : IDL> rm_file,file,err=err

 Inputs      : FILE = filename to delete

 Keywords    : ERR = any errors

 CALLS: ***
	ARR2STR [1], Arr2Str [2], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], EXIST
	HAVE_PROC, IDL_RELEASE, IS_BLANK, IS_DIR, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	SINCE_VERSION [1], SINCE_VERSION [2], delvarx [5], is_open
 CALLED BY:
	CDSHEADFITS, CHECK_FTP, CHECK_KAP, CHKARG, EIT_MKMOVIE, FIND_CAT, FIND_PROC
	GET_LATEST_IAP, GET_NOAA, HESSI, ITOOL_RD_FITS, LOCK_ZDBASE, MK_AGIF, MK_CDS_PLAN
	READCDSFITS, READ_EIT_FILE, RM_LOCK, SCANPATH, SEND_MAIL, SEND_PRINT, SMART_FTP
	UNIX_SPAWN, UPDATE_IAP, URL_GET, WIN_SPAWN, XCAT, XCDS_BOOK, XCPT, XDIFF, XPRINT [2]
	XPRINT [5], XRECORDER, uncompress
 History     : Version 1,  1-Jul-1996,  D.M. Zarro.  Written
               Modified, 29-Nov-99, Zarro (SM&A/GSFC), added CATCH
               Modified, 14-Mar-00, Zarro (SM&A/GSFC) - added /check
               Modified, 13-Aug-01, Zarro (EITI/GSFC) 
                - upgraded to use FILE_DELETE in IDL 5.4
               Modified, 9-Feb-04, Zarro (L-3Com/GSFC) 
                - added directory search
               Version 5, 3-Dec-2004, William Thompson, GSFC
                - Don't call file_delete for null filenames
               Modified, 4-Dec-2006, Zarro (ADNET/GSFC)
                - removed blanks from file names

 Contact     : DZARRO@SOLAR.STANFORD.EDU


RM_LOCK $SSW/gen/idl/system/rm_lock.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : RM_LOCK
               
 Purpose     : remove LOCK file created by APPLY_LOCK
               
 Category    : Planning
               
 Syntax      : IDL> rm_lock,file
    
 Inputs      : FILE = lock file name (with full path)
               
 Keywords    :
               QUIET    = set to suppress messages
               ERR      = output messages
               STATUS = 1/0 for success/failure
               TIMER  = seconds to wait before retrying
               OVER   = override protection checks
               RETRY = no of retries if timer is set (def =0)

 CALLS: ***
	CHECK_LOCK, DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], RM_FILE
 CALLED BY:
	UNLOCK_ZDBASE, db_gbo, ihy_db
 History     : Version 1,  17-July-1996,  D M Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


RM_PATH [1] $SSW/gen/idl/system/rm_path.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       RM_PATH

 PURPOSE: 
       Remove directory (and optionally its subdirs) from IDL path

 EXPLANATION:
       
 CALLING SEQUENCE: 
       RM_PATH, path_name [,/expand] [index=index]

 INPUTS:
       PATH_NAME -- A string scalar containing directory name to be
                    removed

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None. !path may be changed though.

 OPTIONAL OUTPUTS:
       INDEX -- Index of the removed directory in the !path.

 KEYWORD PARAMETERS: 
       EXPAND -- Set this keyword to remove all subdirectories under
                 PATH_NAME from the IDL path.

 CALLS: ***
	ARR2STR [1], Arr2Str [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1]
	DELVARX [2], DELVARX [3], DELVARX [4], REST_MASK, STR_SEP, delvarx [5]
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Utilities, OS
       
 PREVIOUS HISTORY:
       Written October 7, 1994, by Liyun Wang, GSFC/ARC

 MODIFICATION HISTORY:
       Version 2, Liyun Wang, GSFC/ARC, October 19, 1994
          Added the EXPAND keyword
	Version 3, William Thompson, GSFC, 29-Aug-1995
		Changed to use OS_FAMILY

 VERSION:
       Version 3, 29-Aug-1995


rmosaic [1] $SSW/gen/idl/genutil/rmosaic.pro
[Previous] [Next]
   Name: rmosaic

   Purpose: spawn background mosaic job, optional 'solar' hotlist lookup

   Calling Sequence:
      rmosaic				; url menu select
      rmosaic [,/search_string]	; search string = url lookup

   Calling Examples:
      rmosiac,/trace			; TRACE home page
      rmosaic,/yag			; Yohoh analysis guide
      rmosaic,/soho			; SOHO home page

   History:
      26-Jan-95 (SLF) 
       2-Feb-95 (SLF) - add keyword inheritence for search strings to allow
                        automatic expansion

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4], rd_tfile [1]
	rd_tfile [2], remtab [1], remtab [2], str2cols [1], str2cols [2], strjustify
	wmenu_sel [1], wmenu_sel [2]
   Restrictions:
      if no local version, environmental <mosaic_host> should
      point to remote host - in this case, must have RSH priviledge


rmosaic [2] $SSW/gen/idl_fix/soft/old350/rmosaic.pro
[Previous] [Next]
   Name: rmosaic

   Purpose: spawn mosaic job, 'solar' hotlist lookup

   Calling Sequence:
      rmosaic

   History:
      26-Jan-95 (SLF) 

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4], rd_tfile [1]
	rd_tfile [2], remtab [1], remtab [2], str2cols [1], str2cols [2], strjustify
	wmenu_sel [1], wmenu_sel [2]
   Restrictions:
      if no local version, environmental <mosaic_host> should
      point to remote host - in this case, must have RSH priviledge


ROB_CHECKFIT $SSW/gen/idl_libs/astron/robust/rob_checkfit.pro
[Previous] [Next]
 NAME:
	ROB_CHECKFIT
 PURPOSE:
	Used by ROBUST_... routines to determine the quality of a fit and to
	return biweights.
 CALLING SEQUENCE:
	status = ROB_CHECKFIT( Y, YFIT, EPS, DEL, SIG, FRACDEV, NGOOD, W, B
				BISQUARE_LIMIT = )
 INPUT:
	Y     = the data
	YFIT  = the fit to the data
	EPS   = the "too small" limit
	DEL   = the "close enough" for the fractional median abs. deviations
 RETURNS:
	Integer status. if =1, the fit is considered to have converged

 OUTPUTS:
	SIG   = robust standard deviation analog
	FRACDEV = the fractional median absolute deviation of the residuals
	NGOOD   = the number of input point given non-zero weight in the 
		calculation
	W     = the bisquare weights of Y
	B     = residuals scaled by sigma

 OPTIONAL INPUT KEYWORD:
	BISQUARE_LIMIT = allows changing the bisquare weight limit from 
			default 6.0
 PROCEDURES USED:
       ROBUST_SIGMA()
 REVISION HISTORY:
	Written, H.T. Freudenreich, HSTX, 1/94
 CALLS:
 CALLED BY
	ROBUST_LINEFIT, ROBUST_POLY_FIT


ROBUST_LINEFIT $SSW/gen/idl_libs/astron/robust/robust_linefit.pro
[Previous] [Next]
 NAME:
       ROBUST_LINEFIT

 PURPOSE:
       An outlier-resistant two-variable linear regression. 
 EXPLANATION:
       Either Y on X or, for the case in which there is no true independent 
       variable, the bisecting line of Y vs X and X vs Y is calculated. No 
       knowledge of the errors of the input points is assumed.

 CALLING SEQUENCE:
       COEFF = ROBUST_LINEFIT( X, Y, YFIT, SIG, COEF_SIG, [ /BISECT,
                       BiSquare_Limit = , Close_factor = , NumIT = ] )

 INPUTS:
       X = Independent variable vector, floating-point or double-precision
       Y = Dependent variable vector

 OUTPUTS:
       Function result = coefficient vector. 
       If = 0.0 (scalar), no fit was possible.
       If vector has more than 2 elements (the last=0) then the fit is dubious.

 OPTIONAL OUTPUT PARAMETERS:
       YFIT = Vector of calculated y's
       SIG  = The "standard deviation" of the fit's residuals. If BISECTOR 
               is set, this will be smaller by ~ sqrt(2).
       COEF_SIG  = The estimated standard deviations of the coefficients. If 
               BISECTOR is set, however, this becomes the vector of fit 
               residuals measured orthogonal to the line.

 OPTIONAL INPUT KEYWORDS:
       NUMIT = the number of iterations allowed. Default = 25
       BISECT  if set, the bisector of the "Y vs X" and "X vs Y" fits is 
               determined.  The distance PERPENDICULAR to this line is used 
               in calculating weights. This is better when the uncertainties 
               in X and Y are comparable, so there is no true independent 
               variable.  Bisquare_Limit  Limit used for calculation of 
               bisquare weights. In units of outlier-resistant standard 
               deviations. Default: 6.
               Smaller limit ==>more resistant, less efficient
 Close_Factor  - Factor used to determine when the calculation has converged.
               Convergence if the computed standard deviation changes by less 
               than Close_Factor * ( uncertainty of the std dev of a normal
               distribution ). Default: 0.03.
 SUBROUTINE CALLS:
       ROB_CHECKFIT
       ROBUST_SIGMA, to calculate a robust analog to the std. deviation

 CALLS: ***
	ROBUST_SIGMA, ROB_CHECKFIT
 PROCEDURE:
       For the initial estimate, the data is sorted by X and broken into 2
       groups. A line is fitted to the x and y medians of each group.
       Bisquare ("Tukey's Biweight") weights are then calculated, using the 
       a limit of 6 outlier-resistant standard deviations.
       This is done iteratively until the standard deviation changes by less 
       than CLOSE_ENOUGH = CLOSE_FACTOR * {uncertainty of the standard 
               deviation of a normal distribution}

 REVISION HISTORY:
       Written, H. Freudenreich, STX, 4/91.
       4/13/93 to return more realistic SS's HF
       2/94 --more error-checking, changed convergence criterion HF
       5/94 --added BISECT option. HF.
       8/94 --added Close_Factor and Bisquare_Limit options  Jack Saba.
       4/02 --V5.0 version, use MEDIAN(/EVEN)  W. Landsman


ROBUST_POLY_FIT $SSW/gen/idl_libs/astron/robust/robust_poly_fit.pro
[Previous] [Next]
 NAME:
	ROBUST_POLY_FIT

 PURPOSE:
	An outlier-resistant polynomial fit.

 CALLING SEQUENCE:
	COEFF = ROBUST_POLY_FIT(X,Y,NDEGREE  ,[ YFIT,SIG, NUMIT =] )

 INPUTS:
	X = Independent variable vector, floating-point or double-precision
	Y = Dependent variable vector

 OUTPUTS:
	Function result = coefficient vector, length NDEGREE+1. 
	IF COEFF=0.0, NO FIT! If N_ELEMENTS(COEFF) > degree+1, the fit is poor
	(in this case the last element of COEFF=0.)
	Either floating point or double precision.

 OPTIONAL OUTPUT PARAMETERS:
	YFIT = Vector of calculated y's
	SIG  = the "standard deviation" of the residuals

 CALLS: ***
	POLY, POLYFITW, POLY_FIT, ROB_CHECKFIT
 RESTRICTIONS:
	Large values of NDEGREE should be avoided. This routine works best
	when the number of points >> NDEGREE.

 PROCEDURE:
	For the initial estimate, the data is sorted by X and broken into 
	NDEGREE+2 sets. The X,Y medians of each set are fitted to a polynomial
	 via POLY_FIT.   Bisquare ("Tukey's Biweight") weights are then 
	calculated, using a limit  of 6 outlier-resistant standard deviations.
	The fit is repeated iteratively until the robust standard deviation of 
	the residuals changes by less than .03xSQRT(.5/(N-1)).

 PROCEDURES CALLED:
       ROB_CHECKFIT
 REVISION HISTORY
	Written, H. Freudenreich, STX, 8/90. Revised 4/91.
	2/94 -- changed convergence criterion


ROBUST_SIGMA $SSW/gen/idl_libs/astron/robust/robust_sigma.pro
[Previous] [Next]
 NAME:
	ROBUST_SIGMA  

 PURPOSE:
	Calculate a resistant estimate of the dispersion of a distribution.
 EXPLANATION:
	For an uncontaminated distribution, this is identical to the standard
	deviation.

 CALLING SEQUENCE:
	result = ROBUST_SIGMA( Y, [ /ZERO ] )

 INPUT: 
	Y = Vector of quantity for which the dispersion is to be calculated

 OPTIONAL INPUT KEYWORD:
	/ZERO - if set, the dispersion is calculated w.r.t. 0.0 rather than the
		central value of the vector. If Y is a vector of residuals, this
		should be set.

 OUTPUT:
	ROBUST_SIGMA returns the dispersion. In case of failure, returns 
	value of -1.0

 CALLS: ***
	AVG [1], AVG [2]
 CALLED BY:
	BIWEIGHT_MEAN, ROBUST_LINEFIT, ROB_CHECKFIT
 PROCEDURE:
	Use the median absolute deviation as the initial estimate, then weight 
	points using Tukey's Biweight. See, for example, "Understanding Robust
	and Exploratory Data Analysis," by Hoaglin, Mosteller and Tukey, John
	Wiley & Sons, 1983.

 REVSION HISTORY: 
	H. Freudenreich, STX, 8/90
       Replace MED() call with MEDIAN(/EVEN)  W. Landsman   December 2001


roll_xy $SSW/gen/idl/mapping/roll_xy.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : roll_xy

 Purpose     : rotate image coordinates

 Category    : imaging

 Explanation : 

 Syntax      : roll_xy,xarr,yarr,angle,rx,ry

 CALLED BY:
	DROT_COORD, DROT_MAP, DROT_MAP_FAST, DROT_RASTER, DROT_XY, LVIEW_XY, PLOT_HELIO [1]
	PLOT_HELIO [2], PLOT_MAP
	PLOT_MAP2 WARNINGTEMPORARY FIX ONLY FOR 16 bit ZBuffer support, ROT_MAP
 Examples    :

 Inputs      : XARR,YARR = image (X,Y) coordinates
               ANGLE = angle in degrees (+ for clockwise)

 Opt. Inputs : None

 Outputs     : RX,RY = rotated coordinates

 Opt. Outputs: None

 Keywords    : CENTER= [XC,YC] = center of rotation [def = center of image]

 CALLS: ***
	NUM2STR, data_chk [1], data_chk [2]
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Written 22 November 1996, D. Zarro, ARC/GSFC

 Contact     : dzarro@solar.stanford.edu


ROMAN $SSW/gen/idl/string/roman.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : ROMAN()
               
 Purpose     : Returns ROMAN atomic number given the ionization
               
 Explanation : 

 Use         : name=roman(n)
    
 Inputs      : Ionization number
               
 Opt. Inputs : None.
               
 Outputs     : Returns the ROMAN atomic number
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : None.
 CALLED BY:
	CDS_WAVE_LABEL
 Common      : None.
               
 Restrictions: None.
               
 Side effects: None.
               
 Category    : CDS Spectral
               
 Prev. Hist. : None.

 Written     : Phil Judge HAO/NCAR, 29 August, 1995
               
 Modified    : Version 2, 03-Jul-1996, William Thompson, GSFC
			Corrected bug for values between 27 and 30.

 Version     : Version 2, 03-Jul-1996


ROOTNR $SSW/gen/idl/util/rootnr.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	ROOTNR

 Purpose     :	Finds the value of VARIABLE for which FUNC(VARIABLE) = 0.

 Explanation :	Finds the value of VARIABLE for which FUNC(VARIABLE) = 0.

		Approximations to VARIABLE are made by a modified version of
		the Newton-Raphson method until either MAX_ITER is exceeded or
		else successive estimates of VARIABLE differ by less than
		ACCURACY.

 Use         :	ROOTNR, FUNC, VARIABLE, START  [, PARAMS ]

 Inputs      :	FUNC	  - Character string containing name of function.
		START	  - Initial guess.

 Opt. Inputs :	PARAMS	  - The parameters of the function FUNC.  If passed,
		FUNC has the form
 
			F = FUNC(VARIABLE,PARAMS)
 
		Otherwise it has the form
 
			F = FUNC(VARIABLE)

 Outputs     :	VARIABLE  - Variable to store result in.

 Opt. Outputs:	None.

 Keywords    :	ACCURACY = Accuracy to cut off at.  Defaults to 1E-5.
		MAX_ITER = Maximum number of reiterations.  Defaults to 20.
		VALUE	 = Finds VARIABLE for which FUNC(VARIABLE) = VALUE.
			   Defaults to zero.

 Calls       :	None.
 Common      :	None.

 Restrictions:	The function FUNC must have one of the above two forms.

 Side effects:	None.

 Category    :	Utilities, Curve_Fitting.

 Prev. Hist. :	
	William Thompson, February, 1990, from FORTRAN subroutine written by
		Roger Thomas.
	William Thompson, December 1991, modified for IDL version 2.

 Written     :	William Thompson, GSFC, February 1990

 Modified    :	Version 1, William Thompson, GSFC, 9 January 1995
			Incorporated into CDS library
		Version 2, William Thompson, GSFC, 19 July 2000
			Fixed bug detecting whether or not PARAMS was passed.

 Version     :	Version 2, 19 July 2000


ROT $SSW/gen/idl_fix/soft/old310/rot.pro
[Previous] [Next]
 NAME:
	ROT

 PURPOSE:
	Rotate, magnify or demagnify, and/or translate an image.

 CATEGORY:
	Z3 - Image processing, geometric transforms.

 CALLING SEQUENCE:
	Result = ROT(A, Angle, [Mag, X0, Y0], MISSING = missing,
		INTERP = Interp, CUBIC = Cubic)

 INPUTS:
	A:	The image array to be rotated.  This array may be of any type,
		but it must have two dimensions.

	ANGLE:	Angle of rotation in degrees CLOCKWISE. (Why?,
		because of an error in the old ROT.)

 OPTIONAL INPUT PARAMETERS:
	MAG:	Magnification/demagnification factor.  A value of 1.0 = no
		change, > 1 is magnification and < 1 is demagnification.

	X0:	X subscript for the center of rotation.  If omitted, X0 equals
		the number of columns in the image divided by 2.

	Y0:	Y subscript for the center of rotation.  If omitted, y0 equals
		the number of rows in the image divided by 2.

 KEYWORDS:
	INTERP:	Set this keyword for bilinear interpolation.  If this keyword
		is set to 0 or omitted, nearest neighbor sampling is used.
		Note that setting this keyword is the same as using the 
		ROT_INT User Library function.  This change (and others) 
		essentially makes ROT_INT obsolete.

	CUBIC:	If set, uses "Cubic convolution" interpolation.  A more
		accurate, but more time-consuming, form of interpolation.
		CUBIC has no effect when used with 3 dimensional arrays.

      MISSING:	The data value to substitute for pixels in the output image 
		that map outside the input image.

      PIVOT: Setting this keyword causes the image to pivot around the point
		X0, Y0, so that this point maps into the same point in the
		output image.  If this keyword is set to 0 or omitted, then the
		point X0, Y0 in the input image is mapped into the center of
		the output image.

 OUTPUTS:
	ROT returns a rotated, magnified, and translated version of the
	input image.  Note that the dimensions of the output image are
	always the same as those of the input image.

 CALLS: ***
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	COMBINE_IMG, HROT, IMAGE_TOOL_EVENT, ITOOL_RD_FITS, MK_IMG, NRH_BIASREG, NRH_ROTIM
	RD_IMAGE_FITS, SHOW_REGNS, SXIG12_PREP, SXTASEQ, align1img [1], align1img [2]
	c2_vig1, clean_bijm, coal_rot, find_axes, fl_suntoday [1], fl_suntoday [2]
	fl_suntoday [3], mk_strip_file, mk_sun_mosaic, rot_trim
	rt_carrmapmaker yymmdd num_r rad limb wlimb hdr disp saveset nextrot
	spartan_roll2fits [1], sun_today [1], sun_today [2], sun_today [3]
	sxig12_browsegen, sxt2eit, sxt_prep [1], sxt_prep [2], sxt_prep [3]
 COMMON BLOCKS:
	rot_blk	- private common 

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	The POLY_2D function is used to translate, scale, and
	rotate the original image.

 EXAMPLE:
	Create and display an image.  Then display a rotated and magnified
	version.  Create and display the image by entering:

		A = BYTSCL(DIST(256))
		TV, A

	Rotate the image 33 degrees and magnify it 1.5 times.  Use bilinear
	interpolation to make the image look nice.  Enter:

		B = ROT(A, 33, 1.5, /INTERP)
		TV, B
	
 MODIFICATION HISTORY:
	June, 1982. 	Written by DMS, RSI.

	Feb, 1986. 	Modified by Mike Snyder, ES&T Labs, 3M Company.
	 		Adjusted things so that rotation is exactly on the 
			designated center.

	October, 1986.  Modified by DMS to use the POLY_2D function.

	Aug, 1988.	Added INTERP keyword.
       Dec, 1992.      Added PIVOT keyword, William Thompson, NASA/GSFC.
	Nov, 1993.	Added CUBIC keyword, DMS/RSI.
	Feb, 1994.	SLF - added warning about CUBIC (old version support)


ROT_FITS_HEAD $SSW/gen/idl/fits/rot_fits_head.pro
[Previous] [Next]
 Project     : HESSI

 Name        : ROT_FITS_HEAD

 Purpose     : Rotate FITS header information

 Category    : FITS, Utility

 Syntax      : IDL> header=rot_fits_head(header)

 Inputs      : HEADER = FITS header (string or index structure format)

 Outputs     : HEADER with roll adjusted CRPIX, CROTA, CEN values

 CALLS: ***
	COMP_FITS_CEN, EXIST, FXPAR [1], FXPAR [2], HAVE_TAG, IS_STRING, REP_FITS_HEAD, TRIM
	is_struct
 CALLED BY:
	DO_EIT_MAP, EIT_PREP, FITS2MAP [1], FITS2MAP [2], MAP__DEFINE
 History     : Written, 3-Feb-2004, Zarro (L-3Com/GSFC)
               Modified, 13-Apr-2005, Zarro (L-3Com/GSFC) 
                - fixed long to float conversion

 Contact     : dzarro@solar.stanford.edu


ROT_MAP $SSW/gen/idl/mapping/rot_map.pro
[Previous] [Next]
 Project     : SOHO-CDS

 Name        : ROT_MAP

 Purpose     : rotate image contained within structure created by MAKE_MAP

 Category    : imaging

 Syntax      : rmap=rot_map(map,angle)

 Inputs      : MAP = map structure 
               ANGLE = angle in degrees to rotate image map (+ for clockwise)

 Opt. Inputs : None

 Outputs     : RMAP = map with rotated coordinates

 Keywords    : CENTER= [XC,YC] = center of rotation 
               Use MAP.ROLL_CENTER if CENTER is not entered and MAP.ROLL_ANGLE ne 0
               Use center of image otherwise
             : NO_REMAP = don't remap image data (just rotate coords)
             : FULL_SIZE = expand image size to fit all rotated pixels
             : ROLL_ANGLE = new roll angle for map

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DPRINT
	EXIST, GET_MAP_CENTER, GET_MAP_PROP, GET_MAP_XP, GET_MAP_YP, GRID_XY, HAVE_TAG
	MERGE_STRUCT, PR_SYNTAX, REPACK_MAP, REP_TAG_VALUE, TRIM, UNPACK_MAP, VALID_MAP
	delvarx [5], interp2d [1], interp2d [2], interp2d [3], roll_xy
 CALLED BY:
	MAP__DEFINE, OVSA2MAP
 History     : Written 22 November 1996, D. Zarro (ARC/GSFC)
               Modified 27 December 2002, Zarro (EER/GSFC) - made image center
               the default roll center for zero roll data

 Contact     : dzarro@solar.stanford.edu


ROT_SUBIMAGE $SSW/gen/idl/image_tool/rot_subimage.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       ROT_SUBIMAGE

 PURPOSE:
       Modify an image array with a rotated region

 EXPLANATION:
       Given a region specified by two 2-element array xx, and yy, this
       routine returns a new image array in which value of all pixels is set
       to the minimum value of the image array except those in the region
       which are rotated to a new place based on the solar rotation.

 CALLING SEQUENCE:
       ROT_SUBIMAGE, image, new_image, time_gap, date, xx, yy, csi=csi

 INPUTS:
       IMAGE    - 2D image array
       TIME_GAP - Time interval (in days) over which the image is rotated
       DATE     - Current time and date in CCSDS or ECS format
       XX       - [x1, x2], in data pixels, starting and ending pixels of the
                  subimage in X direction
       YY       - [y1, y2], in data pixels, starting and ending pixels of the
                  subimage in Y direction
       CSI -- Coordinate system information structure that contains some
              basic information of the coordinate systems involved. 
              For more information about CSI, take a look
              at itool_new_csi.pro

              Note: Units used for CRVAL1 ans CRVAL2 are arc senconds in
                    case of solar images. If the reference point is
                    the solar disk center, CRVAL1 = CRVAL2 = 0.0. The
                    reference point can also be the first pixel of
                    the image (i.e., the pixcel on the lower-left
                    coner of the image).

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       NEW_IMAGE - Modified image array. Only those pixels in the subimage
                   are rotated, the rest of pixcels are set to the minimum
                   value of the original image array

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS:
       STATUS    - Status flag indicating success (1) or failure/cancel (0)

 CALLS: ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], CNVT_COORD [1], CNVT_COORD [2], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], DIFF_ROT [1], DIFF_ROT [2], PROGMETER, XKILL
 COMMON BLOCKS:
       None.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Planing/Image_tool

 HISTORY:
       Version 1, December 13, 1994, Liyun Wang, NASA/GSFC. Written
       Version 2, May 9, 1997, Liyun Wang, NASA/GSFC
          Added progress meter
          Added the STATUS keyword   

 CONTACT:
       Liyun Wang, NASA/GSFC (Liyun.Wang.1@gsfc.nasa.gov)


ROT_XY $SSW/gen/idl/solar/rot_xy.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS/SUMER

 NAME:
       ROT_XY()

 PURPOSE:
       Get a solar rotated position for a given time interval.

 CATEGORY:
       Utility, coordinates

 SYNTAX:
       Result = rot_xy(xx, yy, interval [, date=date])
       Result = rot_xy(xx, yy, tstart='96/4/19' [, tend=tend])

 INPUTS:
       XX       - Solar X position (arcsecs) of the point; can be a vector
                  (in this case YY must be a vector with same elements)
       YY       - Solar Y position (arcsecs) of the point; can be a vector
                  (in this case XX must be a vector with same elements)
 OPTIONAL INPUTS:
       INTERVAL - Time interval in seconds; positive (negative) value
                  leads to forward (backward) rotation. If INTERVAL
                  is not given, a beginning time must be given via
                  the TSTART keyword

 OUTPUTS:
       RESULT - A (Mx2) array representing rotated positions in arcsecs,
                RESULT(*,0) being X position and RESULT(*,1) Y position;
                where M is number of elements in XX (and in YY).
                If an error occurs, [-9999,-9999] will be returned.

                If OFFLIMB = 1 after the call, there must be some
                points rotated to the back of the sun. The points remain
                visible can be determined by RESULT(INDEX,*), and
                off-limb points will have the value of (-9999, -9999).

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       DATE    - Date/time at which the sun position is calculated; can
                 be in any UTC format. If missing, current date/time is
                 assumed.
       TSTART  - Date/time to which XX and YY are referred; can be in
                 any acceptable time format. Must be supplied if
                 INTERVAL is not passed
       TEND    - Date/time at which XX and YY will be rotated to; can be
                 in any acceptable time format. If needed but missing,
                 current time is assumed
       SOHO    - Set this keyword to use SOHO view. If this keyword is
                 missing, the point of view will depend on whether the
                 env variable SC_VIEW is set 1 or not
       ERROR   - Error message returned; if there is no error, a null
                 string is returned
       OFFLIMB - A named variable indicating whether any rotated
                 point is off the limb (1) or not (0). When OFFLIMB
                 is 1, the points still remaining visible (inside the limb)
                 will be those whose indices are INDEX (below)
       INDEX   - Indices of XX/YY which remain inside the limb after
                 rotation. When OFFLIMB becomes 1, the number of
                 INDEX will be smaller than that of XX or YY. If no
                 point remains inside the limb, INDEX is set to -1
       BACK_INDEX  - Indices of XX/YY which were on the disk at TSTART, 
                 but are no longer visible (i.e. are behind the visible 
                 solar disk) after rotation. 
       KEEP    - keep same epoch DATE when rotating; use same P,B0,R values 
                 both for DATE and DATE+INTERVAL
       
       RADIUS  - solar radius value [output in arcmin units]

       P       - If specified, override PB0R for P angle
       B0      - If specified, override PB0R for B0 angle
       R0      - If specified, override PB0R for solar apparent diameter:
                 r0 is the observer's distance from the Sun, in solar radii
       
       SPHERE  - keyword passed to ARCMIN2HEL

       BEFORE/AFTER - set to when to override P/B0/R0 with input values.

 CALLS: ***
	ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], ARCMIN2HEL, DIFF_ROT [1], DIFF_ROT [2]
	GET_UTC, HEL2ARCMIN [1], HEL2ARCMIN [2], PB0R, is_number [1], is_number [2]
 CALLED BY:
	DROT_COORD, DROT_MAP, DROT_MAP_FAST, DROT_NAR, DROT_RASTER, DROT_XY, DSP_POINT
	EIS_DROT_FOV [1], EIS_DROT_FOV [2], EIS_IMAGE_TOOL_EVENT [1]
	EIS_IMAGE_TOOL_EVENT [2], EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2]
	IMAGE_TOOL_EVENT, ITOOL_DIFF_ROT, ITOOL_PTOOL, LOCATE_FFCAL, MEAN_MAP, ROT_CDS_XY
	XCOR_CDS, hsi_show_flare_on_image, read_lapalma, time_at_meridian
	todays_targets, trace_build_mosaic3
 HISTORY:
       Version 1, March 18, 1996, Liyun Wang, NASA/GSFC. Written
       Version 2, April 16, 1996, Liyun Wang, NASA/GSFC
          Added SOHO keyword
       Version 3, April 18, 1996, Liyun Wang, NASA/GSFC
          Added keywords TSTART and TEND
          Made INTERVAL an optional input parameter if TSTART is set
       Version 4, July 15, 1996, Zarro, NASA/GSFC
          Added KEEP keyword
       Version 5, July 31, 1996, Liyun Wang, NASA/GSFC
          Modified such that no calculation is done if interval is zero
       Version 6, March 11, 1997, Liyun Wang, NASA/GSFC
          Added OFFLIMB keyword
       Version 7, May 16, 1997, Liyun Wang, NASA/GSFC
          Added INDEX keyword
          Fixed a bug feeding off-limb points to HEL2ARCMIN
       Version 8, June 10, 1997, Liyun Wang, NASA/GSFC
          Properly handled off-limb points
       Version 9, June 10, 1997, Liyun Wang, NASA/GSFC
          Properly handled off-limb points
       Version 10, July 1 1997 , Zarro SAC/GSFC -- added _EXTRA
       Version 11, Sept 10, 1997, Zarro SAC/GSFC 
          Added RADIUS output keyword
       Version 12, September 19, 1997, Liyun Wang, NASA/GSFC
          Fixed a bug that caused INDEX undefined when no rotation is needed
       Version 13, November 20, 1998, Zarro (SM&A) - returned scalar INDEX
          in place of INDEX[1]
       Version 14, January 9, 1998, Zarro (SMA/GSFC) - made use of /SOHO
          more consistent
       Version 15, April 10, 1999, Andretta (CUA/GSFC)
          - Added keywords P,B0,R0 (see ARCMIN2HEL and HEL2ARCMIN).
          - Keyword KEEP has now the effect of saving one call to PB0R 
          (useful when it can be assumed that during the rotation interval 
          the P, B0, R parameters do no change significantly). 
          - Added kewyord BACK_INDEX to keep track of points no longer 
          visible because they have been rotated beyond the limb.
       Version 16, 22-Aug-2001, Zarro (EITI/GSFC)
          -Added ANGLES keyword
       Version 17, 11-Mar-2002, Andretta/Zarro (GSFC)
          - fixed time interval & SOHO keyword bug
       Version 18, 10-Jan-2005, Zarro (L-3Com/GSFC)
          - added /BEFORE, /AFTER. If P, B0, & R0 are entered via
            keywords, then you can choose to apply them before or after
            differential rotation. The default is to apply them at the
            start and end of the rotation period, even though it doesn't
            make sense to apply them at both times since at least one of 
            them will change.

 CONTACT:
       Zarro (dzarro@solar.stanford.edu)


rotate_3d $SSW/gen/idl/image/rotate_3d.pro
[Previous] [Next]
   Name: rotate_3d

   Purpose: apply rsi 'rotate' to 3d data; multiples of 90deg w/opt transpose

   Input Parameters:
      array_3d - the input cube
      rotate_param - per description in rsi 'rotate' documentation
                 
   Output:
      function returns rotated cube
  
   Calling Sequence:
      rot3d=rotate_3d(datacube,rotate_parameter)

   Calling Examples:
      IDL> help,rotate_3d(lindgen(512,128,5),1)       ; 90 deg clockwise
       <Expression>    LONG      = Array[128, 512, 5]

 CALLS: ***
	BOX_MESSAGE, data_chk [1], data_chk [2]
 CALLED BY:
	trace_special_movie [2], trace_special_movie [3]
   History:
     10-nov-1999 - S.L.Freeland - hard to believe no one has done thi
                   but I could not find one with intuitive name...


ROTATE_LIMB $SSW/gen/idl/image_tool/rotate_limb.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:	
       ROTATE_LIMB()

 PURPOSE:
       Make a 2xN array that results from rotating points on the limb

 EXPLANATION:
       
 CALLING SEQUENCE: 
       Result = rotate_limb(rot_dir, time_gap)

 INPUTS:
       TIME_GAP   - Time interval (in days) over which the rotation is made;
                    the sign of TIME_GAP determines whether the rotation is
                    forward or backward

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RESULT - A Nx2 array: result(*,0) latitude of points in degrees
                             result(*,1) longitude of points in degrees

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       None.

 CALLS: ***
	DIFF_ROT [1], DIFF_ROT [2]
 CALLED BY:
	ITOOL_DISP_ROT
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       
 PREVIOUS HISTORY:
       Written May 5, 1995, Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
       Version 1, created, Liyun Wang, NASA/GSFC, May 5, 1995
       Version 2, September 2, 1997, Liyun Wang, NASA/GSFC
          Changed to column major operation 

 VERSION:
       Version 2, September 2, 1997


ROTATION $SSW/gen/idl/image/rotation.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:	
       ROTATION()

 PURPOSE:
       Make a 3x3 matrix for a rotation transformation conversion.

 EXPLANATION:
       
 CALLING SEQUENCE: 
       Result = ROTATION(axis_id, angle)

 INPUTS:
       axis_id -- An integer that indicates the axis about which the system
                  is rotated. For x, y, and z axes, the value is 1, 2, and 3
                  respectively. 
       angle   -- Angle of rotation in radians. Positive value indicates a
                  rotation that follows the right-hand rule.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       Result  -- A 3x3 two-dimensional array, the transformation matrix

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       None.

 CALLS:
	None.
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       Utilities, coordinates
 PREVIOUS HISTORY:
       Written in Fortran by Liyun Wang, UF, January 17, 1988      

 MODIFICATION HISTORY:
       Written September 8, 1994, by Liyun Wang, GSFC/ARC
       
 VERSION:
       


ROTPIC $SSW/gen/idl/image/rotpic.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	ROTPIC

 Purpose     :	Rotate a picture that is described by X & Y vectors.

 Explanation :	The IDL Users Library contains a function called ROT, which
		will rotate an image stored in a 2-D array.  However, this is
		not useful when drawing pictures by storing "corner indices"
		in separate X and Y vectors.  This procedure will rotate such
		picture vectors similar to the way ROT rotates an image array.

 Use         :	ROTPIC, X, Y, ROTANG, XROT, YROT

 Inputs      :	X:	The x-coordinates of the picture corners.

		Y:	The y-coordinates of the picture corners.

		ROTANG:	The angle PICTURE(X,Y) is to be rotated.

 Opt. Inputs :	None.

 Outputs     :	XROT:	The x-coordinates of the rotated picture corners.

		YROT:	The y-coordinates of the rotated picture corners.

 Opt. Outputs:	None.

 Keywords    :	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 = ''
				ROTPIC, X, Y, 34., XROT, YROT, ERRMSG=ERRMSG
				IF ERRMSG(0) NE '' THEN ...

 Calls       :	None.
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Utilities, arrays

 Prev. Hist. :	None.

 Written     :	Donald G. Luttermoser, GSFC/ARC, 19 October 1995

 Modified    :	Version 1, Donald G. Luttermoser, GSFC/ARC, 19 October 1995
			Initial program.

 Version     :	Version 1,  19 October 1995.


ROUND $SSW/gen/idl_fix/soft/old310/round.pro
[Previous] [Next]
 ROUTINE:
  ROUND
 PURPOSE:
   Return integer closest to its argument
 CALLING SEQUENCE:
   Result = ROUND(X)

   This is fixup for IDL versions prior to V3.1

 WRITTEN:
   11-jul-94, J. R. Lemen


ROUND_OFF $SSW/gen/idl/util/round_off.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : ROUND_OFF()
               
 Purpose     : To round a number to a specified accuracy
               
 Explanation : Rounds the input number to the accuracy specified.
               
 Use         : IDL> out = round_off(x,acc)
               IDL> out = round_off(12.278,0.01) ==> out = 12.28
    
 Inputs      : x    - the number to be operated on
               acc  - the numerical accuracy required
               
 Opt. Inputs : None
               
 Outputs     : The function value is the input rounded to the desired accuracy
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	Bell, DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	CALC_RAS_DUR, CAT_RAW, LOAD_TP_STRUCT, MK_CDS_PLAN, MK_RASTER, MK_SOHO
	TP_DRAW_RASDUR
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 17-May-1993
               
 Modified    : Replace calls to NINT by ROUND.  CDP, 17-Jun-95

 Version     : Version 2, 17-Jun-95


ROUND_TIME $SSW/gen/idl/time/round_time.pro
[Previous] [Next]
 Project     : HESSI

 Name        : ROUND_TIME

 Purpose     : round time to start of hour, day, month, or year

 Category    : HESSI, GBO, utility, time
               
 Syntax      : IDL> rtime=round_time(time,err=err)

 Inputs      : TIME = input time (e.g. 1-may-00 12:13)

 Outputs     : RTIME = rounded time (e.g. 1-may-00) [def is day in TAI]

 Keywords    : /HOUR, /MONTH, /YEAR
               /NEXT = round to start of next hour, day, month, or year
               RES= 0,1,2,3 (for hour, day, month,year)

 CALLS: ***
	ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], EXIST, PR_SYNTAX, TRIM, str_replace [1], str_replace [2]
 CALLED BY:
	SITE__DEFINE, XVALIDATE
 History     : 11-Apr-2000,  D.M. Zarro (SM&A/GSFC),  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


ROWSORT $SSW/gen/idl/util/rowsort.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	ROWSORT

 Purpose     :	Sort an array based on the values in two of its columns.

 Explanation :	This function returns a vector of subscripts that allow access
		to the rows of the target array in ascending order.  The sort
		is based on two columns of the array (the array may have any
		number of columns) which are specified as parameters to the
		function.  The result is always a vector of longword type 
		with the same number elements as row in the target array.  

 Use         :	A = ROWSORT (TARGET, Col0, Col1)

 Inputs      :	TARGET	The array to be sorted. The array must consist of at
			least two columns but may contain any number of rows.

 Opt. Inputs :	COL0	The primary column to base the sort on.  If two 
			elements in this column contain the same value, then
			the sort is based on the corresponding elements in 
			COL1.

		COL1	The secondary column to peform the search on.
			Array elements in this column are only consulted when
			there is a clash between two elements in COL1.

 Outputs     :	None.

 Opt. Outputs:	None.

 Return Value:	A vector of subscripts which allow access of the target array
		in ascending order.
	

 Keywords    :	ERRMSG  If defined and passed, then any error messages will
			be returned to the user in this parameter rather
			than depending on the MESSAGE routine in IDL.  If 
			no errors are encountered, then a null string is
			returned.  In order to use this feature, ERRMSG must
			be defined first, e.g.

				ERRMSG = ''
				LIST_EXPER, ERRMSG=ERRMSG, ...
				IF ERRMSG NE '' THEN ...

 Calls       : ***
	UNIQ [1], UNIQ [2], UNIQ [3]
 CALLED BY:
	get_uniq_range
 Common      :	None.

 Restrictions:	The algorithm used by this function is very inefficient and 
		should not be used on arrays with more then 100000 rows.

 Side effects:	None.

 Category    :	Planning, Database.

 Prev. Hist. :	none.

 Written     :	Ron Yurow, GSFC, 11 September 1997

 Modified    :	Version 1, Ron Yurow, GSFC, 17 September 1997

 Version     :	Version 1, 17 September 1997


RPC_GET_NOAA $SSW/gen/idl/rpc/rpc_get_noaa.pro
[Previous] [Next]
 Project     : SOLAR-B/EIS

 Name        : RPC_GET_NOAA

 Purpose     : RPC wrapper around GET_NAR

 Category    : planning

 Explanation : Get NOAA AR pointing info

 Syntax      : IDL>nar=rpc_get_nar(tstart)

 Inputs      : TSTART = start time

 Opt. Inputs : TEND = end time

 Outputs     : NAR = structure array with NOAA info

 Keywords    : see GET_NAR

 CALLS: ***
	EXIST, RPC_SERVER
 History     : 16-Feb-2006, Zarro (L-3Com/GSFC) - written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


RPC_OBJECT $SSW/gen/idl/rpc/rpc_object.pro
[Previous] [Next]
 Project     : SOLAR_B/EIS

 Name        : RPC_OBJECT

 Purpose     : Return an RPC client object

 Category    : utility objects

 Syntax      : IDL> rpc=rpc_object(status)

 Inputs      : None

 Outputs     : RPC = RPC client object
               STATUS = 1/0 for success/failuer

 History     : Written 18 Feb 2006, D. Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


RPC_SERVER $SSW/gen/idl/sockets/rpc_server.pro
[Previous] [Next]
 Project     : EIS

 Name        : RPC_SERVER

 Purpose     : return address of RPC server

 Category    : sockets
                   
 Inputs      : None

 Outputs     : SERVER = environment value associated with $RPC_SERVER
                        [def='orpheus.nascom.nasa.gov']

 Keywords    : None

 CALLS: ***
	CHKLOG [1], CHKLOG [2]
 CALLED BY:
	EIS_LIST_EXPER [1], EIS_LIST_EXPER [2], RPC_GET_NOAA, SOCK_RPC
 History     : 29-Sept-2002,  D.M. Zarro (EITI/GSFC)  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


rsh $SSW/gen/idl/system/rsh.pro
[Previous] [Next]
   Name: rsh

   Purpose: spawn remote command

   Input Parameters:
      node - node name for rsh
      command - command to execute

   Output Parameters:
      status - status output from    spawn

   Calling Sequence:
      rsh, node, command [status, user=user, /null, /echo]

 CALLS: ***
	get_host [1], get_host [2]
 CALLED BY:
	cp_fns [1], cp_fns [2], go_batch [1], go_batch [2], is_bestnode [1]
	is_bestnode [2], mo_patch, monitor_scratch [1], monitor_scratch [2]
   Restrictions: unix only

   History:
      4-Feb-1994 (SLF)
     12-May-1994 (SLF) (added a space between node and -l)
      9-Jul-1994 (SLF) moved echo to preced spawn command (see what is is
			doing, not what it did)
     28-feb-1995 (slf) osf case


RSS2PQ $SSW/gen/idl/image/rss2pq.pro
[Previous] [Next]
NAME:
     RSS2PQ
PURPOSE:
     Given a rotation, shift and scale change, returns the p and q 
     variables used in poly_2d to warp images.
CATEGORY:
CALLING SEQUENCE:
     transformation = rss2pq(xshift=xshift,yshift=yshift,rot12=rot12,
                             xscale=xscale,yscale=yscale)
INPUTS:
OPTIONAL INPUT PARAMETERS:
     nx = size of image to be transformed (used only if /center is set)
     ny = size of image to be transformed (used only if /center is set)
KEYWORD PARAMETERS
     rot12 = rotation CCW in degrees (default = 0)
     xshift = x shift in pixels (default = 0), units=reference pixels
     yshift = y shift in pixels (default = 0), units=reference pixels
     xscale = x scale relative to reference scale (default = 1)
     yscale = y scale relative to reference scale (default = 1)
     anchor = [x0,y0] defines the center of rotation (units=reference pixels)
     /center = rotate about the center of the image instead of the lower left
               corner (only affects xhift and yshift).
               Same as anchor=[(nx-1)/2.,(ny-1)/2.]
     /rotfirst = rotate,shift,scale rather than the default
                   shift,rotate,scale.  This is the behavior the routine
                   originally had.
     axshift = shift applied after rotation (rotfirst=0) or before
               rotation (rotfirst=1), in addition to the shift
               applied on the other side of the rotation with xshift.
     ayshift = shift applied after rotation (rotfirst=0) or before
               rotation (rotfirst=1), in addition to the shift
               applied on the other side of the rotation with yshift.
     p = output variable for P
     q = output variable for Q
OUTPUTS:
     transformation = matrix with the same format as the output from 
                      caltrans.pro
                      t(*,0) = p
                      t(*,1) = q
 CALLED BY:
	AUTO_ALIGN_IMAGES, PQ2RSS, SHIFT_IMG, TRACE_CUBE_POINTING, TRACE_MDI_ALIGN
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Using /shiftfirst will make your life a lot easier.
PROCEDURE:
     The rotation anchor is in 
     the original coordinate system and the shifts are in
     units of the original image.

     First shifts, then rotates, then scales.  Pass the output from RSS2PQ
     through pq2pp.pro if you want output that mimics setpts rather than 
     output that mimics caltrans.
MODIFICATION HISTORY:
     Written by T. Metcalf 12-Aug-93
     1994-11-10 TRM Added anchor keyword.
     1995-05-19 TRM Changed default from rotate-shift-scale to 
                    shift-rotate-scale.  Use the /rotfirst keyword to get
                    the old behavior.
     2005-01-24 TRM Added axshift and ayshift keywords.  The anchor
                    for /center was defined as [nx/2,ny/2].  Now it
                    is [(nx-1)/2,(ny-1)/2].


RSTN__DEFINE $SSW/gen/idl/synoptic/rstn__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : RSTN__DEFINE

 Purpose     : Define a RSTN data object

 Category    : Ancillary GBO Synoptic Objects

 Syntax      : IDL> c=obj_new('rstn')

 CALLS: ***
	ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], DPRINT, FILE_BREAK, GET_CALLER
	GET_MONTH, GET_UTC, IS_STRING, RD_RSTN, RSTN::CLEANUP, RSTN::GET_SDIR, RSTN::INIT
	RSTN::PARSE_TIME, RSTN::READ, RSTN::RENAME_FILES, RSTN::SETPROP, RSTN::SYNOP
	STR_FORMAT, TIME2FID, TRIM, TRIM2, is_struct
 History     : Written 15 March 2000, D. Zarro, SM&A/GSFC

 Contact     : dzarro@solar.stanford.edu


RSTRMID $SSW/gen/idl/string/rstrmid.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : RSTRMID

 Purpose     : Reverse of STRMID

 Category    : Utility

 Explanation : 

 Syntax      : IDL> new=rstrmid(input,start,length)

 Inputs      : INPUT = input string
               START = start character (starting from end)
               LENGTH = characters to strip

 Opt. Inputs : START is optional. If not entered, last character is used

 Outputs     : OUTPUT = new string array

 Opt. Outputs: None

 Keywords    : None

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, PR_SYNTAX, REVERSE
 Common      : None

 Restrictions: None

 Side effects: None

 History     : Version 1,  25-May-1998,  D.M. Zarro.  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


RSTRPOS $SSW/gen/idl/string/rstrpos.pro
[Previous] [Next]
 NAME:
       RSTRPOS

 PURPOSE:
	This function finds the last occurrence of a substring within
	an object string. If the substring is found in the expression,
	RSTRPOS returns the character position of the match, otherwise
	it returns -1.

 CATEGORY:
	String processing.

 CALLING SEQUENCE:
        Result = RSTRPOS(Expr, SubStr [, Pos])

 INPUTS:
       Expr:	The expression string in which to search for the substring.
	SubStr: The substring to search for.

 OPTIONAL INPUTS:
	Pos:	The character position before which the search is bugun.
	      	If Pos is omitted, the search begins at the last character
	      	of Expr.

 OUTPUTS:
        Returns the position of the substring, or -1 if the
	 substring was not found within Expr.

 CALLS: ***
	REVERSE
 CALLED BY:
	CHECK_PRO_NAMES, HMS, HXT_AUTOIMG, JSMOVIE2, MENUBCKGRD, MENUCALCFLUX1D
	MENUSHIFTRH1D, MENUTRACEISOPH, MKMOVIE
	MKMOVIE0 obsolete version of mkmoviepro, MKMOVIEM, MKMOVIEWLC, MKMOVIE_kpd
	MKQUERY, NRH1_POSCRIPT, PS_FORM [1], PS_FORM [2], SELECTD, STRIP_DIRNAME [1]
	STRIP_DIRNAME [2], TKI_CALL, TKI_TCMD_EXEC, WCALCNEW, WLISTER, WLOAD, WLOADC
	WLOADINFO1, WMESSAGE [1], WRUNMOVIE4, WSAVE_PS [2], chk_h4s, fparmodify, h4s
	hsi_as_ptfile, hsi_ras_thresfile, las_exp_norm, ld_inst_def, mk_list, mk_minim
	mk_stdim_list, rh_fich_ctr, tr_inventory_telem, w_stdim_list
 SIDE EFFECTS:
        Unlike STRPOS, Expr and SubStr must be strings.

 EXAMPLE:
	Expr = 'Holy smokes, Batman!'	; define the expression.
	Where = RSTRPOS(Expr, 'smokes')	; find position.
	Print, Where			; print position.
		5			; substring begins at position 5
					; (the sixth character).

 MODIFICATION HISTORY:
       JWG, January, 1993
	AB, 7 December 1997, Added check for proper number of arguments
           and ON_ERROR statement to stop in caller in case of error on
	    suggestion of Jack Saba.
	AB, 18 August 1998, Extended original code to allow Expr to be
	    an array.


RTAG_NAMES $SSW/gen/idl/struct/rtag_names.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : RTAG_NAMES

 Category    : structures

 Purpose     : recursively return all tag names within a structure

 Syntax      : IDL> tags=rtag_names(struct)

 Inputs      : STRUCT = structure to check

 Outputs     : TAGS = tag names

 Keywords    : STRUCTURE_NAME: set for structure name

 CALLED BY:
	HAVE_TAG
 History     : 23-Sept-2000,  D.M. Zarro (EIT/GSFC), Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU