IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34746


Ignore:
Timestamp:
Nov 29, 2012, 6:24:46 PM (14 years ago)
Author:
watersc1
Message:

Updated to reflect usage of the database. Ready for testing, I think.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/ippScripts/scripts/regenerate_background.pl

    r34680 r34746  
    2020           'camera|i=s'      => \$camera,      # user-supplied camera name
    2121           'stage_id=s'      => \$stage_id,    # id for this stage
     22           'skycell_id=s'    => \$skycell_id,  # skycell_id
    2223           'verbose'         => \$verbose,     # verbose commands
    2324           'logfile=s'       => \$logfile      # destination for stdout and stderr 
     
    3334    defined $stage_id;
    3435
     36pod2usage( -msg => "Required options: --camera (name) --stage (stage) --stage_id (stage_id) --skycell_id (skycell_id)",
     37           -exitval => 3) if (($stage eq 'warp')&&(!defined($skycell_id)));
     38
     39
    3540my $ipprc = PS::IPP::Config->new ( $camera ) or
    3641    &my_die("Unable to set up", $stage, $stage_id, $PS_EXIT_CONFIG_ERROR); # used for path/neb info
     
    5156    my $warp_id = $stage_id; # Because I think I used the wrong id in places.
    5257    &my_die("--stage_id required for stage warp", $stage, $stage_id, $PS_EXIT_CONFIG_ERROR) if !$stage_id;
     58    &my_die("--skycell_id required for stage warp", $stage, $stage_id, $PS_EXIT_CONFIG_ERROR) if !$skycell_id;
    5359
    5460    # Configuration stuff
     
    7480
    7581    my $imfiles;   # Array of component files
    76     my $command = "$warptool -warped -warp_id $stage_id";
     82    my $command = "$warptool -warped -warp_id $stage_id -skycell_id $skycell_id";
    7783    my $command .= " -dbname $dbname " if defined $dbname;
    7884
     
    104110        my $poor_quality = $imfile->{quality} > 0;
    105111       
    106         my $bkg_file = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL",$path_base,$skycell_id);
    107         my $bkg_exists = $ipprc->file_exists($bkg_file);
     112#       my $bkg_file = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL",$path_base,$skycell_id);
     113#       my $bkg_exists = $ipprc->file_exists($bkg_file);
     114        my $bkg_exists = $imfile->{background_model};
    108115        if ($bkg_exists) { $status = 0; } # We do not need to remake this.     
    109116
     
    218225    foreach my $imfile (@$imfiles) {
    219226        if ($imfile->{ignored}) {next; }
     227        unless ($imfile->{background_model}) {
     228            &my_die("Not all inputs have valid background models",
     229                    $stage,$stage_id,$PS_EXIT_PROG_ERROR);
     230        }
    220231        print $inputMDC_file "INPUT${num}\tMETADATA\n";
    221232       
Note: See TracChangeset for help on using the changeset viewer.