Loop through all combos, query combo, divide by # of table entries
list root names taken for particular target
session.query(wfc_raw_0.rootname, wfc_raw_0.filename, wfc_raw_0.targname)\
.filter(wfc_raw_0.targname==input_target)
list filenames using a particular dark file.
session.query(wfc_raw_0.filename)\
.filter(wfc_raw_0.darkfile == input_dark)
print out GOODMEAN for SCI extensions in proposal set or visit or rootname
q6 = session.query(Master.rootname, WFC_flt_1.goodmean,WFC_flt_4.goodmean).filter(Master.rootname.like('jcqp%')).join(WFC_flt_1).join(WFC_flt_4)
get rootnames for observations with FLASHDUR > 0, that’s not a dark
session.query(Master.rootname, WFC_raw_0.flashdur).filter(WFC_raw_0.flashdur > 0).filter(WFC_raw_0.targname != 'DARK').join(WFC_raw_0)
query.(Master.rootname, wfc_asn_0.filename, wfc_flt_0.filename,.....)\ .join(wfc_asn_0)\ .join(wfc_flt_0)\
query.(Master.rootname=input_rootame, wfc_raw_0.filter1, wfc_raw_0.filter2)\ .join(wfc_raw_0)\ .distinct()
query to get all filter tuples
query.(wfc_raw_0.filter1, wfc_raw_0.filter2)\ .distinct()
query number of wfc_raw_0 entries
Loop through all combos, query combo, divide by # of table entries
list root names taken for particular target session.query(wfc_raw_0.rootname, wfc_raw_0.filename, wfc_raw_0.targname)\ .filter(wfc_raw_0.targname==input_target)
list filenames using a particular dark file. session.query(wfc_raw_0.filename)\ .filter(wfc_raw_0.darkfile == input_dark)
print out GOODMEAN for SCI extensions in proposal set or visit or rootname q6 = session.query(Master.rootname, WFC_flt_1.goodmean,WFC_flt_4.goodmean).filter(Master.rootname.like('jcqp%')).join(WFC_flt_1).join(WFC_flt_4)
get rootnames for observations with FLASHDUR > 0, that’s not a dark session.query(Master.rootname, WFC_raw_0.flashdur).filter(WFC_raw_0.flashdur > 0).filter(WFC_raw_0.targname != 'DARK').join(WFC_raw_0)
get rootnames that DON”T have an association
initial query of what's in association
assoc_names = query(Master.rootname).join(wfc_asn_0)\
now actual query
query(master.rootname)\ .join(wfc_asn0)\ .filter(~master.rootname.in(assoc_names))
qq = session.query(Master.rootname).filter(~exists().where(and_(Master.rootname == WFC_asn_0.rootname)))
date_obs = getattr(WFC_raw_0, 'date-obs') q9 = session.query(WFC_asn_0.filename).filter(date_obs >= '2014-06-01').filter(date_obs <= '2014-06-10')