Changeset 34466 for branches/eam_branches/ipp-20120905
- Timestamp:
- Sep 25, 2012, 10:05:21 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120905
- Files:
-
- 36 edited
- 6 copied
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm (modified) (6 diffs)
-
ippMonitor (modified) (1 prop)
-
ippMonitor/Makefile.in (modified) (3 diffs)
-
ippMonitor/def/simplePlotCamImage.d (modified) (3 diffs)
-
ippMonitor/def/simplePlotSkycalImage.d (copied) (copied from trunk/ippMonitor/def/simplePlotSkycalImage.d )
-
ippMonitor/def/simplePlotStackImage.d (copied) (copied from trunk/ippMonitor/def/simplePlotStackImage.d )
-
ippMonitor/def/simplePlotStaticskyImage.d (copied) (copied from trunk/ippMonitor/def/simplePlotStaticskyImage.d )
-
ippMonitor/raw/ipp.plots.dat (modified) (1 diff)
-
ippMonitor/raw/simplePlotcam.php (modified) (8 diffs)
-
ippMonitor/raw/skycellplot.php (copied) (copied from trunk/ippMonitor/raw/skycellplot.php )
-
ippMonitor/scripts/skycellplot.dvo (copied) (copied from trunk/ippMonitor/scripts/skycellplot.dvo )
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippToPsps (modified) (1 prop)
-
ippToPsps/jython/objectbatch.py (modified) (4 diffs)
-
ippToPsps/jython/scratchdb.py (modified) (1 diff)
-
ippToPsps/jython/stackbatch.py (modified) (8 diffs)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/chiptool_setimfiletoupdate.sql (modified) (1 prop)
-
ippTools/share/difftool_definestackstack_part0.sql (modified) (1 diff)
-
ippTools/share/difftool_definestackstack_part1.sql (modified) (1 diff)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 prop)
-
ippTools/share/warptool_towarped.sql (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/difftoolConfig.c (modified) (1 diff)
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippconfig (modified) (1 prop)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 prop)
-
ppTranslate/src/ppMopsWrite.c (modified) (7 diffs)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotStackImageLoop.c (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
pstamp/scripts/dquery_finish.pl (modified) (2 diffs)
-
pstamp/scripts/psmkreq (modified) (9 diffs)
-
pstamp/scripts/pstamp_checkdependent.pl (modified) (4 diffs)
-
pstamp/scripts/pstamp_finish.pl (modified) (2 diffs)
-
pstamp/scripts/pstamp_request_file (modified) (8 diffs)
-
pstamp/scripts/pstamp_targetlist_file.pl (copied) (copied from trunk/pstamp/scripts/pstamp_targetlist_file.pl )
-
pstamp/scripts/pstampparse.pl (modified) (6 diffs)
-
psvideophot (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120905/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r33511 r34466 25 25 $PSTAMP_SELECT_WEIGHT 26 26 $PSTAMP_SELECT_CMF 27 $PSTAMP_SELECT_SOURCES 27 28 $PSTAMP_SELECT_PSF 28 29 $PSTAMP_SELECT_BACKMDL … … 32 33 $PSTAMP_SELECT_UNCONV 33 34 $PSTAMP_RESTORE_BACKGROUND 35 $PSTAMP_USE_IMFILE_ID 36 $PSTAMP_NO_WAIT_FOR_UPDATE 34 37 $PSTAMP_REQUEST_UNCENSORED 35 38 $PSTAMP_REQUIRE_UNCENSORED 36 $PSTAMP_USE_IMFILE_ID37 $PSTAMP_NO_WAIT_FOR_UPDATE38 39 $PSTAMP_SUCCESS 39 40 $PSTAMP_FIRST_ERROR_CODE … … 59 60 our $PSTAMP_RANGE_IN_PIXELS = 2; 60 61 62 # Definition of the bits in OPTION_MASK 61 63 our $PSTAMP_SELECT_IMAGE = 1; 62 64 our $PSTAMP_SELECT_MASK = 2; 63 65 our $PSTAMP_SELECT_VARIANCE = 4; 64 66 our $PSTAMP_SELECT_WEIGHT = 4; 67 our $PSTAMP_SELECT_SOURCES = 8; 65 68 our $PSTAMP_SELECT_CMF = 8; 66 69 our $PSTAMP_SELECT_PSF = 16; 67 70 our $PSTAMP_SELECT_BACKMDL = 32; 68 71 our $PSTAMP_SELECT_JPEG = 64; 72 # unused 128 73 # unused 256 69 74 our $PSTAMP_SELECT_UNCOMPRESSED = 512; 70 our $PSTAMP_SELECT_INVERSE = 1024;71 our $PSTAMP_SELECT_UNCONV = 2048;72 our $PSTAMP_RESTORE_BACKGROUND = 4096;73 74 our $PSTAMP_USE_IMFILE_ID = 16384; 75 75 our $PSTAMP_SELECT_INVERSE = 1024; 76 our $PSTAMP_SELECT_UNCONV = 2048; 77 our $PSTAMP_RESTORE_BACKGROUND = 4096; 78 # unused 8192 79 80 our $PSTAMP_USE_IMFILE_ID = 16384; 76 81 our $PSTAMP_NO_WAIT_FOR_UPDATE = 32768; 77 our $PSTAMP_REQUEST_UNCENSORED = 1 << 16;78 our $PSTAMP_REQUIRE_UNCENSORED = 1 << 17;82 our $PSTAMP_REQUEST_UNCENSORED = 0x10000; 83 our $PSTAMP_REQUIRE_UNCENSORED = 0x20000; 79 84 80 85 # job and result codes … … 162 167 my $fields_output; 163 168 { 164 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ";169 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USERNAME EMAIL"; 165 170 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 166 171 run(command => $command, verbose => $verbose); 167 172 $fields_output = join "", @$stdout_buf; 168 173 } 169 my (undef, $extname, $extver, $req_name ) = split " ", $fields_output;174 my (undef, $extname, $extver, $req_name, $action, $username, $email) = split " ", $fields_output; 170 175 171 176 # make sure the file contains what we are expecting … … 174 179 if !$extname or ($extname ne "PS1_PS_REQUEST"); 175 180 die "REQ_NAME not found in $request_file_name" if (!$req_name); 176 die "wrong EXTVER $extver found in $request_file_name" if ($extver ne " 1");181 die "wrong EXTVER $extver found in $request_file_name" if ($extver ne "2" and $extver ne "1"); 177 182 178 183 my %header; … … 180 185 $header{EXTVER} = $extver; 181 186 $header{EXTNAME} = $extname; 187 if ($extver > 1) { 188 $header{ACTION} = $action; 189 $header{USER} = $username; 190 $header{EMAIL} = $email; 191 } else { 192 $header{ACTION} = $action = "PROCESS"; 193 $header{USERNAME} = 'null'; 194 $header{EMAIL} = 'null'; 195 } 196 197 if ($action eq "LIST") { 198 return (\%header, undef); 199 } elsif ($action ne "PROCESS") { 200 die "unexpected request ACTION found: $action in $request_file_name"; 201 } 202 182 203 183 204 # -
branches/eam_branches/ipp-20120905/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor merged: 34429,34431-34432,34434,34436
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippMonitor/Makefile.in
r33847 r34466 14 14 PROGRAMS = \ 15 15 $(DESTBIN)/skyplot.dvo \ 16 $(DESTBIN)/skycellplot.dvo \ 16 17 $(DESTBIN)/czartool_getServerStatus.pl \ 17 18 $(DESTBIN)/czartool_revert.pl \ … … 57 58 $(DESTWWW)/simplePlotraw.php \ 58 59 $(DESTWWW)/skyplot.php \ 60 $(DESTWWW)/skycellplot.php \ 59 61 $(DESTWWW)/getimage.php \ 60 62 $(DESTWWW)/ipp.czartool.dat \ … … 211 213 $(DESTWWW)/simplePlotChipImage.php \ 212 214 $(DESTWWW)/simplePlotCamImage.php \ 215 $(DESTWWW)/simplePlotStackImage.php \ 216 $(DESTWWW)/simplePlotStaticskyImage.php \ 217 $(DESTWWW)/simplePlotSkycalImage.php \ 213 218 $(DESTWWW)/histogramBackgroundImage.php \ 214 219 $(DESTWWW)/histogramCamProcessedExpImage.php \ -
branches/eam_branches/ipp-20120905/ippMonitor/def/simplePlotCamImage.d
r34189 r34466 1 TABLE cam Run, chipRun, rawExp1 TABLE camProcessedExp, camRun, chipRun, rawExp 2 2 TITLE New sky plot - cam 3 3 FILE simplePlotCamImage.php … … 7 7 WHERE chipRun.exp_id = rawExp.exp_id 8 8 WHERE camRun.chip_id = chipRun.chip_id 9 WHERE camProcessedExp.cam_id = camRun.cam_id 9 10 10 11 # field size format name show link to extras … … 24 25 FIELD rawExp.bg, 5, %.2f, backgnd, restrict 25 26 FIELD rawExp.bg_stdev, 5, %.2f, stdev, restrict 27 FIELD camProcessedExp.fwhm_major, 5, %.2f, FWHM_major, restrict 26 28 27 29 # What to plot -
branches/eam_branches/ipp-20120905/ippMonitor/raw/ipp.plots.dat
r28604 r34466 5 5 menulink | menuselect | link | Simple plot - chip | simplePlotChipImage.php 6 6 menulink | menuselect | link | Simple plot - cam | simplePlotCamImage.php 7 menulink | menuselect | link | Simple plot - stack | simplePlotStackImage.php 8 menulink | menuselect | link | Simple plot - staticsky | simplePlotStaticskyImage.php 9 menulink | menuselect | link | Simple plot - skycal | simplePlotSkycalImage.php 7 10 8 11 menutop | menutop | plain | | -
branches/eam_branches/ipp-20120905/ippMonitor/raw/simplePlotcam.php
r31102 r34466 28 28 // define restrictiosn to the queries 29 29 // ** TABLE RESTRICTIONS ** 30 $WHERE = "WHERE camRun.state != 'new' AND chipRun.exp_id = rawExp.exp_id AND camRun.chip_id = chipRun.chip_id ";30 $WHERE = "WHERE camRun.state != 'new' AND chipRun.exp_id = rawExp.exp_id AND camRun.chip_id = chipRun.chip_id AND camProcessedExp.cam_id = camRun.cam_id"; 31 31 $WHERE = check_restrict ('rawExp.exp_name', $WHERE, 'string', 1.0); 32 32 $WHERE = check_restrict ('rawExp.exp_id', $WHERE, 'string', 1.0); … … 62 62 $WHERE = check_restrict ('rawExp.bg_stdev', $WHERE, 'max', 1.0); 63 63 $WHERE = check_restrict ('rawExp.comment', $WHERE, 'string', 1.0); 64 $WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'string', 1.0); 65 $WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'min', 1.0); 66 $WHERE = check_restrict ('camProcessedExp.fwhm_major', $WHERE, 'max', 1.0); 64 67 $WHERE = check_ordering ('', $WHERE); 65 68 … … 73 76 74 77 // get the result table count 75 $sql = "SELECT count(*) FROM cam Run, chipRun, rawExp $WHERE";78 $sql = "SELECT count(*) FROM camProcessedExp, camRun, chipRun, rawExp $WHERE"; 76 79 77 80 $qry = $db->query($sql); 78 81 if (dberror($qry)) { 79 echo "<b>error reading cam Run, chipRun, rawExp table count</b><br>\n";82 echo "<b>error reading camProcessedExp, camRun, chipRun, rawExp table count</b><br>\n"; 80 83 echo "<br><small><b> count query : $sql </b></small><br>\n"; 81 84 menu_end(); 82 85 } 83 86 if (!$qry->fetchInto($row)) { 84 echo "<b>error reading cam Run, chipRun, rawExp table count</b><br>\n";87 echo "<b>error reading camProcessedExp, camRun, chipRun, rawExp table count</b><br>\n"; 85 88 echo "<br><small><b> count query : $sql </b></small><br>\n"; 86 89 menu_end(); … … 128 131 $buttonLink = button_restrict_max ('rawExp.bg_stdev', $buttonLink); 129 132 $buttonLink = button_restrict_string ('rawExp.comment', $buttonLink); 130 133 $buttonLink = button_restrict_string ('camProcessedExp.fwhm_major', $buttonLink); 134 $buttonLink = button_restrict_min ('camProcessedExp.fwhm_major', $buttonLink); 135 $buttonLink = button_restrict_max ('camProcessedExp.fwhm_major', $buttonLink); 131 136 // set up the table 132 137 echo "<table class=list>\n"; … … 181 186 write_header_cell ("list", "stdev "); 182 187 write_header_cell ("list", "Date/Time"); 188 write_header_cell ("list", "Cam FWHM_major"); 183 189 echo "</tr>\n"; 184 190 … … 193 199 write_query_row ('rawExp.bg_stdev', 5, 'min'); 194 200 write_query_row ('rawExp.dateobs', 19, 'min'); 201 write_query_row ('camProcessedExp.fwhm_major', 5, 'min'); 195 202 echo "</tr><tr><td>≤</td>\n"; 196 203 echo "<td> </td>\n"; … … 201 208 write_query_row ('rawExp.bg_stdev', 5, 'max'); 202 209 write_query_row ('rawExp.dateobs', 19, 'max'); 210 write_query_row ('camProcessedExp.fwhm_major', 5, 'max'); 203 211 echo "</tr>\n"; 204 212 … … 228 236 229 237 // query the database 230 $sql = "SELECT rawExp.ra,rawExp.decl,rawExp.filter FROM cam Run, chipRun, rawExp $WHERE";238 $sql = "SELECT rawExp.ra,rawExp.decl,rawExp.filter FROM camProcessedExp, camRun, chipRun, rawExp $WHERE"; 231 239 232 240 $qry = $db->query($sql); -
branches/eam_branches/ipp-20120905/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/destreak_restore_camera.pl merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/magic_destreak.pl merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippToPsps
- Property svn:mergeinfo changed
/trunk/ippToPsps merged: 34429,34441
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippToPsps/jython/objectbatch.py
r34290 r34466 124 124 ," + filter[1] + "StackPSFFlux = FLUX_PSF \ 125 125 ," + filter[1] + "StackPSFFluxErr = FLUX_PSF_ERR \ 126 ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) -8.9 \126 ," + filter[1] + "StackKronMag = -2.5 * log10(FLUX_KRON) + 8.9 \ 127 127 ," + filter[1] + "StackKronMagErr = FLUX_KRON_ERR / FLUX_KRON \ 128 128 ," + filter[1] + "20pct = MAG_20/1000 \ 129 129 ," + filter[1] + "80pct = MAG_80/1000 \ 130 " 130 ," + filter[1] + "Flags = FLAGS " 131 131 132 132 133 self.scratchDb.execute(sql) … … 141 142 WHERE " + filter[1] + "MeanPSFMagErr > " + str(cut) 142 143 self.scratchDb.execute(sql) 144 145 self.logger.infoPair("Setting to NULL all x20pct =", "32.767" ) 146 for filter in filters: 147 sql = "UPDATE Object \ 148 SET " + filter[1] + "20pct = null \ 149 WHERE " + filter[1] + "20pct > 32.766" 150 self.scratchDb.execute(sql) 151 self.logger.infoPair("Setting to NULL all x80pct =", "32.767" ) 152 for filter in filters: 153 sql = "UPDATE Object \ 154 SET " + filter[1] + "80pct = null \ 155 WHERE " + filter[1] + "80pct > 32.766" 156 self.scratchDb.execute(sql) 157 158 159 143 160 144 161 ''' … … 187 204 ,decErr \ 188 205 ,nDetections \ 206 ,extra \ 207 ,sgSep \ 189 208 ,dataRelease \ 190 209 ) \ … … 200 219 ,DEC_ERR \ 201 220 ,NMEASURE \ 221 ,PSF_QF_PERF \ 222 ,STARGAL_SEP \ 202 223 , " + str(self.config.dataRelease) + "\ 203 224 FROM " + cptTableName -
branches/eam_branches/ipp-20120905/ippToPsps/jython/scratchdb.py
r34173 r34466 391 391 except: 392 392 self.logger.error("Unable to create DVO detection database table") 393 393 self.makeColumnUnique("dvoDetection", "objID") 394 394 395 395 ''' -
branches/eam_branches/ipp-20120905/ippToPsps/jython/stackbatch.py
r34165 r34466 374 374 ,PSF_THETA \ 375 375 ,psfLikelihood(EXT_NSIGMA) \ 376 ,FLAGS << 32 | FLAGS2\376 ,FLAGS2 << 32 | FLAGS \ 377 377 ,PSF_QF \ 378 378 ,MOMENTS_XX \ … … 389 389 ,KRON_FLUX / " + str(self.expTime) + " \ 390 390 ,KRON_FLUX_ERR / " + str(self.expTime) + " \ 391 , NULL\391 , MOMENTS_R1 * 2.5 \ 392 392 , NULL \ 393 393 ,N_FRAMES \ … … 395 395 ," + self.historyModNum + " \ 396 396 FROM SkyChip_psf" 397 398 self.scratchDb.execute(sql)397 self.scratchDb.execute(sql) 398 399 399 #it is possible to drop some detections from dvo (that are present in the cmf). when that happens we get a 0 for objid 400 400 #we drop those... … … 402 402 self.scratchDb.execute(sql) 403 403 self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0") 404 404 405 405 self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID)) 406 406 407 self.scratchDb.updateFilterID("StackDetection", self.filter) 408 407 409 self.scratchDb.updateAllRows("StackDetection", "dataRelease", str(self.config.dataRelease)) 410 408 411 self.scratchDb.updateAllRows("StackDetection", "primaryF", "0") 412 409 413 self.scratchDb.updateAllRows("StackDetection", "activeFlag", "0") 414 410 415 self.updateStackMetaID("StackDetection") 416 411 417 self.updateStackTypeID("StackDetection") 418 412 419 self.updateDvoIDs("StackDetection") 420 413 421 sql = "ALTER IGNORE TABLE StackDetection ADD PRIMARY KEY (objID)" 422 414 423 self.scratchDb.execute(sql) 415 424 … … 422 431 AND a.ippDetectID = b.IPP_IDET \ 423 432 AND b.PSF_INST_FLUX_SIG IS NOT NULL" 433 424 434 self.scratchDb.execute(sql) 425 435 436 426 437 self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux") 438 427 439 self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "objID") 440 428 441 sql="DELETE FROM StackDetection where objID = 0" 429 self.scratchDb.execute(sql) 430 self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0") 431 442 443 self.scratchDb.execute(sql) 444 self.logger.infoPair("Delleting", "entries with StackDetection.objID = 0") 445 432 446 433 447 ''' … … 600 614 601 615 self.logger.debug("Altering PSPS tables") 616 # heather uncommented the unique line -- well that no worky 602 617 #self.scratchDb.makeColumnUnique("StackDetection", "objID") 603 618 self.scratchDb.createIndex("StackDetection", "ippDetectID") … … 624 639 ''' 625 640 def updateDvoIDs(self, table): 626 641 self.logger.infoPair("getting","imageID") 627 642 imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID']) 643 self.logger.infoPair("obtained","imageID") 628 644 self.logger.debug("Updating table '" + table + "' with DVO IDs...") 629 645 sql = "UPDATE " + table + " AS a, " + self.scratchDb.dvoDetectionTable + " AS b SET \ … … 633 649 WHERE a.ippDetectID = b.ippDetectID \ 634 650 AND b.imageID = " + str(imageID) 635 self.scratchDb.execute(sql) 636 651 652 self.scratchDb.execute(sql) 653 637 654 ''' 638 655 Does the processing, i.e. pulling stuff from IPP tables into PSPS tables -
branches/eam_branches/ipp-20120905/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/camtool_find_pendingimfile.sql merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippTools/share/chiptool_setimfiletoupdate.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/chiptool_setimfiletoupdate.sql merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippTools/share/difftool_definestackstack_part0.sql
r29667 r34466 39 39 WHERE 1 40 40 @STACK1_QUERY@ -- input condition 41 ) AS diffExp ON diffExp.stack1 = stackRun.stack_id AND diffExp.stack2 = template.max_stack_id41 ) AS diffExp ON diffExp.stack1 = stackRun.stack_id 42 42 WHERE 43 43 stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0 -
branches/eam_branches/ipp-20120905/ippTools/share/difftool_definestackstack_part1.sql
r29667 r34466 40 40 WHERE 1 41 41 @STACK1_QUERY@ -- input constraint 42 ) AS diffExp ON diffExp.stack1 = stackRun.stack_id AND diffExp.stack2 = template.max_stack_id42 ) AS diffExp ON diffExp.stack1 = stackRun.stack_id 43 43 WHERE 44 44 stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0 -
branches/eam_branches/ipp-20120905/ippTools/share/pxadmin_create_tables.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/pxadmin_create_tables.sql merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippTools/share/warptool_towarped.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/warptool_towarped.sql merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippTools/src
- Property svn:mergeinfo changed
/trunk/ippTools/src merged: 34429,34443
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippTools/src/difftoolConfig.c
r32485 r34466 351 351 psMetadataAddBool(definestackstackArgs, PS_LIST_TAIL, "-rerun", 0, "define new run even if one exists", false); 352 352 psMetadataAddBool(definestackstackArgs, PS_LIST_TAIL, "-available", 0, "define new run even if no stacks available for some skycells", false); 353 psMetadataAddBool(definestackstackArgs, PS_LIST_TAIL, "-new-templates", 0, "also search for diffs with new template ", false);353 psMetadataAddBool(definestackstackArgs, PS_LIST_TAIL, "-new-templates", 0, "also search for diffs with new template and same template label", false); 354 354 psMetadataAddBool(definestackstackArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 355 355 psMetadataAddBool(definestackstackArgs, PS_LIST_TAIL, "-pretend", 0, "list results but do not queue", false); -
branches/eam_branches/ipp-20120905/ippTools/src/magictool.c
- Property svn:mergeinfo changed
/trunk/ippTools/src/magictool.c merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippconfig
- Property svn:mergeinfo changed
/trunk/ippconfig merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippconfig/recipes/reductionClasses.mdc
- Property svn:mergeinfo changed
/trunk/ippconfig/recipes/reductionClasses.mdc merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMopsWrite.c
r34284 r34466 38 38 39 39 // Get these header words from the first input non null input 40 // but for SEEING which is the median of the (non-NULL) detections 41 // seeings 40 42 ppMopsDetections *det = NULL; 41 for (int d = 0; d < detections->n && det == NULL; d++) { 42 det = detections->data[d]; 43 int validSeeingCount = 0; 44 for (int d = 0; d < detections->n; d++) { 45 if (detections->data[d] != NULL) { 46 if (det == NULL) { 47 det = detections->data[d]; 48 } 49 if (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) { 50 validSeeingCount += 1; 51 } 52 } 43 53 } 44 54 if (det != NULL) { 55 //Get the SEEING median 56 psVector* seeingValues = psVectorAlloc(validSeeingCount, PS_TYPE_F32); 57 psVectorInit(seeingValues, NAN); 58 validSeeingCount = 0; 59 for (int d = 0; d < detections->n; d++) { 60 if ( (detections->data[d] != NULL) && (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) ){ 61 seeingValues->data.F32[validSeeingCount++] = ((ppMopsDetections*) detections->data[d])->seeing; 62 } 63 } 64 psStats *seeingStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 65 psVectorStats(seeingStats, seeingValues, NULL, NULL, 0); 45 66 psMetadataAddF64(header, PS_LIST_TAIL, "MJD-OBS", 0, "MJD of exposure midpoint", det->mjd); 46 67 psMetadataAddStr(header, PS_LIST_TAIL, "RA", 0, "Right Ascension of boresight", det->raBoresight); … … 52 73 psMetadataAddStr(header, PS_LIST_TAIL, "FILTER", 0, "Filter name", det->filter); 53 74 psMetadataAddF32(header, PS_LIST_TAIL, "AIRMASS", 0, "Airmass of exposure", det->airmass); 54 psMetadataAddF32(header, PS_LIST_TAIL, "SEEING", 0, "Mean seeing", det->seeing);75 psMetadataAddF32(header, PS_LIST_TAIL, "SEEING", 0, "Mean seeing", seeingStats->sampleMedian); 55 76 } else { 56 77 psWarning("no inputs with surviving detections. output header will be incomplete"); … … 112 133 // Write data of version 2 (see ICD) 113 134 psMetadataAdd (row, PS_LIST_TAIL, "IPP_IDET", PS_DATA_U32, "IPP detection identifier index", 114 NAN);135 NAN); 115 136 psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX", PS_DATA_F32, "PSF fit instrumental magnitude", 116 NAN);137 NAN); 117 138 psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_FLUX_SIG",PS_DATA_F32, "Sigma of PSF instrumental magnitude", 118 NAN);139 NAN); 119 140 psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG", PS_DATA_F32, "magnitude in standard aperture", 120 NAN);141 NAN); 121 142 psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG_RAW", PS_DATA_F32, "magnitude in real aperture", 122 NAN);143 NAN); 123 144 psMetadataAdd (row, PS_LIST_TAIL, "AP_MAG_RADIUS", PS_DATA_F32, "radius used for aperture mags", 124 NAN);145 NAN); 125 146 psMetadataAdd (row, PS_LIST_TAIL, "AP_FLUX", PS_DATA_F32, "instrumental flux in standard aperture", 126 NAN);147 NAN); 127 148 psMetadataAdd (row, PS_LIST_TAIL, "AP_FLUX_SIG", PS_DATA_F32, "aperture flux error", 128 NAN);149 NAN); 129 150 psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude", 130 NAN);151 NAN); 131 152 psMetadataAdd (row, PS_LIST_TAIL, "CAL_PSF_MAG", PS_DATA_F32, "PSF Magnitude using supplied calibration", 132 NAN);153 NAN); 133 154 psMetadataAdd (row, PS_LIST_TAIL, "CAL_PSF_MAG_SIG", PS_DATA_F32, "measured scatter of zero point calibration", 134 NAN);155 NAN); 135 156 psMetadataAdd (row, PS_LIST_TAIL, "SKY", PS_DATA_F32, "Sky level", 136 NAN);157 NAN); 137 158 psMetadataAdd (row, PS_LIST_TAIL, "SKY_SIGMA", PS_DATA_F32, "Sigma of sky level", 138 NAN);159 NAN); 139 160 psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF_PERFECT", PS_DATA_F32, "PSF coverage/quality factor (poor)", 140 NAN);161 NAN); 141 162 psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_R1", PS_DATA_F32, "first radial moment", 142 NAN);163 NAN); 143 164 psMetadataAdd (row, PS_LIST_TAIL, "MOMENTS_RH", PS_DATA_F32, "half radial moment", 144 NAN);165 NAN); 145 166 psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX", PS_DATA_F32, "Kron Flux (in 2.5 R1)", 146 NAN);167 NAN); 147 168 psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_ERR", PS_DATA_F32, "Kron Flux Error", 148 NAN);149 psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_INNER", PS_DATA_F32, "Kron Flux (in 1.0 R1)", 150 NAN);169 NAN); 170 psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_INNER", PS_DATA_F32, "Kron Flux (in 1.0 R1)", 171 NAN); 151 172 psMetadataAdd (row, PS_LIST_TAIL, "KRON_FLUX_OUTER", PS_DATA_F32, "Kron Flux (in 4.0 R1)", 152 NAN);173 NAN); 153 174 psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_P", PS_DATA_F32, "distance to positive match source", 154 NAN);175 NAN); 155 176 psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_P", PS_DATA_F32, "signal-to-noise of pos match src", 156 NAN);177 NAN); 157 178 psMetadataAdd (row, PS_LIST_TAIL, "DIFF_R_M", PS_DATA_F32, "distance to negative match source", 158 NAN);179 NAN); 159 180 psMetadataAdd (row, PS_LIST_TAIL, "DIFF_SN_M", PS_DATA_F32, "signal-to-noise of neg match src", 160 NAN);181 NAN); 161 182 psMetadataAdd (row, PS_LIST_TAIL, "FLAGS2", PS_DATA_U32, "psphot analysis flags (group 2)", 162 0);163 psMetadataAdd (row, PS_LIST_TAIL, "N_FRAMES", PS_DATA_U16, "Number of frames overlapping source center", 164 0);165 psMetadataAdd (row, PS_LIST_TAIL, "PADDING", PS_DATA_S16, "padding", 166 0);183 0); 184 psMetadataAdd (row, PS_LIST_TAIL, "N_FRAMES", PS_DATA_U16, "Number of frames overlapping source center", 185 0); 186 psMetadataAdd (row, PS_LIST_TAIL, "PADDING", PS_DATA_S16, "padding", 187 0); 167 188 if (args->version == 3) { 168 // TODO: Write data of version 3 (see ICD)189 // TODO: Write data of version 3 (see ICD) 169 190 } 170 191 } … … 179 200 } else { 180 201 181 #define addColumn(_outName, _inName, _convertTo32) \202 #define addColumn(_outName, _inName, _convertTo32) \ 182 203 if (!addOutputColumn(table, detections, total, _outName, _inName, _convertTo32)) { \ 183 204 psError(PS_ERR_UNKNOWN, false, "Failed to add column %s", _outName); \ 184 return false; \205 return false; \ 185 206 } 186 207 … … 198 219 addColumn("EXT_SIGNIFICANCE", "EXT_NSIGMA", 0); 199 220 addColumn("PSF_MAJOR", NULL, 0); 200 addColumn("PSF_MINOR", NULL, 0); 201 addColumn("PSF_THETA", NULL, 0); 202 addColumn("PSF_QUALITY", "PSF_QF", 0); 203 addColumn("PSF_NPIX", NULL, 1); 221 addColumn("PSF_MINOR", NULL, 0); 222 addColumn("PSF_THETA", NULL, 0); 223 addColumn("PSF_QUALITY", "PSF_QF", 0); 224 addColumn("PSF_NPIX", NULL, 1); 204 225 addColumn("MOMENTS_XX", NULL, 0); 205 226 addColumn("MOMENTS_XY", NULL, 0); … … 287 308 ppMopsDetections *det = detections->data[i]; 288 309 if (!det || det->num == 0) { 289 // no detections survived for this input290 continue;310 // no detections survived for this input 311 continue; 291 312 } 292 313 psVector *in = NULL; 293 314 in = psMetadataLookupVector(NULL, det->table, inColumnName); 294 315 if (!in) { 295 psError(PS_ERR_PROGRAMMING, true, "failed to find input column: %s (convertTo32 is true)", inColumnName);296 return false;316 psError(PS_ERR_PROGRAMMING, true, "failed to find input column: %s (convertTo32 is true)", inColumnName); 317 return false; 297 318 } 298 319 if (in->type.type != PS_TYPE_S64 && in->type.type != PS_TYPE_U64) { 299 psError(PS_ERR_PROGRAMMING, true, "input column to convert is not S64 or U64: %s %d",300 inColumnName, in->type.type);301 return false;320 psError(PS_ERR_PROGRAMMING, true, "input column to convert is not S64 or U64: %s %d", 321 inColumnName, in->type.type); 322 return false; 302 323 } 303 324 if (out == NULL) { 304 // First time through set up the output vector and the copy parameters305 if (in->type.type == PS_TYPE_S64) {306 out = psVectorAlloc(outputSize, PS_TYPE_S32);307 } else {308 out = psVectorAlloc(outputSize, PS_TYPE_U32);309 }325 // First time through set up the output vector and the copy parameters 326 if (in->type.type == PS_TYPE_S64) { 327 out = psVectorAlloc(outputSize, PS_TYPE_S32); 328 } else { 329 out = psVectorAlloc(outputSize, PS_TYPE_U32); 330 } 310 331 } 311 332 for (long d=0; d < det->num; d++) { 312 if (in->type.type == PS_TYPE_S64) {313 out->data.S32[next++] = in->data.S64[d];314 } else {315 out->data.U32[next++] = in->data.U64[d];316 }333 if (in->type.type == PS_TYPE_S64) { 334 out->data.S32[next++] = in->data.S64[d]; 335 } else { 336 out->data.U32[next++] = in->data.U64[d]; 337 } 317 338 } 318 339 } … … 323 344 ppMopsDetections *det = detections->data[i]; 324 345 if (!det || det->num == 0) { 325 // no detections survived for this input326 continue;346 // no detections survived for this input 347 continue; 327 348 } 328 349 psVector *in = NULL; 329 350 in = psMetadataLookupVector(NULL, det->table, inColumnName); 330 351 if (!in) { 331 psError(PS_ERR_PROGRAMMING, true, "failed to find input column: %s (convertTo32 is false)", inColumnName);332 out = psVectorAlloc(outputSize, PS_TYPE_F32);333 psVectorInit(out, NAN);334 psMetadataAddVector(table, PS_LIST_TAIL, outColumnName, 0, NULL, out);335 return false;352 psError(PS_ERR_PROGRAMMING, true, "failed to find input column: %s (convertTo32 is false)", inColumnName); 353 out = psVectorAlloc(outputSize, PS_TYPE_F32); 354 psVectorInit(out, NAN); 355 psMetadataAddVector(table, PS_LIST_TAIL, outColumnName, 0, NULL, out); 356 return false; 336 357 } 337 358 if (out == NULL) { 338 // First time through set up the output vector and the copy parameters339 out = psVectorAlloc(outputSize, in->type.type);340 next = (void *) out->data.U8;341 switch (in->type.type) {342 case PS_TYPE_S8:343 elementSize = sizeof(psS8);344 break;345 case PS_TYPE_U8:346 elementSize = sizeof(psU8);347 break;348 case PS_TYPE_S16:349 elementSize = sizeof(psS16);350 break;351 case PS_TYPE_U16:352 elementSize = sizeof(psU16);353 break;354 case PS_TYPE_S32:355 elementSize = sizeof(psS32);356 break;357 case PS_TYPE_U32:358 elementSize = sizeof(psU32);359 break;360 case PS_TYPE_S64:361 elementSize = sizeof(psS64);362 break;363 case PS_TYPE_U64:364 elementSize = sizeof(psU64);365 break;366 case PS_TYPE_F32:367 elementSize = sizeof(psF32);368 break;369 case PS_TYPE_F64:370 elementSize = sizeof(psF64);371 break;372 default:373 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Unknown vector type %d", in->type.type);374 return false;375 }376 } 377 // We are doing nasty things here so we can use memcpy. 359 // First time through set up the output vector and the copy parameters 360 out = psVectorAlloc(outputSize, in->type.type); 361 next = (void *) out->data.U8; 362 switch (in->type.type) { 363 case PS_TYPE_S8: 364 elementSize = sizeof(psS8); 365 break; 366 case PS_TYPE_U8: 367 elementSize = sizeof(psU8); 368 break; 369 case PS_TYPE_S16: 370 elementSize = sizeof(psS16); 371 break; 372 case PS_TYPE_U16: 373 elementSize = sizeof(psU16); 374 break; 375 case PS_TYPE_S32: 376 elementSize = sizeof(psS32); 377 break; 378 case PS_TYPE_U32: 379 elementSize = sizeof(psU32); 380 break; 381 case PS_TYPE_S64: 382 elementSize = sizeof(psS64); 383 break; 384 case PS_TYPE_U64: 385 elementSize = sizeof(psU64); 386 break; 387 case PS_TYPE_F32: 388 elementSize = sizeof(psF32); 389 break; 390 case PS_TYPE_F64: 391 elementSize = sizeof(psF64); 392 break; 393 default: 394 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Unknown vector type %d", in->type.type); 395 return false; 396 } 397 } 398 // We are doing nasty things here so we can use memcpy. 378 399 // It would be safer to do a proper loop over the elements. 379 400 long toCopy = det->num * elementSize; -
branches/eam_branches/ipp-20120905/psphot
- Property svn:mergeinfo changed
/trunk/psphot merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/psphot/src
- Property svn:mergeinfo changed
/trunk/psphot/src merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed
/trunk/psphot/src/psphotStackImageLoop.c merged: 34429
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/pstamp/scripts
- Property svn:mergeinfo changed
/trunk/pstamp/scripts merged: 34429,34444-34445,34447
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/pstamp/scripts/dquery_finish.pl
r33324 r34466 128 128 my $job_id = $job->{job_id}; 129 129 130 if ($job->{fault}) { 131 # how do we get this information back to the user? 132 print STDERR "job: $job_id faulted with $job->{fault}\n"; 133 next; 134 } 130 135 my $outputBase = $job->{outputBase}; 131 136 my $results = "${outputBase}results.txt"; … … 166 171 my $results = shift; 167 172 168 open IN, "<$results_file" or my_die("failed to open $results_file ", $PS_EXIT_UNKNOWN_ERROR);173 open IN, "<$results_file" or my_die("failed to open $results_file\n", $PS_EXIT_UNKNOWN_ERROR); 169 174 170 175 foreach my $line (<IN>) { -
branches/eam_branches/ipp-20120905/pstamp/scripts/psmkreq
r29305 r34466 52 52 my $comment; 53 53 54 my $survey_name = 'null'; 55 my $release = 'null'; 56 my $stack_type = 'null'; 57 my $bgrestore; 58 my $jpeg; 59 my $nocompress; 60 54 61 my $missing_tools; 55 62 my $pstamp_request_file = can_run('pstamp_request_file') or (warn "Can't find required program pstamp_request_file" and $missing_tools = 1); … … 68 75 'width=i' => \$width, 69 76 'height=i' => \$height, 70 'pixcenter' => \$pixcenter, 77 # pixcenter is deprecated 78 # 'pixcenter' => \$pixcenter, 71 79 'arcseconds' => \$arcseconds, 72 80 'coord_mask=i' => \$coord_mask, … … 87 95 'comment=s' => \$comment, 88 96 97 # new columns for version 2 98 'survey=s' => \$survey_name, 99 'release=s' => \$release, 100 'stack_type' => \$stack_type, 101 89 102 'option_mask=i' => \$option_mask, 90 103 'image' => \$image, 91 104 'mask' => \$mask, 92 105 'variance' => \$variance, 93 ' cmf'=> \$cmf,106 'sources' => \$cmf, 94 107 'psf' => \$psf, 95 108 'backmdl' => \$backmdl, … … 99 112 'do_not_wait' => \$no_wait, 100 113 114 # new options for version 2 115 'no_compress' => \$nocompress, 116 'bgrestore' => \$bgrestore, 117 101 118 'verbose' => \$verbose, 102 119 'save-temps' => \$save_temps, … … 110 127 111 128 pod2usage( -msg => "Invalid job_type: $job_type", -exitval =>1 ) 112 unless ($job_type eq 'stamp' or $job_type eq 'get_image' );113 114 if ( $job_type eq 'stamp') {129 unless ($job_type eq 'stamp' or $job_type eq 'get_image' or $job_type eq 'listtargets'); 130 131 if (($job_type eq 'stamp') or ($job_type eq 'listtargets')) { 115 132 if (defined $list) { 116 133 pod2usage( -msg => "--ra --dec --x --y are not used with --list", -exitval =>1 ) … … 152 169 $id = 0 if !$id; 153 170 154 unless ($stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') { 155 die "$stage is not a valid value for stage\n"; 171 172 unless (($job_type eq 'listtargets' and $stage eq 'exposure') or $stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') { 173 die "$stage is not a valid stage for $job_type jobs\n"; 156 174 } 157 175 … … 207 225 } else { 208 226 $rows = []; 209 push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max );227 push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max, $survey_name, $release, $stack_type); 210 228 } 211 229 212 230 my ($tdf, $table_def_name) = tempfile ("/tmp/tabledef.XXXX", UNLINK => !$save_temps); 213 print $tdf "$req_name 1\n";231 print $tdf "$req_name 2\n"; 214 232 my $rownum = 0; 215 233 foreach my $row (@$rows) { 216 234 $rownum++; 217 235 my $line = "$rownum $row->{ra}\t$row->{dec}\t$width $height" 218 . " $coord_mask $job_type $option_mask $project $r eq_type"236 . " $coord_mask $job_type $option_mask $project $row->{survey_name} $row->{release} $req_type" 219 237 . " $stage $id $tess_id $component $data_group" 220 . " $row->{filter} $row->{mjd_min} $row->{mjd_max} ";238 . " $row->{filter} $row->{mjd_min} $row->{mjd_max} $row->{stack_type}"; 221 239 222 240 if ($row->{comment} and $row->{comment} ne '') { … … 230 248 } 231 249 close $tdf; 250 251 system "cat $table_def_name"; 252 #exit 0; 232 253 233 254 { … … 277 298 $row->{dec} = checkDEC($vals[1], $linenumber); 278 299 $row->{filter} = checkFilter($vals[2], $filter, $linenumber); 279 $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber);; 280 $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber);; 300 $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber); 301 $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber); 302 $row->{survey_name} = $vals[5]; 303 $row->{release} = $vals[6]; 304 $row->{stack_type} = $vals[7]; 281 305 $row->{comment} = $comment; 282 306 -
branches/eam_branches/ipp-20120905/pstamp/scripts/pstamp_checkdependent.pl
r34238 r34466 137 137 print "skipping $command\n"; 138 138 } 139 } elsif (($it->{state} eq 'cleaned') or ($it->{state} eq ' update')) {139 } elsif (($it->{state} eq 'cleaned') or ($it->{state} eq 'goto_cleaned') or ($it->{state} eq 'update')) { 140 140 # For warp and diff stages we need to call the 'queue_update' subroutines even if the 141 141 # data_state is update in order to check the state of inputs in earlier stages in the pipeline … … 260 260 # caller will fault the jobs 261 261 return $error_code; 262 } elsif ($chip->{state} eq 'goto_cleaned') { 263 264 if ($chip->{data_state} eq 'full') { 265 # cleanup has been queued, but has not yet finished. (cleanup pantasks is probably stopped) 266 # Since this chip is in full go ahead and set the run to state update and change the label. 267 # XXX: In the very rare case that this chip run is actually in the running cleanup pantasks 268 # queue things may get confused but we can live with that 269 my $command = "$chiptool -updaterun -set_state update -chip_id $chip_id"; 270 $command .= " -set_label $rlabel" if $rlabel; 271 272 if (!$no_update) { 273 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 274 run(command => $command, verbose => $verbose); 275 unless ($success) { 276 my_die("failed to change ${stage}Run $stage_id $component from goto_cleaned to update", $PS_EXIT_UNKNOWN_ERROR); 277 } 278 } else { 279 print "skipping $command\n"; 280 } 281 $queued_update = 1; 282 } 262 283 } elsif (($chip->{data_state} ne 'update') and ($chip->{data_state} ne 'full')) { 263 284 … … 344 365 my $skycell = $metadata; 345 366 367 if ($skycell->{state} eq 'goto_cleaned' and $skycell->{data_state} eq 'full') { 368 # cleanup has been queued, but hasn't been done. it's "safe" to set the state back to full 369 # XXX: seem comments in check_states_chip 370 my $command = "$warptool -updaterun -set_state update -warp_id $warp_id"; 371 $command .= " -set_label $rlabel" if $rlabel; 372 373 if (!$no_update) { 374 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 375 run(command => $command, verbose => $verbose); 376 unless ($success) { 377 my_die("failed to change state of ${stage}Run $stage_id from goto_cleaned to update", $PS_EXIT_UNKNOWN_ERROR); 378 } 379 } else { 380 print "skipping $command\n"; 381 } 382 return 0; 383 } 384 346 385 # get the list of input chips for this skycell 347 386 my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id"; … … 428 467 my $skycell = $metadata; 429 468 my $skycell_id = $skycell->{skycell_id}; 469 470 if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') { 471 print "changing state of diffRun $diff_id from goto_cleaned to update. skycell $skycell_id is full\n"; 472 my $command = "$difftool -updaterun -set_state update -diff_id $diff_id"; 473 $command .= " -set_label $rlabel" if $rlabel; 474 475 if (!$no_update) { 476 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 477 run(command => $command, verbose => $verbose); 478 unless ($success) { 479 my_die("failed to queue ${stage}Run $stage_id $component for update", $PS_EXIT_UNKNOWN_ERROR); 480 } 481 } else { 482 print "skipping $command\n"; 483 } 484 return 0; 485 } 430 486 431 487 if ($diff_mode == $IPP_DIFF_MODE_WARP_STACK ) { -
branches/eam_branches/ipp-20120905/pstamp/scripts/pstamp_finish.pl
r33670 r34466 107 107 my ($header, $rows) = read_request_file($req_file); 108 108 109 if (!$header or !$rows) { 110 # Since a request got queued, the request file must have been readable at some 111 # point 109 my $action = $header->{ACTION}; 110 111 if (!$header or (($action eq 'PROCESS') and !$rows)) { 112 # Since a request got queued, the request file must have been readable at some point 112 113 my_die("failed to read request file $req_file", $req_id, $PS_EXIT_CONFIG_ERROR); 113 114 } … … 126 127 } 127 128 128 # The results table definition file 129 my ($tdf, $table_def_name) = tempfile ("$outdir/tabledef.XXXX", UNLINK => !$save_temps); 130 131 # data for the header 132 print $tdf "$req_name|$req_id|\n"; 133 134 # get the list of jobs generated for this request 135 my @jobs; 136 { 137 my $command = "$pstamptool -listjob -req_id $req_id"; 138 $command .= " -dbname $dbname" if $dbname; 139 $command .= " -dbserver $dbserver" if $dbserver; 140 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 141 run(command => $command, verbose => $verbose); 142 unless ($success) { 143 die("Unable to perform $command error code: $error_code"); 144 } 145 my $output = join "", @$stdout_buf; 146 if (!$output) { 147 # This should not happen. A fake job should have been entered 148 my_die("Request $req_id produced no jobs", $req_id, $PS_EXIT_PROG_ERROR); 149 } else { 150 my $jobs = parse_md_fast($mdcParser, $output); 151 152 @jobs = @$jobs; 153 } 154 } 155 156 my $exp_info; 157 foreach my $job (@jobs) { 158 my $job_id = $job->{job_id}; 159 my $job_type = $job->{jobType}; 160 my $rownum = $job->{rownum}; 161 my $fault = $job->{fault}; 162 my $exp_id = $job->{exp_id}; 163 164 my $error_string = get_error_string($fault); 165 166 if (($fault eq $PSTAMP_DUP_REQUEST) and ($req_name eq "NULL")) { 167 # this request had a duplicate request name yet the parser didn't give 168 # it an "ERROR style name. 169 my_die("duplicate request not given a request name", $req_id, $PS_EXIT_PROG_ERROR); 170 } 171 my ($row, $req_info, $project) = get_request_info($rows, $rownum); 172 173 my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver); 174 my $image_db = $proj_hash->{dbname}; 175 if (!$image_db and !$fault) { 176 # if project isn't resolvable, the paser should have faulted this job 177 my_die("failed to find imagedb for project $project", $req_id, $PS_EXIT_CONFIG_ERROR); 178 } 179 180 my $job_params = get_job_parameters($job); 181 my $stage = ""; 182 if ($job_params) { 183 $stage = $job_params->{stage}; 184 } 185 186 if ($stage ne 'stack') { 187 # get the metadata for the exposure (if any i.e. stack) 188 # returns an appropriate string if !$exp_id 189 $exp_info = get_exposure_info($job_params, $image_db, $exp_id); 190 } else { 191 my $filter = $job_params->{filter}; 192 $filter = "0" if !$filter; 193 my $mjd_obs = $job_params->{mjd_obs}; 194 $mjd_obs = "0" if !$mjd_obs; 195 $exp_info = "$mjd_obs|0|0|$filter|0|0"; 196 } 197 198 if (($job_type eq "stamp") || ($job_type eq "get_image") || ($job_type eq "none")) { 199 my $jreglist = "$outdir/reglist$job_id"; 200 if (open JRL, "<$jreglist") {; 201 # process the reglist file to get the list of files produced by this job 202 foreach my $line (<JRL>) { 203 204 # XXX: we are getting many cases where the size and/or md5sum calculated by 205 # the job has changed by the time the request_finish has run 206 # Don't 207 # add line to the requests's reglist 208 # .... 209 # print $rlf $line; 210 211 212 chomp $line; 213 my ($img_name, $reported_size, $reported_sum, $filetype) = split '\|', $line; 214 # ... instead let dsreg compute the paramters by leaving them blank 215 print $rlf "$img_name|||$filetype|\n"; 216 217 # add line to the table definition file 218 print $tdf "$rownum|$fault|$error_string|$img_name|$job_id|"; 219 220 # ra_deg and dec_deg are the coordinates of center of the stamp 221 # first assume that the image is compressed and check the first extension. 222 # If not found check the PHU. If that doesn't work just set them to zero. 223 # XXX do this more cleanly 224 my (undef, $ra_deg, $dec_deg) = split " ", `echo $outdir/$img_name | fields -x 0 RA_DEG DEC_DEG`; 225 if (!defined $ra_deg) { 226 (undef, $ra_deg, $dec_deg) = split " ", `echo $outdir/$img_name | fields RA_DEG DEC_DEG`; 129 my $request_fault = 0; 130 if ($action eq 'PROCESS') { 131 # The results table definition file 132 my ($tdf, $table_def_name) = tempfile ("$outdir/tabledef.XXXX", UNLINK => !$save_temps); 133 # data for the header 134 print $tdf "$req_name|$req_id|\n"; 135 # get the list of jobs generated for this request 136 my @jobs; 137 { 138 my $command = "$pstamptool -listjob -req_id $req_id"; 139 $command .= " -dbname $dbname" if $dbname; 140 $command .= " -dbserver $dbserver" if $dbserver; 141 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 142 run(command => $command, verbose => $verbose); 143 unless ($success) { 144 die("Unable to perform $command error code: $error_code"); 145 } 146 my $output = join "", @$stdout_buf; 147 if (!$output) { 148 # This should not happen. A fake job should have been entered 149 my_die("Request $req_id produced no jobs", $req_id, $PS_EXIT_PROG_ERROR); 150 } else { 151 my $jobs = parse_md_fast($mdcParser, $output); 152 153 @jobs = @$jobs; 154 } 155 } 156 157 my $exp_info; 158 foreach my $job (@jobs) { 159 my $job_id = $job->{job_id}; 160 my $job_type = $job->{jobType}; 161 my $rownum = $job->{rownum}; 162 my $fault = $job->{fault}; 163 my $exp_id = $job->{exp_id}; 164 165 my $error_string = get_error_string($fault); 166 167 if (($fault eq $PSTAMP_DUP_REQUEST) and ($req_name eq "NULL")) { 168 # this request had a duplicate request name yet the parser didn't give 169 # it an "ERROR style name. 170 my_die("duplicate request not given a request name", $req_id, $PS_EXIT_PROG_ERROR); 171 } 172 my ($row, $req_info, $project) = get_request_info($rows, $rownum); 173 174 my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver); 175 my $image_db = $proj_hash->{dbname}; 176 if (!$image_db and !$fault) { 177 # if project isn't resolvable, the paser should have faulted this job 178 my_die("failed to find imagedb for project $project", $req_id, $PS_EXIT_CONFIG_ERROR); 179 } 180 181 my $job_params = get_job_parameters($job); 182 my $stage = ""; 183 if ($job_params) { 184 $stage = $job_params->{stage}; 185 } 186 187 if ($stage ne 'stack') { 188 # get the metadata for the exposure (if any i.e. stack) 189 # returns an appropriate string if !$exp_id 190 $exp_info = get_exposure_info($job_params, $image_db, $exp_id); 191 } else { 192 my $filter = $job_params->{filter}; 193 $filter = "0" if !$filter; 194 my $mjd_obs = $job_params->{mjd_obs}; 195 $mjd_obs = "0" if !$mjd_obs; 196 $exp_info = "$mjd_obs|0|0|$filter|0|0"; 197 } 198 199 if (($job_type eq "stamp") || ($job_type eq "get_image") || ($job_type eq "none")) { 200 my $jreglist = "$outdir/reglist$job_id"; 201 if (open JRL, "<$jreglist") {; 202 # process the reglist file to get the list of files produced by this job 203 foreach my $line (<JRL>) { 204 205 # XXX: we are getting many cases where the size and/or md5sum calculated by 206 # the job has changed by the time the request_finish has run 207 # Don't 208 # add line to the requests's reglist 209 # .... 210 # print $rlf $line; 211 212 213 chomp $line; 214 my ($img_name, $reported_size, $reported_sum, $filetype) = split '\|', $line; 215 # ... instead let dsreg compute the paramters by leaving them blank 216 print $rlf "$img_name|||$filetype|\n"; 217 218 # add line to the table definition file 219 print $tdf "$rownum|$fault|$error_string|$img_name|$job_id|"; 220 221 # ra_deg and dec_deg are the coordinates of center of the stamp 222 # first assume that the image is compressed and check the first extension. 223 # If not found check the PHU. If that doesn't work just set them to zero. 224 # XXX do this more cleanly 225 my (undef, $ra_deg, $dec_deg) = split " ", `echo $outdir/$img_name | fields -x 0 RA_DEG DEC_DEG`; 226 if (!defined $ra_deg) { 227 (undef, $ra_deg, $dec_deg) = split " ", `echo $outdir/$img_name | fields RA_DEG DEC_DEG`; 228 } 229 $ra_deg = 0.0 if (!$ra_deg); 230 $dec_deg = 0.0 if (!$dec_deg); 231 print $tdf "$ra_deg|$dec_deg|"; 232 233 print $tdf "$exp_info|"; 234 print $tdf "$req_info|"; 235 print $tdf "\n"; 227 236 } 228 $ra_deg = 0.0 if (!$ra_deg); 229 $dec_deg = 0.0 if (!$dec_deg); 230 print $tdf "$ra_deg|$dec_deg|"; 231 237 close JRL; 238 } else { 239 my_die("No reglist for successful job: $job_id", $req_id, $PS_EXIT_PROG_ERROR) 240 if $fault eq $PSTAMP_SUCCESS; 241 print STDERR "no reglist file for job $job_id\n" if $verbose; 242 print $tdf "$rownum|$fault|$error_string|0|$job_id|"; 243 print $tdf "0|0|"; # center of (non-existent) stamp 232 244 print $tdf "$exp_info|"; 233 245 print $tdf "$req_info|"; 234 246 print $tdf "\n"; 235 247 } 236 close JRL;237 248 } else { 238 my_die("No reglist for successful job: $job_id", $req_id, $PS_EXIT_PROG_ERROR) 239 if $fault eq $PSTAMP_SUCCESS; 240 print STDERR "no reglist file for job $job_id\n" if $verbose; 241 print $tdf "$rownum|$fault|$error_string|0|$job_id|"; 242 print $tdf "0|0|"; # center of (non-existent) stamp 243 print $tdf "$exp_info|"; 244 print $tdf "$req_info|"; 245 print $tdf "\n"; 246 } 247 } else { 248 # XXX do list jobs 249 # we can probably arange things to use the code as above and skip the fileset registration 250 print STDERR "Unknown jobType: $job_type"; 251 next; 252 } 253 } 254 close $rlf; 255 close $tdf; 256 my $request_fault = 0; 257 # make the results file 258 { 259 my $command = "$pstamp_results --input $table_def_name --output $outdir/results.fits"; 260 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 261 run(command => $command, verbose => $verbose); 262 unless ($success) { 263 print STDERR "Unable to perform $command error code: $error_code\n"; 264 $request_fault = $error_code >> 8; 265 } else { 266 # dump a textual representation 267 my $command = "$pstampdump $outdir/results.fits > $outdir/results.mdc"; 249 # XXX do list jobs 250 # we can probably arange things to use the code as above and skip the fileset registration 251 print STDERR "Unknown jobType: $job_type"; 252 next; 253 } 254 } 255 close $tdf; 256 # make the results file 257 { 258 my $command = "$pstamp_results --input $table_def_name --output $outdir/results.fits"; 268 259 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 269 260 run(command => $command, verbose => $verbose); 270 261 unless ($success) { 262 print STDERR "Unable to perform $command error code: $error_code\n"; 271 263 $request_fault = $error_code >> 8; 272 my_die("Unable to perform $command error code: $error_code", $req_id, $request_fault); 273 } 274 } 275 } 264 } else { 265 # dump a textual representation 266 my $command = "$pstampdump $outdir/results.fits > $outdir/results.mdc"; 267 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 268 run(command => $command, verbose => $verbose); 269 unless ($success) { 270 $request_fault = $error_code >> 8; 271 my_die("Unable to perform $command error code: $error_code", $req_id, $request_fault); 272 } 273 } 274 } 275 } elsif ($action ne 'LIST') { 276 my_die("Unexpected action $action found", $req_id, $PS_EXIT_PROG_ERROR); 277 } else { 278 # pstampparse did all of the work 279 } 280 281 close $rlf; 282 276 283 if (!$request_fault) { 277 284 # register the fileset -
branches/eam_branches/ipp-20120905/pstamp/scripts/pstamp_request_file
r29673 r34466 49 49 value => undef 50 50 }, 51 { name => 'ACTION', 52 writetype => TSTRING, 53 comment => 'Action to perform: LIST or PROCESS', 54 value => undef 55 }, 56 { name => 'USERNAME', 57 writetype => TSTRING, 58 comment => 'username for request (optional)', 59 value => undef 60 }, 61 { name => 'EMAIL', 62 writetype => TSTRING, 63 comment => 'email for submittor (optional)', 64 value => undef 65 }, 51 66 ]; 52 67 53 68 # Specification of columns to write 54 69 my $columns = [ 70 { name => 'ROWNUM', type => 'J', writetype => TULONG }, 71 72 { name => 'CENTER_X', type => 'D', writetype => TDOUBLE }, 73 { name => 'CENTER_Y', type => 'D', writetype => TDOUBLE }, 74 { name => 'WIDTH', type => 'D', writetype => TDOUBLE }, 75 { name => 'HEIGHT', type => 'D', writetype => TDOUBLE }, 76 # 2 bits in COORD_MASK indicate what units of roi coords are 77 { name => 'COORD_MASK', type => 'J', writetype => TULONG }, 78 79 { name => 'JOB_TYPE', type => '16A', writetype => TSTRING }, 80 { name => 'OPTION_MASK',type => 'J', writetype => TULONG }, 81 82 # image selection parameters 83 { name => 'PROJECT', type => '16A', writetype => TSTRING }, 84 # new in version 2 85 { name => 'SURVEY_NAME',type => '16A', writetype => TSTRING }, 86 { name => 'IPP_RELEASE', type => '16A', writetype => TSTRING }, 87 # end of new in version 2 88 { name => 'REQ_TYPE', type => '16A', writetype => TSTRING }, 89 { name => 'IMG_TYPE', type => '16A', writetype => TSTRING }, 90 { name => 'ID', type => '16A', writetype => TSTRING }, 91 { name => 'TESS_ID', type => '64A', writetype => TSTRING }, 92 { name => 'COMPONENT', type => '64A', writetype => TSTRING }, 93 94 { name => 'DATA_GROUP ',type => '64A', writetype => TSTRING }, 95 96 { name => 'REQFILT', type => '16A', writetype => TSTRING }, 97 { name => 'MJD_MIN', type => 'D', writetype => TDOUBLE }, 98 { name => 'MJD_MAX', type => 'D', writetype => TDOUBLE }, 99 { name => 'RUN_TYPE', type => '16A', writetype => TSTRING }, 100 101 { name => 'COMMENT ', type => '64A', writetype => TSTRING }, 102 ]; 103 my $columns_v1 = [ 55 104 { name => 'ROWNUM', type => 'J', writetype => TULONG }, 56 105 … … 89 138 } 90 139 140 # build array of arrays for the column data. Note if the input file is version 1 then 141 # some of thes will get dropped 91 142 my @colData; 92 143 foreach (@$columns) { … … 96 147 97 148 my $minimum_cols = 6; 98 my $numRows = read_data_for_table($in,'\s+', \@colData, $header, $minimum_cols); 149 my $extver = 2; 150 my $numRows = read_data_for_table($in,'\s+', \@colData, $header, $minimum_cols, \$extver); 99 151 if (!$numRows) { 100 152 print STDERR "no data in $input\n"; … … 115 167 $output = $req_name . ".fits" if !$output; 116 168 117 my $status = make_fits_table($output, EXTNAME, $numRows, \@colData, $ columns, $header);169 my $status = make_fits_table($output, EXTNAME, $numRows, \@colData, $extver > 1 ? $columns : $columns_v1, $header); 118 170 119 171 exit $status; … … 230 282 my $header = shift; # rerence to array of header keyword descriptions 231 283 my $minimum_required_vals = shift; 284 my $r_extver = shift; # reference to extension version 232 285 233 286 my $line_num = 0; … … 243 296 my @vals = split /$sep/, $line; 244 297 my $nvals = @vals; 245 die "number of header columns in input $nvals does not equal expected number of header words $nhead" 298 die "two few columns $nvals in header definition. Require at least 2" if @vals < 2; 299 300 $$r_extver = $vals[1]; 301 if ($extver > 1) { 302 die "number of header columns in input $nvals does not equal expected number of header words $nhead" 246 303 if (@vals != @$header); 247 248 for (my $i=0; $i < @$header; $i++) { 249 $header->[$i]->{value} = $vals[$i]; 250 } 251 252 last; # only one header line 253 } 304 } else { 305 # drop header keywords not used in version 1 306 for (my $i = @$header - 1; $i >= $nvals; $i--) { 307 pop @$header; 308 } 309 } 310 311 for (my $i=0; $i < $nvals; $i++) { 312 my $val = $vals[$i]; 313 if (defined $val) { 314 $header->[$i]->{value} = $val; 315 } else { 316 $header->[$i]->{value} = 'null'; 317 } 318 } 319 320 last; # one line defines the header 321 } 322 } 323 if ($$r_extver == 1) { 324 # pop off the colData arrays to account for the unused columns 325 pop @colData; 326 pop @colData; 327 pop @colData; 254 328 } 255 329 … … 271 345 exit 1; 272 346 } 347 # trim leading whitespace from comment 348 $comment =~ s/^\s+//; 273 349 if ($comment) { 274 350 if ($comment =~ /#/) { … … 381 457 print "If --output is omitted the output file name is set to REQ_NAME.fits\n\n"; 382 458 print "Header 1 Line. Format:\n\n"; 383 print " REQ_NAME EXTVER\n\n";459 print "REQ_NAME EXTVER ACTION USERNAME EMAIL\n\n"; 384 460 print "REQUEST specification (1 or more lines). Format:\n\n"; 385 print " ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT DATA_GROUP REQFILT MJD_MIN MJD_MAX| COMMENT\n\n";461 print "ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT SURVEY_NAME IPP_RELEASE REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT DATA_GROUP REQFILT MJD_MIN MJD_MAX RUN_TYPE | COMMENT\n\n"; 386 462 387 463 exit 0; -
branches/eam_branches/ipp-20120905/pstamp/scripts/pstampparse.pl
r33670 r34466 93 93 my $fields_output; 94 94 { 95 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ";95 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USER EMAIL"; 96 96 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 97 97 run(command => $command, verbose => $verbose); … … 102 102 $fields_output = join "", @$stdout_buf; 103 103 } 104 my (undef, $extname, $extver, $req_name ) = split " ", $fields_output;104 my (undef, $extname, $extver, $req_name, $action, $username, $email) = split " ", $fields_output; 105 105 106 106 # make sure the file contains what we are expecting … … 109 109 my_die("$request_file_name is not a PS1_PS_REQEST", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST"; 110 110 my_die("REQ_NAME not found in $request_file_name", $PS_EXIT_PROG_ERROR) if (!$req_name); 111 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1" );111 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1" and $extver ne "2"); 112 112 113 113 … … 230 230 # the images of interest for this new row doesn't match the list. 231 231 # process the list ... 232 $num_jobs += processRows( \@rowList);232 $num_jobs += processRows($action, \@rowList); 233 233 234 234 # and reset the list to contain just the new row … … 238 238 # out of rows process the list 239 239 if (scalar @rowList > 0) { 240 $num_jobs += processRows( \@rowList);241 } 242 243 if (($ mode eq "queue_job") and ($num_jobs eq 0)) {240 $num_jobs += processRows($action, \@rowList); 241 } 242 243 if (($action eq 'LIST' or $mode eq "queue_job") and ($num_jobs eq 0)) { 244 244 print STDERR "no jobs created for $req_name\n" if $verbose; 245 245 insertFakeJobForRow(undef, 0, $PSTAMP_INVALID_REQUEST); … … 387 387 } 388 388 389 sub processRows {389 sub list_targets { 390 390 my $rowList = shift; 391 391 my $num_jobs = 0; 392 393 $num_jobs = 1; 394 return $num_jobs; 395 } 396 397 sub processRows { 398 my $action = shift; 399 my $rowList = shift; 400 my $num_jobs = 0; 401 402 if ($action eq 'LIST') { 403 return list_targets($rowList); 404 } 392 405 393 406 # all rows in the list are compatible -
branches/eam_branches/ipp-20120905/psvideophot
- Property svn:mergeinfo changed
/trunk/psvideophot merged: 34429
- Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.
