idlastro / Web Socket Procedures: READ_IPAC_VAR

[Source code]

NAME
READ_IPAC_VAR
PURPOSE
Read an IPAC ascii table from a variable into IDL structures.
Used by query_irsa_cat.pro.
EXPLANATION
Reads an IPAC ASCII table from a variable into IDL structures.  The
definition of an IPAC-format table is currently here:
   https://irsa.ipac.caltech.edu/applications/DDGEN/Doc/ipac_tbl.html
CALLING SEQUENCE
info = read_ipac_var(textvar, table_col_info=table_col_info, 
       table_hdr=table_hdr, [change_null=change_null, /debug])
INPUTS
TEXTVAR -- a text variable with the table returned from the query
OPTIONAL INPUT
CHANGE_NULL -- an integer value to be used when the IPAC table
               has a non-numeric string for null values in an 
               integer column.  The default is -9999.
DEBUG -- enables some debugging statements
OUTPUTS
info - IDL array structure with the data.  The structure
     tag names are taken from the column names, with possible
     changes needed by IDL.  
     If the table is not valid, or contains no data, the function returns a value of -1
 table_col_info - A structure with table column headers
     in tags starting with "HEADER": HEADER_Col_Names, 
     HEADER_Col_Names_Orig, HEADER_Col_Types_Orig, and, 
     if present, HEADER_Data_Units and HEADER_Null_Values.
 table_hdr - A string array with whatever comment and keyword
             lines precede the column headers.
PROCEDURES USED
VALID_NUM
NOTES
Uses some unnecessary looping, but it's kept this way to stay
similar to read_ipac_table.pro. 
MODIFICATION HISTORY
Adapted from read_ipac_table - C. Gonzalez, U. Alicante March 2011 
Allow long integer, convert blanks in numeric fields to null
value - T. Brooke, IPAC May 2011
Allow 64bit long; use valid_num to check - TB June 2013
Re-do structures to separate out the data - TB Aug 2017