PDS_VERESION_ID = PDS3 RECORD_TYPE = STREAM OBJECT = TEXT NOTE = "New Release of PDSREAD" SOFTWARE_VERSION_ID = "4.0" PUBLICATION_DATE = 2004-08-01 END_OBJECT = TEXT END READPDS.PRO is an IDL function that reads data from a PDS image or data table file and stores it in an IDL structure. (It is the 'top level' program that all of the others in this set are written to serve.) The calling syntax of READPDS.PRO is as follows: result = READPDS( filename,[ /SILENT] ) where: - 'result' is the data returned from the PDS image or data table file being read by READPDS. - 'filename' is a scalar string containing the name of the PDS file to be read. - 'SILENT' is an optional argument to READPDS that will suppress the default display of the size of the array or structure. READPDS.PRO uses all of the functions in this directory: ARASCPDS, ARBINPDS, ARBINPDS2, BTABVECT, BTABVECT2, CHECK_AXES, CLEAN, CLEANARR, COLASPDS, COLBIPDS, OBJPDS, GET_INDEX, HEADPDS, IMAGEPDS, PDSPAR, POINTPDS, QUBEPDS, REMOVE, STR2NUM, TASCPDS, TBINPDS, and TIMEPDS. All of these must be present or be in the idl path for READPDS.PRO to function properly. It is also intended to be used only on MSB architectures ('big-endian') if the file being read was written on an MSB architecture; READPDS.PRO has no conversion from MSB to other architectures, yet. CHANGE LOGS: Version Date Programmer Description 4.0 2004-08-01 P. Khetarpal Rewrote the major routines for reading images, tables, and qubes by using IDL structures to read data directly, instead of reading data element by element. Also, rewrote routines using many levels of subroutines, and thorough error-checking. Heavy comments were added to almost all routines. The previous releases of version 3.3.x are compiled into one in this release of pdsread. 3.3.x 2004-03-18 P. Khetarpal Fixed bugs for reading array objects included with other non-array objects for IDL. Wrote a new binary array routine to read arrays with axes greater than 2. 3.2 2003-12-02 P. Khetarpal Fixed bugs for reading tables with long int number of rows or columns; fixed item byte issue for reading tables. 3.1 2003-10-03 P. Khetarpal Updated for standards changes; fixed minor bugs; increased robustness of subroutines; added a subroutine to handle cleaning of string arrays. 3.0 2003-08-05 P. Khetarpal Updated for standards changes; added WINDOW support; added "examples" directory; included ARRAY and COLLECTION object support. EXAMPLES LABEL: - to obtain a PDS label information as a string array variable, type label = HEADPDS('pdsfile.lbl') which will return a string array of the entire pdsfile.lbl and put it into the variable label. IMAGE: - to read a PDS image file for viewing, type img = READPDS('image.lbl') which will read data from the file and put it into the variable, 'img'. The following message will be displayed: Now reading header: image.lbl Now reading 128 by 128 array ** Structure , 2 tags, length=32770, data length=32770, refs=1: OBJECTS INT 1 IMAGE INT Array[128, 128] - to view, type tvscl, img.image which should bring up an idl window with an image of the data from 'image.lbl' in it. (Multiple images would be returned as an IDL structure with the first element named 'images' being the number of images contained and the other elements being the images in order found.) Note: img is no longer an image array, but a structure. TABLES: - to read a PDS ascii table to read or extract information from later, type data = READPDS('ascii.lbl') - to read a PDS binary table to read or extract information from later, type data = READPDS('binary.lbl') in either case, READPDS will return the data as an IDL structure: Now reading header: ascii.lbl Now reading table with 2 Columns and 20 Rows ** Structure , 2 tags, length=368, data length=358, refs=1: OBJECTS INT 1 TABLE STRUCT -> Array[1] To access the table, type: help, /STRUCTURE, data.table ** Structure , 3 tags, length=360, data length=356, refs=2: COLUMN_NAMES STRING Array[3] COLUMN1 DOUBLE Array[20] COLUMN2 DOUBLE Array[20] Here's how to access columns: To access entire table: print, result.table column names: print, result.table.column_names first column: print, result.table.column1 second column: print, result.table.column2 which should cause the contents to print to the screen. NOTE: For PDS tables, the IDL routines access the "structure" file (.fmt) automatically as long as the "structure" file is in the same directory. QUBE: - to read a PDS cube to read or extract information from later, type cube = READPDS ('qube.lbl') which should return a three dimensional array. Now reading header: qube.lbl Now reading 256 by 98 by 432 qube array ** Structure , 2 tags, length=21676034, data length=21676034, refs=1 OBJECTS INT 1 QUBE INT Array[256, 98, 432] - to view the data from any of the frames, type frame = cube[*,*,0] tvscl, frame which should display the first frame on the screen. 6D ARRAY: - to read a PDS 6D image array with 1 ELEMENT sub-object and the last axis is set to NAXIS6 = 1, type array = READPDS ('array.lbl') which should return a five dimensional array of data. Since NAXIS6 = 1, IDL ignores this axis (for example, a 128 x 128 x 1 image cube is equivalent to a 128 x 128 image). Now reading header: array.lbl Now reading array ** Structure , 2 tags, length=262148, refs=1: OBJECTS INT 1 ARRAY LONG Array[128, 128, 2, 1, 2] - the above description is from an example KECK data file in FITS format. The FITS file contains 2 stacked sets (chop-nod sets), each containing 2, two-dimensional images. The PDS label was written as an array object to be read and then displayed as an image. - to view the first image, type: tvscl, result.array[*,*,0,0,0,0] or tvscl, result.array[*,*,0,0,0] which should display the first frame on the screen. NOTE: The new PDS IDL routines have been modified so that multiple data objects can be embedded in one file. For example, one can have an image and a table in the same data file. The "result" would be returned as a structure of three objects containing the number of objects, the image array, and the table structure. Now you can also read the primitive object types such as the ARRAY objects and the COLLECTION objects. (for more information on IDL structures, see the IDL User's Guide)