PDS_VERSION_ID = PDS3 RECORD_TYPE = FIXED_LENGTH RECORD_BYTES = 80 OBJECT = TEXT PUBLICATION_DATE = 2011-07-31 NOTE = "Stardust-NExT CIDA /DOCUMENT/SAMPLES/SAMPINFO.TXT" END_OBJECT = TEXT END SAMPLES/ contents ================= This file describes the contents of this /DOCUMENT/SAMPLES/ directory. The documents in this directory are samples for a PDS user to compare with their own products to confirm that they are reading the data correctly. For the Stardust-NExT CIDA data in this data set, the documents are plots of the eighty-one encounter events which occurred on the day of the flyby of comet 9P/Tempel 1 by the Stardust spacecraft. The plots are in the form of PNG images, and there is an HTML index page, containing thumbnail versions of the plots, ten to a row, to simplify browsing through the plots. SAMPLES/ directory layout ========================= /DOCUMENT/ | +--DOCINFO.TXT Information about data set /DOCUMENT/ directory +--*.LBL PDS labels for data set documents +--*.* Data set documents | +--SAMPLES/ This directory | +--SAMPLES.LBL PDS label of documents in this directory +--SAMPLES.HTM Index page for browsing plots +--Tyyyymoddhhmmssx.PNG Full-size plots as PNG images +--Tyyyymoddhhmmssx_S.PNG Thumbnail plots as PNG images +--SAMPINFO.TXT This file SAMPLES/ generation scripts =========================== The code used to generate the plots is provided below as an example of how to read the CIDA Spectrum EDFs. ######################################################################## ######################################################################## ### Start of sampleedf.py import os import re import sys import pprint import datetime from pds import pdsify import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt """ Sample Python script to convert Stardust-NExT Spectrum (Event) EDF files to images and to HTML index page Usage: python sampleedf.py ../../data/*/T20110215*.TAB * See import statements above for dependencies * This routine is provided as is with no support or guarantee. """ ######################################################################## ### Utility routine: convert ISO UTC (e.g. PDS START_TIME) to datetime def utc2dt(utc): exec('rtn=datetime.datetime(' + ','.join(re.split('[-T:]0?',utc))+')') return rtn ######################################################################## ### Initialization: ### - Convert TCA to datetime ### - Determine destination directory: ### - Get plot scaling for use with in generating thumbnails ### - Set plot labels ### - Open image index page as HTML file samples.htm, write initial info dtTca=utc2dt('2011-02-15T04:39:12') if 'SAMPLESDIR' in os.environ: subdir=os.environ['SAMPLESDIR'] else:subdir='./' xi,yi=plt.gcf().get_size_inches() labels = ('Target','Low Delayed','Low Straight','High Delayed','High Straight') fHtml=open(os.path.join(subdir,'samples.htm'),'w') fHtml.write("""
\rstanza to index page ### Add images to list ### Clear spectrum data fHtml.write( """ | """
% (os.path.basename(fullFn)
,title
,title
,)
)
fHtml.write( """""" % ( os.path.basename(thumbFn) ,) )
if "USEUTC" in os.environ: tyme = utc[:10]
else : tyme = "TCA%+ds" % (deltaSecs,)
fHtml.write( """ %s; I %s | \r\n""" %
(tyme
,'+-'[mode[:3]=='NEG']
,)
)
pngList+=[os.path.basename(fullFn),os.path.basename(thumbFn)]
chdata=alllines=[]
fHtml.flush()
### End of loop
######################################################################
########################################################################
### Finish index page
fHtml.write("""%s