[Comm2011] code to get the 32 intersting raws when imaging some standard stars on all the cjips
Jeffrey Bout
jeffreybout at gmail.com
Fri Jun 10 12:58:22 CEST 2011
Hi all,
Here some code to determine for a bunch of rawscience frames for
'putting some standard stars on all the 32 chips', which of the
rawscience frames are the ones that image the standard stars:
1) get some raws...
awe> context.set_project('COMM2011')
awe> raws = (RawScienceFrame.OBJECT=='SA110')&(RawScienceFrame.is_valid<>0)&(RawScienceFrame.DATE_OBS>datetime.datetime(2011,5,9))&(RawScienceFrame.filter.name=='OCAM_g_SDSS')&(RawScienceFrame.astrom.CRVAL1<>280.458333)
# not 280.458333 which is not part of the 32 pointings
2) separate the different exposures
awe> from astro.experimental import jtools
awe> rg = jtools.group_list(raws, 'DATE_OBS')
3) simulate the the boundingbox of each corr. coadd.
awe> coadds = [jtools.BoundingBox({'method':'union',
'objects':frames}) for frames in rg.values()]
4) get the overlap of all these coadds, this is the interesting area
awe> overlap = jtools.BoundingBox({'method':'intersection', 'objects':coadds})
5) optional: a nice plot?
awe> import pylab as pl
awe> pl.clf()
awe> for c in coadds: c.plot()
awe> overlap.plot('g', cross=True)
6) get the raws that overlap more than 90% with the 'coadds-overlap'
awe> overlapping_raws = dict([(key, jtools.get_value(filter(lambda
frame: jtools.BoundingBox(frame).get_overlap(overlap, fraction=True) >
0.9, frames))) for key, frames in rg.items()])
More information about the Comm2011
mailing list