IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2023, 2:05:41 PM (3 years ago)
Author:
eugene
Message:

adding advance task, fix the logs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl

    r42415 r42430  
    1212use Getopt::Long qw( GetOptions :config auto_help auto_version );
    1313
    14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file)
     14# USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc)
    1515
    1616# we need to select targets for ITC copies of files currently only at ATRC:
     
    1818# for each chip, target a single host?
    1919
    20 my ($fulldate, $dateword, $chiplist) = &parse_cmdopts;
     20my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts;
    2121my ($neb_dbh) = &parse_db_config ('nebulous.config');
    2222
     
    7171            my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
    7272            unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    73             open (OUTFILE, ">>$dateword/$newhost.inst.txt");
     73            open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt");
    7474            print OUTFILE "$newfile $datast $md5sum\n";
    7575            close (OUTFILE);
     
    8585            my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
    8686            unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    87             open (OUTFILE, ">>$dateword/$newhost.inst.txt");
     87            open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt");
    8888            print OUTFILE "$newfile $datast $md5sum\n";
    8989            close (OUTFILE);
     
    189189sub parse_cmdopts {
    190190
    191     my ($dateobs, $chiplist);
    192     GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist) || pod2usage(2);
     191    my ($dateobs, $chiplist, $stage);
     192    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2);
    193193   
    194194    pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
    195195    pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
     196    pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
    196197   
    197198    # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
     
    206207    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    207208
    208     return ($fulldate, $dateword, $chiplist);
     209    return ($fulldate, $dateword, $chiplist, $stage);
    209210}
    210211
Note: See TracChangeset for help on using the changeset viewer.