Changeset 26289
- Timestamp:
- Nov 29, 2009, 3:17:29 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (4 diffs)
-
pstamp/scripts/pstamp_check_dependents.pl (modified) (6 diffs)
-
pstamp/scripts/pstamp_finish.pl (modified) (1 diff)
-
pstamp/scripts/pstamp_request_file (modified) (2 diffs)
-
pstamp/scripts/pstamp_results_file.pl (modified) (1 diff)
-
pstamp/scripts/pstampparse.pl (modified) (8 diffs)
-
pstamp/src/pstamprequest.c (modified) (4 diffs)
-
pstamp/test/ps1-0905001-all.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r26242 r26289 43 43 my $mjd_max = shift; 44 44 my $filter = shift; 45 my $ label= shift;45 my $data_group = shift; 46 46 my $verbose = shift; 47 47 … … 128 128 } 129 129 130 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $ label, $verbose);130 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose); 131 131 132 132 return $results; … … 148 148 my $dateobs_end = shift; 149 149 my $filter = shift; 150 my $ label= shift;150 my $data_group = shift; 151 151 my $verbose = shift; 152 152 … … 281 281 282 282 $command .= " -filter $filter" if !isnull($filter); 283 $command .= " - label $label" if !isnull($label);283 $command .= " -data_group $data_group" if !isnull($data_group); 284 284 285 285 # run the tool and parse the output -
trunk/pstamp/scripts/pstamp_check_dependents.pl
r25957 r26289 25 25 use PS::IPP::PStamp::Job qw( :standard ); 26 26 27 my ( $dep_id, $dep_state, $stage, $stage_id, $imagedb, $ rlabel, $no_magic, $dbname, $dbserver);27 my ( $dep_id, $dep_state, $stage, $stage_id, $imagedb, $no_magic, $dbname, $dbserver); 28 28 my ( $no_update, $verbose, $save_temps, $logfile); 29 29 … … 34 34 'stage_id=s' => \$stage_id, 35 35 'imagedb=s' => \$imagedb, 36 'rlabel=s' => \$rlabel,37 36 'no-magic=s' => \$no_magic, 38 37 'dbname=s' => \$dbname, … … 46 45 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 47 46 48 die "--dep_id --state --stage --stage_id --imagedb and --rlabelare requried \n"49 if !$dep_id or !$dep_state or !$stage or !$stage_id or !$imagedb or !$rlabel;47 die "--dep_id --state --stage --stage_id and --imagedb are requried \n" 48 if !$dep_id or !$dep_state or !$stage or !$stage_id or !$imagedb; 50 49 51 50 my $ipprc = PS::IPP::Config->new(); # IPP Configuration … … 103 102 } else { 104 103 105 # XXX: TODO set label to the "standard" update value106 107 104 # don't update if in runs are in state goto_cleaned, wait for clean to finish 108 105 if ($state eq "cleaned") { 109 runcommand("$chiptool -dbname $imagedb -chip_id $stage_id -updaterun -set_state update ");110 } 111 112 # don't update yet if magicDSRuns are in state goto_ purged, wait for purge to finish113 if ($magic_ds_state eq " purged") {106 runcommand("$chiptool -dbname $imagedb -chip_id $stage_id -updaterun -set_state update -set_label update"); 107 } 108 109 # don't update yet if magicDSRuns are in state goto_cleaned, wait for purge to finish 110 if ($magic_ds_state eq "cleaned") { 114 111 my $magic_ds_id = $run_state->{magic_ds_id}; 115 112 runcommand("$magicdstool -dbname $imagedb -magic_ds_id $magic_ds_id -updaterun -set_state new"); … … 145 142 } else { 146 143 147 # XXX: TODO set label to the "standard" update value148 149 144 # don't update if in runs are in state goto_cleaned, wait for clean to finish 150 145 if ($state eq 'cleaned') { 151 runcommand("$warptool -dbname $imagedb -warp_id $stage_id -updaterun -set_state update ");146 runcommand("$warptool -dbname $imagedb -warp_id $stage_id -updaterun -set_state update -set_label update"); 152 147 } 153 148 154 149 if ($chip_state eq 'cleaned') { 155 150 my $chip_id = $run_state->{chip_id}; 156 runcommand("$chiptool -dbname $imagedb -chip_id $chip_id -updaterun -set_state update ");157 } 158 159 # don't update yet if magicDSRuns are in state goto_ purged, wait for purge to finish160 if ($magic_ds_state eq ' purged') {151 runcommand("$chiptool -dbname $imagedb -chip_id $chip_id -updaterun -set_state update -set_label update"); 152 } 153 154 # don't update yet if magicDSRuns are in state goto_cleaned, wait for purge to finish 155 if ($magic_ds_state eq 'cleaned') { 161 156 my $magic_ds_id = $run_state->{magic_ds_id}; 162 157 runcommand("$magicdstool -dbname $imagedb -magic_ds_id $magic_ds_id -updaterun -set_state new"); … … 190 185 } 191 186 return join "", @$stdout_buf if defined wantarray(); 187 return $success; 192 188 } else { 193 189 print STDERR "skipping $command\n"; 194 190 } 191 return 1; 195 192 } 196 193 -
trunk/pstamp/scripts/pstamp_finish.pl
r26048 r26289 315 315 my $comment = $row->{COMMENT}; 316 316 $comment = "null" if !$comment; 317 my $label = $row->{LABEL}; 318 $label = "null" if !$label; 317 my $data_group = $row->{DATA_GROUP}; 318 if (!defined $data_group) { 319 # XXX: backwards compatibility hook. Remove "soon". 320 $data_group = $row->{LABEL}; 321 } 322 $data_group = "null" if !$data_group; 319 323 320 324 # This is ugly, error prone and hard to change. 321 325 # Create a results file module and provide a list of the names (we have the data in the columns) 322 326 my $rowinfo = "$row->{PROJECT}|$row->{JOB_TYPE}|$row->{REQ_TYPE}|$row->{IMG_TYPE}|"; 323 $rowinfo .= "$row->{ID}|$tess_id|$component|$ label|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";327 $rowinfo .= "$row->{ID}|$tess_id|$component|$data_group|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|"; 324 328 $rowinfo .= "$row->{REQFILT}|$row->{COORD_MASK}|$row->{CENTER_X}|$row->{CENTER_Y}|"; 325 329 $rowinfo .= "$row->{WIDTH}|$row->{HEIGHT}|"; -
trunk/pstamp/scripts/pstamp_request_file
r25736 r26289 69 69 { name => 'COMPONENT', type => '64A', writetype => TSTRING }, 70 70 71 { name => ' LABEL ',type => '64A', writetype => TSTRING },71 { name => 'DATA_GROUP ',type => '64A', writetype => TSTRING }, 72 72 73 73 { name => 'REQFILT', type => '16A', writetype => TSTRING }, … … 324 324 print " REQ_NAME EXTVER\n\n"; 325 325 print "REQUEST specification (1 or more lines). Format:\n\n"; 326 print " ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT LABELREQFILT MJD_MIN MJD_MAX | COMMENT\n\n";326 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"; 327 327 328 328 exit 0; -
trunk/pstamp/scripts/pstamp_results_file.pl
r25739 r26289 90 90 { name => 'TESS_ID', type => '64A', writetype => TSTRING }, 91 91 { name => 'COMPONENT', type => '64A', writetype => TSTRING }, 92 { name => ' LABEL',type => '64A', writetype => TSTRING },92 { name => 'DATA_GROUP', type => '64A', writetype => TSTRING }, 93 93 94 94 # output parameters -
trunk/pstamp/scripts/pstampparse.pl
r26242 r26289 193 193 my $mjd_min = $row->{MJD_MIN}; 194 194 my $mjd_max = $row->{MJD_MAX}; 195 my $label = $row->{LABEL}; 195 my $data_group = $row->{DATA_GROUP}; 196 if (!defined $data_group) { 197 # backwards compatability hook 198 $data_group = $row->{LABEL}; 199 } 200 196 201 my $x = $row->{CENTER_X}; 197 202 my $y = $row->{CENTER_Y}; … … 272 277 # request specification. An array reference is returned. 273 278 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component, 274 $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $ label, $verbose);279 $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $data_group, $verbose); 275 280 276 281 if (!$imageList or !@$imageList) { … … 424 429 # set up to queue an update run 425 430 queue_update_run(\$newState, \$fault, \$dep_id, $image->{image_db}, 426 $run_state, $stage, $image->{stage_id}, $need_magic , $image->{label});431 $run_state, $stage, $image->{stage_id}, $need_magic); 427 432 } 428 433 } … … 548 553 # we collected a set of sky coordinates above. 549 554 # filter the images so that only those that contain the centers of the ROIs are processed 550 my $command = "$dvoImagesAtCoords $pointsListName";555 my $command = "$dvoImagesAtCoords -coords $pointsListName"; 551 556 if ($have_skycells) { 552 557 my $tess_id = $thisRun->[0]->{tess_id}; … … 671 676 # set up to queue an update run 672 677 queue_update_run(\$newState, \$fault, \$dep_id, $image->{image_db}, 673 $run_state, $stage, $image->{stage_id}, $need_magic , $image->{label});678 $run_state, $stage, $image->{stage_id}, $need_magic); 674 679 } 675 680 } … … 801 806 return 0 if ($r1->{TESS_ID} ne $r2->{TESS_ID}); 802 807 return 0 if ($r1->{REQFILT} ne $r2->{REQFILT}); 803 return 0 if ($r1->{ LABEL} ne $r2->{LABEL});808 return 0 if ($r1->{DATA_GROUP} ne $r2->{DATA_GROUP}); 804 809 return 0 if ($r1->{MJD_MIN} ne $r2->{MJD_MAX}); 805 810 return 0 if ($r1->{MJD_MAX} ne $r2->{MJD_MAX}); … … 850 855 sub queue_update_run 851 856 { 852 my ($r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $need_magic , $label) = @_;857 my ($r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $need_magic) = @_; 853 858 854 859 if (($state ne 'cleaned') and ($state ne 'update') and ($state ne 'goto_cleaned')) { … … 858 863 my $dep_id; 859 864 my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb"; 860 $command .= " -rlabel $label" if $label;861 865 $command .= " -no_magic" if !$need_magic; 862 866 if (!$no_update) { -
trunk/pstamp/src/pstamprequest.c
r25709 r26289 19 19 "REQ_TYPE", // byid, byexp, bydiff, bycoord 20 20 "ID", // db id, exposure name, diff_image_id, n/a 21 "C LASS_ID",21 "COMPONENT", 22 22 "REQFILT", 23 23 "STAMP_NAME", … … 126 126 switch (getType(argnum, pArgc, argv, options, "ID")) { 127 127 case PSTAMP_RAW: 128 getId("C LASS_ID", argnum, pArgc, argv, options);128 getId("COMPONENT", argnum, pArgc, argv, options); 129 129 break; 130 130 case PSTAMP_CHIP: 131 getId("C LASS_ID", argnum, pArgc, argv, options);131 getId("COMPONENT", argnum, pArgc, argv, options); 132 132 break; 133 133 case PSTAMP_WARP: … … 145 145 switch (getType(argnum, pArgc, argv, options, "ID")) { 146 146 case PSTAMP_RAW: 147 getId("C LASS_ID", argnum, pArgc, argv, options);147 getId("COMPONENT", argnum, pArgc, argv, options); 148 148 break; 149 149 case PSTAMP_CHIP: 150 getId("C LASS_ID", argnum, pArgc, argv, options);150 getId("COMPONENT", argnum, pArgc, argv, options); 151 151 break; 152 152 case PSTAMP_WARP: … … 163 163 switch (getType(argnum, pArgc, argv, options, NULL)) { 164 164 case PSTAMP_RAW: 165 getId("C LASS_ID", argnum, pArgc, argv, options);165 getId("COMPONENT", argnum, pArgc, argv, options); 166 166 break; 167 167 case PSTAMP_CHIP: 168 getId("C LASS_ID", argnum, pArgc, argv, options);168 getId("COMPONENT", argnum, pArgc, argv, options); 169 169 break; 170 170 case PSTAMP_WARP: -
trunk/pstamp/test/ps1-0905001-all.txt
r26242 r26289 10 10 11 11 # REQ_NAME EXTVER 12 byskycell_test112 CHANGEME 1 13 13 14 14 # subsequent lines define the rows in the table 15 15 16 # If ROWNUM is set to zero, pstamp_request_file will set insert a value for each row beginning with 117 # If a later input row reuses one of the automatically assigned values an error is reported.18 19 16 20 17 # ID | ROI Specification | JOB Specification | Images of interest specification 21 # ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT LABELREQFILT MJD_MIN MJD_MAX | COMMENT18 # ROWNUM CENTER_X CENTER_Y WIDTH HEIGHT COORD_MASK JOB_TYPE OPTION_MASK PROJECT REQ_TYPE IMG_TYPE ID TESS_ID COMPONENT DIST_GROUP REQFILT MJD_MIN MJD_MAX | COMMENT 22 19 # 23 20 # various looks at the location of SN candidate PS1-0905001 24 1 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid raw 70853 null null null null 0 0 |PS1-0905001 r25 2 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid chip 20272 null null MD08.200905.v1null 0 0 |PS1-0905001 r21 1 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid raw 70853 null null null null 0 0 |PS1-0905001 r 22 2 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid chip 20272 null null null null 0 0 |PS1-0905001 r 26 23 27 24 # 3 and 4 will fail because the weight images was damaged by the destreaking 28 25 # process 29 3 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid warp 6323 null null MD08.200905.v1null 0 0 |PS1-0905001 r30 4 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid diff 16880 null null MD08.200905.v1null 0 0 |PS1-0905001 r26 3 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid warp 6323 null null null null 0 0 |PS1-0905001 r 27 4 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid diff 16880 null null null null 0 0 |PS1-0905001 r 31 28 # these will work 32 103 243.035580 55.128140 250 250 2 stamp 59 gpc1 byid warp 6323 null null MD08.200905.v1null 0 0 |PS1-0905001 r33 104 243.035580 55.128140 250 250 2 stamp 59 gpc1 byid diff 16880 null null MD08.200905.v1null 0 0 |PS1-0905001 r29 103 243.035580 55.128140 250 250 2 stamp 59 gpc1 byid warp 6323 null null null null 0 0 |PS1-0905001 r 30 104 243.035580 55.128140 250 250 2 stamp 59 gpc1 byid diff 16880 null null null null 0 0 |PS1-0905001 r 34 31 35 5 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid stack 14032 null null nullnull 0 0 |PS1-0905001 r32 5 243.035580 55.128140 250 250 2 stamp 63 gpc1 byid stack 14032 null null null null 0 0 |PS1-0905001 r 36 33 37 34 6 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp raw o4973g0133o null null null null 0 0 |PS1-0905001 r 38 7 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp chip o4973g0133o null null MD08.2009 05.v1null 0 0 |PS1-0905001 r39 8 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp warp o4973g0133o null null MD08.2009 05.v1null 0 0 |PS1-0905001 r40 9 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp diff o4973g0133o null null MD08.2009 05.v1null 0 0 |PS1-0905001 r35 7 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp chip o4973g0133o null null MD08.2009110 null 0 0 |PS1-0905001 r 36 8 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp warp o4973g0133o null null MD08.2009110 null 0 0 |PS1-0905001 r 37 9 243.035580 55.128140 250 250 2 stamp 1 gpc1 byexp diff o4973g0133o null null MD08.2009110 null 0 0 |PS1-0905001 r 41 38 42 39
Note:
See TracChangeset
for help on using the changeset viewer.
