IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 21, 2010, 11:35:15 AM (16 years ago)
Author:
Paul Price
Message:

Add date of processing to output log.

File:
1 edited

Legend:

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

    r20100 r27718  
    11#!/usr/bin/env perl
    22
    3 ## USAGE:flatcorr_init.pl 
     3## USAGE:flatcorr_init.pl
    44## given dbname, dvodb, filter, time range, camera, telescope, etc?
    55## select matching images and register as a new flatcorr run
     
    2424use Sys::Hostname;
    2525my $host = hostname();
     26my $date = `date`;
    2627print "\n\n";
    27 print "Starting script $0 on $host\n\n";
     28print "Starting script $0 on $host at $date\n\n";
    2829
    2930use vars qw( $VERSION );
     
    6869my $caltool  = can_run('caltool')  or (warn "Can't find caltool"  and $missing_tools = 1);
    6970
    70 if ($missing_tools) { 
     71if ($missing_tools) {
    7172    warn ("Can't find required tools");
    72     exit($PS_EXIT_CONFIG_ERROR); 
     73    exit($PS_EXIT_CONFIG_ERROR);
    7374}
    7475
     
    9091        cache_run(command => $command, verbose => 1);
    9192
    92     unless ($success) { 
     93    unless ($success) {
    9394        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    9495        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RESORT", $status, $dbname);
     
    99100{
    100101    foreach my $filter (@filters) {
    101         my $command = "$relphot $filter";
    102         $command .= "-D CATDIR $catdir";
    103         $command .= "-region $RAs $RAe $DECs $DECe";
    104 
    105         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    106             cache_run(command => $command, verbose => 1);
    107 
    108         unless ($success) {
    109             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    110             &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
    111         }
     102        my $command = "$relphot $filter";
     103        $command .= "-D CATDIR $catdir";
     104        $command .= "-region $RAs $RAe $DECs $DECe";
     105
     106        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     107            cache_run(command => $command, verbose => 1);
     108
     109        unless ($success) {
     110            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     111            &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
     112        }
    112113    }
    113114}
     
    117118if (0) {
    118119    foreach my $filter (@filters) {
    119         my $command = "$uniphot $filter";
    120         $command .= "-D CATDIR $catdir";
    121         $command .= "-region $RAs $RAe $DECs $DECe";
    122 
    123         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    124             cache_run(command => $command, verbose => 1);
    125 
    126         unless ($success) {
    127             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    128             &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "UNIPHOT", $status, $dbname);
    129         }
     120        my $command = "$uniphot $filter";
     121        $command .= "-D CATDIR $catdir";
     122        $command .= "-region $RAs $RAe $DECs $DECe";
     123
     124        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     125            cache_run(command => $command, verbose => 1);
     126
     127        unless ($success) {
     128            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     129            &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "UNIPHOT", $status, $dbname);
     130        }
    130131    }
    131132}
     
    137138
    138139    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    139         cache_run(command => $command, verbose => 1);
    140 
    141     unless ($success) { 
    142         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    143         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
     140        cache_run(command => $command, verbose => 1);
     141
     142    unless ($success) {
     143        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     144        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
    144145    }
    145146}
     
    151152
    152153    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    153         cache_run(command => $command, verbose => 1);
    154 
    155     unless ($success) { 
    156         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    157         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname);
     154        cache_run(command => $command, verbose => 1);
     155
     156    unless ($success) {
     157        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     158        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname);
    158159    }
    159160}
     
    185186    my $region    = shift;
    186187    my $last_step = shift;
    187     my $status    = shift;
    188     my $dbname    = shift;
     188    my $status    = shift;
     189    my $dbname    = shift;
    189190
    190191    carp($msg);
    191192    if (defined $dvo_id && defined $region && defined $last_step && defined $status and not $no_update) {
    192193        my $command = "$caltool -addcalrun";
    193         $command .= " -dvo_id $dvo_id";
     194        $command .= " -dvo_id $dvo_id";
    194195        $command .= " -region $region";
    195         $command .= " -last_step $last_step";
    196         $command .= " -status $status";
     196        $command .= " -last_step $last_step";
     197        $command .= " -status $status";
    197198        $command .= " -dbname $dbname" if defined $dbname;
    198199        system ($command);
Note: See TracChangeset for help on using the changeset viewer.