- Timestamp:
- Mar 23, 2023, 2:05:41 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
r42415 r42430 12 12 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 13 13 14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) 14 # USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc) 15 15 16 16 # we need to select targets for ITC copies of files currently only at ATRC: … … 18 18 # for each chip, target a single host? 19 19 20 my ($fulldate, $dateword, $chiplist ) = &parse_cmdopts;20 my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts; 21 21 my ($neb_dbh) = &parse_db_config ('nebulous.config'); 22 22 … … 71 71 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 72 72 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"); 74 74 print OUTFILE "$newfile $datast $md5sum\n"; 75 75 close (OUTFILE); … … 85 85 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 86 86 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"); 88 88 print OUTFILE "$newfile $datast $md5sum\n"; 89 89 close (OUTFILE); … … 189 189 sub parse_cmdopts { 190 190 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); 193 193 194 194 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 195 195 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; 196 197 197 198 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 206 207 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 207 208 208 return ($fulldate, $dateword, $chiplist );209 return ($fulldate, $dateword, $chiplist, $stage); 209 210 } 210 211
Note:
See TracChangeset
for help on using the changeset viewer.
