Store as one big table in
,
where
awe> sourcelist = SourceList()
awe> sourcelist.frame = coaddedframe
awe> sourcelist.frame.retrieve()
awe> sourcelist.make()
awe> sourcelist = SourceList()
awe> sourcelist.frame = coaddedframe
awe> sourcelist.frame.retrieve()
awe> sourcelist.sexconf.DETECTION_THRESHOLD = 12
awe> sourcelist.sexparam = ['MAG_APER', 'MAGERR_APER']
awe> sourcelist.make()
awe> sourcelist = SourceList(pathname='external.fits')
awe> sourcelist.make_sourcelist_from_catalog()
How to retrieve a SourceList:
awe> sourcelist = (SourceList.SLID == 4130)[0]
awe> sourcelist = (SourceList.name == 'MySourceList')[0]
awe> sourcelists = (SourceList.name.like('GAS*'))
awe> nos = len(sourcelist.sources)
awe> nos = sourcelist.number_of_sources
awe> print sourcelist.info()
awe> attrs = sourcelist.sources.get_attributes()
awe> print attrs
awe> RA = sourcelist.sources.RA
awe> print RA
awe> source_info = sourcelist.sources[13]
awe> print source_info
awe> sourcelist.sources.make_skycat(sid_list=None,
filename=None)
awe> help(sourcelist.sources.make_skycat)
awe> sourcelist.sources.area_search(self_search=True,
htm_depth=20,
Area=None)
awe> help(sourcelist.sources.area_search)
awe> r = sourcelist.sources.area_search(Area=[(1,0),(0,0),(0,1),(1,1)])
awe> print 'Sources found: ', len(r[sourcelist.SLID])
awe> sourcelist.sources.get_data(dict)
awe> help(sourcelist.sources.get_data)
awe> d = {'RA':[], 'DEC':[], 'MAG_ISO':[]}
awe> r = sourcelist.sources.get_data(d)
awe> sourcelist.sources.sql_query(dict, query_string)
awe> help(sourcelist.sources.sql_query)
awe> d = {'RA':[], 'DEC':[], 'MAG_ISO':[]}
awe> r = sourcelist.sources.sql_query(d, 'MAG_ISO<18.5 AND A>0.2')
awe> AL = AssociateList()
awe> sl0 = (SourceList.SLID == 0)[0]
awe> sl1 = (SourceList.SLID == 1)[0]
awe> AL.input_lists.append(sl0)
awe> AL.input_lists.append(sl1)
awe> AL.make()
optional:
awe> AL.set_search_distance(5.0)
awe> AL.filter_for_closest_pairs = False
awe> AL.set_search_area(llra,lldec,lrra,lrdec,urra,urdec,ulra,uldec)
awe> AL.associatelisttype = 1
NOTE: You can give an existing AssociateList as input instead of a SourceList.



awe> asslist.associates.count_from_members(members=0,
mode='EQ')
awe> help(asslist.associates.count_from_members)
awe> asslist.associates.count_from_flag(mask=None,
mode='ANY',
count=None,
countmode='EQ')
awe> help(asslist.associates.count_from_flag)
awe> asslist.associates.get_data(attrlist=[],
mask=None,
mode='ANY',
count=None,
countmode='EQ')
awe> help(asslist.associates.get_data)
awe> attrlist = ['RA', 'DEC', 'MAG_ISO']
awe> r = asslist.associates.get_data(attrlist,mask=3,mode='ALL')
awe> aids = [k for k in r.keys()]
awe> aids.sort()
awe> print 'AID', attrlist
awe> for aid in aids[:10]:
awe> for row in r[aid]:
awe> print aid, row
Find an associatelist which was used for a Global Astrometric Solution. Then try to find the distance between two different pointings by comparing the grid positions of associated sources i.e. sources belonging to the same association.
Hints:
gass = GAstrometric.gasslist.name != ''
gasslist = gass[0].gasslist
gasslist.associates.get_attributes()
Solution:
attrlist = ['Xpos', 'Ypos']
r = gasslist.associates.get_data(attrlist=attrlist,
mask= 2 + 4,
mode= 'INTERSECT')