#!/usr/bin/env python

from astropy.table import Table

import argparse

parser = argparse.ArgumentParser()
parser.add_argument("obsdb",type=str,
                    help="input observations database")
args = parser.parse_args()

fields = ['frameIndex','fileName','imType',
          'filter','objName','expTime']

obsdb = Table.read(args.obsdb)
obsdb[fields].more()


@@ -16,16 +16,35 @@
 python%0A%0A
+import numpy as np%0A
 from ast
@@ -218,157 +218,968 @@
 e%22)%0A
-args = parser.parse_args()%0A%0Afields = %5B'frameIndex','fileName','imType',%0A          'filter','objName','expTime'%5D%0A%0Aobsdb = Table.read(args.obsdb)%0Aobsdb
+parser.add_argument('-b','--band',type=str,default=None,%0A                help='band to include %5Bdefault=both%5D')%0Aparser.add_argument('--frames',type=str,default=None,%0A                help='frames to include (i1,i2) %5Bdefault=all%5D')%0Aparser.add_argument('-t','--imtype',type=str,default=None,%0A                help='specify image type to include')%0Aparser.add_argument('-u','--utdate',type=str,default=None,%0A                help='UT date(s) to include %5Bdefault=all%5D')%0Aparser.add_argument('--night',type=str,default=None,%0A                help='night(s) to include %5Bdefault=all%5D')%0Aargs = parser.parse_args()%0A%0Afields = %5B'frameIndex','fileName','imType',%0A          'filter','objName','expTime'%5D%0A%0Aobsdb = Table.read(args.obsdb)%0A%0Aframes = np.ones(len(obsdb),dtype=bool)%0Aif args.band:%0A%09frames &= np.in1d(obsdb%5B'filter'%5D,args.band)%0Aif args.imtype:%0A%09frames &= np.in1d(obsdb%5B'imType'%5D,args.imtype)%0Aif args.utdate:%0A%09frames &= np.in1d(obsdb%5B'utDate'%5D,args.utdate)%0A%0Aobsdb%5Bframes%5D
 %5Bfie

add some basic selection from db