Changeset 20246
- Timestamp:
- Oct 17, 2008, 1:24:34 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/flatcorr_proc.pl (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/flatcorr_proc.pl
r20194 r20246 42 42 use Pod::Usage qw( pod2usage ); 43 43 44 my ($corr_id, $dvodb, $ region, $filter, $dbname, $workdir, $verbose, $no_update, $no_op);44 my ($corr_id, $dvodb, $camera, $region, $filter, $dbname, $workdir, $verbose, $no_update, $no_op); 45 45 GetOptions( 46 46 'corr_id|i=s' => \$corr_id, 47 47 'dvodb|c=s' => \$dvodb, 48 'camera=s' => \$camera, 48 49 'region|r=s' => \$region, 49 50 'filter|f=s' => \$filter, … … 56 57 57 58 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 58 pod2usage( -msg => "Required options: --corr_id --dvodb -- region --filter --workdir",59 pod2usage( -msg => "Required options: --corr_id --dvodb --camera --region --filter --workdir", 59 60 -exitval => 3) unless 60 61 defined $corr_id and 61 62 defined $dvodb and 63 defined $camera and 62 64 defined $region and 63 65 defined $workdir and … … 78 80 } 79 81 82 $ipprc->define_camera($camera); 83 80 84 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 81 85 82 my $outgrid = "$workdir/grid.$corr_id"; 83 my $outcorr = "$workdir/corr.$corr_id"; 86 # XXX either workdir needs to be non-nebulous here, or addstar / relphot need to handle 87 # nebulous interactions... 88 my $outgrid = "$workdir/grid.$camera.$filter.$corr_id"; 89 my $outcorr = "$workdir/corr.$camera.$filter.$corr_id"; 84 90 85 91 # parse the region (RAs,RAe:DECs,DECe) : item = +/-NNN.NNNN … … 90 96 # Run addstar -resort to ensure the db is indexed 91 97 { 92 my $command = " echo$addstar -resort";98 my $command = "$addstar -resort"; 93 99 $command .= " -D CATDIR $dvodb"; 94 100 $command .= " -region $RAs $RAe $DECs $DECe"; … … 104 110 105 111 # Run relphot (filter) for the specified region (need to clarify the options like imfreeze) 106 { 107 my $command = "echo $relphot $filter"; 108 $command .= " -D CAMERA $camera"; 112 # need to convert the camera name to the dvo camera value 113 { 114 my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar 115 116 my $command = "$relphot $filter"; 117 $command .= " -D CAMERA $camdir"; 109 118 $command .= " -D CATDIR $dvodb"; 110 119 $command .= " -region $RAs $RAe $DECs $DECe"; … … 133 142 134 143 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 135 run(command => $command, verbose => $verbose);144 run(command => $command, verbose => 0); 136 145 unless ($success) { 137 146 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 159 168 160 169 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 161 run(command => $command, verbose => $verbose);170 run(command => $command, verbose => 0); 162 171 unless ($success) { 163 172 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 179 188 180 189 my $filelevel = $file->{filelevel}; 181 my $camera = $file->{camera};182 190 my $telescope = $file->{telescope}; 183 191 my $filter = $file->{filter}; 184 185 ## XXX the flat-field correction is only defined for a single186 ## camera. we are grabbing the camera here, but we are assuming187 ## the flatcorrRun was defined for only a single camera.188 $ipprc->define_camera($camera);189 192 190 193 my $command = "$dettool -register_detrend"; … … 203 206 204 207 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 205 run(command => $command, verbose => 1);208 run(command => $command, verbose => $verbose); 206 209 207 210 unless ($success) { … … 232 235 } 233 236 234 my $command = " echo$dvoMakeCorr $outcorr";237 my $command = "$dvoMakeCorr $outcorr"; 235 238 $command .= " -file $outgrid.fits"; 236 239 $command .= " -ref $reffile"; 237 240 238 241 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 239 run(command => $command, verbose => 1);242 run(command => $command, verbose => $verbose); 240 243 241 244 unless ($success) { … … 252 255 253 256 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 254 run(command => $command, verbose => 1);257 run(command => $command, verbose => $verbose); 255 258 256 259 unless ($success) { … … 268 271 269 272 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 270 run(command => $command, verbose => 1);273 run(command => $command, verbose => $verbose); 271 274 272 275 unless ($success) { … … 287 290 288 291 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 289 run(command => $command, verbose => 1);292 run(command => $command, verbose => $verbose); 290 293 unless ($success) { 291 294 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
Note:
See TracChangeset
for help on using the changeset viewer.
