Changeset 30676 for branches/eam_branches/ipp-20110213/ippScripts
- Timestamp:
- Feb 17, 2011, 3:20:07 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/ippScripts/scripts
- Files:
-
- 8 edited
-
dist_bundle.pl (modified) (1 diff)
-
ipp_apply_burntool_single.pl (modified) (1 prop)
-
ipp_cleanup.pl (modified) (1 diff)
-
magic_destreak_cleanup.pl (modified) (4 diffs)
-
magic_destreak_revert.pl (modified) (3 diffs)
-
receive_file.pl (modified) (6 diffs)
-
register_imfile.pl (modified) (2 diffs)
-
stack_skycell.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/ippScripts/scripts/dist_bundle.pl
r30489 r30676 287 287 # we can use the chip mask because disttool demands that magic have been run 288 288 # and so the camera mask and the chip mask are the same 289 $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $chip_path_base, $component); 289 #$mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $chip_path_base, $component); 290 # XXX: hack the pending query passes in the camera path base 291 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $chip_path_base, $component); 290 292 my $mask_resolved = $ipprc->file_resolve($mask); 291 293 my $fh = open_with_retries($mask_resolved); -
branches/eam_branches/ipp-20110213/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20101203/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 30586-30587,30631 /trunk/ippScripts/scripts/ipp_apply_burntool_single.pl (added) merged: 30636
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20110213/ippScripts/scripts/ipp_cleanup.pl
r30546 r30676 1900 1900 { 1901 1901 my $files = shift; # reference to a list of files to unlink 1902 # my $test_verbose = 1; 1903 1904 # if ($test_verbose == 1) { 1905 # open(TMPLOG,">>/tmp/czw.cleanup.log"); 1906 # flock(TMPLOG,2); 1907 # } 1908 1909 # this script is, of course, very dangerous. 1902 1910 1903 foreach my $file (@$files) { 1911 1904 print STDERR "unlinking $stage $stage_id $file"; 1912 unless ($ipprc->file_exists($file)) { 1913 print STDERR "\t File not found\n"; 1914 } 1915 else { 1916 print STDERR "\n"; 1917 } 1918 1919 # if ($test_verbose == 1) { 1920 # print TMPLOG "$stage $stage_id $file"; 1921 1922 # else { 1923 # print TMPLOG "\n"; 1924 # } 1925 # } 1926 1927 $ipprc->file_delete($file); 1928 } 1929 1930 # if ($test_verbose == 1) { 1931 # flock(TMPLOG,8); 1932 # close(TMPLOG); 1933 # } 1905 1906 my $error_code = $ipprc->kill_file($file); 1907 1908 &my_die("failed to kill $file", $stage, $stage_id, $PS_EXIT_CONFIG_ERROR) if $error_code; 1909 } 1934 1910 1935 1911 return 1; -
branches/eam_branches/ipp-20110213/ippScripts/scripts/magic_destreak_cleanup.pl
r30520 r30676 44 44 'magic_ds_id=s' => \$magic_ds_id,# Magic destreak run identifier 45 45 'camera=s' => \$camera, # camera for evaluating file rules 46 'stage=s' => \$stage, # camera for evaluating file rules46 'stage=s' => \$stage, # ipp stage for this magicDSRun 47 47 'save-temps' => \$save_temps, # Save temporary files? 48 48 'dbname=s' => \$dbname, # Database name … … 160 160 my $backup_path_base = $comp->{backup_path_base}; 161 161 my ($bimage, $bmask, $bch_mask, $bweight, $bsources, $bastrom); 162 my ($rimage, $rmask, $rch_mask, $rweight, $rsources, $rastrom);162 # my ($rimage, $rmask, $rch_mask, $rweight, $rsources, $rastrom); 163 163 164 164 if ($stage eq "chip") { … … 219 219 } 220 220 221 delete_files($bimage, $bmask, $bweight, $bsources, $bastrom, $bch_mask , $rch_mask);221 delete_files($bimage, $bmask, $bweight, $bsources, $bastrom, $bch_mask); 222 222 223 223 if ($stage eq "diff" and $warp_warp) { … … 252 252 foreach my $file (@_) { 253 253 if ($file) { 254 if ($ipprc->file_exists($file)) { 255 if (!$no_update) { 256 print STDERR "deleting $file\n" if $verbose; 257 $ipprc->file_delete($file, 1) or my_die("Failed to delete $file", $magic_ds_id, $PS_EXIT_UNKNOWN_ERROR); 258 } else { 259 print STDERR "skipping delete $file\n"; 260 } 261 } else { 262 print STDERR "$file not found\n" if $verbose; 263 } 254 my $error_code = $ipprc->kill_file($file); 255 my_die("Failed to delete $file", $magic_ds_id, $error_code) if $error_code; 264 256 } 265 257 } -
branches/eam_branches/ipp-20110213/ippScripts/scripts/magic_destreak_revert.pl
r30260 r30676 191 191 # Note that when destreaking as part of an update $magicked is non-zero. 192 192 # In this case we do not touch the camera stage mask so there is no need to revert it 193 if ( !$magicked and $dynamicMasks) {193 if ($dynamicMasks and (!$magicked or ($run_state eq 'goto_restored'))) { 194 194 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id); 195 195 $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id); … … 210 210 $bweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $backup_path_base, $class_id); 211 211 212 $rimage = $ipprc->filename("PPIMAGE.CHIP", $recovery_path_base, $class_id); 213 # This is somewhat kludgey but it works whether the mask is camera mask or chip mask 214 $rmask = dirname($recovery_path_base) . "/REC_" . basename($mask); 215 $rch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $recovery_path_base, $class_id); 216 $rweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $recovery_path_base, $class_id); 212 if ($recovery_path_base) { 213 $rimage = $ipprc->filename("PPIMAGE.CHIP", $recovery_path_base, $class_id); 214 # This is somewhat kludgey but it works whether the mask is camera mask or chip mask 215 $rmask = dirname($recovery_path_base) . "/REC_" . basename($mask); 216 $rch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $recovery_path_base, $class_id); 217 $rweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $recovery_path_base, $class_id); 218 } 217 219 } elsif ($stage eq "camera") { 218 220 $astrom = $ipprc->filename("PSASTRO.OUTPUT", $path_base); … … 227 229 $bweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $backup_path_base); 228 230 $bsources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $backup_path_base); 229 $rimage = $ipprc->filename("PSWARP.OUTPUT", $recovery_path_base); 230 $rmask = $ipprc->filename("PSWARP.OUTPUT.MASK", $recovery_path_base); 231 $rweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $recovery_path_base); 231 if ($recovery_path_base) { 232 $rimage = $ipprc->filename("PSWARP.OUTPUT", $recovery_path_base); 233 $rmask = $ipprc->filename("PSWARP.OUTPUT.MASK", $recovery_path_base); 234 $rweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $recovery_path_base); 235 } 232 236 } elsif ($stage eq "diff") { 233 237 my $name = "PPSUB.OUTPUT"; -
branches/eam_branches/ipp-20110213/ippScripts/scripts/receive_file.pl
r29973 r30676 41 41 42 42 # Parse the command-line arguments 43 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $component, $bytes, $md5sum, $workdir, $dirinfo_uri, $ dbname, $verbose, $no_update, $save_temps );43 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $component, $bytes, $md5sum, $workdir, $dirinfo_uri, $no_extract, $dbname, $verbose, $no_update, $save_temps ); 44 44 45 45 GetOptions( … … 54 54 'md5sum=s' => \$md5sum, # md5sum for file from data store 55 55 'workdir=s' => \$workdir, # Working directory for output 56 'no-extract' => \$no_extract, # Do not extract the tarfiles 56 57 'dirinfo=s' => \$dirinfo_uri, # file containing the destination directories for this component 57 58 'dbname=s' => \$dbname, # Database name … … 85 86 my $mdcParser = PS::IPP::Metadata::Config->new; 86 87 87 88 # select a directory for the dirinfo and dbinfo files 89 # XXX: perhaps this directory should be set by the script and passed in 90 # rather than computed here. 91 92 my ($day, $month, $year) = (localtime)[3,4,5]; 93 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day; 94 my $dir_for_info_files = caturi($workdir, $datestr, $fileset); 95 96 97 my $is_tarfile = 0; 98 if ($file =~ m|.*\.tgz$|) { # XXX: perhaps get this off of file type ? 99 $is_tarfile = 1; 100 } 101 102 my $filename; 103 if ($is_tarfile and $no_extract) { 104 $filename = "$dir_for_info_files/$file"; 105 } else { 106 $filename = "$tempdir/$file"; 107 } 88 108 89 109 # Retrieve file 90 my $filename = "$tempdir/$file"; # Target filename91 110 { 92 111 my $uri = "$source/$product/$fileset/$file"; # URI for datastore file … … 107 126 my ($destdir, $components, $dirinfo_lines) = read_dirinfo_file($dirinfo_file_to_read, $file_id); 108 127 109 # select a directory for the dirinfo and dbinfo files110 # XXX: perhaps this directory should be set by the script and passed in111 # rather than computed here.112 113 my ($day, $month, $year) = (localtime)[3,4,5];114 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day;115 my $dir_for_info_files = caturi($workdir, $datestr, $fileset);116 128 117 129 # Deal with file … … 279 291 280 292 281 } elsif ($ file =~ m|.*\.tgz$|) { # XXX: perhaps get this off of file type ?293 } elsif ($is_tarfile and !$no_extract) { 282 294 # Get contents of tarball 283 295 my @files = (); … … 339 351 } 340 352 } 353 } elsif ($is_tarfile and $no_extract) { 354 print "skipping extraction of tarfile $filename\n"; 341 355 } else { 342 356 &my_die( "Unrecognised file: $file\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); -
branches/eam_branches/ipp-20110213/ippScripts/scripts/register_imfile.pl
r30283 r30676 199 199 $command .= " -data_state full"; 200 200 } 201 elsif (is_ccim($tmp_exp_name,$exp_type)) { 202 printf STDERR "This is a camera commanded detrend exposure that should not cause a burn.\n"; 203 $command .= " -data_state full"; 204 } 201 205 else { 202 206 printf STDERR "Need to check burntool.\n"; … … 380 384 } 381 385 386 sub is_ccim 387 { 388 my $exp_name = shift; 389 my $exp_type = shift; 390 391 # needs to match regtool.c checks for "is_ccim". 392 if ($exp_name =~ /c/) { 393 if (($exp_type eq 'DOMEFLAT')|| 394 ($exp_type eq 'DARK')|| 395 ($exp_type eq 'BIAS')) { 396 return(1); 397 } 398 } 399 return(0); 400 } 401 382 402 sub is_daytime 383 403 { -
branches/eam_branches/ipp-20110213/ippScripts/scripts/stack_skycell.pl
r30598 r30676 172 172 my $photometry = metadataLookupBool($recipe, 'PHOTOMETRY'); # perform photometry? 173 173 my $output_nocomp = metadataLookupBool($recipe, 'OUTPUT.NOCOMP'); # change filerules to produced uncompressed output images 174 174 my $output_logflux = metadataLookupBool($recipe, 'OUTPUT.LOGFLUX'); # change filerules to produce logflux compressed output images. 175 176 if ($output_nocomp and $output_logflux) { 177 &my_die("Unable to not compress and logflux compress simultaneously. Check config.",$stack_id, $PS_EXIT_CONFIG_ERROR); 178 } 175 179 176 180 # Generate MDC file with the inputs … … 252 256 $command .= " -F PPSTACK.UNCONV.EXPWT PPSTACK.UNCONV.EXPWT.NOCOMP"; 253 257 } 258 if ($output_logflux) { 259 $command .= " -R PPSTACK.OUTPUT FITS.TYPE COMP_STACK "; # Just this one output component? 260 $command .= " -R PPSTACK.OUTPUT.VARIANCE FITS.TYPE COMP_STACK "; 261 $command .= " -R PPSTACK.OUTPUT.EXPWT FITS.TYPE COMP_STACK "; 262 $command .= " -R PPSTACK.UNCONV FITS.TYPE COMP_STACK "; 263 $command .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE COMP_STACK "; 264 $command .= " -R PPSTACK.UNCONV.EXPWT FITS.TYPE COMP_STACK "; 265 } 254 266 $command .= " -threads $threads" if defined $threads; 255 267 $command .= " -debug-stack" if defined $debug;
Note:
See TracChangeset
for help on using the changeset viewer.
