Changeset 37927
- Timestamp:
- Feb 23, 2015, 4:08:25 PM (11 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 7 edited
-
config/ippToPspsDbSchema.sql (modified) (1 diff)
-
config/tables.FO.vot (modified) (4 diffs)
-
jython/Makefile.am (modified) (1 diff)
-
jython/diffobjectbatch.py (modified) (14 diffs)
-
jython/dvodiffobjects.py (modified) (3 diffs)
-
jython/forcedobjectbatch.py (modified) (12 diffs)
-
jython/loader.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/config/ippToPspsDbSchema.sql
r37917 r37927 199 199 `region` varchar(50) default NULL, 200 200 KEY `batch_id` (`batch_id`), 201 CONSTRAINT ` diffobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`)201 CONSTRAINT `forcedobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`) 202 202 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 203 203 SET character_set_client = @saved_cs_client; -
trunk/ippToPsps/config/tables.FO.vot
r37840 r37927 264 264 <DESCRIPTION>flags for i forced</DESCRIPTION> 265 265 </FIELD> 266 <FIELD name="iLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">267 <DESCRIPTION>per-object smear polarizability X11 term</DESCRIPTION>268 </FIELD>269 <FIELD name="iLensObjSmearX12" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">270 <DESCRIPTION>per-object smear polarizability X12 term</DESCRIPTION>271 </FIELD>272 <FIELD name="iLensObjSmearX22" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">273 <DESCRIPTION>per-object smear polarizability X22 term</DESCRIPTION>274 </FIELD>275 <FIELD name="iLensObjSmearE1" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">276 <DESCRIPTION>per-object smear polarizability E1 term</DESCRIPTION>277 </FIELD>278 <FIELD name="iLensObjSmearE2" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">279 <DESCRIPTION>per-object smear polarizability E2 term</DESCRIPTION>280 </FIELD>281 266 <FIELD name="iGamma" arraysize="1" datatype="float" unit="arcsec^2" default="-999"> 282 267 <DESCRIPTION>second moment (Mxx+Myy)</DESCRIPTION> … … 460 445 </DATA> 461 446 </TABLE> 462 <TABLE name="ForcedMean Object">463 <DESCRIPTION>VOTable description of PSPS table ForcedMean Object</DESCRIPTION>447 <TABLE name="ForcedMeanLensing"> 448 <DESCRIPTION>VOTable description of PSPS table ForcedMeanLensing</DESCRIPTION> 464 449 <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM> 465 450 <FIELD name="objID" arraysize="1" datatype="long" unit="dimensionless" default="NA"> … … 607 592 <DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION> 608 593 </FIELD> 594 <FIELD name="iLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999"> 595 <DESCRIPTION>per-object smear polarizability X11 term</DESCRIPTION> 596 </FIELD> 597 <FIELD name="iLensObjSmearX12" arraysize="1" datatype="float" unit="arcsec^-2" default="-999"> 598 <DESCRIPTION>per-object smear polarizability X12 term</DESCRIPTION> 599 </FIELD> 600 <FIELD name="iLensObjSmearX22" arraysize="1" datatype="float" unit="arcsec^-2" default="-999"> 601 <DESCRIPTION>per-object smear polarizability X22 term</DESCRIPTION> 602 </FIELD> 603 <FIELD name="iLensObjSmearE1" arraysize="1" datatype="float" unit="arcsec^-2" default="-999"> 604 <DESCRIPTION>per-object smear polarizability E1 term</DESCRIPTION> 605 </FIELD> 606 <FIELD name="iLensObjSmearE2" arraysize="1" datatype="float" unit="arcsec^-2" default="-999"> 607 <DESCRIPTION>per-object smear polarizability E2 term</DESCRIPTION> 608 </FIELD> 609 609 <FIELD name="iLensObjShearX11" arraysize="1" datatype="float" unit="dimensionless" default="-999"> 610 610 <DESCRIPTION>per-object shear polarizability X11 term</DESCRIPTION> … … 778 778 <DESCRIPTION>psf model shear polarizability E2 term</DESCRIPTION> 779 779 </FIELD> 780 <DATA> 781 <TABLEDATA></TABLEDATA> 782 </DATA> 780 783 </TABLE> 781 784 </RESOURCE> -
trunk/ippToPsps/jython/Makefile.am
r37551 r37927 14 14 diffobjectbatch.py \ 15 15 dvodetections.py \ 16 dvodiffobjects.py \ 16 17 dvoforceddetections.py \ 17 18 dvoforcedobjects.py \ -
trunk/ippToPsps/jython/diffobjectbatch.py
r37917 r37927 14 14 from ipptopspsdb import IppToPspsDb 15 15 from scratchdb import ScratchDb 16 from dvoobjects import DvoObjects 16 #from dvoobjects import DvoObjects 17 from dvodiffobjects import DvoDiffObjects 17 18 from sqlUtility import sqlUtility 18 19 … … 53 54 54 55 try: 55 self.dvo Objects = DvoObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb, self.scratchDb)56 self.dvoDiffObjects = DvoDiffObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb, self.scratchDb) 56 57 except: 57 self.logger.errorPair("Unable to create instance of", "Dvo Objects")58 self.logger.errorPair("Unable to create instance of", "DvoDiffObjects") 58 59 raise 59 60 … … 72 73 self.region = self.scratchDb.getRegionNameFromThisDvoIndex(self.id) 73 74 self.ippToPspsDb.insertObjectMeta(self.batchID, self.region) 74 self.dvo Objects.nativeIngestRegion(self.region)75 self.dvoDiffObjects.nativeIngestRegion(self.region) 75 76 76 77 cptTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cpt") … … 184 185 except: 185 186 self.logger.errorPair("failed sql", sql) 187 raise 186 188 return False 187 189 188 190 189 191 # XXX this does not seem like a good thing to leave in SQL 190 self.logger.infoPair("Calculating nDetections from", "n[filters]")191 for filter in filters:192 #self.logger.infoPair("Calculating nDetections from", "n[filters]") 193 #for filter in filters: 192 194 # now do a sum of n[filters], but do not include the ones with -999 193 sql = "UPDATE DiffDetObject " 194 sql += "SET nDetections = nDetections + " + filter[1] +"nTotal " 195 sql += " WHERE " + filter[1] + "nTotal != -999" 196 try: 197 self.scratchDb.execute(sql) 198 except: 199 self.logger.errorPair("failed sql", sql) 200 return False 195 # sql = "UPDATE DiffDetObject " 196 # sql += "SET nDetections = nDetections + n" + filter[1] 197 # sql += " WHERE n" + filter[1] + " != -999" 198 # try: 199 # self.scratchDb.execute(sql) 200 # except: 201 # self.logger.errorPair("failed sql", sql) 202 # raise 203 201 204 202 205 … … 223 226 except: 224 227 self.logger.errorPair("failed sql", sql) 225 r eturn False228 raise 226 229 227 230 ## use mean ra and dec (dec < 0) … … 241 244 except: 242 245 self.logger.errorPair("failed sql", sql) 243 r eturn False246 raise 244 247 245 248 ''' … … 261 264 except: 262 265 self.logger.errorPair("Couldn't squash out of range stuff", sql) 263 r eturn False266 raise 264 267 265 268 self.logger.infoPair("setting to null > 1e-38 and < 1e-38 in", "cps FLUX_KRON") … … 270 273 except: 271 274 self.logger.errorPair("Couldn't squash out of range stuff", sql) 272 r eturn False275 raise 273 276 274 277 … … 288 291 sqlLine.group("batchID", "'" + str(self.batchID) + "'") 289 292 sqlLine.group("dvoRegionID", "CAT_ID") 290 sqlLine.group("skycellID", "SKYCELL_ID")293 # sqlLine.group("skycellID", "SKYCELL_ID") 291 294 sqlLine.group("dataRelease", "'" + str(self.skychunk.dataRelease) + "'") 292 295 sqlLine.group("objInfoFlag", "FLAGS") … … 304 307 except: 305 308 self.logger.errorPair("Couldn't populate DiffDetObject table", sql) 306 r eturn False309 raise 307 310 308 311 # add row count columns so we can perform joins to get colors … … 317 320 318 321 self.logger.infoPair("update DiffDetObject from ","cps table") 319 322 #this fills ng/etc 320 323 self.updateDiffObjectFromCps(cpsTableName) 321 324 #this fills qfperfect 325 self.updateMeanObjectFromCps(cpsTableName) 322 326 # XXX EAM 20140724 : is this necessary?? 323 327 #objects can have out of range ra dec in dvo - need to find and kill them at the end … … 360 364 except: 361 365 self.logger.errorPair("Couldn't cull outsiders from DiffDetObject table", sql) 362 r eturn False366 raise 363 367 364 368 self.logger.infoPair("Dropping row column from", "DiffDetObject table") … … 385 389 except: 386 390 self.logger.errorPair('failed sql',sql) 387 r eturn391 raise 388 392 389 393 … … 425 429 self.scratchDb.dropColumn("DiffDetObject", "row") 426 430 427 self.dvo Objects.purgeRegion(self.region)431 self.dvoDiffObjects.purgeRegion(self.region) 428 432 429 433 #this is abuse of something but this is how I get the object batches to crash to further investigate them -
trunk/ippToPsps/jython/dvodiffobjects.py
r37750 r37927 15 15 A class for ingesting DVO detections into MySQL 16 16 ''' 17 class Dvo Objects(Dvo):17 class DvoDiffObjects(Dvo): 18 18 19 19 ''' … … 22 22 def __init__(self, logger, config, skychunk, ippToPspsDb, scratchDb): 23 23 24 super(Dvo Objects, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDb)24 super(DvoDiffObjects, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDb) 25 25 26 26 # declare DVO file types of interest … … 39 39 40 40 # TODO path to DVO prog hardcoded temporarily 41 cmd = "dvopsps objects"41 cmd = "dvopsps diffobj" 42 42 cmd += " -dbhost " + self.scratchDb.dbHost 43 43 cmd += " -dbname " + self.scratchDb.dbName -
trunk/ippToPsps/jython/forcedobjectbatch.py
r37918 r37927 25 25 26 26 ''' 27 class Forced MeanObjectBatch(Batch):27 class ForcedObjectBatch(Batch): 28 28 29 29 ''' … … 40 40 batchID): 41 41 42 super(Forced MeanObjectBatch, self).__init__(42 super(ForcedObjectBatch, self).__init__( 43 43 logger, 44 44 config, … … 71 71 72 72 self.region = self.scratchDb.getRegionNameFromThisDvoIndex(self.id) 73 self.ippToPspsDb.insertForced MeanObjectMeta(self.batchID, self.region)73 self.ippToPspsDb.insertForcedObjectMeta(self.batchID, self.region) 74 74 self.dvoForcedObjects.nativeIngestRegion(self.region) 75 75 … … 86 86 return False 87 87 88 self.logger.infoPair("checking if we have anything in"," cpy/cpt") 89 rowcountcpt = self.scratchDb.getRowCount(cptTableName); 90 rowcountcpy = self.scratchDb.getRowCount(cpyTableName); 91 if (rowcountcpt == 0): 92 self.logger.infoPair("0 rows for ","cpt table") 93 return False 94 if (rowcountcpy == 0): 95 self.logger.infoPair("o rows for ","cpy table") 96 return False 88 97 return True 89 98 … … 104 113 105 114 return True 115 116 117 ''' 118 Updates table and generates pspsuniqueids 119 ''' 120 121 def updatePspsUniqueIDs(self): 122 sql = "UPDATE ForcedMeanObject set uniquePspsFOid = (("+str(self.batchID)+"*1000000000 ) + row)" 123 try: self.scratchDb.execute(sql) 124 except: 125 self.logger.errorPair('failed sql',sql) 126 raise 127 128 129 106 130 107 131 ''' … … 146 170 SET \ 147 171 ForcedMeanObject." + filter[1] + "nTotal = NWARP \ 148 ,ForcedMeanObject." + filter[1] + "nIncPSF Mag= NUSED_WRP \149 ,ForcedMeanObject." + filter[1] + "nIncKron Mag= NUSED_KRON_WRP \150 ,ForcedMeanObject." + filter[1] + "nIncAp Mag= NUSED_AP_WRP \151 ,ForcedMeanObject." + filter[1] + "PSF Mag = MAG_PSF_WRP \152 ,ForcedMeanObject." + filter[1] + "PSF MagErr = MAG_PSF_WRP_ERR \153 ,ForcedMeanObject." + filter[1] + "PSF MagStd = MAG_PSF_WRP_STD\154 ,ForcedMeanObject." + filter[1] + "Kron Mag = MAG_KRON_WRP \155 ,ForcedMeanObject." + filter[1] + "Kron MagErr = MAG_KRON_WRP_ERR \156 ,ForcedMeanObject." + filter[1] + "Kron MagStd = MAG_KRON_WRP_STD\157 ,ForcedMeanObject." + filter[1] + "Ap Mag = MAG_AP_WRP \158 ,ForcedMeanObject." + filter[1] + "Ap MagErr = MAG_AP_WRP_ERR \159 ,ForcedMeanObject." + filter[1] + "Ap MagStd = MAG_AP_WRP_STD\172 ,ForcedMeanObject." + filter[1] + "nIncPSFFlux = NUSED_WRP \ 173 ,ForcedMeanObject." + filter[1] + "nIncKronFlux = NUSED_KRON_WRP \ 174 ,ForcedMeanObject." + filter[1] + "nIncApFlux = NUSED_AP_WRP \ 175 ,ForcedMeanObject." + filter[1] + "PSFFlux = FLUX_PSF_WRP \ 176 ,ForcedMeanObject." + filter[1] + "PSFFluxErr = FLUX_PSF_WRP_ERR \ 177 ,ForcedMeanObject." + filter[1] + "PSFFluxStd = FLUX_PSF_WRP_STDEV \ 178 ,ForcedMeanObject." + filter[1] + "KronFlux = FLUX_KRON_WRP \ 179 ,ForcedMeanObject." + filter[1] + "KronFluxErr = FLUX_KRON_WRP_ERR \ 180 ,ForcedMeanObject." + filter[1] + "KronFluxStd = FLUX_KRON_WRP_STDEV \ 181 ,ForcedMeanObject." + filter[1] + "ApFlux = FLUX_AP_WRP \ 182 ,ForcedMeanObject." + filter[1] + "ApFluxErr = FLUX_AP_WRP_ERR \ 183 ,ForcedMeanObject." + filter[1] + "ApFluxStd = FLUX_AP_WRP_STDEV \ 160 184 ,ForcedMeanObject." + filter[1] + "Flags = FLAGS " 161 185 … … 163 187 try: self.scratchDb.execute(sql) 164 188 except: 165 self.logger.errorPair("failed update MeanObject", sql)189 self.logger.errorPair("failed update ForcedMeanObject", sql) 166 190 raise 167 191 … … 175 199 SET " + filter[1] + "PSFMagErr = null \ 176 200 WHERE " + filter[1] + "PSFMagErr > " + str(cut) 177 self.scratchDb.execute(sql) 178 201 # taking out the cut since this is for mag, not flux 202 203 # try: self.scratchDb.execute(sql) 204 # except: 205 # self.logger.errorPair("failed setting null meanmagerr","ForcedMeanObject") 206 # raise 179 207 self.logger.infoPair("Calculating nDetections from", "n[filters]") 180 208 for filter in filters: 181 209 # now do a sum of n[filters], but do not include the ones with -999 182 sql = "UPDATE ForcedMeanObject "210 sql = "UPDATE ForcedMeanObject " 183 211 sql += "SET nDetections = nDetections + " + filter[1] +"nTotal " 184 sql += " WHERE n" + filter[1] + "!= -999"185 self.scratchDb.execute(sql)212 sql += " WHERE " + filter[1] + "nTotal != -999" 213 #self.scratchDb.execute(sql) 186 214 try: self.scratchDb.execute(sql) 187 215 except: … … 192 220 Inserts stuff for all mags from the cpy files 193 221 ''' 194 def updateForcedMean ObjectFromCpy(self, cpyTable):222 def updateForcedMeanTablesFromCpy(self, cpyTable): 195 223 196 224 # list of all filters PSPS is interested in … … 229 257 " + cpyTable + " AS cpy ON (cpy.row = (ForcedMeanObject.row* " + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) \ 230 258 SET \ 231 ForcedMeanObject." + filter[1] + "nIncR5 = NMEAS \259 ForcedMeanObject." + filter[1] + "nIncR5 = NMEAS \ 232 260 ,ForcedMeanObject." + filter[1] + "nIncR6 = NMEAS \ 233 261 ,ForcedMeanObject." + filter[1] + "FmeanflxR5 = FLUX_AP_R5 \ … … 239 267 ,ForcedMeanObject." + filter[1] + "FmeanflxR6Std = FLUX_STD_AP_R6 \ 240 268 ,ForcedMeanObject." + filter[1] + "FmeanflxR6Fill = FLUX_FIL_AP_R6 \ 241 ,ForcedMeanObject." + filter[1] + "LensObjSmearX11 = X11_SM_OBJ \242 ,ForcedMeanObject." + filter[1] + "LensObjSmearX12 = X12_SM_OBJ \243 ,ForcedMeanObject." + filter[1] + "LensObjSmearX22 = X22_SM_OBJ \244 ,ForcedMeanObject." + filter[1] + "LensObjSmearE1 = E1_SM_OBJ \245 ,ForcedMeanObject." + filter[1] + "LensObjSmearE2 = E2_SM_OBJ \246 ,ForcedMeanObject." + filter[1] + "LensObjShearX11 = X11_SH_OBJ \247 ,ForcedMeanObject." + filter[1] + "LensObjShearX12 = X12_SH_OBJ \248 ,ForcedMeanObject." + filter[1] + "LensObjShearX22 = X22_SH_OBJ \249 ,ForcedMeanObject." + filter[1] + "LensObjShearE1 = E1_SH_OBJ \250 ,ForcedMeanObject." + filter[1] + "LensObjShearE2 = E2_SH_OBJ \251 ,ForcedMeanObject." + filter[1] + "LensPSFSmearX11 = X11_SM_PSF \252 ,ForcedMeanObject." + filter[1] + "LensPSFSmearX12 = X12_SM_PSF \253 ,ForcedMeanObject." + filter[1] + "LensPSFSmearX22 = X22_SM_PSF \254 ,ForcedMeanObject." + filter[1] + "LensPSFSmearE1 = E1_SM_PSF \255 ,ForcedMeanObject." + filter[1] + "LensPSFSmearE2 = E2_SM_PSF \256 ,ForcedMeanObject." + filter[1] + "LensPSFShearX11 = X11_SH_PSF \257 ,ForcedMeanObject." + filter[1] + "LensPSFShearX12 = X12_SH_PSF \258 ,ForcedMeanObject." + filter[1] + "LensPSFShearX22 = X22_SH_PSF \259 ,ForcedMeanObject." + filter[1] + "LensPSFShearE1 = E1_SH_PSF \260 ,ForcedMeanObject." + filter[1] + "LensPSFShearE2 = E2_SH_PSF \261 269 ,ForcedMeanObject." + filter[1] + "Gamma = GAMMA \ 262 270 ,ForcedMeanObject." + filter[1] + "E1 = E1 \ 263 271 ,ForcedMeanObject." + filter[1] + "E2 = E2 " 264 272 265 266 273 try: self.scratchDb.execute(sql) 267 274 except: 268 self.logger.errorPair("failed update on ForcedMeanObject using cpy table", sql) 275 self.logger.errorPair("failed update on ForcedMeanObject using cpy table",sql) 276 raise 277 278 sql = "UPDATE ForcedMeanLensing JOIN \ 279 " + cpyTable + " AS cpy ON (cpy.row = (ForcedMeanLensing.row* " + str(filterCount) + ")-(" + str(filterCount) + " - " + str(filter[0]) + ")) \ 280 SET \ 281 ForcedMeanLensing." + filter[1] + "LensObjSmearX11 = X11_SM_OBJ \ 282 ,ForcedMeanLensing." + filter[1] + "LensObjSmearX12 = X12_SM_OBJ \ 283 ,ForcedMeanLensing." + filter[1] + "LensObjSmearX22 = X22_SM_OBJ \ 284 ,ForcedMeanLensing." + filter[1] + "LensObjSmearE1 = E1_SM_OBJ \ 285 ,ForcedMeanLensing." + filter[1] + "LensObjSmearE2 = E2_SM_OBJ \ 286 ,ForcedMeanLensing." + filter[1] + "LensObjShearX11 = X11_SH_OBJ \ 287 ,ForcedMeanLensing." + filter[1] + "LensObjShearX12 = X12_SH_OBJ \ 288 ,ForcedMeanLensing." + filter[1] + "LensObjShearX22 = X22_SH_OBJ \ 289 ,ForcedMeanLensing." + filter[1] + "LensObjShearE1 = E1_SH_OBJ \ 290 ,ForcedMeanLensing." + filter[1] + "LensObjShearE2 = E2_SH_OBJ \ 291 ,ForcedMeanLensing." + filter[1] + "LensPSFSmearX11 = X11_SM_PSF \ 292 ,ForcedMeanLensing." + filter[1] + "LensPSFSmearX12 = X12_SM_PSF \ 293 ,ForcedMeanLensing." + filter[1] + "LensPSFSmearX22 = X22_SM_PSF \ 294 ,ForcedMeanLensing." + filter[1] + "LensPSFSmearE1 = E1_SM_PSF \ 295 ,ForcedMeanLensing." + filter[1] + "LensPSFSmearE2 = E2_SM_PSF \ 296 ,ForcedMeanLensing." + filter[1] + "LensPSFShearX11 = X11_SH_PSF \ 297 ,ForcedMeanLensing." + filter[1] + "LensPSFShearX12 = X12_SH_PSF \ 298 ,ForcedMeanLensing." + filter[1] + "LensPSFShearX22 = X22_SH_PSF \ 299 ,ForcedMeanLensing." + filter[1] + "LensPSFShearE1 = E1_SH_PSF \ 300 ,ForcedMeanLensing." + filter[1] + "LensPSFShearE2 = E2_SH_PSF " 301 302 try: self.scratchDb.execute(sql) 303 except: 304 self.logger.errorPair("failed update on ForcedMeanLensing using cpy table", sql) 269 305 raise 270 306 … … 299 335 except: 300 336 self.logger.errorPair("Couldn't populate Object table from cpt", sql) 301 r eturn False337 raise 302 338 303 339 # add row count columns so we can perform joins to get colors 304 self.logger.infoPair("Adding 'row' columns to", "Object and cpstables")340 self.logger.infoPair("Adding 'row' columns to", "Object ,cps, cpy tables") 305 341 self.scratchDb.addRowCountColumn("ForcedMeanObject", "row") 306 342 self.scratchDb.addRowCountColumn(cpsTableName, "row") 343 self.scratchDb.addRowCountColumn(cpyTableName, "row") 344 345 self.logger.infoPair("generating unique ids for ","ForcedMeanObject") 346 self.updatePspsUniqueIDs() 307 347 308 348 309 349 self.logger.infoPair("update ForcedMeanObject from ","cps table") 310 311 350 self.updateForcedMeanObjectFromCps(cpsTableName) 312 351 313 self.logger.infoPair("update ForcedMeanObject from ","cpy table") 314 315 self.updateForcedMeanObjectFromCpy(cpyTableName) 352 sqlLine = sqlUtility("INSERT INTO ForcedMeanLensing (") 353 354 sqlLine.group("objID", "objID") 355 sqlLine.group("uniquePspsFOid","uniquePspsFOid") 356 sqlLine.group("ippObjID", "ippObjID") 357 sqlLine.group("batchID", "batchID") 358 sqlLine.group("nDetections", "nDetections") 359 sqlLine.group("gStackID", "gStackID") 360 sqlLine.group("rStackID", "rStackID") 361 sqlLine.group("iStackID", "iStackID") 362 sqlLine.group("zStackID", "zStackID") 363 sqlLine.group("yStackID", "yStackID") 364 365 sql = sqlLine.makeRaw(") SELECT ", " FROM ForcedMeanObject") 366 367 try: 368 self.scratchDb.execute(sql) 369 except: 370 self.logger.errorPair("Couldn't populate ForcedMeanLensing table from ForcedMeanObject", sql) 371 raise 372 373 self.logger.infoPair("adding row to ","ForcedMeanLensing") 374 self.scratchDb.addRowCountColumn("ForcedMeanLensing", "row") 375 376 self.logger.infoPair("updating ForcedMeanObject and ForcedMeanLensing from ","cpy tables") 377 self.updateForcedMeanTablesFromCpy(cpyTableName) 316 378 317 379 318 380 self.logger.infoPair("Dropping row column from", "ForcedMeanObject table") 319 381 self.scratchDb.dropColumn("ForcedMeanObject", "row") 320 382 self.logger.infoPair("Dropping row column from", "ForcedMeanLensing table") 383 self.scratchDb.dropColumn("ForcedMeanLensing", "row") 321 384 ##self.logger.infoPair("Purging from scratch Db", self.region + " region") 322 385 323 386 ##Don't do this till after MeanObject 324 387 ##self.dvoForcedObjects.purgeRegion(self.region) 325 388 self.logger.infoPair("setting minmaxobjid for ", "ForcedMeanObject table") 326 389 self.setMinMaxObjID(["ForcedMeanObject"]) 327 328 return True 390 self.logger.infoPair("checking if we have detctions", "FOrcedMeanObject table") 391 rowcount = self.scratchDb.getRowCount("ForcedMeanObject") 392 if rowcount == 0: 393 self.logger.infoPair("skipping this one","ForcedMeanObject ") 394 self.skipBatch = False 395 return True 396 else: 397 return True 329 398 330 399 -
trunk/ippToPsps/jython/loader.py
r37763 r37927 28 28 29 29 #from forcedwarpbatch import ForcedWarpBatch 30 #from forcedobjectbatch import ForcedObjectBatch30 from forcedobjectbatch import ForcedObjectBatch 31 31 # 32 32 # … … 168 168 self.logger.infoPair("Box dimensions: ", "ra / dec / size : %.1f / %.1f / %.1f -- sky bounds : (%.2f - %2.f, %2.f - %2.f)" % (boxDim['RA'], boxDim['DEC'], boxDim['SIDE'], boxDim['minRA'], boxDim['maxRA'], boxDim['minDEC'], boxDim['maxDEC'])) 169 169 self.logger.infoPair(batchType + " items found in this box", "%d" % len(ids)) 170 171 if batchType != "OB":170 #previously said if not OB, but we don't need these for Do or FO 171 if (batchType == "P2" or batchType == "ST" or batchType =="DF" or batchType == "FW"): 172 172 if self.config.resetDvo or not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost): 173 173 if not self.dvoDetections.nativeIngestDetections(boxId, boxDim):
Note:
See TracChangeset
for help on using the changeset viewer.
