[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBDIMEN() Purpose : Returns the dimensions for a column in a FITS binary table. Explanation : This procedure returns the dimensions associated with a column in a binary table opened for read with the command FXBOPEN. Use : Result = FXBDIMEN(UNIT,COL) Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. COL = Column in the binary table to read data from, either as a character string containing a column label (TTYPE), or as a numerical column index starting from column one. Opt. Inputs : None. Outputs : The result of the function is an array containing the dimensions for the specified column in the FITS binary table that UNIT points to. Opt. Outputs: None. 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 = '' Result = FXBDIMEN( ERRMSG=ERRMSG, ... ) IF ERRMSG NE '' THEN ... Calls : FXBCOLNUM, FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: The dimensions will be returned whether or not the table is still open or not. If UNIT does not point to a binary table, then 0 is returned. If UNIT is an undefined variable, then 0 is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 4 March 1994. Modified : Version 1, William Thompson, GSFC, 4 March 1994. Version 2, William Thompson, GSFC, 21 June 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 3, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxbdimen.pro)
FXBFIND
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBFIND Purpose : Find column keywords in a FITS binary table header. Explanation : Finds the value of a column keyword for all the columns in the binary table for which it is set. For example, FXBFIND, UNIT, 'TTYPE', COLUMNS, VALUES, N_FOUND Would find all instances of the keywords TTYPE1, TTYPE2, etc. The array COLUMNS would contain the column numbers for which a TTYPEn keyword was found, and VALUES would contain the values. N_FOUND would contain the total number of instances found. Use : FXBFIND, [UNIT or HEADER], KEYWORD, COLUMNS, VALUES, N_FOUND [, DEFAULT ] Inputs : Either UNIT or HEADER must be passed. UNIT = Logical unit number of file opened by FXBOPEN. HEADER = FITS binary table header. KEYWORD = Prefix to a series of FITS binary table column keywords. The keywords to be searched for are formed by combining this prefix with the numbers 1 through the value of TFIELDS in the header. Opt. Inputs : DEFAULT = Default value to use for any column keywords that aren't found. If passed, then COLUMNS and VALUES will contain entries for every column. Otherwise, COLUMNS and VALUES only contain entries for columns where values were found. Outputs : COLUMNS = Array containing the column numbers for which values of the requested keyword series were found. VALUES = Array containing the found values. N_FOUND = Number of values found. The value of this parameter is unaffected by whether or not DEFAULT is passed. Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN, FXPAR Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: If UNIT is passed, then the file must have been opened with FXBOPEN. If HEADER is passed, then it must be a legal FITS binary table header. The type of DEFAULT must be consistent with the values of the requested keywords, i.e. both most be either of string or numerical type. The KEYWORD prefix must not have more than five characters to leave room for the three digits allowed for the column numbers. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Feb. 1992. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxbfind.pro)
FXBFINDLUN
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBFINDLUN() Purpose : Find logical unit number UNIT in FXBINTABLE common block. Explanation : Finds the proper index to use for getting information about the logical unit number UNIT in the arrays stored in the FXBINTABLE common block. Called from FXBCREATE and FXBOPEN. Use : Result = FXBFINDLUN( UNIT ) Inputs : UNIT = Logical unit number. Opt. Inputs : None. Outputs : The result of the function is an index into the FXBINTABLE common block. Opt. Outputs: None. Keywords : None. Calls : None. Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: If UNIT is not found in the common block, then it is added to the common block. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Feb. 1992. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 July 1993. Added DHEAP variable to fix bug with variable length arrays. Version 3, Michael Schubnell, University of Michigan, 22 May 1996 Change N_DIMS from short to long integer. Version : Version 3, 22 May 1996 Converted to IDL V5.0 W. Landsman September 1997(See fxbfindlun.pro)
FXBFINISH
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBFINISH Purpose : Close a FITS binary table extension file opened for write. Explanation : Closes a FITS binary table extension file that had been opened for write by FXBCREATE. Use : FXBFINISH, UNIT Inputs : UNIT = Logical unit number of the file. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. 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 = '' FXBFINISH, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : None. Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: The file must have been opened with FXBCREATE, and written with FXBWRITE. Side effects: Any bytes needed to pad the file out to an integral multiple of 2880 bytes are written out to the file. Then, the file is closed. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Jan 1992. W. Thompson, Feb 1992, modified to support variable length arrays. W. Thompson, Feb 1992, removed all references to temporary files. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 July 1993. Fixed bug with variable length arrays. Version 3, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 4, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 4, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxbfinish.pro)
FXBHEADER
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBHEADER() Purpose : Returns the header of an open FITS binary table. Explanation : This procedure returns the FITS extension header of a FITS binary table opened for read with the command FXBOPEN. Use : Result = FXBHEADER(UNIT) Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. Opt. Inputs : None. Outputs : The result of the function is a string array containing the header for the FITS binary table that UNIT points to. Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: The string array returned always has as many elements as the largest header read by FXBOPEN. Any extra elements beyond the true header are blank or null strings. The header will be returned whether or not the table is still open or not. If UNIT does not point to a binary table, then a string array of nulls is returned. If UNIT is an undefined variable, then the null string is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 1 July 1993. Modified : Version 1, William Thompson, GSFC, 1 July 1993. Version : Version 1, 1 July 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxbheader.pro)
FXBHELP
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBHELP Purpose : Prints short description of columns in a FITS binary table. Explanation : Prints a short description of the columns in a FITS binary table to the terminal screen. Use : FXBHELP, UNIT Inputs : UNIT = Logical unit number of file opened by FXBOPEN. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : None. Calls : FXBFIND, FXBFINDLUN, FXPAR Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: The file must have been opened with FXBOPEN. Side effects: Certain fields may be truncated in the display. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Feb. 1992, from TBHELP by W. Landsman. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 12 May 1993. Modified to not write to a logical unit number assigned to the terminal. This makes it compatible with IDL for Windows. Version : Version 2, 12 May 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxbhelp.pro)
FXBHMAKE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBHMAKE Purpose : Create basic FITS binary table extension (BINTABLE) header. Explanation : Creates a basic header array with all the required keywords, but with none of the table columns defined. This defines a basic structure which can then be added to or modified by other routines. Use : FXBHMAKE, HEADER, NROWS [, EXTNAME [, COMMENT ]] Inputs : NROWS = Number of rows in the binary table. Opt. Inputs : EXTNAME = If passed, then the EXTNAME record is added with this value. COMMENT = Comment to go along with EXTNAME. Outputs : HEADER = String array containing FITS extension header. Opt. Outputs: None. Keywords : INITIALIZE = If set, then the header is completely initialized, and any previous entries are lost. DATE = If set, then the DATE keyword is added to the header. EXTVER = Extension version number (integer). EXTLEVEL = Extension level number (integer). 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 = '' FXBHMAKE, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : GET_DATE, FXADDPAR, FXHCLEAN Common : None. Restrictions: Warning: No checking is done of any of the parameters. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Jan 1992. William Thompson, Sep 1992, added EXTVER and EXTLEVEL keywords. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 June 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 3, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxbhmake.pro)
FXBINTABLE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBINTABLE Purpose : Common block FXBINTABLE used by "FXB" routines. Explanation : This is not an IDL routine as such, but contains the definition of the common block FXBINTABLE for inclusion into other routines. By defining the common block in one place, the problem of conflicting definitions is avoided. This file is included into routines that need this common block with the single line (left justified) @fxbintable FXBINTABLE contains the following arrays: LUN = An array of logical unit numbers of currently (or previously) opened binary table files. STATE = Array containing the state of the FITS files associated with the logical unit numbers, where 0=closed, 1=open for read, and 2=open for write. HEAD = FITS binary table headers. MHEADER = Array containing the positions of the first data byte of the header for each file referenced by array LUN. NHEADER = Array containing the positions of the first data byte after the header for each file referenced by array LUN. NAXIS1 = Values of NAXIS1 from the binary table headers. NAXIS2 = Values of NAXIS2 from the binary table headers. TFIELDS = Values of TFIELDS from the binary table headers. HEAP = The start of the first byte of the heap area for variable length arrays. DHEAP = The start of the first byte of the next variable length array, if writing. BYTOFF = Byte offset from the beginning of the row for each column in the binary table headers. TTYPE = Values of TTYPE for each column in the binary table headers. FORMAT = Character code formats of the various columns. IDLTYPE = IDL type code for each column in the binary table headers. N_ELEM = Number of elements for each column in the binary table headers. TSCAL = Scale factors for the individual columns. TZERO = Zero offsets for the individual columns. MAXVAL = For variable length arrays, contains the maximum number of elements for each column in the binary table headers. N_DIMS = Number of dimensions, and array of dimensions for each column of type string in the binary table headers. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Feb 1992. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 July 1993. Added DHEAP variable to fix bug with variable length arrays. Version : Version 2, 21 July 1993.(See fxbintable.pro)
FXBISOPEN
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBISOPEN() Purpose : Returns true if UNIT points to an open FITS binary table. Explanation : This procedure checks to see if the logical unit number given by the variable UNIT corresponds to a FITS binary table opened for read with the command FXBOPEN, and which has not yet been closed with FXBCLOSE. Use : Result = FXBISOPEN(UNIT) If FXBISOPEN(UNIT) THEN ... Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. Opt. Inputs : None. Outputs : The result of the function is either True (1) or False (0), depending on whether UNIT points to an open binary table or not. Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: If UNIT is an undefined variable, then False (0) is returned. If UNIT points to a FITS binary table file that is opened for write, then False (0) is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 1 July 1993. Modified : Version 1, William Thompson, GSFC, 1 July 1993. Version : Version 1, 1 July 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxbisopen.pro)
FXBOPEN
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBOPEN Purpose : Open binary table extension in a disk FITS file for reading. Explanation : Opens a binary table extension in a disk FITS file for reading. The columns are then read using FXBREAD, and the file is closed when done with FXBCLOSE. Use : FXBOPEN, UNIT, FILENAME, EXTENSION [, HEADER ] Inputs : FILENAME = Name of FITS file to be opened. EXTENSION = Either the number of the FITS extension, starting with the first extension after the primary data unit being one; or a character string containing the value of EXTNAME to search for. Opt. Inputs : None. Outputs : UNIT = Logical unit number of the opened file. Opt. Outputs: HEADER = String array containing the FITS binary table extension header. Keywords : NO_TDIM = If set, then any TDIMn keywords found in the header are ignored. 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 = '' FXBOPEN, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : FXBFINDLUN, FXBPARSE, FXHREAD, FXPAR Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: The file must be a valid FITS file. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Feb 1992, based on READFITS by J. Woffard and W. Landsman. W. Thompson, Feb 1992, changed from function to procedure. W. Thompson, June 1992, fixed up error handling. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 27 May 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 21 June 1994 Extended ERRMSG to call to FXBPARSE Version 4, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 4, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxbopen.pro)
FXBPARSE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBPARSE Purpose : Parse the binary table extension header. Explanation : Parses the binary table extension header, and store the information about the format of the binary table in the FXBINTABLE common block--called from FXBCREATE and FXBOPEN. Use : FXBPARSE, ILUN, UNIT, HEADER Inputs : ILUN = Index into the arrays in the FXBINTABLE common block. HEADER = FITS binary table extension header. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : NO_TDIM = If set, then any TDIMn keywords found in the header are ignored. 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 = '' FXBPARSE, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : FXBFIND, FXBTDIM, FXBTFORM, FXPAR Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: Any TDIMn keywords found for bit arrays (format 'X') are ignored, since the dimensions would refer to bits, not bytes. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Feb. 1992. William Thompson, Jan. 1993, modified for renamed FXBTFORM and FXBTDIM. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 June 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 4, Michael Schubnell, University of Michigan, 22 May 1996 Change N_DIMS from short to long integer. Version 5, W. Landsman, GSFC, 12 Aug 1997 Use double complex datatype, if needed Version 6, W. Landsman GSFC 30 Aug 1997 Version for IDL V5.0 Version : Version 6, 31 Aug 1997 Converted to IDL V5.0 W. Landsman September 1997(See fxbparse.pro)
FXBREAD
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBREAD Purpose : Read a data array from a disk FITS binary table file. Explanation : Each call to FXBREAD will read the data from one column and one row from the FITS data file, which should already have been opened by FXBOPEN. One needs to call this routine for every column and every row in the binary table. FXBCLOSE will then close the FITS data file. Use : FXBREAD, UNIT, DATA, COL [, ROW ] Inputs : UNIT = Logical unit number corresponding to the file containing the binary table. COL = Column in the binary table to read data from, either as a character string containing a column label (TTYPE), or as a numerical column index starting from column one. Opt. Inputs : ROW = Either row number in the binary table to read data from, starting from row one, or a two element array containing a range of row numbers to read. If not passed, then the entire column is read in. Row must be passed for variable length arrays. Outputs : DATA = IDL data array to be read from the file. Opt. Outputs: None. Keywords : NOSCALE = If set, then the ouput data will not be scaled using the optional TSCAL and TZERO keywords in the FITS header. Default is to scale. VIRTUAL = If set, and COL is passed as a name rather than a number, then if the program can't find a column with that name, it will then look for a keyword with that name in the header. Such a keyword would then act as a "virtual column", with the same value for every row. DIMENSIONS = Vector array containing the dimensions to be used to read in the data. Bypasses any dimensioning information stored in the header. Ignored for bit arrays. If the data type is double-precision complex, then an extra dimension of 2 is prepended to the dimensions passed by the user. NANVALUE= Value signalling data dropout. All points corresponding to IEEE NaN (not-a-number) are converted to this number. Ignored unless DATA is of type float, double-precision or complex. 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 = '' FXBREAD, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : IEEE_TO_HOST, FXPAR, WHERE_NEGZERO, WHERENAN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: The binary table file must have been opened with FXBOPEN. The data must be consistent with the column definition in the binary table header. The row number must be consistent with the number of rows stored in the binary table header. The number of elements implied by the dimensions keyword must not exceed the number of elements stored in the file. Side effects: If the DIMENSIONS keyword is used, then the number of data points read in may be less than the number of points stored in the table. If there are no elements to read in (the number of elements is zero), then the program sets !ERR to -1, and DATA is unmodified. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Jan 1992. W. Thompson, Feb 1992, modified to support variable length arrays. W. Thompson, Jun 1992, modified way that row ranges are read in. No longer works reiteratively. W. Thompson, Jun 1992, fixed bug where NANVALUE would be modified by TSCAL and TZERO keywords. W. Thompson, Jun 1992, fixed bug when reading character strings. Treats dimensions better when reading multiple rows. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 30 June 1993. Added overwrite keyword to REFORM call to speed up. Version 3, William Thompson, GSFC, 21 July 1993. Fixed bug with variable length arrays. Version 4, William Thompson, GSFC, 29 October 1993. Added error message for not finding column by name. Version 5, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 6, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 7, William Thompson, GSFC, 29 December 1994 Fixed bug where single element dimensions were lost. Version 8, William Thompson, GSFC, 20 March 1995 Fixed bug introduced in version 7. Version 9, Wayne Landsman, GSFC, 3 July 1996 Fixed bug involving use of virtual keyword. Version 10, William Thompson, GSFC, 31-Jan-1997 Added call to WHERE_NEGZERO. Version 11, Wayne Landsman, GSFC, 12 Aug, 1997 Use IDL dcomplex datatype if needed Version 12, Wayne Landmsan, GSFC, 20 Feb, 1998 Remove call to WHERE_NEGZERO (now part of IEEE_TO_HOST) Version : Version 12, 20 Feb 1998 Converted to IDL V5.0 W. Landsman September 1997(See fxbread.pro)
FXBSTATE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBSTATE() Purpose : Returns the state of a FITS binary table. Explanation : This procedure returns the state of a FITS binary table that was either opened for read with the command FXBOPEN, or for write with the command FXBCREATE. Use : Result = FXBSTATE(UNIT) Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. Opt. Inputs : None. Outputs : The result of the function is the state of the FITS binary table that UNIT points to. This can be one of three values: 0 = Closed 1 = Open for read 2 = Open for write Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: If UNIT is an undefined variable, then 0 (closed) is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 1 July 1993. Modified : Version 1, William Thompson, GSFC, 1 July 1993. Version : Version 1, 1 July 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxbstate.pro)
FXBTDIM
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBTDIM() Purpose : Parse TDIM-like kwywords. Explanation : Parses the value of a TDIM-like keyword (e.g. TDIMnnn, TDESC, etc.) to return the separate elements contained within. Use : Result = FXBTDIM( TDIM_KEYWORD ) Inputs : TDIM_KEYWORD = The value of a TDIM-like keyword. Must be a character string of the form "(value1,value2,...)". If the parentheses characters are missing, then the string is simply returned as is, without any further processing. Opt. Inputs : None. Outputs : The result of the function is a character string array containing the values contained within the keyword parameter. If a numerical result is desired, then simply call, e.g. Result = FIX( FXBTDIM( TDIM_KEYWORD )) Opt. Outputs: None. Keywords : None. Calls : GETTOK Common : None. Restrictions: The input parameter must have the proper format. The separate values must not contain the comma character. TDIM_KEYWORD must not be an array. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Jan. 1992. William Thompson, Jan. 1993, renamed to be compatible with DOS limitations. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxbtdim.pro)
FXBTFORM
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBTFORM Purpose : Returns information about FITS binary table columns. Explanation : Procedure to return information about the format of the various columns in a FITS binary table. Use : FXBTFORM,HEADER,TBCOL,IDLTYPE,FORMAT,NUMVAL,MAXVAL Inputs : HEADER = Fits binary table header. Opt. Inputs : None. Outputs : TBCOL = Array of starting column positions in bytes. IDLTYPE = IDL data types of columns. FORMAT = Character code defining the data types of the columns. NUMVAL = Number of elements of the data arrays in the columns. MAXVAL = Maximum number of elements for columns containing variable length arrays, or zero otherwise. Opt. Outputs: None. 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 = '' FXBTFORM, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : FXPAR Common : None. Restrictions: None. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Feb. 1992, from TBINFO by D. Lindler. W. Thompson, Jan. 1993, renamed to be compatible with DOS limitations. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 June 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 4, William Thompson, GSFC, 9 April 1997 Modified so that variable length arrays can be read, even if the maximum array size is not in the header. Version 5 Wayne Landsman, GSFC, August 1997 Recognize double complex array type if since IDL version 4.0 Version 6 Wayne Landsman, GSFC, August 1997 Version for IDL V5.0 Version : Version 6, 30 Aug 1997 Converted to IDL V5.0 W. Landsman September 1997(See fxbtform.pro)
FXBWRITE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXBWRITE Purpose : Write a binary data array to a disk FITS binary table file. Explanation : Each call to FXBWRITE will write to the data file, which should already have been created and opened by FXBCREATE. One needs to call this routine for every column and every row in the binary table. FXBFINISH will then close the file. Use : FXBWRITE, UNIT, DATA, COL, ROW Inputs : UNIT = Logical unit number corresponding to the file containing the binary table. DATA = IDL data array to be written to the file. COL = Column in the binary table to place data in, starting from column one. ROW = Row in the binary table to place data in, starting from row one. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : BIT = Number of bits in bit mask arrays (type "X"). Only used if the column is of variable size. NANVALUE= Value signalling data dropout. All points corresponding to this value are set to be IEEE NaN (not-a-number). Ignored unless DATA is of type float, double-precision or complex. 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 = '' FXBWRITE, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : HOST_TO_IEEE Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: The binary table file must have been opened with FXBCREATE. The data must be consistent with the column definition in the binary table header. The row number must be consistent with the number of rows stored in the binary table header. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Jan 1992, based on WRITEFITS by J. Woffard and W. Landsman. W. Thompson, Feb 1992, modified to support variable length arrays. W. Thompson, Feb 1992, removed all references to temporary files. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 July 1993. Fixed bug with variable length arrays. Version 3, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 4, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 5, Wayne Landsman, GSFC, 12 Aug 1997 Recognize IDL double complex data type Version : Version 5, 12 August 1997 Converted to IDL V5.0 W. Landsman September 1997(See fxbwrite.pro)
FXFINDEND
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXFINDEND Purpose : Find the end of a FITS file. Explanation : This routine finds the end of the last logical record in a FITS file, which may be different from that of the physical end of the file. Each FITS header is read in and parsed, and the file pointer is moved to where the next FITS extension header would be if there is one, or to the end of the file if not. Use : FXFINDEND, UNIT Inputs : UNIT = Logical unit number for the opened file. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : None. Calls : FXHREAD, FXPAR Common : None. Restrictions: The file must have been opened for block I/O. There must not be any FITS "special records" at the end of the file. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Feb. 1992. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxfindend.pro)
FXHCLEAN
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXHCLEAN Purpose : Removes required keywords from FITS header. Explanation : Removes any keywords relevant to array structure from a FITS header, preparatory to recreating it with the proper values. Use : FXHCLEAN, HEADER Inputs : HEADER = FITS header to be cleaned. Opt. Inputs : None. Outputs : HEADER = The cleaned FITS header is returned in place of the input array. Opt. Outputs: None. 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 = '' FXHCLEAN, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : SXDELPAR, FXPAR Common : None. Restrictions: HEADER must be a string array containing a properly formatted FITS header. Side effects: Warning: when cleaning a binary table extension header, not all of the keywords pertaining to columns in the table may be removed. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Jan 1992. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 4, William Thompson, GSFC, 30 December 1994 Added TCUNIn to list of column keywords to be removed. Version : Version 4, 30 December 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxhclean.pro)
FXHMAKE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXHMAKE Purpose : Create a basic FITS header array. Explanation : Creates a basic header array with all the required keywords. This defines a basic structure which can then be added to or modified by other routines. Use : FXHMAKE, HEADER [, DATA ] Inputs : None required. Opt. Inputs : DATA = IDL data array to be written to file in the primary data unit (not in an extension). This is used to determine the values of the BITPIX and NAXIS, etc. keywords. If not passed, then BITPIX is set to eight, NAXIS is set to zero, and no NAXISnnn keywords are included in this preliminary header. Outputs : HEADER = String array containing FITS header. Opt. Outputs: None. Keywords : INITIALIZE = If set, then the header is completely initialized, and any previous entries are lost. EXTEND = If set, then the keyword EXTEND is inserted into the file, with the value of "T" (true). DATE = If set, then the DATE keyword is added to the header. 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 = '' FXHMAKE, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : GET_DATE, FXADDPAR, FXHCLEAN Common : None. Restrictions: Groups are not currently supported. Side effects: BITPIX, NAXIS, etc. are defined such that complex arrays are stored as floating point, with an extra first dimension of two elements (real and imaginary parts). Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Jan 1992, from FXHMAKE by D. Lindler and M. Greason. Differences include: * Use of FITS standard (negative BITPIX) to signal floating point numbers instead of (SDAS/Geis) DATATYPE keyword. * Storage of complex numbers as pairs of real numbers. * Support for EXTEND keyword, and for cases where there is no primary data array. * Insertion of DATE record made optional. Only required FITS keywords are inserted automatically. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 21 June 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 4, Wayne Landsman, GSFC, 12 August 1997 Recognize double complex data type Version : Version 4, 12 Aug 1997 Converted to IDL V5.0 W. Landsman September 1997(See fxhmake.pro)
FXHMODIFY
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXHMODIFY Purpose : Modify a FITS header in a file on disk. Explanation : Opens a FITS file, and adds or modifies a parameter in the FITS header. Can be used for either the main header, or for an extension header. The modification is performed directly on the disk file. Use : FXHMODIFY, FILENAME, NAME, VALUE, COMMENT Inputs : FILENAME = String containing the name of the file to be read. NAME = Name of parameter. If NAME is already in the header the value and possibly comment fields are modified. Otherwise a new record is added to the header. If NAME is equal to either "COMMENT" or "HISTORY" then the value will be added to the record without replacement. In this case the comment parameter is ignored. VALUE = Value for parameter. The value expression must be of the correct type, e.g. integer, floating or string. String values of 'T' or 'F' are considered logical values. Opt. Inputs : COMMENT = String field. The '/' is added by this routine. Added starting in position 31. If not supplied, or set equal to '' (the null string), then any previous comment field in the header for that keyword is retained (when found). Outputs : None. Opt. Outputs: None. Keywords : EXTENSION = Either the number of the FITS extension, starting with the first extension after the primary data unit being one; or a character string containing the value of EXTNAME to search for. If not passed, then the primary FITS header is modified. BEFORE = Keyword string name. The parameter will be placed before the location of this keyword. For example, if BEFORE='HISTORY' then the parameter will be placed before the first history location. This applies only when adding a new keyword; keywords already in the header are kept in the same position. AFTER = Same as BEFORE, but the parameter will be placed after the location of this keyword. This keyword takes precedence over BEFORE. FORMAT = Specifies FORTRAN-like format for parameter, e.g. "F7.3". A scalar string should be used. For complex numbers the format should be defined so that it can be applied separately to the real and imaginary parts. 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 = '' FXHMODIFY, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : FXHREAD, FXPAR, FXADDPAR Common : None. Restrictions: Adding records to a FITS header is not allowed if it would increase the number of 2880 byte records needed to store the header. Modifying existing records is always allowed. This routine can not be used to modify any of the keywords that control the structure of the FITS file, e.g. BITPIX, NAXIS, PCOUNT, etc. Doing so could corrupt the readability of the FITS file. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 3 March 1994. Modified : Version 1, William Thompson, GSFC, 3 March 1994. Version 2, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 3, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxhmodify.pro)
FXHREAD
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXHREAD Purpose : Reads a FITS header from an opened disk file. Explanation : Reads a FITS header from an opened disk file. Use : FXHREAD, UNIT, HEADER [, STATUS ] Inputs : UNIT = Logical unit number. Opt. Inputs : Outputs : HEADER = String array containing the FITS header. Opt. Outputs: STATUS = Condition code giving the status of the read. Normally, this is zero, but is set to !ERR if an error occurs, or if the first byte of the header is zero (ASCII null). Keywords : None. Calls : None. Common : None. Restrictions: The file must already be positioned at the start of the header. It must be a proper FITS file. Side effects: The file ends by being positioned at the end of the FITS header, unless an error occurs. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Feb 1992, from READFITS by J. Woffard and W. Landsman. W. Thompson, Aug 1992, added test for SIMPLE keyword. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxhread.pro)
FXPAR
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXPAR() Purpose : Obtain the value of a parameter in a FITS header. Explanation : The first 8 chacters of each element of HDR are searched for a match to NAME. If the keyword is one of those allowed to take multiple values ("HISTORY", "COMMENT", or " " (blank)), then the value is taken as the next 72 characters. Otherwise, it is assumed that the next character is "=", and the value (and optional comment) is then parsed from the last 71 characters. An error occurs if there is no parameter with the given name. Complex numbers are recognized as two numbers separated by one or more space characters. If a numeric value has no decimal point (or E or D) it is returned as type LONG. If it contains more than 8 numerals, or contains the character 'D', then it is returned as type DOUBLE. Otherwise it is returned as type FLOAT. If an integer is too large to be stored as type LONG, then it is returned as DOUBLE. Use : Result = FXPAR( HDR, NAME [, ABORT ] ) Result = FXPAR(HEADER,'DATE') ;Finds the value of DATE Result = FXPAR(HEADER,'NAXIS*') ;Returns array dimensions as ;vector Inputs : HDR = FITS header string array (e.g. as returned by FXREAD). Each element should have a length of 80 characters NAME = String name of the parameter to return. If NAME is of the form 'keyword*' then an array is returned containing values of keywordN where N is an integer. The value of keywordN will be placed in RESULT(N-1). The data type of RESULT will be the type of the first valid match of keywordN found. Opt. Inputs : ABORT = String specifying that FXPAR should do a RETALL if a parameter is not found. ABORT should contain a string to be printed if the keyword parameter is not found. If not supplied, FXPAR will return with a negative !err if a keyword is not found. Outputs : The returned value of the function is the value(s) associated with the requested keyword in the header array. If the parameter is complex, double precision, floating point, long or string, then the result is of that type. Apostrophes are stripped from strings. If the parameter is logical, 1 is returned for T, and 0 is returned for F. If NAME was of form 'keyword*' then a vector of values are returned. Opt. Outputs: None. Keywords : COUNT = Optional keyword to return a value equal to the number of parameters found by FXPAR. COMMENTS= Array of comments associated with the returned values. Calls : GETTOK, VALID_NUM Common : None. Restrictions: None. Side effects: Keyword COUNT returns the number of parameters found. The system variable !err is set to -1 if parameter not found, 0 for a scalar value returned. If a vector is returned it is set to the number of keyword matches found. If a keyword occurs more than once in a header, a warning is given, and the first occurence is used. However, if the keyword is "HISTORY", "COMMENT", or " " (blank), then multiple values are returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : DMS, May, 1983, Written. D. Lindler Jan 90 added ABORT input parameter J. Isensee Jul,90 added COUNT keyword W. Thompson, Feb. 1992, added support for FITS complex values. W. Thompson, Oct. 1992, rewrote to change strategy for extracting values to allow for non-standard formats and renamed to FXPAR. Added COMMENT keyword. Written : David M. Stern, RSI, May 1983. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 14 October 1994 Modified to use VALID_NUM instead of STRNUMBER. Inserted additional call to VALID_NUM to trap cases where character strings did not contain quotation marks. Version 3, William Thompson, GSFC, 22 December 1994 Fixed bug with blank keywords, following suggestion by Wayne Landsman. Version 4, Mons Morrison, LMSAL, 9-Jan-98 Made non-trailing ' for string tag just be a warning (not a fatal error). It was needed because "sxaddpar" had an error which did not write tags properly for long strings (over 68 characters) Version 5, Wayne Landsman GSFC, 29 May 1998 Fixed potential problem with overflow of LONG values Version : Version 5, 29 May 1998 Converted to IDL V5.0 June 1998(See fxpar.pro)
FXPARPOS
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXPARPOS() Purpose : Finds position to insert record into FITS header. Explanation : Finds the position to insert a record into a FITS header. Called from FXADDPAR. Use : Result = FXPARPOS(KEYWRD, IEND [, BEFORE=BEFORE ] [, AFTER=AFTER ]) Inputs : KEYWRD = Array of eight-character keywords in header. IEND = Position of END keyword. Opt. Inputs : None. Outputs : Result of function is position to insert record. Opt. Outputs: None. Keywords : BEFORE = Keyword string name. The parameter will be placed before the location of this keyword. For example, if BEFORE='HISTORY' then the parameter will be placed before the first history location. This applies only when adding a new keyword; keywords already in the header are kept in the same position. AFTER = Same as BEFORE, but the parameter will be placed after the location of this keyword. This keyword takes precedence over BEFORE. If neither BEFORE or AFTER keywords are passed, then IEND is returned. Calls : None. Common : None. Restrictions: KEYWRD and IEND must be consistent with the relevant FITS header. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, Jan 1992. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993. Converted to IDL V5.0 W. Landsman September 1997(See fxparpos.pro)
FXPOSIT
[Previous Routine] [Next Routine] [List of Routines]NAME: FXPOSIT PURPOSE: Return the unit number of a FITS file positioned at specified extension EXPLANATION: The FITS file will be ready to be read at the beginning of the specified extension. CALLING SEQUENCE: unit=FXPOSIT(FILE, EXT_NO, /READONLY) INPUT PARAMETERS: FILE = FITS file name, scalar string EXT_NO = Extension to be moved to, scalar nonnegative integer RETURNS: Unit number of file or -1 if an error is detected. OPTIONAL KEYWORD PARAMETER: READONLY - If this keyword is set and non-zero, then OPENR rather than OPENU will be used to open the FITS file. COMMON BLOCKS: None. SIDE EFFECTS: Opens and returns the descriptor of a file. PROCEDURE: Each FITS header is read in and parsed, and the file pointer is moved to where the next FITS extension header until the desired extension is reached. PROCEDURE CALLS: FXPAR(), MRD_HREAD, MRD_SKIP MODIFICATION HISTORY: Derived from William Thompson's FXFINDEND routine. Modified by T.McGlynn, 5-October-1994. Modified by T.McGlynn, 25-Feb-1995 to handle compressed files. Pipes cannot be accessed using FXHREAD so MRD_HREAD was written. W. Landsman 23-Apr-1997 Force the /bin/sh shell when uncompressing W. Landsman 26-May-1997 Non-unix is not just VMS Converted to IDL V5.0 W. Landsman September 1997(See fxposit.pro)
FXREAD
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXREAD Purpose : Read basic FITS files. Explanation : Read the primary array from a disk FITS file. Optionally allows the user to read in only a subarray and/or every Nth pixel. Use : FXREAD, FILENAME, DATA [, HEADER [, I1, I2 [, J1, J2 ]] [, STEP]] Inputs : FILENAME = String containing the name of the file to be read. Opt. Inputs : I1,I2 = Data range to read in the first dimension. If passed, then HEADER must also be passed. If not passed, or set to -1,-1, then the entire range is read. J1,J2 = Data range to read in the second dimension. If passed, then HEADER and I1,J2 must also be passed. If not passed, or set to -1,-1, then the entire range is read. STEP = Step size to use in reading the data. If passed, then HEADER must also be passed. Default value is 1. Ignored if less than 1. Outputs : DATA = Data array to be read from the file. Opt. Outputs: HEADER = String array containing the header for the FITS file. Keywords : NANVALUE = Value signalling data dropout. All points corresponding to IEEE NaN (not-a-number) are set to this value. Ignored unless DATA is of type float or double-precision. PROMPT = If set, then the optional parameters are prompted for at the keyboard. AVERAGE = If set, then the array size is reduced by averaging pixels together rather than by subselecting pixels. Ignored unless STEP is nontrivial. Note: this is much slower. YSTEP = If passed, then STEP is the step size in the 1st dimension, and YSTEP is the step size in the 2nd dimension. Otherwise, STEP applies to both directions. NOSCALE = If set, then the output data will not be scaled using the optional BSCALE and BZERO keywords in the FITS header. Default is to scale, if and only if BSCALE and BZERO are present and nontrivial. NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the optional HEADER array will not be changed. The default is to reset these keywords to BSCALE=1, BZERO=0. Ignored if NOSCALE is set. 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 = '' FXREAD, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : GET_DATE, IEEE_TO_HOST, FXADDPAR, FXHREAD, FXPAR, WHERENAN Common : None. Restrictions: Groups are not supported. The optional parameters I1, I2, and STEP only work with one or two-dimensional arrays. J1 and J2 only work with two-dimensional arrays. Use of the AVERAGE keyword is not compatible with arrays with missing pixels. Side effects: If the keywords BSCALE and BZERO are present in the FITS header, and have non-trivial values, then the returned array DATA is formed by the equation DATA = BSCALE*original + BZERO However, this behavior can overridden by using the /NOSCALE keyword. If the data is scaled, then the optional HEADER array is changed so that BSCALE=1 and BZERO=0. This is so that these scaling parameters are not applied to the data a second time by another routine. Also, history records are added storing the original values of these constants. Note that only the returned array is modified--the header in the FITS file itself is untouched. If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO keywords are not changed. It is then the user's responsibility to ensure that these parameters are not reapplied to the data. In particular, these keywords should not be present in any header when writing another FITS file, unless the user wants their values to be applied when the file is read back in. Otherwise, FITS readers will read in the wrong values for the data array. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, May 1992, based in part on READFITS by W. Landsman, and STSUB by M. Greason and K. Venkatakrishna. W. Thompson, Jun 1992, added code to interpret BSCALE and BZERO records, and added NOSCALE and NOUPDATE keywords. W. Thompson, Aug 1992, changed to call FXHREAD, and to add history records for BZERO, BSCALE. Written : William Thompson, GSFC, May 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 17 November 1993. Corrected bug with AVERAGE keyword on non-IEEE compatible machines. Corrected bug with subsampling on VAX machines. Version 3, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 4, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version 5, Zarro (SAC/GSFC), 14 Feb 1997 Added I/O error checking Version : Version 5(See fxread.pro)
FXTAPEREAD
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXTAPEREAD Purpose : Copy FITS files tape to disk with interactive capabilities. Explanation : Copy FITS files from tape onto disk. Data is left in FITS format, and not converted to SDAS. For use on VMS (any version) and UNIX running IDL Version 3.1 or later (see Restrictions). Use : FXTAPEREAD ; Prompt for all parameters. FXTAPEREAD, UNIT, LIST, KEYWORD, TAPENAME, FNAMES [, XWSTR] FXTAPEREAD, 1, INDGEN(5)+1, 'IMAGE' ; Read the first 5 files on unit 1. The filenames are ; taken from the IMAGE keyword. FXTAPEREAD, 1, [2,4], '', '', ['GALAXY', 'STAR'] ; Read files 2 and 4 on unit 1. Create files named ; GALAXY and STAR. FXTAPEREAD, 1, [2,4] ; Read files 2 and 4, and prompt for filenames. Inputs : None necessary. Opt. Inputs : Interactive users will normally just type FXTAPEREAD and be prompted for all parameters. However, the following parameters can be passed directly to FXTAPEREAD: UNIT = Tape unit number (scalar: 0-9). LIST = Vector containing list of file numbers to read. KEYWORD = Scalar string giving a FITS keyword which will be extracted from the headers on tape and used for file names. Set KEYWORD to the null string '', if such a keyword is not to be used. TAPENAME= Scalar string giving a name for the tape. Filenames will be constructed by concatenating TAPENAME with the file number. TAPENAME is used only if KEYWORD is passed as the null string ''. FNAMES = Vector string giving a file name for each file number given in LIST. FNAMES is used only if both KEYWORD = '' and TAPENAME = ''. Spaces are trimmed from names in FNAMES. XWSTR = A string array that contains informational text concerning tape reading events. These strings are printed either to the screen or to the FILENAME widget (internally called XWIDGET) created by the XWINTAPE procedure. Outputs : None. Opt. Outputs: FNAMES = If KEYWORD or TAPENAME is set to a non-null string, then the filename created by FXTPIO_READ is stored in this variable to be returned to the caller. XWSTR = A string array that contains informational text concerning tape reading events. These strings are printed either to the screen or to the FILENAME widget (internally called XWIDGET) created by the XWINTAPE procedure. Note that FXTAPEREAD adds strings to this array and passes them back to the caller. 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 = '' FXTAPEREAD, 1, INDGEN(5)+1, 'IMAGE', $ ERRMSG=ERRMSG IF ERRMSG(0) NE '' THEN ... NOSUFFIX = Normally FXTAPEREAD (via FXTPIO_READ) will automatically append a ".fits" to the end of a passed file name. Setting this keyword prevents that from happening. SFDU = This keyword tells this routine that the first file on the tape is an SFDU header file (defined to be tape file number 1). If this keyword is set, then the first file on the tape is skipped after the initial rewind is preformed. XWIDGET = This keyword tells this routine that an X-window widget (i.e., XWINTAPE) is driving this program. If this is the case, any informational messages generated from this routine will be displayed in the widget instead of the screen. Calls : DATATYPE, FITSTAPE, GETFILES, FXTPIO_READ Common : None. Restrictions: Supported under VMS and (NOW) under UNIX running IDL Versions 3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are included in a user library directory. Side effects: FXTAPEREAD will always rewind the tape before processing. The FITS file is copied over record by record with no conversion, until themarker is reached. No testing is done of the validity of the FITS file. Images are NOT converted using BSCALE and BZERO factors in the header. For each tape file a FITS disk file will be created with the name " .FITS" unless /NOSUFFIX has been set.. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, March 1992, from FITSRD by D. Lindler. William Thompson, May 1992, fixed TPOS bug when reading multiple files. William Thompson, Jan. 1993, changed for renamed FXTPIO_READ. Written : William Thompson, GSFC, March 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, Donald G. Luttermoser, GSFC/ARC, 13 March 1995. Added ERRMSG keyword. Reformatted and modified the documentation. Version 3, Donald G. Luttermoser, GSFC/ARC, 20 March 1995. Added NOSUFFIX & SFDU keyword. Version 4, Donald G. Luttermoser, GSFC/ARC, 9 May 1995. Added the XWIDGET keyword. Version 5, Donald G. Luttermoser, GSFC/ARC, 13 December 1995. Fixed the output text when an SFDU header file has been written to the tape. This SFDU file is now referred to tape file #1 (instead of #0 as previously done) and the first FITS file is tape file #2 (instead of #1). Version : Version 5, 13 December 1995. Converted to IDL V5.0 W. Landsman October 1997 (See fxtaperead.pro)
FXTAPEWRITE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXTAPEWRITE Purpose : Procedure to copy disk FITS files to tape with interactive capabilities. Explanation : Writes the FITS files to tape based upon the parameters inputted or supplied. If no parameters are supplied, then the user is asked a series of questions to walk him or her through copying a number of FITS files from disk to tape. Use : FXTAPEWRITE ; Prompt for all parameters. FXTAPEWRITE, UNIT, BLFAC, FNAMES, KEYWORD [, XWSTR] FXTAPEWRITE, 0, 1, FNAMES ; Writes all FITS files listed in FNAMES to the tape ; associated to UNIT = 0 with 2880 bytes per record. FXTAPEWRITE, 1, 3, 'CDS', 'FILENAME' ; Writes all FITS files beginning with the name 'CDS' ; to the tape associated to UNIT = 1 with 8640 (2880*3) ; bytes per record and includes the keyword 'FILENAME' ; in the FITS header which contains the disk file name ; of the file being written. Inputs : None necessary. Opt. Inputs : Interactive users will normally just type FXTAPEWRITE and be prompted for all parameters. However, the following parameters can be passed directly to FXTAPEWRITE: UNIT = Tape unit number (integer scalar). BLFAC = Blocking factor (1-10) = # of 2880 byte records per block. FNAMES = File names (string array). If in interactive mode, the file names may either be specified individually, or a tapename may be specified, and all files in the form "tapename.FITS" will be written to tape. KEYWORD = Name of a FITS keyword to put file names into. This will simplify subsequent reading of the FITS tape, since individual filenames will not have to be specified. If you don't want to put the file names into the FITS header, then just hit (interactive mode) or do not pass this parameter. XWSTR = A string array that contains informational text concerning the tape I/O. These strings are printed either to the screen or to the FILENAME widget (set internally to XWIDGET) if the XWINTAPE procedure is driving this routine. Outputs : None. Opt. Outputs: XWSTR = A string array that contains informational text concerning the tape I/O. These strings are printed either to the screen or to the FILENAME widget (set internally to XWIDGET) if the XWINTAPE procedure is driving this routine. Note that FXTAPEWRITE will add strings to this array which is then passed back to the caller. Keywords : XWIDGET = This keyword tells this FXTAPEWRITE that the XWINTAPE widget procedure is driving this procedure. If so, then any informational text is printed to the FILENAME widget (internally set to XWIDGET) created by XWINTAPE. SFDU = If set, then an SFDU header file was placed at the beginning of the tape. 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 = '' FXTAPEWRITE, 1, 1, FNAMES, ERRMSG=ERRMSG IF ERRMSG(0) NE '' THEN ... Calls : DATATYPE, FITSTAPE, GETFILES, FXTPIO_WRITE Common : None. Restrictions: Supported under VMS and (NOW) under UNIX running IDL Versions 3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are included in a user library directory. Side effects: Tape is not rewound before files are written. Tape should be positioned with REWIND or SKIPF before calling FXTAPEWRITE. If you want to append new FITS files to a tape, then call TINIT (tape init) to position tape between final double EOF. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, March 1992, from FITSWRT by D. Lindler. William Thompson, May 1992, removed call to TINIT. William Thompson, Jan. 1993, changed for renamed FXTPIO_WRITE. Written : William Thompson, GSFC, March 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, Donald G. Luttermoser, GSFC/ARC, 13 March 1995. Included "passed" input parameters and ERRMSG keyword. Reformatted and modified the documentation. Version 3, Donald G. Luttermoser, GSFC/ARC, 9 May 1995. Added the XWIDGET keyword. Version 4, Donald G. Luttermoser, GSFC/ARC, 13 December 1995. Corrected output text such that if an SFDU file was placed at the beginning of the tape (indicated with the added keyword /SFDU), the first FITS file written to the tape is tape file #2 (not #1 as previously done). Version : Version 4, 13 December 1995. Converted to IDL V5.0 W. Landsman October 1997 (See fxtapewrite.pro)
FXTPIO_READ
[Previous Routine] [Next Routine] [List of Routines]NAME: FXTPIO_READ PURPOSE: Copies FITS files from tape to disk -- internal routine. EXPLANATION : Procedure to copy a FITS file from a tape on the specified tape unit to the disk file.FITS (unless the /NOSUFFIX keyword has been set). For use on VMS (any version) and UNIX running IDL Version 3.1 or later (see Restrictions). The procedure FXTAPEREAD is normally used to read a FITS tape. FXTPIO_READ is a procedure call internal to FXTAPEREAD. CALLING SEQUENCE: FXTPIO_READ, UNIT, NAME, [ KEYWORD, /NOSUFFIX, ERRMSG = ] INPUT PARAMETERS: UNIT = Tape unit number (scalar: 0-9). NAME = File name (without an extension, unless /NOSUFFIX is set). OPTIONAL INPUT PARAMETERS: KEYWORD = If supplied and not equal to the null string then the file name will be taken from the value of the header keyword specified. OUTPUTS: NAME = Name of file if input keyword parameter is supplied. OPTIONAL OUTPUT KEYWORD: 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 = '' FXTPIO_READ, 1, NAME, ERRMSG=ERRMSG IF ERRMSG(0) NE '' THEN ... OPTIONAL INPUT KEYWORD: NOSUFFIX = Normally FXTPIO_READ will automatically append a ".fits" to the end of a passed file name. Setting this keyword prevents this from happening. PROCEDURE CALLS: REMCHAR, FITSTAPE, FXPAR RESTRICTIONS: Supported under VMS and (NOW) under UNIX running IDL Versions 3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are included in a user library directory. SIDE EFFECTS: The FITS file is copied to a disk file called .FITS (unless the /NOSUFFIX keyword has been set). The FITS file is copied over record by record with no conversion, until the end-of-file marker is reached. No testing is done of the validity of the FITS file. Images are NOT converted using BSCALE and BZERO factors in the header. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : William Thompson, March 1992, from FITSREAD by D. Lindler, M. Greason, and W. Landsman. W. Thompson, May 1992, changed open statement to force 2880 byte fixed length records (VMS). The software here does not depend on this file configuration, but other FITS readers might. William Thompson, Jan. 1993, renamed to be compatible with DOS Version 2, Donald G. Luttermoser, GSFC/ARC, 14 March 1995. Added ERRMSG and NOSUFFIX keywords. (See fxtpio_read.pro)
FXTPIO_WRITE
[Previous Routine] [Next Routine] [List of Routines]NAME: FXTPIO_WRITE PURPOSE: Copy FITS files from disk to tape -- internal routine. EXPLANATION: Procedure will copy a disk FITS file to the specified tape unit, at the current tape position. Used for true disk FITS files, not SDAS/Geis files. Called by FXTAPEWRITE. CALLING SEQUENCE: FXTPIO_WRITE, UNIT, FILE, [ KEYWORD, ERRRMSG = ] INPUTS: UNIT = IDL tape unit number (scalar: 0-9). FILE = Disk FITS file name, with extension. OPTIONAL INPUTS: KEYWORD = Keyword to place file name into. If not supplied or equal to the null string '' then the file name is not put into the header before writing it to tape. OUTPUTS: NONE OPTIONAL KEYWORD OUTPUT: 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 = '' FXTPIO_WRITE, 1, FILE, ERRMSG=ERRMSG IF ERRMSG(0) NE '' THEN ... PROCEDURE CALLS: REMCHAR, FXHREAD, FXPAR, FDECOMP, FXADDPAR, FITSTAPE RESTRICTIONS: Supported under VMS and (NOW) under UNIX running IDL Versions 3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are included in a user library directory. REVISION HISTORY: William Thompson, March 1992, from FITSWRITE by D. Lindler, W. Landsman, and M. Greason. William Thompson, Jan. 1993, renamed to be compatible with DOS Version 2, Donald G. Luttermoser, GSFC/ARC, 14 March 1995. Added ERRMSG keyword. Updated documentation concerning UNIX. Version 3, Donald G. Luttermoser, GSFC/ARC, 9 May 1995. Removed the "PRINT, FILE" line from this routine and placed it in FXTAPEWRITE which drives this procedure.(See fxtpio_write.pro)
FXWRITE
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : FXWRITE Purpose : Write a disk FITS file. Explanation : Creates a disk FITS file and writes a FITS primary header, and optionally a primary data array. Use : FXWRITE, FILENAME, HEADER [, DATA ] Inputs : FILENAME = String containing the name of the file to be written. HEADER = String array containing the header for the FITS file. Opt. Inputs : DATA = IDL data array to be written to the file. If not passed, then it is assumed that extensions will be added to the file. Outputs : None. Opt. Outputs: None. Keywords : NANVALUE = Value signalling data dropout. All points corresponding to this value are set to be IEEE NaN (not-a-number). Ignored unless DATA is of type float, double-precision or complex. NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the HEADER array will not be changed. The default is to reset these keywords to BSCALE=1, BZERO=0. 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 = '' FXWRITE, ERRMSG=ERRMSG, ... IF ERRMSG NE '' THEN ... Calls : CHECK_FITS, GET_DATE, HOST_TO_IEEE, FXADDPAR, FXPAR Common : None. Restrictions: If DATA is passed, then HEADER must be consistent with it. If no data array is being written to the file, then HEADER must also be consistent with that. The routine FXHMAKE can be used to create a FITS header. If found, then the optional keywords BSCALE and BZERO in the HEADER array is changed so that BSCALE=1 and BZERO=0. This is so that these scaling parameters are not applied to the data a second time by another routine. Also, history records are added storing the original values of these constants. If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO keywords are not changed. The user should then be aware that FITS readers will apply these numbers to the data, even if the data is already converted to floating point form. Groups are not supported. Side effects: None. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : W. Thompson, Jan 1992, from WRITEFITS by J. Woffard and W. Landsman. Differences include: * Made DATA array optional, and HEADER array mandatory. * Changed order of HEADER and DATA parameters. * No attempt made to fix HEADER array. W. Thompson, May 1992, changed open statement to force 2880 byte fixed length records (VMS). The software here does not depend on this file configuration, but other FITS readers might. W. Thompson, Aug 1992, added code to reset BSCALE and BZERO records, and added the NOUPDATE keyword. Written : William Thompson, GSFC, January 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version 2, William Thompson, GSFC, 31 May 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 3, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997(See fxwrite.pro)
F_FORMAT
[Previous Routine] [Next Routine] [List of Routines]NAME: F_FORMAT PURPOSE: Choose a nice floating format for displaying an array of REAL data. EXPLANATION: Called by TVLIST, IMLIST. CALLING SEQUENCE: fmt = F_FORMAT( minval, maxval, factor, [ length ] ) INPUTS: MINVAL - REAL scalar giving the minimum value of an array of numbers for which one desires a nice format. MAXVAL - REAL scalar giving maximum value in array of numbers OPTIONAL INPUT: LENGTH - length of the output F format (default = 5) must be an integer scalar > 2 OUTPUT: FMT - an F or I format string, e.g. 'F5.1' FACTOR - factor of 10 by which to multiply array of numbers to achieve a pretty display using format FMT. EXAMPLE: Find a nice format to print an array of numbers with a minimum of 5.2e-3 and a maximum of 4.2e-2. IDL> fmt = F_FORMAT( 5.2e-3, 4.2e-2, factor ) yields fmt = '(F5.2)' and factor = .01, i.e. the array can be displayed with a F5.2 format after multiplication by 100. REVISION HISTORY: Written W. Landsman December 1988 Deal with factors < 1. August 1991 Deal with factors < 1. *and* a large range October 1992 Now returns In format rather than Fn.0 February, 1994 Converted to IDL V5.0 W. Landsman September 1997(See f_format.pro)
GAL_FLAT
[Previous Routine] [Next Routine] [List of Routines]NAME: GAL_FLAT PURPOSE: Transforms the image of a galaxy so that the galaxy appears face-on EXPLANATION: Either a nearest-neighbor approximations or a bilinear interpolation may be used. CALLING SEQUENCE: RESULT = GAL_FLAT( image, ang, inc, [, cen, /INTERP ] ) INPUTS: IMAGE - Image to be transformed ANG - Angle of major axis, counterclockwise from Y-axis, degrees For an image in standard orientation (North up, East left) this is the Position Angle INC - Angle of inclination of galaxy, degrees OPTIONAL INPUTS: CEN - Two element vector giving the X and Y position of galaxy center If not supplied, then the galaxy center is assumed to coincide with the image center INPUT KEYWORDS: INTERP - If present, and non-zero, then bilinear interpolation will be performed. Otherwise a nearest neighbor approximation is used. OUTPUTS: RESULT - the transformed image, same dimensions and type as IMAGE METHOD: A set of 4 equal spaced control points are corrected for inclination using the procedure POLYWARP. These control points are used by POLY_2D to correct the whole image. REVISION HISTORY: Written by R. S. Hill, SASC Technologies Inc., 4 December 1985 Code cleaned up a bit W. Landsman December 1992 Converted to IDL V5.0 W. Landsman September 1997(See gal_flat.pro)
GAUSSIAN
[Previous Routine] [Next Routine] [List of Routines]NAME: GAUSSIAN PURPOSE: Compute the 1-d Gaussian function and optionally the derivative EXPLANATION: Compute the 1-D Gaussian function and optionally the derivative at an array of points. CALLING SEQUENCE: y = gaussian( xi, parms,[ pderiv ]) INPUTS: xi = array, independent variable of Gaussian function. parms = parameters of Gaussian, 2 or 3 element array: parms(0) = maximum value (factor) of Gaussian, parms(1) = mean value (center) of Gaussian, parms(2) = standard deviation (sigma) of Gaussian. (if parms has only 2 elements then sigma taken from common). OPTIONAL OUTPUT: pderiv = optional output of partial derivatives, computed only if parameter is present in call. pderiv(*,i) = partial derivative at all xi absisca values with respect to parms(i), i=0,1,2. Function returns array of Gaussian evaluated at xi. EXAMPLE: Evaulate a Gaussian centered at x=0, with sigma=1, and a peak value of 10 at the points 0.5 and 1.5. Also compute the derivative IDL> f = gaussian( [0.5,1.5], [10,0,1], DERIV ) ==> f= [8.825,3.25]. DERIV will be a 2 x 3 array containing the numerical derivative at the two points with respect to the 3 parameters. COMMON BLOCKS: common gaussian, sigma HISTORY: Written, Frank Varosi NASA/GSFC 1992. Converted to IDL V5.0 W. Landsman September 1997(See gaussian.pro)
GCIRC
[Previous Routine] [Next Routine] [List of Routines]NAME: GCIRC PURPOSE: Computes rigorous great circle arc distances. All computations are double precision. CALLING SEQUENCE: GCIRC, U, RA1, DC1, RA2, DC2, DIS INPUTS: U -- Describes units of inputs and output: 0: everything radians 1: RAx in decimal hours, DCx in decimal degrees, DIS in arc seconds RA1 -- Right ascension of point 1 DC1 -- Declination of point 1 RA2 -- Right ascension of point 2 DC2 -- Declination of point 2 OUTPUTS: DIS -- Angular distance on the sky between points 1 and 2 See U above for units; double scalar PROCEDURE: "Cosine formula" (p. 7 of Smart's Spherical Astronomy or p. 12 of Green's Spherical Astronomy) NOTES: (1) Either RA1,DC1 or RA2,DC2 (but not both coordinates) can be vectors. In this case DIS is a vector giving the angular distance between each of the vector coordinates to the scalar coordinate. (2) Coordinates closer together than a few milliarcsec cannot be distinguished. If you are in this realm, you should be using special-purpose algorithms. PROCEDURE CALLS: ISARRAY() MODIFICATION HISTORY: Written in Fortran by R. Hill -- SASC Technologies -- January 3, 1986 Translated from FORTRAN to IDL, RSH, STX, 2/6/87 Vector arguments allowed W. Landsman April 1989 Prints result if last argument not given. RSH, RSTX, 3 Apr. 1998 Converted to IDL V5.0 April 1998(See gcirc.pro)
GETFILES
[Previous Routine] [Next Routine] [List of Routines]NAME: GETFILES PURPOSE: Prompt the user to interactively specify a list of files EXPLANATION: User can specify a single file per line or a range of files separated by a dash or comma. Used, for example, by FITSRD to return a list of file numbers on tape to read CALLING SEQUENCE: getfiles, list OUTPUT: LIST - integer array containing file numbers SIDE EFFFECTS: User will be prompted to enter a list of file numbers REVISION HISTORY Written D. Lindler November, 1985 Converted to Version 2 IDL, August 1990 Converted to IDL V5.0 W. Landsman September 1997(See getfiles.pro)
GETLOG
[Previous Routine] [Next Routine] [List of Routines]NAME: GETLOG PURPOSE: Formats a logical directory for the given operating system. CALLING SEQUENCE: result = GETLOG(lname) INPUTS: lname - the base name of the logical (without special characters). OUTPUTS: Returns appropriate string. Under VMS the logical is not translated since it may correspond to multiple directories. RESTRICTIONS: Assumes that the directory logical will have meaning to the host operating system. PROCEDURE: The operating system in !version.os_family is checked. If it equals: 'vms' then a ':' is appended. 'windows' directory name is translated with GETENV() and a '\' is appended 'unix' directory name is translated with GETENV() and a '/' is appended 'MacOS' directory name is translated with GETENV() EXAMPLE: Open the file 'stars.dbh' in the logical directory ZDBASE in an operating system independent way: IDL> openr,1,getlog('ZDBASE') + 'stars.dbh' MODIFICATION HISTORY: Written, JDNeill, May, 1990. Modified, JDNeill,Sep, 1990 -- for unix return full path instead of just environment variable name. Modified, I. Freedman, HSTX April 1994 -- for MacOS return full path Bug in CASE statement fixed. JDO, HSTX, May 2 1994. Added Windows compatibility W. Landsman September 1995 Converted to IDL V5.0 W. Landsman September 1997(See getlog.pro)
GETOPT
[Previous Routine] [Next Routine] [List of Routines]NAME: GETOPT PURPOSE: Convert a string supplied by the user into a valid scalar or vector EXPLANATION: Distinct elements in the string may be separated by either a comma or a space. The output scalar or vector can be specified to be either integer or floating point. A null string is converted to a zero. !ERR is set to the number of elements supplied. CALLING SEQUENCE: option = GETOPT( input, [ type, numopt ]) INPUTS: input - string that was input by user in response to a prompt Arithmetic operations can be included in the string (see examples) OPTIONAL INPUTS: type - Either an "I" (integer) or an "F" (floating point) specifying the datatype of the output vector. Default is floating point numopt - number of values expected by calling procedure If less than NUMOPT values are supplied the output vector will be padded with zeros. OUTPUTS: option - scalar or vector containing the numeric conversion of the fields in the string INPUT. If NUMOPT is not supplied, the number of elements in OPTION will equal the number of distinct fields in INPUT. NOTES: (1) If an input is invalid, !ERR is set to -1 and the result is set to 999. (2) GETOPT uses the execute function to interpret the user string. Therefore GETOPT itself cannot be called with the EXECUTE function. (3) GETOPT has a hard limit of 10 tokens in the input string. EXAMPLES: (1) a = getopt( '3.4,5*4 ', 'I' ) yields a = [ 3, 20] (2) a = getopt( '5/2.', 'F', 5) yields a = [2.5,0.,0.,0.,0.] (3) a = getopt( '2*3,5,6') yields a = [6.,5.,6.] REVISON HISTORY: written by B. Pfarr, STX, 5/6/87 change value of !ERR W. Landsman STX, 6/30/88 Converted to IDL V5.0 W. Landsman September 1997(See getopt.pro)
GETPRO
[Previous Routine] [Next Routine] [List of Routines]NAME: GETPRO PURPOSE: Search !PATH for a procedure, and copy into user's working directory EXPLANATION: Extract a procedure from an IDL Library or directory given in the !PATH system variable and place it in the current default directory (presumably to be edited by the user). GETPRO can also be used to obtain a copy of the default startup file. CALLING SEQUENCE: GETPRO, [ proc_name ] ;Find PROC_NAME in !PATH and copy OPTIONAL INPUT: proc_name - Character string giving the name of the IDL procedure or function. Do not give an extension. If omitted, the program will prompt for PROC_NAME. OUTPUTS: None. SIDE EFFECTS: A file with the extension .PRO and a name given by PROC_NAME will be created on the user's directory. PROCEDURE: The system variable !PATH is parsed into individual libraries or directories. Each library or directory is then searched for the procedure name. When found, a SPAWN is used to extract or copy the procedure into the user's directory. If not found in !PATH, then the ROUTINE_NAMES() function is used to determine if it is an intrinsic IDL procedure. EXAMPLE: Put a copy of the USER library procedure CURVEFIT on the current directory IDL> getpro, 'CURVEFIT' RESTRICTIONS: User will be unable to obain source code for a native IDL function or procedure, or for a FORTRAN or C routine added with CALL_EXTERNAL. User must have write privilege to the current directory This procedure is not used with Macintosh IDL. PROCEDURE CALLS: FDECOMP REVISION HISTORY: Written W. Landsman, STX Corp. June 1990 Converted to SUN IDL. M. Greason, STX, August 1990. Revised to work on both UNIX and VMS, N. Collins,STX,Nov.1990 Now uses intrinsic EXPAND_PATH() command W. Landsman November 1994 Use ROUTINE_NAMES() to check for intrinsic procs W. Landsman July 95 Update for Windows/IDL W. Landsman September 95 Check if procedure is in current directory W. Landsman June 1997 Converted to IDL V5.0 W. Landsman September 1997(See getpro.pro)
GETPSF
[Previous Routine] [Next Routine] [List of Routines]NAME: GETPSF PURPOSE: To generate a point-spread function (PSF) from observed stars. EXPLANATION: The PSF is represented as a 2-dimensional Gaussian (integrated over each pixel) and a lookup table of residuals. The lookup table and Gaussian parameters are output in a FITS image file. The PSF FITS file created by GETPSF can be read with the procedure RDPSF. Adapted from the 1986 STSDAS version of DAOPHOT CALLING SEQUENCE: GETPSF, image, xc, yc, apmag, sky, [ronois, phpadu, gauss, psf, idpsf, psfrad, fitrad, psfname, /DEBUG ] INPUTS: IMAGE - input image array XC - input vector of x coordinates (from FIND), these should be IDL (first pixel is (0,0)) convention. YC - input vector of y coordinates (from FIND) APMAG - vector of magnitudes (from APER), used for initial estimate of gaussian intensity. If APMAG is multidimensional, (more than 1 aperture was used in APER) then the first aperture is used. SKY - vector of sky values (from APER) OPTIONAL INPUTS: The user will be prompted for the following parameters if not supplied. RONOIS - readout noise per pixel, (in electrons, or equivalent photons) PHPADU - photons per analog digital unit, used to scale the data numbers in IMAGE into photon units IDPSF - subscripts of the list of stars created by APER which will be used to define the PSF. Stars whose centroid does not fall within PSFRAD of the edge of the frame, or for which a Gaussian fit requires more than 25 iterations, will be ignored when creating the final PSF. PSFRAD - the scalar radius, in pixels, of the circular area within which the PSF will be defined. This should be slightly larger than the radius of the brightest star that one will be interested in. FITRAD - the scalar radius, in pixels of the circular area used in the least-square star fits. Stetson suggest that FITRAD should approximately equal to the FWHM, slightly less for crowded fields. (FITRAD must be smaller than PSFRAD.) PSFNAME- Name of the FITS file that will contain the table of residuals, and the best-fit Gaussian parameters. This file is subsequently required for use by NSTAR. OPTIONAL OUTPUTS: GAUSS - 5 element vector giving parameters of gaussian fit to the first PSF star GAUSS(0) - height of the gaussian (above sky) GAUSS(1) - the offset (in pixels) of the best fitting gaussian and the original X centroid GAUSS(2) - similiar offset from the Y centroid GAUSS(3) - Gaussian sigma in X GAUSS(4) - Gaussian sigma in Y PSF - 2-d array of PSF residuals after a Gaussian fit. PROCEDURE: GETPSF fits a Gaussian profile to the core of the first PSF star and generates a look-up table of the residuals of the actual image data from the Gaussian fit. If desired, it will then fit this PSF to another star (using PKFIT) to determine its precise centroid, scale the same Gaussian to the new star's core, and add the differences between the actual data and the scaled Gaussian to the table of residuals. (In other words, the Gaussian fit is performed only on the first star.) OPTIONAL KEYWORD INPUT: DEBUG - if this keyword is set and non-zero, then the result of each fitting iteration will be displayed. PROCEDURES CALLED DAOERF, MAKE_2D, MKHDR, RINTER(), PKFIT, STRNUMBER(), STRN(), WRITEFITS REVISON HISTORY: Adapted from the 1986 version of DAOPHOT in STSDAS IDL Version 2 W Landsman November 1988 Use DEBUG keyword instead of !DEBUG W. Landsman May 1996 Converted to IDL V5.0 W. Landsman September 1997(See getpsf.pro)
GETROT
[Previous Routine] [Next Routine] [List of Routines]NAME: GETROT PURPOSE: Return the rotation and plate scale of an image from its FITS header EXPLANATION: Derive the counterclockwise rotation angle, and the X and Y scale factors of an image, from a FITS image header. Input parameter may be either a FITS image header or an astrometry structure (as obtained by EXTAST.PRO) CALLING SEQUENCE: GETROT, Hdr, [ Rot, CDelt, /DEBUG ] or GETROT, Astr, Rot, CDelt, /DEBUG ] INPUT PARAMETERS: HDR - FITS Image header (string array). Program will extract the astrometry structure or ASTR - ASTROMETRY structure, of the type returned by BUILDAST or EXTAST. See BUILDAST.PRO or EXTAST.PRO for details. OPTIONAL OUTPUT PARAMETERS: ROT - Scalar giving the counterclockwise rotation of NORTH in DEGREES from the +Y axis of the image. CDELT- 2 element vector giving the scale factors in DEGREES/PIXEL in the X and Y directions. Values correspond to the FITS parameters CDELT1 and CDELT2 If no output variables are supplied (or /DEBUG is set), then GETROT will display the rotation and plate scale at the terminal. OPTIONAL INPUT KEYWORD DEBUG - if DEBUG is set, GETROT will print the rotation for both the X and Y axis when these values are unequal. If DEBUG is set to 2, then the output parameter ROT will contain both X and Y rotations. PROCEDURE: If the FITS header already contains CDELT (and CD or CROTA) keyword, (as suggested by the proposed Greisen & Calabretta FITS standard) then this is used for the scale factor. If the header contains CD keywords but no CDELT keywords (as in IRAF headers) then the scale factor is derived from the CD matrix. REVISION HISTORY: Written W. Landsman STX January 1987 Convert to IDL V2. M. Greason, STX, May 1990 Option to return both rotations added. J. D. Offenberg, STX, Aug 1991 Use new astrometry structure W. Landsman Mar 1994 Recognize a GSSS header W. Landsman June 1994 Converted to IDL V5.0 W. Landsman September 1997(See getrot.pro)
GETTOK
[Previous Routine] [Next Routine] [List of Routines]NAME: GETTOK PURPOSE: Retrieve the first part of the string up to a specified character EXPLANATION: GET TOKen - Retrieve first part of string until the character char is encountered. CALLING SEQUENCE: token = gettok( st, char ) INPUT: char - character separating tokens, scalar string INPUT-OUTPUT: st - (scalar) string to get token from (on output token is removed) OUTPUT: token - scalar string value is returned EXAMPLE: If ST is 'abc=999' then gettok(ST,'=') would return 'abc' and ST would be left as '999' HISTORY version 1 by D. Lindler APR,86 Remove leading blanks W. Landsman (from JKF) Aug. 1991 Converted to IDL V5.0 W. Landsman September 1997(See gettok.pro)
GETWRD
[Previous Routine] [Next Routine] [List of Routines]NAME: GETWRD PURPOSE: Return the n'th word from a text string. CATEGORY: CALLING SEQUENCE: wrd = getwrd(txt, n, [m]) INPUTS: txt = text string to extract from. in n = word number to get (first = 0 = def). in m = optional last word number to get. in KEYWORD PARAMETERS: Keywords: LOCATION = l. Return word n string location. DELIMITER = d. Set word delimiter (def = space & tab). /LAST means n is offset from last word. So n=0 gives last word, n=-1 gives next to last, ... If n=-2 and m=0 then last 3 words are returned. /NOTRIM suppresses whitespace trimming on ends. NWORDS=n. Returns number of words in string. OUTPUTS: wrd = returned word or words. out COMMON BLOCKS: getwrd_com NOTES: Note: If a NULL string is given (txt="") then the last string given is used. This saves finding the words again. If m > n wrd will be a string of words from word n to word m. If no m is given wrd will be a single word. n<0 returns text starting at word abs(n) to string end If n is out of range then a null string is returned. See also nwrds. MODIFICATION HISTORY: Ray Sterner, 6 Jan, 1985. R. Sterner, Fall 1989 --- converted to SUN. R. Sterner, Jan 1990 --- added delimiter. R. Sterner, 18 Mar, 1990 --- added /LAST. R. Sterner, 31 Jan, 1991 --- added /NOTRIM. R. Sterner, 20 May, 1991 --- Added common and NULL string. R. Sterner, 13 Dec, 1992 --- Made tabs equivalent to spaces. R. Sterner, 4 Jan, 1993 --- Added NWORDS keyword. Johns Hopkins University Applied Physics Laboratory. Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt. Converted to IDL V5.0 W. Landsman September 1997(See getwrd.pro)
GET_COORDS
[Previous Routine] [Next Routine] [List of Routines]NAME: GET_COORDS PURPOSE: Converts a string with angular coordinates to floating point values. EXPLANATION: Although called by ASTRO.PRO, this is a general purpose routine. The user may input as floating point or sexigesimal. If user inputs calling procedure's job to convert hours to degrees if needed. Since the input string is parsed character-by-character, ANY character that is not a digit, minus sign or decimal point may be used as a delimiter, i.e. acceptable examples of user input are: 1:03:55 -10:15:31 1 3 55.0 -10 15 31 1*3 55 -10abcd15efghij31 1.065278 hello -10.25861 CALLING SEQUENCE: GET_COORDS, Coords, [ PromptString, NumVals, INSTRING =, /QUIET ] OPTIONAL INPUT: PromptString - A string to inform the user what data are to be entered InString - a keyword that, if set, is assumed to already contain the input data string to be parsed. If this keyword is set, then the user is not prompted for any input. Quiet - if set the program won't printout any error messages, but bad input is still flagged by Coords=[-999,-999]. OUTPUT: Coords - a 2 element floating array containing the coordinates. The vector [-999,-999] is returned if there has been an error. OPTIONAL OUTPUT: NumVals - the number of separate values entered by the user: 2 if the user entered the coordinates as floating point numbers, 6 if the user entered the coordinates as sexigesimal numbers. Some calling procedures might find this information useful (e.g., to to print some output in the same format as the user's input). REVISION HISTORY Written by Joel Parker, 5 MAR 90 Included InString and Quiet keywords. Cleaned up some of the code and comments. JWmP, 16 Jun 94 ******************************************************************************* Converted to IDL V5.0 W. Landsman September 1997(See get_coords.pro)
GET_DATE
[Previous Routine] [Next Routine] [List of Routines]NAME: GET_DATE PURPOSE: Return the current UTC date in CCYY-MM-DD format for FITS headers EXPLANATION: This is the format required by the DATE and DATE-OBS keywords in a FITS header. CALLING SEQUENCE: GET_DATE, dte, [/OLD, /TIMETAG, LOCAL_DIFF=] INPUTS: None OUTPUTS: dte = A scalar character string giving the current date. Actual appearance of dte depends on which keywords are supplied. No Keywords supplied - dte is a 10 character string with the format CCYY-MM-DD whererepresents a calendar year, the ordinal number of a calendar month within the calendar year, and the ordinal number of a day within the calendar month. /TIMETAG set - dte is a 19 character string with the format CCYY-MM-DDThh:mm:ss where represents the hour in the day, the minutes, the seconds, and the literal 'T' the ISO 8601 time designator /OLD set - dte is an 8 character string in DD/MM/YY format INPUT KEYWORDS: /TIMETAG - Specify the time to the nearest second in the DATE format /OLD - Return the DATE format formerly (pre-1997) recommended for FITS Note that this format is now deprecated because it uses only a 2 digit representation of the year. LOCAL_DIFF - numeric scalar giving the difference between local time and Greenwich Mean Time (GMT) in hours. Unix users should not use this keyword because under Unix, SYSTIME(1) returns the GMT, and GET_DATE can figure out the time difference for itself. Users on other machines must either supply a LOCAL_DIFF keyword, or use the TIME_CONV environment variable discussed below. For example, a user on U.S. Eastern Standard Time should set LOCAL_DIFF = -5 EXAMPLE: Add the current date to the DATE keyword in a FITS header,h IDL> GET_DATE,dte IDL> sxaddpar, h, 'DATE', dte, 'Date header was created' ENVIRONMENT VARIABLE: An alternate method of inputing the difference between local and GMT time for non-Unix machines is to specify this information in a file named local_diff.dat in a directory specified with the environment variable TIME_CONV. For example, a user in EST should write -5 on this first (and only) line of this file. NOTES: (1) A discussion of the DATExxx syntax in FITS headers can be found in ftp://fits.cv.nrao.edu/fits/data/samples/year-2000/year2000.txt (2) Those who wish to use need further flexibility in their date formats (e.g. to use TAI time) should look at Bill Thompson's time routines in ftp://idlastro.gsfc.nasa.gov/pub/contrib/thompson/time REVISION HISTORY: Written W. Landsman March 1991 Major rewrite to write new DATExxx syntax W. Landsman August 1997 Converted to IDL V5.0 W. Landsman September 1997 (See get_date.pro)
GET_EQUINOX
[Previous Routine] [Next Routine] [List of Routines]NAME: GET_EQUINOX PURPOSE: Return the equinox value from a FITS header. EXPLANATION: Checks for 3 possibilities (1) If the EQUINOX keyword is found and has a numeric value, then this value is returned (2) If the EQUINOX keyword has the values 'J2000' or 'B1950', then either 2000. or 1950. is returned. (3) If the EQUINOX keyword is not found, then GET_EQUINOX will return the EPOCH keyword value. This usage of EPOCH is disparaged. CALLING SEQUENCE: Year = GET_EQUINOX( Hdr, [ Code ] ) INPUTS: Hdr - FITS Header, string array, will be searched for the EQUINOX (or EPOCH) keyword. OUTPUT: Year - Year of equinox in FITS header, numeric scalar OPTIONAL OUTPUT: Code - Result of header search, scalar -1 - EQUINOX or EPOCH keyword not found in header 0 - EQUINOX found as a numeric value 1 - EPOCH keyword used for equinox (not recommended) 2 - EQUINOX found as 'B1950' 3 - EQUINOX found as 'J2000' PROCEDURES USED: ZPARCHECK, SXPAR() REVISION HISTORY: Written W. Landsman STX March, 1991 Converted to IDL V5.0 W. Landsman September 1997(See get_equinox.pro)
GET_JULDATE
[Previous Routine] [Next Routine] [List of Routines]NAME: GET_JULDATE PURPOSE: Return the current Julian Date CALLING SEQUENCE: GET_JULDATE,jd INPUTS: None OUTPUTS: jd = Current Julian Date, double precision scalar EXAMPLE: Return the current hour, day, month and year as integers IDL> GET_JULDATE, JD ;Get current Julian date IDL> DAYCNV, JD, YR, MON, DAY, HOURS ;Convert to hour,day month & year METHOD: The systime(1) function is used to obtain the number of days after 1-JAN-1970. The offset to Julian days is then computed. WARNING! This procedure assumes that systime(1) returns the value of Universal Time (UT). This appears to be true for most Unix workstations and DOS machines, but not for VMS or Macintoshes, for which systime(1) returns the local time. Users may need to add the difference between UT and local time to the value of JD, depending on the particular installation. REVISION HISTORY: Written Wayne Landsman March, 1991 Converted to IDL V5.0 W. Landsman September 1997(See get_juldate.pro)
GLACTC
[Previous Routine] [Next Routine] [List of Routines]NAME: GLACTC PURPOSE: Convert between celestial and Galactic coordinates. EXPLANATION: Program to convert right ascension (ra) and declination (dec) to Galactic longitude (gl) and latitude (gb) (j=1) or vice versa (j=2). CALLING SEQUENCE: glactc, ra, dec, year, gl, gb, j INPUTS: year equinox of ra and dec, scalar (input) j direction of conversion (input) 1: ra,dec --> gl,gb 2: gl,gb --> ra,dec INPUTS OR OUTPUTS ( depending on argument J ) ra right ascension, hours, scalar or vector dec declination, degrees,scalar or vector gl galactic longitude (system II), degrees, scalar or vector gb galactic latitude (system II), degrees, scalar or vector All results forced double precision floating. COMMON BLOCKS: gal See Side Effects. SIDE EFFECTS: Year and galaxy orientation saved in common to make repeated computations more efficient. EXAMPLES: Find the galactic coordinates of Altair (RA (2000): 19,50,47 Dec (2000): 08 52 06) IDL> glactc, ten(19,50,47),ten(8,52,6),2000,gl,gb,1 ==> gl = 47.74, gb = -8.91 HISTORY: FORTRAN subroutine by T. A. Nagy, 21-MAR-78. Conversion to IDL, R. S. Hill, STX, 19-OCT-87. Modified to handle vector input, E. P. Smith, GSFC, 14-OCT-94 Converted to IDL V5.0 W. Landsman September 1997(See glactc.pro)
GROUP
[Previous Routine] [Next Routine] [List of Routines]NAME: GROUP PURPOSE: Assign stars with non-overlapping PSF profiles into distinct groups EXPLANATION: Part of the IDL-DAOPHOT sequence CALLING SEQUENCE: GROUP, X, Y, RCRIT, NGROUP INPUTS: X - vector, giving X coordinates of a set of stars. Y - vector, giving Y coordinates of a set of stars. RCRIT - scalar, giving minimum distance between stars of two distinct groups. Stars less than this distance from each other are always in the same group. Stetson suggests setting the critical distance equal to the PSF radius + the Fitting radius. OUTPUTS: NGROUP - integer vector, same number of elements as X and Y, giving a group number for each star position. Group numbering begins with 0. METHOD: Each position is initially given a unique group number. The distance of each star is computed against every other star. Those distances less than RCRIT are assigned the minimum group number of the set. A check is then made to see if any groups have merged together. PROCEDURES USED: REM_DUP() REVISION HISTORY: Written W. Landsman STX April, 1988 Major revision to properly merge groups together W. Landsman Sep 1991 Work for more than 32767 points W. Landsman March 1997 Converted to IDL V5.0 W. Landsman September 1997(See group.pro)
GSSSADXY
[Previous Routine] [Next Routine] [List of Routines]NAME: GSSSADXY PURPOSE: Converts RA and DEC (J2000) to (X,Y) for an STScI GuideStar image. EXPLANATION: The sky coordinates may be printed and/or returned in variables. CALLING SEQEUNCE: GSSSADXY, GSA, Ra,Dec, [ X, Y, /Print ] INPUT: GSA - the GSSS Astrometry structure created by GSSSEXTAST RA - the RA coordinate(s) in *degrees*, scalar or vector DEC - the DEC coordinate(s) in *degrees*, scalar or vector OPTIONAL KEYWORD INPUT: PRINT - If this keyword is set and non-zero, then coordinates will be displayed at the terminal OUTPUT: X - the corresponding X pixel coordinate(s), double precision Y - the corresponding Y pixel coordinate(s), double precision EXAMPLE: Given a FITS header, hdr, from the STScI Guidestar Survey, determine the X,Y coordinates of 3C 273 (RA = 12 29 6.7 +02 03 08) IDL> GSSSEXTAST, hdr, gsa ;Extract astrometry structure IDL> GSSSADXY, gsa, ten(12,29,6.7)*15,ten(2,3,8),/print NOTES: For most purpose users can simply use ADXY, which will call GSSSADXY if it is passed a GSS header. PROCEDURES CALLED: ASTDISP - Print RA, Dec in standard format HISTORY: 10-JUL-90 Version 1 written by Eric W. Deutsch Derived from procedures written by Brian McLean Vectorized code W. Landsman March, 1991 14-AUG-91 Fixed error which caused returned X and Y to be .5 pixels too large. Now X,Y follows same protocol as ADXY. June 1994 - Dropped PRFLAG parameter, added /PRINT W. Landsman (HSTX) Converted to IDL V5.0 W. Landsman September 1997(See gsssadxy.pro)
GSSSEXTAST
[Previous Routine] [Next Routine] [List of Routines]NAME: GSSSEXTAST DESCRIPTION: This procedure extracts the astrometry information from a ST Guide Star Survey FITS header and places it in an IDL structure for subsequent use with GSSSxyad and GSSSadxy. CALLING SEQUENCE: GSSSExtast, hdr, astr, noparams INPUT: h - the GSSS FITS header OUTPUT: astr - Structure containing the GSSS Astrometry information .CTYPE = ['RA---GSS','DEC--GSS'] .CRVAL = plate center Ra, Dec (from PLTRAH, PLTRAM etc.) .XLL,.YLL = offsets lower lefthand corner .AMDX, .AMDY = 12 transformation coefficients .XSZ,.YSZ = X and Y pixel size in microns .PLTSCL = plate scale in arc sec/mm .PPO3, .PPO6 - orientation coefficients NOTES: Most users should use EXTAST rather than this procedure. EXTAST will call GSSSEXTAST if supplied with GSSS FITS header. PROCEDURES CALLED: SXPAR() - Extract parameter values from a FITS header HISTORY: 01-JUL-90 Version 1 written by Eric W. Deutsch Code derived from Software by Brian McLean 20-AUG-91 Modified to Double Precision Variables. E. Deutsch June 94 Change astrometry tags to better agree with EXTAST W. Landsman Converted to IDL V5.0 W. Landsman September 1997(See gsssextast.pro)
GSSSXYAD
[Previous Routine] [Next Routine] [List of Routines]NAME: GSSSXYAD PURPOSE: Convert (X,Y) coordinates in a STScI Guide Star image to RA and Dec EXPLANATION: The sky coordinates may be printed and/or returned in variables. CALLING SEQUENCE: GSSSxyad, gsa, x, y, ra, dec, [ /PRINT ] INPUT: GSA - The GSSS Astrometry structure extract from the FITS header by GSSSEXTAST X - The X pixel coordinate(s) of the image, scalar or vector Y - The Y pixel coordinate(s) of the image, scalar or vector OUTPUT: RA - The RA coordinate of the given pixel(s) in *degrees* DEC - The DEC coordinate of the given pixel(s) in *degrees* Both RA and Dec will be returned as double precision OPTIONAL KEYWORD INPUT: PRINT - If this keyword is set and non-zero, then coordinates will be displayed at the terminal EXAMPLE: Given a FITS header,hdr, from a GSSS image, print the astronomical coordinates of (X,Y) = (200.23, 100.16) at the terminal IDL> GSSSExtast, hdr, gsa ;Extract astrometry structure IDL> GSSSxyad, gsa, 200.23, 100.16, /print NOTES: For most purpose users can simply use XYAD, which will call GSSSXYAD if it is passed a GSSS header. PROCEDURES CALLED: ASTDISP - print RA, Dec in a standard format HISTORY: 01-JUL-90 Version 1 written by Eric W. Deutsch Vectorized Code W. Landsman March, 1991 14-AUG-91 Fixed error which caused returned RA and DEC to be off by -.5 pixels in both X,Y. Now X,Y follows same protocol as ADXY. 20-AUG-91 Modified to use AstDisp procedure. June 94 Added /PRINT keyword instead of PRFLAG W. Landsman June 94 Converted to IDL V5.0 W. Landsman September 1997(See gsssxyad.pro)
GSSS_STDAST
[Previous Routine] [Next Routine] [List of Routines]NAME: GSSS_STDAST DESCRIPTION: This procedure takes a header with GSSS (ST Guide Star Survey) astrometry and writes a roughly equivalent tangent projection astrometry into the header. CALLING SEQUENCE: GSSS_STDAST, H INPUT - OUTPUT: H - FITS header (string array) containing GSSS astrometry. GSSS_STDAST will write the roughly equivalent tangent projection astrometry solution into H. METHOD: The procedures GSSSXYAD is used to exactly determine the RA and Dec at 3 reference points. STARAST is then used to find the tangent projection astrometry that best matches these reference points. NOTES: Some early GSSS images (before the 1994 CD-Rom) used keywords CRPIXx rather than CNPIXx. The GSSS astrometry in these images could be corrupted by this procedure as the CRPIXx values will be altered. The tangent is only a approximation of the nonlinear GSSS astrometry, but is generally accurate to about 0.1 pixels on a 1024 x 1024 image. PROCEDURES USED: GSSSEXTAST, GSSSXYAD, STARAST, PUTAST, SXADDHIST, SXDELPAR HISTORY: 13-AUG-91 Version 2 written from MAKEASTGSSS Eric Deutsch (STScI) Delete CDELT* keywords from header W. Landsman May 1994 Remove call to BUILDAST W. Landsman Jan, 1995 Converted to IDL V5.0 W. Landsman September 1997(See gsss_stdast.pro)
HASTROM
[Previous Routine] [Next Routine] [List of Routines]NAME: HASTROM PURPOSE: Linear transformation of an image to align it with a reference image EXPLANATION: A linear transformation is applied (using POLY_2D) to an image so that its astrometry is identical with that in a reference header. This procedure can be used to align two images. CALLING SEQUENCE: HASTROM, oldim, oldhd, newim, newhd, refhd, [MISSING =, INTERP = ] or HASTROM, oldim, oldhd, refhd, [MISSING =, INTERP =, NGRID =, CUBIC =, DEGREE = ] INPUTS: OLDIM - Image array to be manipulated. If only 3 parameters are supplied then OLDIM and OLDHD will be modified to contain the output image array and header OLDHD - FITS header array for OLDIM, containing astrometry parameters REFHD - Reference header, containing astrometry parameters. OLDIM will be rotated, shifted, and compressed or expanded until its astrometry matches that in REFHD. OUTPUTS: NEWIM - Image array after linear tranformation has been performed. The dimensions of NEWIM will be identical to the NAXIS1 and NAXIS2 keywords specified in REFHD. Regions on the reference image that do not exist in OLDIM can be assigned a value with the MISSING keyword. NEWHD - Updated FITS image header associated with NEWIM OPTIONAL INPUT KEYWORDS: MISSING - Set this keyword to a scalar value which will be assigned to pixels in the output image which do not correspond to existing imput images. If not supplied, then linear extrapolation is used. See the IDL manual on POLY_2D. INTERP - Scalar, one of 0, 1, or 2 determining type of interpolation 0 nearest neighbor, 1 (default) bilinear interpolation, 2 cubic interpolation. CUBIC - a scalar value between -1 and 0 specifying cubic interpolation with the specified value as the cubic interpolation parameter. (see poly_2d for info). Setting CUBIC to a value greater than zero is equivalent to setting CUBIC = -1. NGRID - Integer scalar specifying the number of equally spaced grid points on each axis to use to specify the transformation. Default is GRID = 3 (9 total grid points). The value of GRID must always be greater than DEGREE + 1 DEGREE - Integer scalar specifying the degree of the transformation. See the routine POLYWARP for more info. Default = 1 (linear transformation). NOTES: (1) The 3 parameter calling sequence is less demanding on virtual memory. (2) The astrometry in OLDHD will be precessed to match the equinox given in REFHD. (3) If an ST Guidestar image is used for the reference header, then the output header will be converted to standard astrometry. EXAMPLE: Suppose one has an image array, IM, and an associated FITS header H. One desires to warp the image array so that it is aligned with another image with a FITS header, HREF. Both headers contain astrometry info. Set pixel values to 0 where there is no overlap between the input and reference image, and use linear interpolation (default) IDL> hastrom, IM, H, HREF, MISSING = 0 PROCEDURES USED: ad2xy, check_FITS, extast, get_EQUINOX(), gsssextast, hprecess, putast, sxaddpar, sxaddhist, sxpar(), xy2ad, zparcheck REVISION HISTORY: Written W. Landsman, STX Co. Feb, 1989 Updated to CHECK_FITS Dec, 1991 New astrometry keywords Mar, 1994 Recognize GSSS header W. Landsman June, 1994 Added CUBIC keyword W. Landsman March, 1997 Converted to IDL V5.0 W. Landsman September 1997 Accept INTERP=0, Convert output GSS header to standard astrometry W. Landsman June 1998(See hastrom.pro)
HBOXAVE
[Previous Routine] [Next Routine] [List of Routines]NAME: HBOXAVE PURPOSE: Box average an image array and update the FITS header array EXPLANATION: The function BOXAVE() is used. This procedure is recommended for integer images when photometric precision is desired, because it performs intermediate steps using REAL*4 arithmetic. Otherwise, the procedure HREBIN is much faster. CALLING SEQUENCE: HBOXAVE, Oldim, Oldhd, Newim, Hewhd, box or HBOXAVE, Oldim, Oldhd, box INPUTS: Oldim - the original image array Oldhd - the original image FITS header, string array OPTIONAL INPUTS: box - the box size to be used, integer scalar. If omitted, then HBOXAVE will prompt for this parameter. OPTIONAL OUTPUTS: Newim - the image after boxaveraging Newhd - header for newim containing updated astrometry info If output parameters are not supplied, the program will modify the input parameters OLDIM and OLDHD to contain the new array and updated header. PROCEDURE: The parameters BSCALE, NAXIS1, NAXIS2, CRPIX1, and CRPIX2 and the CD (or CDELT) parameters are updated for the new FITS header. EXAMPLE: Compress the image in a FITS file 'image.fits' by a factor of 4 and update the astrometry in the FITS header IDL> im = readfits('image.fits',hdr) ;Read FITS file into IDL arrays IDL> hboxave, im, hdr, 4 ;Boxaverage by 4 IDL> writefits,'image.fits',im,hdr ;Write a new FITS file CALLED PROCEDURES: CHECK_FITS - Check that the FITS header is appropriate to the image BOXAVE() - Performs box averaging of an image SXPAR(), SXADDPAR - Read and write FITS keyword values MODIFICATION HISTORY: Written, Aug. 1986 W. Landsman, STI Corp. IDLV2 changes, sxaddpar format keyword added, J. Isensee, July,1990 Fix 0.5 pixel offset in new CRPIX computation W. Landsman, Dec, 1991 Update BSCALE even if no astrometry present W. Landsman, May 1997 Converted to IDL V5.0 W. Landsman September 1997(See hboxave.pro)
HCONGRID
[Previous Routine] [Next Routine] [List of Routines]NAME: HCONGRID PURPOSE: CONGRID an image and update astrometry in a FITS header EXPLANATION: Expand or contract an image using CONGRID and update the associated FITS header array. CALLING SEQUENCE: HCONGRID, oldhd ;Update FITS header only HCONGRID, oldim, oldhd, [ newim, newhd, newx, newy, CUBIC = , INTERP=, OUTSIZE =] INPUTS: OLDIM - the original image array OLDHD - the original image FITS header, string array OPTIONAL INPUTS: NEWX - size of the new image in the X direction NEWY - size of the new image in the Y direction The OUTSIZE keyword can be used instead of the NEWX, NEWY parameters OPTIONAL OUTPUTS: NEWIM - the image after expansion or contraction with CONGRID NEWHD - header for newim containing updated astrometry info If output parameters are not supplied, the program will modify the input parameters OLDIM and OLDHD to contain the new array and updated header. OPTIONAL KEYWORD INPUTS: OUTSIZE - Two element integer vector which can be used instead of the NEWX and NEWY parameters to specify the output image dimensions INTERP - 0 for nearest neighbor, 1 for bilinear interpolation 2 for cubic interpolation. CUBIC - If set and non-zero, then cubic interpolation is used (equivalent to INTERP=2). In IDL V5.0 and later, CUBIC can also be a value between -1 and 0 (see ROT for more info). PROCEDURE: Expansion or contraction is done using the CONGRID function. neighbor. The parameters BSCALE, NAXIS1, NAXIS2, CRPIX1, and CRPIX2 and the CD (or CDELT) parameters are updated for the new header. NOTES: A FITS header can be supplied as the first parameter without having to supply an image array. The astrometry in the FITS header will be updated to be appropriate to the specified image size. EXAMPLE: Congrid an 512 x 512 image array IM and FITS header H to size 300 x 300 using cubic interpolation IDL> hcongrid, IM ,H, OUT = [300, 300], INTERP = 2 The variables IM and H will be modified to the new image size. PROCEDURES CALLED: CHECK_FITS, CONGRID(), EXTAST, GSSS_STDAST, SXADDHIST, SXADDPAR, SXPAR(), ZPARCHECK RESTRICTIONS: Must be since IDL V3.5 so that the /CUBIC keyword to ROT is recognized MODIFICATION HISTORY: Written, Aug. 1986 W. Landsman, STI Corp. Added interp keywords, J. Isensee, July, 1990 Add cubic interpolation W. Landsman HSTX January 1994 Recognize a GSSS FITS header W. Landsman June 1994 Fix case where header but not image supplied W. Landsman May 1995 Remove call to SINCE_VERSION() W. Landsman March 1996 Assume since IDL V3.5, add CUBIC keyword W. Landsman March 1997 Update BSCALE even if no astrometry present W. Landsman May 1997 Converted to IDL V5.0 W. Landsman September 1997(See hcongrid.pro)
HEADFITS
[Previous Routine] [Next Routine] [List of Routines]NAME: HEADFITS PURPOSE: Read a FITS (primary or extension) header into a string array. EXPLANATION: Under Unix, HEADFITS() can also read gzip (.gz) or Unix compressed (.Z) FITS files CALLING SEQUENCE: Result = HEADFITS( filename ,[ EXTEN = ]) INPUTS: FILENAME = String containing the name of the FITS file to be read. OPTIONAL INPUT KEYWORD: EXTEN = integer scalar, specifying which FITS extension to read. For example, to read the header of the first extension set EXTEN = 1. Default is to read the primary FITS header (EXTEN = 0). OUTPUTS: Result of function = FITS header, string array EXAMPLE: Print the main FITS header of a file 'test.fits' into a string variable, h IDL> print, headfits( 'test.fits') Print the second extension header of a gzip compressed FITS file 'test.fits.gz' (Unix only). Use HPRINT for pretty format IDL> hprint, headfits( 'test.fits.gz', 2) PROCEDURES CALLED FXPOSIT(), MRD_HREAD MODIFICATION HISTORY: adapted by Frank Varosi from READFITS by Jim Wofford, January, 24 1989 Keyword EXTEN added, K.Venkatakrishna, May 1992 Make sure first 8 characters are 'SIMPLE' W. Landsman October 1993 Check PCOUNT and GCOUNT W. Landsman December 1994 Major rewrite, work for Unix gzip files, W. Landsman April 1996 Converted to IDL V5.0 W. Landsman September 1997(See headfits.pro)
HELIO
[Previous Routine] [Next Routine] [List of Routines]NAME: HELIO PURPOSE: Compute (low-precision) Heliocentric coordinates for the planets. EXPLANATION: Adapted from the book Celestial Basic CALLING SEQUENCE: HELIO, JD, HMS, LIST, HRAD, HLONG, HLAT INPUTS: JD = Julian day to compute for, long scalar HMS = hours, minutes, seconds array: H, M, S. Universal time. LIST = List of planets array. May be a single number. 1 = merc, 2 = venus, ... 9 = pluto. OUTPUTS: HRAD = array of Heliocentric radii (A.U). HLONG = array of Heliocentric (ecliptic) longitudes (degrees). HLAT = array of Heliocentric latitudes (degrees). These values are scalars if LIST is a scalar. EXAMPLE: To find the heliocentric positions of Jupiter and Saturn on 1-Jan-1989 JDCNV,1989,1,1,0,JD ;Convert to Julian Date HELIO,JD,[0,0,0],[5,6],hrad,hlong,hlat ;Get radius, long, and lat COMMON BLOCKS: HELIOCOM --- stores parameters. ROUTINES USED: DATATYPE, ISARRAY, MODIFICATION HISTORY: R. Sterner. 20 Aug, 1986. Code cleaned up a bit W. Landsman December 1992 Converted to IDL V5.0 W. Landsman September 1997(See helio.pro)
HELIO_JD
[Previous Routine] [Next Routine] [List of Routines]NAME: HELIO_JD PURPOSE: Convert geocentric (reduced) Julian date to heliocentric Julian date EXPLANATION: This procedure is used to correct for extra light travel time between the Earth and the Sun. CALLING SEQUENCE: jdhelio = HELIO_JD( date, ra, dec) INPUTS date - reduced Julian date (= JD - 2400000), scalar or vector, MUST be double precision ra,dec - scalars giving right ascension and declination in DEGREES OUTPUTS: jdhelio - heliocentric julian date. EXAMPLE: What is heliocentric julian date of an observation of V402 Cygni (RA = 20 7 15, Dec = 37 0.33) taken June 15, 1973 at 11:40 UT? IDL> juldate, [1973,6,15,11,40], jd ;Get Geocentric julian date IDL> hjd = helio_jd( jd, ten(20,7,15)*15., ten(37,0.33) ) ==> hjd = 41848.9881 PROCEDURES CALLED: zparcheck, xyz REVISION HISTORY: Algorithm from the book Astronomical Photometry by Henden, p. 114 Written, W. Landsman STX June, 1989 Converted to IDL V5.0 W. Landsman September 1997(See helio_jd.pro)
HELIO_RV
[Previous Routine] [Next Routine] [List of Routines]NAME: HELIO_RV PURPOSE: Return the heliocentric radial velocity of a spectroscopic binary EXPLANATION: This function will return the heliocentric radial velocity of a spectroscopic binary star at a given heliocentric Julian date (HJD) given its orbit. CALLING SEQUENCE: Result = HELIO_RV ( Reduced_HJD ,T ,Period ,Gamma [,e ,Omega ] ) INPUT: Reduced_HJD - Reduced_HJD of observation T - Reduced_HJD of periastron passage (max. +ve velocity for circular orbits) Period - the period in days Gamma - systemic velocity K - velocity semi-amplitude in the same units as Gamma. e - eccentricity of the orbit, default is 0. Omega - longitude of periastron in degrees. Must be specified for eccentric orbits. OUTPUT: The predicted heliocentric radial velocity in the same units as Gamma for the date(s) specified by Reduced_HJD. RESTRICTIONS: To ensure consistency with the routines JULDATE and HELIO_JD, the reduced HJD must be used throughtout. EXAMPLES: Example 1 What was the heliocentric radial velocity of the primary component of HU Tau at 1730 UT 25 Oct 1994? IDL> juldate ,[94,10,25,17,30],JD ;Get Geocentric julian date IDL> hjd = helio_jd(jd,ten(04,38,16)*15.,ten(20,41,05)) ; Convert to HJD IDL> print, helio_rv(hjd,46487.5303D,2.0563056D,-6.0,59.3) -63.661180 NB. 1. The routines JULDATE and HELIO_JD return a reduced HJD (HJD - 2400000) and so T and P must be specified in the same fashion. 2. The user should be careful to use double precision format to specify T and P to sufficient precision where necessary. Example 2 Plot two cycles of an eccentric orbit, e=0.6, omega=45 for both components of a binary star IDL> phi=findgen(100)/50.0 ; Generates 100 phase points IDL> plot, phi,helio_rv(phi,0,1,0,100,0.6,45),yrange=[-100,150] IDL> oplot, phi,helio_rv(phi,0,1,0,50,0.6,45+180) This illustrates both the use of arrays to perform multiple calculations and generating radial velocities for a given phase by setting T=0 and P=1. Note also that omega has been changed by 180 degrees for the orbit of the second component (the same 'trick' can be used for circular orbits). MODIFICATION HISTORY: Written by: Pierre Maxted CUOBS, October, 1994 Circular orbits handled by setting e=0 and omega=0 to allow binary orbits to be handled using omega and omega+180. Pierre Maxted,Feb 95 BUG - omega was altered by the routine - corrected Feb 95,Pierre Maxted Iteration for E changed to that given by Reidel , Feb 95,Pierre Maxted /SINGLE keyword removed. May 96,Pierre Maxted Converted to IDL V5.0 W. Landsman September 1997(See helio_rv.pro)
HERMITE
[Previous Routine] [Next Routine] [List of Routines]NAME: HERMITE PURPOSE: To compute Hermite spline interpolation of a tabulated function. EXPLANATION: Hermite interpolation computes the cubic polynomial that agrees with the tabulated function and its derivative at the two nearest tabulated points. It may be preferable to Lagrangian interpolation (QUADTERP) when either (1) the first derivatives are known, or (2) one desires continuity of the first derivative of the interpolated values. HERMITE() will numerically compute the necessary derivatives, if they are not supplied. CALLING SEQUENCE: F = HERMITE( XX, FF, X, [ FDERIV = ]) INPUT PARAMETERS: XX - Vector giving tabulated X values of function to be interpolated Must be either monotonic increasing or decreasing FF - Tabuluated values of function, same number of elements as X X - Scalar or vector giving the X values at which to interpolate OPTIONAL INPUT KEYWORD: FDERIV - function derivative values computed at XX. If not supplied, then HERMITE() will compute the derivatives numerically. The FDERIV keyword is useful either when (1) the derivative values are (somehow) known to better accuracy than can be computed numerically, or (2) when HERMITE() is called repeatedly with the same tabulated function, so that the derivatives need be computed only once. OUTPUT PARAMETER: F - Interpolated values of function, same number of points as X EXAMPLE: Interpolate the function 1/x at x = 0.45 using tabulated values with a spacing of 0.1 IDL> x = indgen(20)*0.1 + 0.1 IDL> y = 1/x IDL> print,hermite(x,y,0.45) This gives 2.2188 compared to the true value 1/0.45 = 2.2222 IDL> yprime = -/x^2 ;But in this case we know the first derivatives IDL> print,hermite(x,y,0.45,fderiv = yprime) == 2.2219 ;and so can get a more accurate interpolation NOTES: The algorithm here is based on the FORTRAN code discussed by Hill, G. 1982, Publ Dom. Astrophys. Obs., 16, 67. The original FORTRAN source is U.S. Airforce. Surveys in Geophysics No 272. HERMITE() will return an error if one tries to interpolate any values outside of the range of the input table XX PROCEDURES CALLED: TABINV REVISION HISTORY: Written, B. Dorman (GSFC) Oct 1993, revised April 1996 Added FDERIV keyword, W. Landsman (HSTX) April 1996 Test for out of range values W. Landsman (HSTX) May 1996 Converted to IDL V5.0 W. Landsman September 1997(See hermite.pro)
HEXTRACT
[Previous Routine] [Next Routine] [List of Routines]NAME: HEXTRACT PURPOSE: Extract a subimage from an array and update astrometry in FITS header EXPLANATION: Extract a subimage from an array and create a new FITS header with updated astrometry for the subarray CALLING SEQUENCE: HEXTRACT, Oldim, Oldhd, [ Newim, Newhd, x0, x1, y0, y1, /SILENT ] or HEXTRACT, Oldim, Oldhd, [x0, x1, y0, y1, /SILENT ] INPUTS: Oldim - the original image array Oldhd - the original image header OPTIONAL INPUTS: x0, x1, y0, y1 - respectively, first and last X pixel, and first and last Y pixel to be extracted from the original image, integer scalars. If omitted, HEXTRACT will prompt for these parameters OPTIONAL OUTPUTS: Newim - the new subarray extracted from the original image Newhd - header for newim containing updated astrometry info If output parameters are not supplied or set equal to -1, then the HEXTRACT will modify the input parameters OLDIM and OLDHD to contain the subarray and updated header. OPTIONAL INPUT KEYWORD: SILENT - If set and non-zero, then a message describing the extraction is not printed at the terminal. This message can also be suppressed by setting !QUIET. PROCEDURE: The FITS header parameters NAXIS1, NAXIS2, CRPIX1, and CRPIX2 are updated for the extracted image. EXAMPLE: Read an image from a FITS file 'IMAGE', extract a 512 x 512 subimage with the same origin, and write to a new FITS file 'IMAGENEW' IDL> im = READFITS( 'IMAGE', hdr ) ;Read FITS files into IDL arrays IDL> hextract, im, h, 0, 511, 0, 511 ;Extract 512 x 512 subimage IDL> writefits, 'IMAGENEW', im ,h ;Write subimage to a FITS file PROCEDURES CALLED CHECK_FITS, STRN(), SXPAR(), SXADDPAR, SXADDHIST MODIFICATION HISTORY: Written, Aug. 1986 W. Landsman, STX Corp. Use astrometry structure, W. Landsman Jan, 1994 Minor fix if bad Y range supplied W. Landsman Feb, 1996 Added /SILENT keyword W. Landsman March, 1997 Converted to IDL V5.0 W. Landsman September 1997(See hextract.pro)
HOST_TO_IEEE
[Previous Routine] [Next Routine] [List of Routines]NAME: HOST_TO_IEEE PURPOSE: Translate an IDL variable from host to IEEE representation EXPLANATION: The variable is converted from the format used by the host architecture into IEEE-754 representation (as used, for example, in FITS data ). CALLING SEQUENCE: HOST_TO_IEEE, data, [ IDLTYPE = , ] INPUT-OUTPUT PARAMETERS: data - any IDL variable, scalar or vector. It will be modified by HOST_TO_IEEE to convert from host to IEEE representation. Byte and string variables are returned by HOST_TO_IEEE unchanged OPTIONAL KEYWORD INPUTS: IDLTYPE - scalar integer (1-9) specifying the IDL datatype according to the code given by the SIZE function. This keyword will usually be used when suppying a byte array that needs to be interpreted as another data type (e.g. FLOAT). EXAMPLE: Suppose FITARR is a 2880 element byte array to be converted to a FITS record and interpreted a FLOAT data. IDL> host_to_ieee, FITARR, IDLTYPE = 4 METHOD: The BYTEORDER procedure is called with the appropriate keywords MODIFICATION HISTORY: Adapted from CONV_UNIX_VAX, W. Landsman Hughes/STX January, 1992 Version for IDL V5.0 August 1997 Converted to IDL V5.0 W. Landsman September 1997(See host_to_ieee.pro)
HPRECESS
[Previous Routine] [Next Routine] [List of Routines]NAME: HPRECESS PURPOSE: Precess the astrometry in a FITS header to a new equinox CALLING SEQUENCE: HPRECESS, HDR, [ yearf ] INPUT-OUTPUT: HDR - FITS Header, must contain the CRVAL astrometry keywords, and either an EPOCH or EQUINOX keyword. HDR will be modified to contain the precessed astrometry OPTIONAL INPUT: YEARF - Scalar, giving the year of the new (Final) equinox. If not supplied, user will be prompted for this value. METHOD: The CRVAL and CD (or CROTA) keywords are extracted from the header and precessed to the new equinox. The EPOCH or EQUINOX keyword in the header is updated. A HISTORY record is added RESTRICTIONS: The FK5 reference frame is assumed for both equinoxes. PROCEDURES USED: ZPARCHECK, GET_EQUINOX(), EXTAST, SXADDPAR, SXADDHIST, PRECESS, PRECESS_CD, PUTAST REVISION HISTORY: Written W. Landsman STX July, 1988 CD matrix precessed - February, 1989 Update EQUINOX keyword when CROTA2 present November, 1992 Recognize a GSSS header June, 1994 Additional Noparams value recognize for storing CDs. RSH, 6 Apr 95 Converted to IDL V5.0 W. Landsman September 1997(See hprecess.pro)
HPRINT