Changeset 37068 for branches/eam_branches/ipp-ops-20130712/pstamp
- Timestamp:
- Jul 17, 2014, 12:36:19 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712
- Files:
-
- 12 edited
-
. (modified) (1 prop)
-
pstamp (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
pstamp/scripts/dqueryparse.pl (modified) (1 prop)
-
pstamp/scripts/psgetcalibinfo (modified) (1 prop)
-
pstamp/scripts/psmkreq (modified) (1 prop)
-
pstamp/scripts/pstamp_checkdependent.pl (modified) (1 prop)
-
pstamp/scripts/pstamp_finish.pl (modified) (1 prop)
-
pstamp/scripts/pstamp_job_run.pl (modified) (4 diffs, 1 prop)
-
pstamp/scripts/pstampparse.pl (modified) (1 prop)
-
pstamp/src/pstamp.h (modified) (1 diff)
-
pstamp/test/gpc1/stacksummary.bycoord.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-ops-20130712/pstamp
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts
- Property svn:mergeinfo changed
/trunk/pstamp/scripts merged: 36638-36639,36679,36687-36688,36700,36781,36784,36811-36812,36821,36839,36882,37015,37053
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/dqueryparse.pl
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/psgetcalibinfo
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/psmkreq
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/pstamp_checkdependent.pl
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/pstamp_finish.pl
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/pstamp_job_run.pl
- Property svn:mergeinfo deleted
r36141 r37068 29 29 my ($job_id, $redirect_output, $outputBase, $rownum, $jobType, $options); 30 30 my ($verbose, $dbname, $dbserver, $no_update, $save_temps); 31 my $very_verbose = 0; # for debugging 31 32 32 33 GetOptions( … … 67 68 } 68 69 70 if ($verbose && $save_temps) { 71 # we're probably debugging turn up the verbosity 72 $very_verbose = 1; 73 } 74 69 75 if (!$dbserver) { 70 76 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 71 77 } 72 78 79 my $temproot = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR"); 80 $temproot = "/tmp" if !defined $temproot; 81 73 82 my $missing_tools; 74 83 75 84 my $pstamptool = can_run('pstamptool') or (warn "Can't find pstamptool" and $missing_tools = 1); 76 my $ppstamp = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1);77 my $pstamp_get_image_job = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1);78 my $psgetcalibinfo = can_run('psgetcalibinfo') or (warn "Can't find psgetcalibinfo" and $missing_tools = 1);85 my $ppstamp = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1); 86 my $pstamp_get_image_job = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1); 87 my $psgetcalibinfo = can_run('psgetcalibinfo') or (warn "Can't find psgetcalibinfo" and $missing_tools = 1); 79 88 my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1); 80 89 my $whichnode = can_run('whichnode') or (warn "can't find whichnode" and $missing_tools = 1); 90 my $ppBackground = can_run('ppBackground') or (warn "Can't find ppBackground" and $missing_tools = 1); 91 my $ppBackgroundStack = can_run('ppBackgroundStack') or (warn "Can't find ppBackgroundStack" and $missing_tools = 1); 92 my $stack_bkg_mk_mdc = can_run('stack_bkg_mk_mdc.pl') or (warn "Can't find stack_bkg_mk_mdc.pl" and $missing_tools = 1); 81 93 82 94 if ($missing_tools) { … … 120 132 } 121 133 134 if ($options & $PSTAMP_RESTORE_BACKGROUND) { 135 # this subroutine creates a background restored version of the image or fails. 136 # upon success params->{image} is replaced with the new (temporary) version 137 my $error_code = create_background_restored_images($params); 138 if ($error_code) { 139 # if error code is one of the permanant ones set state of job to stop 140 my_die("failed to create background restored images", $job_id, $error_code, 141 $error_code >= $PSTAMP_FIRST_ERROR_CODE ? 'stop' : undef); 142 } 143 } 144 122 145 my $image = $params->{image}; 123 146 my $mask; 124 147 my $variance; 148 149 # We need to background restore HERE 150 # and change the image file supplied to ppstamp 151 125 152 my $fileArgs = " -file $params->{image}"; 126 153 my @file_list = ($params->{image}); … … 665 692 } 666 693 694 # use ppBackground or ppBackgroundStack to produce background restored images 695 sub create_background_restored_images { 696 my $params = shift; 697 my $stage = $params->{stage}; 698 699 if ($stage ne 'stack' and $stage ne 'chip') { 700 # this function is only supported for chip and stack stage 701 # perhaps the parser should catch this ... 702 print STDERR "background restoration not currently supported for stage $params->{stage}\n"; 703 return $PSTAMP_BG_RESTORE_NOT_AVAILABLE; 704 } 705 706 my $tempdir = tempdir("$temproot/pstamp.$job_id.XXXX", CLEANUP => !$save_temps); 707 my $imagedb = $params->{imagedb}; 708 my $camera = $params->{camera}; 709 710 # reinstantiate IPP Configuration using the now known camera so that we get the applicable file rules 711 $ipprc = PS::IPP::Config->new($camera); 712 713 my $input_image = $params->{image}; 714 my $input_mask = $params->{mask}; 715 my $input_variance = $params->{weight}; 716 717 if ($stage eq 'stack') { 718 my $stack_id = $params->{stack_id}; 719 my $mdcfile = "$tempdir/stk.$stack_id.bkg_input.mdc"; 720 { 721 my $command = "$stack_bkg_mk_mdc --stack_id $stack_id --camera $camera --dbname $imagedb > $mdcfile"; 722 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 723 run(command => $command, verbose => $verbose); 724 unless ($success) { 725 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 726 &my_die("Unable to perform stack_bg_mk_mdc.pl: $error_code", $job_id, $PS_EXIT_CONFIG_ERROR, 'run'); 727 } 728 } 729 730 my $outroot = "$tempdir/stk.$stack_id"; 731 732 # XXX: get otapath from a config file or detrend system 733 my $otapath = "neb:///detrends/background_OTA_models.20140527/test_solutions"; 734 { 735 my $command = "$ppBackgroundStack $outroot -input $mdcfile -image $input_image" 736 . " -OTApath $otapath" ; 737 $command .= " -mask $input_mask" if $input_mask; 738 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 739 run(command => $command, verbose => $very_verbose); 740 unless ($success) { 741 # we turned off verbosity because ppBackgroundStack emits too much output 742 # XXX: perhaps use a log file and save it with the job data 743 print STDERR join "", @$stderr_buf; 744 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 745 &my_die("Unable to perform ppBackgroundStack: $error_code", $job_id, $PS_EXIT_CONFIG_ERROR, 'run'); 746 } 747 } 748 # it's all good change the image to be passed to ppstamp 749 $params->{image} = $ipprc->filename('PPBACKGROUND.STACK.OUTPUT', $outroot) or 750 &my_die("Unable to resolve ppBackgroundStack output file name", $job_id, $PS_EXIT_UNKNOWN_ERROR, 'run'); 751 752 } elsif ($stage eq 'chip') { 753 my $input_mdl = $params->{backmdl}; 754 my $chip_id = $params->{chip_id}; 755 my $class_id = $params->{class_id}; 756 my $outroot = "$tempdir/bgrestored.ch.$chip_id"; 757 { 758 my $command = "$ppBackground $outroot -background $input_mdl -image $input_image"; 759 # XXX: I think ppBackground might always require mask and variance images 760 $command .= " -mask $input_mask"; 761 $command .= " -variance $input_variance"; 762 763 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 764 run(command => $command, verbose => $verbose); 765 unless ($success) { 766 print STDERR join "", @$stderr_buf; 767 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 768 &my_die("Unable to perform ppBackground: $error_code", $job_id, $PS_EXIT_CONFIG_ERROR, 'run'); 769 } 770 } 771 $params->{image} = $ipprc->filename('PPBACKGROUND.OUTPUT', $outroot, $class_id) or 772 &my_die("Unable to resolve ppBackgroundStack output image name", $job_id, $PS_EXIT_CONFIG_ERROR, 'run'); 773 $params->{mask} = $ipprc->filename('PPBACKGROUND.OUTPUT.MASK', $outroot, $class_id) or 774 &my_die("Unable to resolve ppBackgroundStack output mask name", $job_id, $PS_EXIT_CONFIG_ERROR, 'run'); 775 $params->{weight} = $ipprc->filename('PPBACKGROUND.OUTPUT.VARIANCE', $outroot, $class_id) or 776 &my_die("Unable to resolve ppBackgroundStack output variance name", $job_id, $PS_EXIT_CONFIG_ERROR, 'run'); 777 778 } else { 779 # can't get here 780 &my_die( "background restoration not currently supported for stage $params->{stage}\n", 781 $job_id, $PS_EXIT_PROG_ERROR, 'stop'); ; 782 } 783 784 return 0; 785 } 786 667 787 sub my_die 668 788 { -
branches/eam_branches/ipp-ops-20130712/pstamp/scripts/pstampparse.pl
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-ops-20130712/pstamp/src/pstamp.h
r36122 r37068 24 24 PSTAMP_NOT_AUTHORIZED = 29, 25 25 PSTAMP_NO_VALID_PIXELS = 30, 26 PSTAMP_BG_RESTORE_NOT_AVAILABLE = 31, 26 27 } pstampJobErrors; 27 28 -
branches/eam_branches/ipp-ops-20130712/pstamp/test/gpc1/stacksummary.bycoord.txt
r36122 r37068 4 4 CHANGEME 2 PROCESS null 5 5 # 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 FWHM_MIN FWHM_MAX | COMMENT 6 1 359.767 -30.2009 100 100 2 stamp 1gpc1 3PI null bycoord stack_summary null RINGS.V3 null LAP.ThreePI.20130717% r 0 0 null 0 0 |6 1 359.767 -30.2009 100 100 2 stamp 196673 gpc1 3PI null bycoord stack_summary null RINGS.V3 null LAP.ThreePI.20130717% r 0 0 null 0 0 |
Note:
See TracChangeset
for help on using the changeset viewer.
