20DayAuto.app

/Applications/20DayAuto.app is the main program for daily automated processing of Cassini data. It is written in AppleScript so the stephen account must remain logged in for it to run 20DayAuto is launched by cron from the stephen account at 5AM . It uses the getCHEMSFiles.py script to retrieve new files from APL then runs the IDL programs phaflux and phaplot to create text and pdf files that are transferred to the space server via webdav.
  1. First run getCHEMSFiles.py to get new files from APL. If there are errors send an email message to Doug and Scott and exit.
  2. Delete the current 20DayAuto_events.log file and open a new one.
  3. Delete the temporary directory specified in temp_dir.txt if it exists. Create the temporary directory.
  4. Figure out which 20 day periods to update. Periods must include at least one file from newFiles.txt [both pha and sci] and must have all files necessary in the 20-day period. Leap years and doy ≤ 5 or doy ≥ 350 are special cases. If there is an error write to the log file. Write each new period to the log file.
  5. Use those periods to update the flux file listing (newFluxList.txt), time range (newTrange.txt) and xdr file listing (newxdrList.txt) in local_chems_files
  6. Run the IDL routine IDLCalls.pro which calls phaflux and phaplot to calculate flux and make plots. Set a 3 hour timeout to limit the time IDL can run. phaflux.pro needs to be able to iterate through the period array and take the custom flux file list. Note that IDL needs XQuartz to be running
  7. Use pstopdf to convert the postscript files generated by phaplot to pdf files and delete the .ps files
  8. Use curl to put the new txt and pdf files on the space server via webdav and move the files [flux and output] to the correct folders on the Cassini mac
  9. Delete the temporary folder

Python Scripts

getCHEMSFiles.py
used by 20DayAuto on the Cassini mac to retrieve the latest cmichs and cmichp files from APL, creates a newFiles.txt file containing a list of files transferred for the current and prior years
kill_20DayAuto.py
launched by cron in the stephen account on the Cassini mac one hour before 20DayAuto to kill 20DayAuto.app if it is still running after 23 hours
extract_times_from_EventsTable.py
in the reference folder, python script to extract the Apoapse times from the file 091005_EventsTable_091207.xls located in the same directory as this script and write times formatted for trajectory generation to a file named times_list.txt located in the same directory as this script.
getEphemData.py
in the reference folder, python script to download CASSINI ephemeris data from http://www-pw.physics.uiowa.edu/~jbg/cas.html
updatedata.py
in /Documents/Cassini/ on the space server. runs after 20DayAuto finishes and adds new data to the hdf5 file chemsdata.h5 used by the getdata EpQ and MpQ web apps
chemsdata.py
in /Library/Server/Web/Data/WebApps/chemsdata/ on the space server, a small Flask web application for filtering and retrieving Cassini data generated by 20DayAuto for the EpQ and MpQ web pages

IDL Scripts

IDLCalls.pro
used by 20DayAuto to run phaplot and phaflux
phaplot.pro
Reads the pha data files and creates two 2-D histograms (MPQ vs time, Mass vs MPQ) using the phahist procedure.
Creates histogram for Mass and MPQ using PHA1Dhist procedure.
Uses time_conv.pro, plot_proc.pro, cassini_analysis.pro, ephem_analysis.pro and phaplot.pro
The PHA Plot file from the reference folder contains more details though some information may be slightly out of date.
phaflux.pro
Analyze the phaflux text files and creates plots
The PHA Flux file from the reference folder contains more details though some information may be slightly out of date.
phaflux_calls.pro and
phaplot_calls.pro
compile necessary modules and run phaflux and phaplot