The PAS system produces a stream of images using time-stamp names. I wrote a script for parsing lists of ACAM images in the Fall of 2015, but I generalized it so that I could use for all types of PAS images. Here are some examples and notes for what has turned out to be a very useful piece of code.
acl.py -h OR acl.py --help usage: acl.py [-h] [-v] arg1 arg2 arg3 positional arguments: arg1 name of input file list (list.acm) arg2 UT start in floating point format (5.399494) arg3 Time interval in seconds (10hours = 36000 sec) (37.50 ) optional arguments: -h, --help show this help message and exit -v, --verbose Verbose responsesHence this code takes as input a list of file names that can be full path names. It also takes a UT start time (in floating point hours) and a time interval (in floating point seconds). When it ir runs, it goes through the list and find all of the images in the specified time interval (i.e. UT_start + UT_start+Time). The results fo to an easily read file named: acl.out. I have run acl.py on both on mcs and scohome:
===================================================================== On mcs (as astronomer): *** I want a list of OWFS2 images. [astronomer@mcs work]$ pwd /home/mcs/astronomer/sco/ACAM/work [astronomer@mcs work]$ ls list.list.wf2 [astronomer@mcs work]$ cat list.wf2 /home/jove/guider/data/WFS2/20160201/20160201T031505.1_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T031542.2_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T031619.3_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T035455.0_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T071744.2_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T071752.5_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T071800.7_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110738.4_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110758.5_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110818.6_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110845.7_wf2_sci.fits [astronomer@mcs work]$ acl.py list.wf2 7.0 50000 7.2956111 5 /home/jove/guider/data/WFS2/20160201/20160201T071744.2_wf2_sci.fits 7.2979167 6 /home/jove/guider/data/WFS2/20160201/20160201T071752.5_wf2_sci.fits 7.3001944 7 /home/jove/guider/data/WFS2/20160201/20160201T071800.7_wf2_sci.fits 11.1273333 8 /home/jove/guider/data/WFS2/20160201/20160201T110738.4_wf2_sci.fits 11.1329167 9 /home/jove/guider/data/WFS2/20160201/20160201T110758.5_wf2_sci.fits 11.1385000 10 /home/jove/guider/data/WFS2/20160201/20160201T110818.6_wf2_sci.fits 11.1460278 11 /home/jove/guider/data/WFS2/20160201/20160201T110845.7_wf2_sci.fits [astronomer@mcs work]$ ls acl.out acl.select list.wf2 [astronomer@mcs work]$ wc -l * 11 acl.out 7 acl.selected 11 list.wf2 =====================================================================Let's note a few things. We see that 7 images were listed to standard out. These are the images that passed our time window criterion: starting at 7.0 hours UT and 50000 (13.9 hours) after. In addition, we are shown the UT time of each image in UT hours (floating point) and the number of the image IN THE ORIGINAL LIST (i.e. the line number in list.wf2). By viewing sucha listing it is pretty easy to home in on a set of images based on their UT time grouping. Since we are usually doing something like collecting "the last 5 images", this is an even easier task. Now let's look at the contents of the local output files. We see in the "wc-l" call above that our input file "list.wf2" had 11 lines (11 images). The file "acl.out" also has 11 lines. The "acl.out" files lists properties of ALL images in out input list. The file "acl.selected" lists properties of the SELECTED IMAGES only. In fact, the 7 lines in acl.selected, as we see below, are simple the 7 fullpath names of the SELECTED images:
===================================================================== [astronomer@mcs work]$ cat acl.out 3.251417 1 wf2 20160201T031505.1_wf2_sci.fits 03:15:05.1 3.261722 2 wf2 20160201T031542.2_wf2_sci.fits 03:15:42.2 3.272028 3 wf2 20160201T031619.3_wf2_sci.fits 03:16:19.3 3.915278 4 wf2 20160201T035455.0_wf2_sci.fits 03:54:55.0 7.295611 5 wf2 20160201T071744.2_wf2_sci.fits 07:17:44.2 7.297917 6 wf2 20160201T071752.5_wf2_sci.fits 07:17:52.5 7.300194 7 wf2 20160201T071800.7_wf2_sci.fits 07:18:00.7 11.127333 8 wf2 20160201T110738.4_wf2_sci.fits 11:07:38.4 11.132917 9 wf2 20160201T110758.5_wf2_sci.fits 11:07:58.5 11.138500 10 wf2 20160201T110818.6_wf2_sci.fits 11:08:18.6 11.146028 11 wf2 20160201T110845.7_wf2_sci.fits 11:08:45.7 This file contains: UT time in hours, image number in list.wf2, name of camera, base FITS name, UT in hh:mm:ss.s [astronomer@mcs work]$ cat acl.selected /home/jove/guider/data/WFS2/20160201/20160201T071744.2_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T071752.5_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T071800.7_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110738.4_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110758.5_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110818.6_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110845.7_wf2_sci.fits =====================================================================Suppose I wanted the last two images? By making an initial run I would learn that the 2nd to the last image was taken at UT=11.138500, so I could make an acl.py run to get these last two images with (for example):
[astronomer@mcs work]$ acl.py list.wf2 11.1380 2000 11.1385000 10 /home/jove/guider/data/WFS2/20160201/20160201T110818.6_wf2_sci.fits 11.1460278 11 /home/jove/guider/data/WFS2/20160201/20160201T110845.7_wf2_sci.fits [astronomer@mcs work]$ cat acl.selected /home/jove/guider/data/WFS2/20160201/20160201T110818.6_wf2_sci.fits /home/jove/guider/data/WFS2/20160201/20160201T110845.7_wf2_sci.fitsLastly, I might want to retieve local copies of these images. I can use the impuller routine and my file listing in acl.selected:
[astronomer@mcs work]$ ls acl.out acl.selected list.wf2 [astronomer@mcs work]$ impuller acl.selected Name = /home/jove/guider/data/WFS2/20160201/20160201T110818.6_wf2_sci.fits Name = /home/jove/guider/data/WFS2/20160201/20160201T110845.7_wf2_sci.fits [astronomer@mcs work]$ ls 20160201T110818.6_wf2_sci.fits 20160201T110845.7_wf2_sci.fits acl.out acl.selected list.wf2
There are lots of ways to generate the input lists for this. One of the routines I commonly use on mcs (as it hard-codes the paths to where PAS places images) is lastim.