- Timestamp:
- Apr 6, 2023, 6:00:06 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/check_night_status.pl
r42415 r42444 11 11 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 12 12 13 # USAGE: check_night_status.pl --dateobs (night) --chiplist (file) 13 # USAGE: check_night_status.pl --dateobs (night) --chiplist (file) --stage (0,1,etc) 14 14 15 15 # we need to select targets for ITC copies of files currently only at ATRC: … … 17 17 # for each chip, target a single host? 18 18 19 my ($fulldate, $dateword, $chiplist ) = &parse_cmdopts;19 my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts; 20 20 21 21 # read the list of chip_ids: … … 36 36 foreach my $chip_id (@chip_ids) { 37 37 38 my $urifile = "$dateword/$chip_id.uris. txt";38 my $urifile = "$dateword/$chip_id.uris.$stage.txt"; 39 39 open (FILE, "$urifile"); 40 40 my @lines = <FILE>; … … 110 110 sub parse_cmdopts { 111 111 112 my ($dateobs, $chiplist );113 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist ) || pod2usage(2);112 my ($dateobs, $chiplist, $stage); 113 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2); 114 114 115 115 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 116 116 pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist; 117 pod2usage( -msg => "Define the stage (0, 1, etc) with --stage", -exitval => 2) unless defined $stage; 118 119 # check that stage is an integer 120 unless (is_integer ($stage)) { die "stage must be a non-negative integer\n"; } 121 unless ($stage >= 0) { die "stage must be a non-negative integer\n"; } 122 117 123 118 124 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 127 133 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 128 134 129 return ($fulldate, $dateword, $chiplist );135 return ($fulldate, $dateword, $chiplist, $stage); 130 136 } 131 137 138 139 sub is_integer { 140 defined $_[0] && $_[0] =~ /^[+-]?\d+$/; 141 } 142
Note:
See TracChangeset
for help on using the changeset viewer.
