PDS_VERSION_ID = PDS3 LABEL_REVISION_NOTE = " 2012-02-21 Cornell:BTCarcich incorporated comments from Ken Klaasen. " RECORD_TYPE = STREAM OBJECT = TEXT INTERCHANGE_FORMAT = ASCII PUBLICATION_DATE = 2011-08-31 NOTE = "Contents of /DATA/ subdirectories in Stardust-NExT NAVCAM Data Archive." END_OBJECT = TEXT END Stardust-NExT NAVCAM data ========================= Contents ======== Overview General structure (layout of data within the files) Image structure Simple approach to reading an IMAGE Directory layout and filename conventions /DATA/ directory and subdirectory layout Overview ======== The NAVCAM files under the /DATA/ directory in this data set comprise two sets of data: images with a target of comet 9P/TEMPEL 1 (1867 G1), and other images with a target of CALIBRATION or N/A. The /DATA/ subdirectory structure separates the data files by target and further separates the files by year and date of the observation. This document describes both Level 2 (EDR) and Level 3 NAVCAM data, although the two data levels are each in separate data sets, so this file is common to both data sets. General file structure (layout of data within the files) ======================================================== The data are in, or described in, two types of files: N*.LBL - PDS labels describing the data in the .FIT files below N*.FIT - FITS-compliant files containing image and ancillary data. Each PDS label file describes in detail the layout and content of the corresponding FITS file. A brief description will be given here. Refer to /DOCUMENT/ONLABELS.TXT for more details, and to the PDS Standards Reference (available from http://pds.jpl.nasa.gov) for more general details about PDS labels. Each FITS file comprises one or more Data Units (DU). The first DU in a file is the Primary DU (PDU); subsequent DUs are Extension DUs (EDUs). Each DU comprises a header section and an optional binary data section. The PDS label describes the exact location of all DU header and data sections in the file, as well the layout of the data (IMAGE or TABLE) within the data section. Header and data sections are padded such that all sections have a length that is a multiple of 2880 bytes, so all DUs and all sections start at an offset which is an integer multiple of 2880 bytes from the start of the file. Each PDU data section contains a NAVCAM raster image as a two-dimensional array of pixels, 1024 SAMPLES across and 1024 LINES high. EDUs contain ancillary data (histogram, quality map, &c) associated with the PDU image. As indicated by the PDS LINE_DIRECTION ("UP") and LINE_SAMPLE_DIRECTION ("RIGHT") keywords, the first LINE of pixels in all IMAGEs is at the bottom of the "as-viewed-from-the-spacecraft" image, and the first SAMPLE in each LINE is at the left edge of that LINE. Simple approach to reading an IMAGE =================================== Some image viewing packages (e.g. IRFANview under Microsoft Windows (tm)) are capable of reading raw data from an arbitrary file as a raster image and include menus to specify pixel size (SAMPLE_BITS), byte order, and counts of LINES and LINE_SAMPLES. Also, PDS provides the NASAview package to browse PDS IMAGEs and TABLEs. Finally, many open-source FITS readers can read the FITS data files directly without accessing the PDS labels. It is also possible to read an image programmatically. E.g. the following Python script reads the ENCOUNTER EDR data (8-bit pixels) in the first thirteen statements (from an understanding of the contents of the PDS label), and then writes the data out as a PNG image using the open-source PIL Image module. ####################################################################### ### Start of Python code ### - a modified version of this code and the PNG image it produces is ### under the /EXTRAS/ directory of this data set. f=open("n30036te02.lbl") ### Open PDS label for lin in f.readlines(): ### Loop thru label lines toks=lin.split("=") ### Split line at "=" if toks[0].strip()!="^IMAGE": continue ### Next line if not ^IMAGE toks=toks[1].split(",") ### Split ("file",N) at "," toks=toks[1].split(")") ### Split N ) at ")" offset = 2880 * (int(toks[0])-1) ### Calculate data offset break ### Exit loop f.close() ### Close PDS label f=open("n30036te02.fit") ### Open FITS data file f.seek(offset) ### Seek to ^IMAGE data s = f.read(1024*1024) ### Read 8-bit image data f.close() ### Close FITS file import PIL.Image as I ### Python Image module im = I.fromstring("L",(1024,1024),s,"raw") ### Convert data to Image out = im.transpose(I.FLIP_TOP_BOTTOM) ### Flip Image to top-down out.save("/tmp/n30036.png") ### Save as PNG image ### End of Python code ####################################################################### /DATA/ directory layout and filename conventions ================================================ /DATA/ directory layout -------------------- Under the /DATA/ directory of this data set, the data files are located in subdirectories by target as noted in this table: Dir. & Subdir. Target NAVCAM data type -------------- ------ ---------------- /DATA/TEMPEL1/ 9P/TEMPEL 1 (1867 G1) ENCOUNTER or CRUISE /DATA/OTHER/ CALIBRATION or N/A CRUISE See also the /DATA/ directory and subdirectory layout graphic below. Filename conventions -------------------- Each PDS label's filename has the same name before .LBL as its corresponding image filename has before the .FIT. All NAVCAM data filenames start with N, and end with a suffix of .LBL or .FIT. The filename convention will be described here starting from the right, i.e. from the suffix, and working toward the left. - The SUFFIX .LBL indicates the file is a data label. - The SUFFIX .FIT indicates the file is a FITS-compliant file - The single digit before the SUFFIX, always 2 for this data set, is the VERSION. VERSION is a convention used by the Ground Data system to keep a run on the same data from overwriting earlier runs. Each run uses the most current geometry and gets the latest telemetry. During the Stardust-NExT mission, the VERSION 1 run processed each block of telemetry shortly after it was downlinked. After the mission, the VERSION 2 run processed all mission data with the final geometry (SPICE) data. - The single digit before the VERSION, always "0" (zero) for this data set, is the FILTER_NUMBER. FILTER_NUMBER "0" is the OPNAV filter. - The two characters before the FILTER are SUBPHASE, a form of mission phase used to avoid name conflicts between images with the same IMAGE_NUMBER (see below). The values for SUBPHASE used in this data set are: CO - Commissioning a.k.a. checkout, ca. 2007 A.D. C5 - Cruise 5, ca. 2008-2010 A.D. C6 - Cruise 6, ca. 2010 A.D. TE - Tempel 1 encounter through end of mission, 2010-2011 A.D. - The four or five digits before the SUBPHASE are the IMAGE_NUMBER. The IMAGE_NUMBER is the decimal integer value of a non-volatile counter controlled by the NAVCAM software which increments by one when an image command is executed. It is not reset by a power cycle or spacecraft reboot, but it may be reset to a value by command from the ground. /DATA/ directory and subdirectory layout ======================================== /DATA/ | +--TEMPEL1/ NAVCAM 9P/Tempel 1 directory | | | +--YYYY/ Year subdirectory e.g. 2011 | | | +--MM_DD/ Month and day subdirectory e.g. 02_15 | | | +--NnnnnnTE02.LBL PDS label for NnnnnTE02.FIT | | - nnnnn is IMAGE_NUMBER e.g. 300036 | +--NnnnnnTE02.FIT FITS data file | +--OTHER/ NAVCAM non-9P/Tempel 1 directory | | | +--YYYY/ Year subdirectory e.g. 2008 | | | +--MM_DD/ Month and day subdirectory e.g. 02_15 | | | +--NnnnnSP02.LBL PDS label for NnnnSP02.FIT | | - SP is SUBPHASE e.g. C5 | +--NnnnnSP02.LBL FITS data file | +-- DATAINFO.TXT This file