PDS_VERSION_ID = PDS3 LABEL_REVISION_NOTE = " 2012-02-21 Cornell:BTCarcich incorporated comments from Ken Klaasen. 2014-05-31 Latchmoor:Carcich update for Annefrank and Wild 2 re-calibrations 2015-10 Latchmoor:Carcich Lien resolution " RECORD_TYPE = STREAM OBJECT = TEXT INTERCHANGE_FORMAT = ASCII PUBLICATION_DATE = 2014-05-31 NOTE = "Contents of /DATA/ subdirectories in Stardust NAVCAM Data Archive for Annefrank and Wild 2 data." END_OBJECT = TEXT END Stardust 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 one level of data processing: either raw data (EDR; -2- in DATA_SET_ID) or calibrated data (RDR; -3- in DATA_SET_ID; RDR). Under /DATA/, images are grouped by activity: approach data (range to target greater than 300,000km); encounter (closest approach) data (range less than 50,000km). The /DATA/ subdirectory structure separates the data files by activity and further separates the images by year and date of the observation. This document describes both Level 2 (EDR) and Level 3 (RDR) NAVCAM data for the flybys of asteroid 5535 Annefrank and comet 81P/Wild2 (1978 A2), although only one Level of data will be in any one data set. 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 below subdirectories by processing level and activity as noted in this table. Dir. & Subdir. Processing level Activity -------------- ---------------- -------- /DATA/EDR/APPROACH EDR (raw) Approach; range > 300,000km /DATA/EDR/ENCOUNTER EDR (raw) Encounter; range < 50,000km /DATA/RDR/APPROACH RDR (calibrated) Approach; range > 300,000km /DATA/RDR/ENCOUNTER RDR (calibrated) Encounter; range < 50,000km Year and month_day (YYYY/MM_DD/) subdirectories are under those higher-level activity directories, and contain the actual data files; see the /DATA directory and subdirectory layout graphic below for more detail. 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 - In Level 3 (RDR) data sets only, the three-character calibration level (CALLVL) before the SUFFIX, either _RR or _DN, indicates the level of calibration performed on the image data: _RR The image has been calibrated to Radiance; _DN The image is a bias frame (zero exposure) and has been converted to bias- and dark-subtracted, flat-fielded Data Number (DN). - In Level 2 (EDR) data sets only, there is no CALLVL suffix i.e. the CALLVL suffix is the empty string, "". - The single digit before the CALLVL, 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 prime 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: AE - Approach to and encounter with asteroid 5535 Annefrank WE - Approach to and encounter with comet 81P/Wild 2 (1978 A2) - 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 (Annefrank shown; Wild 2 is similar) ============================================================================= /DATA/ | +--APPROACH/ Approach raw data subdirectory | | | +--YYYY/ Year subdirectory e.g. 2002 | | | +--MM_DD/ Month and day subdirectory e.g. 11_01 | | | | | +--NnnnnAE02*.LBL PDS label for NnnnnAE02*.FIT | | - nnnnn is IMAGE_NUMBER e.g. 0370 | +--NnnnnAE02*.FIT FITS data file | +--ENCOUNTER/ Encounter raw data subdirectory | | | +--YYYY/ Year subdirectory e.g. 2002 | | | +--MM_DD/ Month and day subdirectory e.g. 11_02 | | | +--NnnnnAE02*.LBL PDS label for NnnnnAE02*.FIT | | - nnnnn is IMAGE_NUMBER e.g. 0371 | +--NnnnnAE02*.FIT FITS data file | +-- DATAINFO.TXT This file * the CALLVL suffix either will be _DN or _RR for Level 3 (RDR) data sets, or will be the empty string, "", for Level 2 (EDR) data sets.