IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 1, 2008, 1:43:05 PM (18 years ago)
Author:
eugene
Message:

updates to use actual caltool, flatcorr commands

File:
1 edited

Legend:

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

    r15314 r16276  
    3636use Pod::Usage qw( pod2usage );
    3737
    38 my ($dvo_id, $catdir, $region, $dbname, $workdir, $no_update, $no_op);
     38my ($cal_id, $dvodb, $region, $dbname, $workdir, $no_update, $no_op);
    3939GetOptions(
    40     'dvo_id|i=s'       => \$dvo_id,
    41     'catdir|c=s'       => \$catdir,
     40    'cal_id|i=s'       => \$cal_id,
     41    'dvodb|c=s'        => \$dvodb,
    4242    'region|r=s'       => \$region,
    4343    'dbname|d=s'       => \$dbname,# Database name
     
    4848
    4949pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    50 pod2usage( -msg => "Required options: --dvo_id --catdir --region",
     50pod2usage( -msg => "Required options: --cal_id --dvodb --region",
    5151           -exitval => 3) unless
    52     defined $dvo_id and
    53     defined $catdir and
     52    defined $cal_id and
     53    defined $dvodb and
    5454    defined $region;
    5555
     
    7878{
    7979    my $command = "$addstar -resort";
    80     $command .= "-D CATDIR $catdir";
     80    $command .= "-D CATDIR $dvodb";
    8181    $command .= "-region $RAs $RAe $DECs $DECe";
    8282
     
    8686    unless ($success) {
    8787        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    88         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RESORT", $status, $dbname);
     88        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RESORT", $status, $dbname);
    8989    }
    9090}
     
    9494    foreach my $filter (@filters) {
    9595        my $command = "$relphot $filter";
    96         $command .= "-D CATDIR $catdir";
     96        $command .= "-D CATDIR $dvodb";
    9797        $command .= "-region $RAs $RAe $DECs $DECe";
    9898
     
    102102        unless ($success) {
    103103            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    104             &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
     104            &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELPHOT", $status, $dbname);
    105105        }
    106106    }
     
    112112    foreach my $filter (@filters) {
    113113        my $command = "$uniphot $filter";
    114         $command .= "-D CATDIR $catdir";
     114        $command .= "-D CATDIR $dvodb";
    115115        $command .= "-region $RAs $RAe $DECs $DECe";
    116116
     
    120120        unless ($success) {
    121121            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    122             &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "UNIPHOT", $status, $dbname);
     122            &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "UNIPHOT", $status, $dbname);
    123123        }
    124124    }
     
    127127{
    128128    my $command = "$relastro -objects";
    129     $command .= "-D CATDIR $catdir";
     129    $command .= "-D CATDIR $dvodb";
    130130    $command .= "-region $RAs $RAe $DECs $DECe";
    131131
     
    135135    unless ($success) {
    136136        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    137         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
     137        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
    138138    }
    139139}
     
    141141{
    142142    my $command = "$relastro -images";
    143     $command .= "-D CATDIR $catdir";
     143    $command .= "-D CATDIR $dvodb";
    144144    $command .= "-region $RAs $RAe $DECs $DECe";
    145145
     
    149149    unless ($success) {
    150150        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    151         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname);
    152     }
    153 }
    154 
    155 my $command = "$caltool -addcalrun";
    156 $command .= " -dvo_id $dvo_id";
     151        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.IMAGES", $status, $dbname);
     152    }
     153}
     154
     155my $command = "$caltool -addrun";
     156$command .= " -cal_id $cal_id";
    157157$command .= " -region $region";
    158158$command .= " -last_step RELASTRO.IMAGES";
    159 $command .= " -status SUCCESS";
     159$command .= " -state 0";
    160160$command .= " -dbname $dbname" if defined $dbname;
    161161
     
    176176{
    177177    my $msg = shift; # Warning message on die
    178     my $dvo_id    = shift;
     178    my $cal_id    = shift;
    179179    my $region    = shift;
    180180    my $last_step = shift;
     
    183183
    184184    carp($msg);
    185     if ($dvo_id && $region && $last_step && $status and not $no_update) {
     185    if ($cal_id && $region && $last_step && $status and not $no_update) {
    186186        my $command = "$caltool -addcalrun";
    187         $command .= " -dvo_id $dvo_id";
     187        $command .= " -cal_id $cal_id";
    188188        $command .= " -region $region";
    189189        $command .= " -last_step $last_step";
    190         $command .= " -status $status";
     190        $command .= " -state $status";
    191191        $command .= " -dbname $dbname" if defined $dbname;
    192192        system ($command);
Note: See TracChangeset for help on using the changeset viewer.