IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20246


Ignore:
Timestamp:
Oct 17, 2008, 1:24:34 PM (18 years ago)
Author:
eugene
Message:

cleanup output, command calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/flatcorr_proc.pl

    r20194 r20246  
    4242use Pod::Usage qw( pod2usage );
    4343
    44 my ($corr_id, $dvodb, $region, $filter, $dbname, $workdir, $verbose, $no_update, $no_op);
     44my ($corr_id, $dvodb, $camera, $region, $filter, $dbname, $workdir, $verbose, $no_update, $no_op);
    4545GetOptions(
    4646    'corr_id|i=s'      => \$corr_id,
    4747    'dvodb|c=s'        => \$dvodb,
     48    'camera=s'         => \$camera,
    4849    'region|r=s'       => \$region,
    4950    'filter|f=s'       => \$filter,
     
    5657
    5758pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    58 pod2usage( -msg => "Required options: --corr_id --dvodb --region --filter --workdir",
     59pod2usage( -msg => "Required options: --corr_id --dvodb --camera --region --filter --workdir",
    5960           -exitval => 3) unless
    6061    defined $corr_id and
    6162    defined $dvodb and
     63    defined $camera and
    6264    defined $region and
    6365    defined $workdir and
     
    7880}
    7981
     82$ipprc->define_camera($camera);
     83
    8084my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    8185
    82 my $outgrid = "$workdir/grid.$corr_id";
    83 my $outcorr = "$workdir/corr.$corr_id";
     86# XXX either workdir needs to be non-nebulous here, or addstar / relphot need to handle
     87# nebulous interactions...
     88my $outgrid = "$workdir/grid.$camera.$filter.$corr_id";
     89my $outcorr = "$workdir/corr.$camera.$filter.$corr_id";
    8490
    8591# parse the region (RAs,RAe:DECs,DECe) : item = +/-NNN.NNNN
     
    9096# Run addstar -resort to ensure the db is indexed
    9197{
    92     my $command = "echo $addstar -resort";
     98    my $command = "$addstar -resort";
    9399    $command .= " -D CATDIR $dvodb";
    94100    $command .= " -region $RAs $RAe $DECs $DECe";
     
    104110
    105111# Run relphot (filter) for the specified region (need to clarify the options like imfreeze)
    106 {
    107     my $command = "echo $relphot $filter";
    108     $command .= " -D CAMERA $camera";
     112# need to convert the camera name to the dvo camera value
     113{
     114    my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
     115
     116    my $command = "$relphot $filter";
     117    $command .= " -D CAMERA $camdir";
    109118    $command .= " -D CATDIR $dvodb";
    110119    $command .= " -region $RAs $RAe $DECs $DECe";
     
    133142
    134143    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    135         run(command => $command, verbose => $verbose);
     144        run(command => $command, verbose => 0);
    136145    unless ($success) {
    137146        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    159168
    160169    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    161         run(command => $command, verbose => $verbose);
     170        run(command => $command, verbose => 0);
    162171    unless ($success) {
    163172        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    179188
    180189    my $filelevel = $file->{filelevel};
    181     my $camera    = $file->{camera};
    182190    my $telescope = $file->{telescope};
    183191    my $filter    = $file->{filter};
    184 
    185     ## XXX the flat-field correction is only defined for a single
    186     ## camera.  we are grabbing the camera here, but we are assuming
    187     ## the flatcorrRun was defined for only a single camera.
    188     $ipprc->define_camera($camera);
    189192
    190193    my $command = "$dettool -register_detrend";
     
    203206
    204207    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    205         run(command => $command, verbose => 1);
     208        run(command => $command, verbose => $verbose);
    206209
    207210    unless ($success) {
     
    232235    }
    233236
    234     my $command = "echo $dvoMakeCorr $outcorr";
     237    my $command = "$dvoMakeCorr $outcorr";
    235238    $command .= " -file $outgrid.fits";
    236239    $command .= " -ref $reffile";
    237240
    238241    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    239         run(command => $command, verbose => 1);
     242        run(command => $command, verbose => $verbose);
    240243
    241244    unless ($success) {
     
    252255
    253256    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    254         run(command => $command, verbose => 1);
     257        run(command => $command, verbose => $verbose);
    255258
    256259    unless ($success) {
     
    268271
    269272    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    270         run(command => $command, verbose => 1);
     273        run(command => $command, verbose => $verbose);
    271274
    272275    unless ($success) {
     
    287290
    288291        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    289             run(command => $command, verbose => 1);
     292            run(command => $command, verbose => $verbose);
    290293        unless ($success) {
    291294            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
Note: See TracChangeset for help on using the changeset viewer.