Changeset 36711
- Timestamp:
- Apr 30, 2014, 9:40:55 PM (12 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 2 edited
-
gpc1db.py (modified) (2 diffs)
-
stackbatch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/gpc1db.py
r36709 r36711 504 504 joined to the dvodb 505 505 ''' 506 def getStackID sFromSkyID(self,dvoDb,skyID,filter):506 def getStackIDFromSkyIDAndFilter(self,dvoDb,skyID,filter): 507 507 508 508 self.logger.infoPair("finding stack_ids from gpc1 for sky_id ", skyID) … … 533 533 self.logger.exception("can't query for stackid in DVO") 534 534 self.logger.infoPair("failed sql:", sql) 535 return rows535 return -999 536 536 537 537 self.logger.infoPair("number of stackIDs found ", len(rows)) -
trunk/ippToPsps/jython/stackbatch.py
r36709 r36711 59 59 self.logger.infoPair("did I get", "here"); 60 60 self.stackType = "DEEP_STACK" # TODO 61 ## = stuff I commented out for pv2 stacks 62 63 #heather tasks 64 65 # get a list of stackIDs 66 self.logger.infoPair ("getting stackID for: ","g.00000") 67 self.gstackID = getStackIDFromSkyIDAndFilter( skychunk.dvoLabel, skyID, "g.00000") 68 self.logger.infoPair ("getting stackID for: ","r.00000") 69 self.rstackID = getStackIDFromSkyIDAndFilter( skychunk.dvoLabel, skyID, "r.00000") 70 self.logger.infoPair ("getting stackID for: ","i.00000") 71 self.istackID = getStackIDFromSkyIDAndFilter( skychunk.dvoLabel, skyID, "i.00000") 72 self.logger.infoPair ("getting stackID for: ","z.00000") 73 self.zstackID = getStackIDFromSkyIDAndFilter( skychunk.dvoLabel, skyID, "z.00000") 74 self.logger.infoPair ("getting stackID for: ","y.00000") 75 self.ystackID = getStackIDFromSkyIDAndFilter( skychunk.dvoLabel, skyID, "y.00000") 76 77 # from each stackget fits name from getStackStageCmf 78 self.logger.infoPair ("finding fits file for: ","g.00000") 79 self.gfits = getStackStageCmf(skychunk.dvoLabel, gstackID) 80 self.logger.infoPair ("finding fits file for: ","r.00000") 81 self.rfits = getStackStageCmf(skychunk.dvoLabel, rstackID) 82 self.logger.infoPair ("finding fits file for: ","i.00000") 83 self.ifits = getStackStageCmf(skychunk.dvoLabel, istackID) 84 self.logger.infoPair ("finding fits file for: ","z.00000") 85 self.zfits = getStackStageCmf(skychunk.dvoLabel, zstackID) 86 self.logger.infoPair ("finding fits file for: ","y.00000") 87 self.yfits = getStackStageCmf(skychunk.dvoLabel, ystackID) 88 89 #from each of those get self.gheader, self.rheader, etc. 90 91 if self.gfits: 92 self.gheader = self.gfits.getPrimaryHeader() 93 if not self.gheader: 94 self.logger.errorPair("could not read FITS PHU for ",gstackID) 95 raise 96 97 if self.rfits: 98 self.rheader = self.rfits.getPrimaryHeader() 99 if not self.rheader: 100 self.logger.errorPair("could not read FITS PHU for ",rstackID) 101 raise 102 103 if self.ifits: 104 self.iheader = self.ifits.getPrimaryHeader() 105 if not self.iheader: 106 self.logger.errorPair("could not read FITS PHU for ",istackID) 107 raise 108 109 if self.zfits: 110 self.zheader = self.zfits.getPrimaryHeader() 111 if not self.zheader: 112 self.logger.errorPair("could not read FITS PHU for ",zstackID) 113 raise 114 115 if self.yfits: 116 self.yheader = self.yfits.getPrimaryHeader() 117 if not self.yheader: 118 self.logger.errorPair("could not read FITS PHU for ",ystackID) 119 raise 61 120 62 121 # get stack meta data 63 meta = self.gpc1Db.getStackStageMeta(self.id) 122 meta = self.gpc1Db.getStackStageMeta(self.gstackID) 123 ## this should be ok - it takes a stack_id and returns filter/skycell etc. 124 125 64 126 if not meta: 65 127 self.logger.errorPair("Could not get stack", "metadata") 66 128 raise 67 129 68 self.filter = meta[0];69 self.filter = self.filter[0:1]70 self.filterID = self.scratchDb.getFilterID(self.filter)130 ##self.filter = meta[0]; 131 ##self.filter = self.filter[0:1] 132 ##self.filterID = self.scratchDb.getFilterID(self.filter) 71 133 self.skycell = meta[1]; 72 134 … … 92 154 # self.skycell = str( (tessID * (10000 * 1000)) + (int(self.projectioncell) * 1000) + cellID ) 93 155 94 self.analysisVer = meta[2];156 ##self.analysisVer = meta[2]; 95 157 96 158 #self.expTime = gpc1Db.getStackExpTime(self.id) 97 self.expTime = self.header['EXPTIME']159 ##self.expTime = self.header['EXPTIME'] 98 160 99 161 # delete PSPS tables 100 self.scratchDb.dropTable("StackMeta") 162 self.scratchDb.dropTable("gStackMeta") 163 self.scratchDb.dropTable("rStackMeta") 164 self.scratchDb.dropTable("iStackMeta") 165 self.scratchDb.dropTable("zStackMeta") 166 self.scratchDb.dropTable("yStackMeta") 167 101 168 self.scratchDb.dropTable("StackObject") 102 169 self.scratchDb.dropTable("StackModelFit") … … 105 172 # self.testprint() 106 173 174 # for PV2 we will have (grizy) of stack meta and skychip 175 176 107 177 # delete IPP tables 108 self.scratchDb.dropTable("SkyChip_psf") 109 self.scratchDb.dropTable("SkyChip_xrad") 110 self.scratchDb.dropTable("SkyChip_xfit") 111 self.scratchDb.dropTable("SkyChip_xsrc") 178 self.scratchDb.dropTable("gSkyChip_psf") 179 self.scratchDb.dropTable("gSkyChip_xrad") 180 self.scratchDb.dropTable("gSkyChip_xfit") 181 self.scratchDb.dropTable("gSkyChip_xsrc") 182 self.scratchDb.dropTable("rSkyChip_psf") 183 self.scratchDb.dropTable("rSkyChip_xrad") 184 self.scratchDb.dropTable("rSkyChip_xfit") 185 self.scratchDb.dropTable("rSkyChip_xsrc") 186 self.scratchDb.dropTable("iSkyChip_psf") 187 self.scratchDb.dropTable("iSkyChip_xrad") 188 self.scratchDb.dropTable("iSkyChip_xfit") 189 self.scratchDb.dropTable("iSkyChip_xsrc") 190 self.scratchDb.dropTable("zSkyChip_psf") 191 self.scratchDb.dropTable("zSkyChip_xrad") 192 self.scratchDb.dropTable("zSkyChip_xfit") 193 self.scratchDb.dropTable("zSkyChip_xsrc") 194 self.scratchDb.dropTable("ySkyChip_psf") 195 self.scratchDb.dropTable("ySkyChip_xrad") 196 self.scratchDb.dropTable("ySkyChip_xfit") 197 self.scratchDb.dropTable("ySkyChip_xsrc") 112 198 113 199 # create an output filename, which is {stackID}.FITS … … 119 205 120 206 # insert what we know about this stack batch into the stack table 121 self.ippToPspsDb.insertStackMeta(self.batchID, self.filter, self.stackType)207 self.ippToPspsDb.insertStackMeta(self.batchID, "grizy" , self.stackType) 122 208 123 209 # insert sourceID/imageID combo so DVO can look it up 124 if not self.useFullTables:125 self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID'])210 ##if not self.useFullTables: 211 ## self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID']) 126 212 127 213 # self.testprint() … … 132 218 self.logger.infoPair("Skycell", "%s" % self.skycell) 133 219 self.logger.infoPair("Projectioncell", "%s" % self.projectioncell) 134 self.logger.infoPair("Filter", "%s" % self.filter)220 ##self.logger.infoPair("Filter", "%s" % self.filter) 135 221 136 222 ''' … … 922 1008 923 1009 # HAF everything is commented out for now with ## 924 ##if not self.useFullTables: 925 ## if not self.getIDsFromDVO(): 926 ## return False 927 ##self.logger.infoPair("populating","StackMeta") 928 ##self.populateStackMeta() 1010 if not self.useFullTables: 1011 if not self.getIDsFromDVO(): 1012 return False 1013 self.logger.infoPair("populating","gStackMeta") 1014 self.populateStackMeta("g.00000") 1015 self.logger.infoPair("populating","rStackMeta") 1016 self.populateStackMeta("r.00000") 1017 self.logger.infoPair("populating","iStackMeta") 1018 self.populateStackMeta("i.00000") 1019 self.logger.infoPair("populating","zStackMeta") 1020 self.populateStackMeta("z.00000") 1021 self.logger.infoPair("populating","yStackMeta") 1022 self.populateStackMeta("y.00000") 1023 929 1024 ##self.logger.infoPair("populating","StackObject") 930 1025 ##self.populateStackObject()
Note:
See TracChangeset
for help on using the changeset viewer.
