Changeset 24764
- Timestamp:
- Jul 12, 2009, 11:06:44 AM (17 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 10 edited
-
detrend_correct_imfile.pl (modified) (1 diff)
-
detrend_norm_apply.pl (modified) (5 diffs)
-
detrend_norm_calc.pl (modified) (4 diffs)
-
detrend_norm_exp.pl (modified) (1 diff)
-
detrend_process_exp.pl (modified) (1 diff)
-
detrend_process_imfile.pl (modified) (2 diffs)
-
detrend_reject_exp.pl (modified) (1 diff)
-
detrend_resid_exp.pl (modified) (2 diffs)
-
detrend_resid_imfile.pl (modified) (4 diffs)
-
detrend_stack.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_correct_imfile.pl
r23688 r24764 57 57 and defined $outroot 58 58 and defined $camera; 59 60 # force det_type to be upper-case in this script 61 $det_type = uc($det_type); 59 62 60 63 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration -
trunk/ippScripts/scripts/detrend_norm_apply.pl
r24742 r24764 62 62 defined $outroot; 63 63 64 # force det_type to be upper-case in this script 65 $det_type = uc($det_type); 66 64 67 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 65 68 … … 72 75 # Define which detrend types we normalise 73 76 use constant DETTYPE => { 74 ' bias' => 'bias',75 ' dark' => 'dark',76 ' dark_premask' => 'dark',77 ' shutter' => 'shutter',78 ' flat_premask' => 'flat',79 ' domeflat_premask' => 'flat',80 ' skyflat_premask' => 'flat',81 ' flat_raw' => 'flat',82 ' domeflat_raw' => 'flat',83 ' skyflat_raw' => 'flat',84 ' flat' => 'flat',85 ' domeflat' => 'flat',86 ' skyflat' => 'flat',87 ' fringe' => 'fringe',88 ' mask' => 'mask',89 ' darkmask' => 'mask',90 ' flatmask' => 'mask',91 ' ctemask' => 'mask',92 ' darktest' => 'dark',77 'BIAS' => 'BIAS', 78 'DARK' => 'DARK', 79 'DARK_PREMASK' => 'DARK', 80 'SHUTTER' => 'SHUTTER', 81 'FLAT_PREMASK' => 'FLAT', 82 'DOMEFLAT_PREMASK' => 'FLAT', 83 'SKYFLAT_PREMASK' => 'FLAT', 84 'FLAT_RAW' => 'FLAT', 85 'DOMEFLAT_RAW' => 'FLAT', 86 'SKYFLAT_RAW' => 'FLAT', 87 'FLAT' => 'FLAT', 88 'DOMEFLAT' => 'FLAT', 89 'SKYFLAT' => 'FLAT', 90 'FRINGE' => 'FRINGE', 91 'MASK' => 'MASK', 92 'DARKMASK' => 'MASK', 93 'FLATMASK' => 'MASK', 94 'CTEMASK' => 'MASK', 95 'DARKTEST' => 'DARK', 93 96 }; 94 97 95 98 # convert supplied detrend type to a controlled namespace 96 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless exists DETTYPE()->{ lc($det_type)};97 my $det_type_real = DETTYPE()->{ lc($det_type)};99 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless exists DETTYPE()->{$det_type}; 100 my $det_type_real = DETTYPE()->{$det_type}; 98 101 99 102 &my_die("Couldn't find input file: $input_uri\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri); … … 107 110 $ipprc->outroot_prepare($outroot); 108 111 109 my $outFile = ($det_type_real eq " mask") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...)110 111 my $RECIPE_PPSTATS = ($det_type_real eq " dark") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...)112 my $outFile = ($det_type_real eq "MASK") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...) 113 114 my $RECIPE_PPSTATS = ($det_type_real eq "DARK") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...) 112 115 113 116 my $output = $ipprc->filename($outFile, $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); … … 123 126 124 127 # we cannot use ppImage to load a normalized mask : just copy it and build the jpeg images 125 if ($det_type_real eq ' mask') {128 if ($det_type_real eq 'MASK') { 126 129 $RECIPE_PPIMAGE = 'PPIMAGE_BIN'; 127 130 my $input_real = $ipprc->file_resolve($input_uri, 0); … … 135 138 $command .= " -recipe PPSTATS $RECIPE_PPSTATS"; 136 139 $command .= " -F PPIMAGE.OUTPUT $outFile" unless $outFile eq 'PPIMAGE.OUTPUT'; 137 $command .= ' -isfringe' if $det_type_real eq ' fringe';138 $command .= ' -isdark' if $det_type_real eq ' dark';140 $command .= ' -isfringe' if $det_type_real eq 'FRINGE'; 141 $command .= ' -isdark' if $det_type_real eq 'DARK'; 139 142 $command .= " -tracedest $traceDest -log $logDest"; 140 143 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/detrend_norm_calc.pl
r24741 r24764 33 33 34 34 # Parse command-line arguments 35 my ($det_id, $iter, $det Type, $outroot, $dbname, $verbose, $no_update, $no_op, $redirect );35 my ($det_id, $iter, $det_type, $outroot, $dbname, $verbose, $no_update, $no_op, $redirect ); 36 36 GetOptions( 37 37 'det_id|d=s' => \$det_id, # Detrend id 38 38 'iteration|i=s' => \$iter, # Iteration 39 'det_type|t=s' => \$det Type, # Detrend type39 'det_type|t=s' => \$det_type, # Detrend type 40 40 'outroot|w=s' => \$outroot, # output file base name 41 41 'dbname|d=s' => \$dbname, # Database name … … 52 52 defined $det_id and 53 53 defined $iter and 54 defined $det Type and54 defined $det_type and 55 55 defined $outroot; 56 57 # force det_type to be upper-case in this script 58 my $det_type = uc($det_type); 56 59 57 60 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 64 67 # Define which detrend types we normalise 65 68 use constant NORMALIZE => { 66 ' bias' => 0,67 ' dark' => 0,68 ' dark_premask' => 0,69 ' darktest'=> 0,70 ' shutter' => 0,71 ' flat_premask'=> 1,72 ' domeflat_premask'=> 1,73 ' skyflat_premask'=> 1,74 ' flat_raw'=> 1,75 ' domeflat_raw'=> 1,76 ' skyflat_raw'=> 1,77 ' flat'=> 1,78 ' domeflat'=> 1,79 ' skyflat' => 1,80 ' fringe'=> 0,81 ' mask'=> 0,82 ' darkmask' => 0,83 ' flatmask'=> 0,84 ' ctemask'=> 0,69 'BIAS' => 0, 70 'DARK' => 0, 71 'DARK_PREMASK' => 0, 72 'SHUTTER' => 0, 73 'FLAT_PREMASK' => 1, 74 'DOMEFLAT_PREMASK' => 1, 75 'SKYFLAT_PREMASK' => 1, 76 'FLAT_RAW' => 1, 77 'DOMEFLAT_RAW' => 1, 78 'SKYFLAT_RAW' => 1, 79 'FLAT' => 1, 80 'DOMEFLAT' => 1, 81 'SKYFLAT' => 1, 82 'FRINGE' => 0, 83 'MASK' => 0, 84 'DARKMASK' => 0, 85 'FLATMASK' => 0, 86 'CTEMASK' => 0, 87 'DARKTEST' => 0, 85 88 }; 86 89 87 &my_die("Unrecognised detrend type: $det Type", $det_id, $iter, $PS_EXIT_PROG_ERROR) unless exists NORMALIZE()->{lc($detType)};90 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $PS_EXIT_PROG_ERROR) unless exists NORMALIZE()->{$det_type}; 88 91 89 92 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files … … 125 128 126 129 my $norms; # MDC with normalisations 127 if (NORMALIZE()->{ lc($detType)} and not $no_op) {130 if (NORMALIZE()->{$det_type} and not $no_op) { 128 131 129 132 my %matrix; # Matrix of statistics as a function of exposures and classes -
trunk/ippScripts/scripts/detrend_norm_exp.pl
r23688 r24764 58 58 defined $outroot; 59 59 60 $det_type = uc($det_type); 61 60 62 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 61 63 my $logfile = $outroot . ".log"; -
trunk/ippScripts/scripts/detrend_process_exp.pl
r23688 r24764 61 61 defined $outroot; 62 62 63 $det_type = uc($det_type); 64 63 65 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $exp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 64 66 if ($redirect) { -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r24721 r24764 63 63 defined $outroot; 64 64 65 # force det_type to be upper-case in this script 66 $det_type = uc($det_type); 67 65 68 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 66 69 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR); … … 69 72 # Recipes to use as a function of detrend type 70 73 $reduction = "DETREND" unless defined $reduction; 71 my $ppimage_recipe = $ipprc->reduction($reduction, uc($det_type). '_PROCESS'); # Recipe name for ppImage72 my $jpeg_recipe = $ipprc->reduction($reduction, uc($det_type). '_JPEG_IMAGE'); # Recipe name for JPEG74 my $ppimage_recipe = $ipprc->reduction($reduction, $det_type . '_PROCESS'); # Recipe name for ppImage 75 my $jpeg_recipe = $ipprc->reduction($reduction, $det_type . '_JPEG_IMAGE'); # Recipe name for JPEG 73 76 74 77 # The output file rule name depends on the detrend type -
trunk/ippScripts/scripts/detrend_reject_exp.pl
r23688 r24764 58 58 defined $outroot; 59 59 60 $det_type = uc($det_type); 61 60 62 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 61 63 $ipprc->outroot_prepare($outroot) or my_die( "Unable to prepare output root", $det_id, $iter, $PS_EXIT_SYS_ERROR ); -
trunk/ippScripts/scripts/detrend_resid_exp.pl
r23688 r24764 79 79 defined $outroot; 80 80 81 # force det_type to be upper-case in this script 82 $det_type = uc($det_type); 83 81 84 # load IPP config information for the specified camera 82 85 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $exp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 87 90 $reduction = 'DETREND' unless defined $reduction; 88 91 89 my $recipe = $ipprc->reduction($reduction, uc($det_type). '_JPEG_RESID'); # Recipe to use92 my $recipe = $ipprc->reduction($reduction, $det_type . '_JPEG_RESID'); # Recipe to use 90 93 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $PS_EXIT_PROG_ERROR) unless defined $recipe; 91 94 -
trunk/ippScripts/scripts/detrend_resid_imfile.pl
r24741 r24764 74 74 defined $detrend; 75 75 76 # force det_type to be upper-case in this script 77 $det_type = uc($det_type); 78 76 79 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 77 80 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or my_die( "Unable to find LOG.IMFILE", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR ); … … 83 86 my $recipe; # Name of recipe to use 84 87 if ($mode eq 'master') { 85 $recipe = uc($det_type). '_RESID';88 $recipe = $det_type . '_RESID'; 86 89 } elsif ($mode eq 'verify') { 87 $recipe = uc($det_type). '_VERIFY';90 $recipe = $det_type . '_VERIFY'; 88 91 } else { 89 92 &my_die("Unrecognised mode: $mode", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); … … 92 95 print "raw recipe: $recipe\n"; 93 96 my $ppimage_recipe = $ipprc->reduction($reduction, $recipe); 94 my $jpeg_recipe = $ipprc->reduction($reduction, uc($det_type). '_JPEG_RESID');97 my $jpeg_recipe = $ipprc->reduction($reduction, $det_type . '_JPEG_RESID'); 95 98 print "real recipe: $recipe\n"; 96 99 97 100 # Flags to specify the particular detrend to use 98 101 use constant DETRENDS => { 99 ' bias' => '-bias', # Specify the bias frame100 ' dark' => '-dark', # Specify the dark frame101 ' darktest'=> '-dark', # Specify the dark frame102 ' dark_premask'=> '-dark', # Specify the dark frame103 ' shutter' => '-shutter', # Specify the shutter frame104 ' flat_premask' => '-flat', # Specify the flat frame105 ' domeflat_premask' => '-flat', # Specify the flat frame106 ' skyflat_premask' => '-flat', # Specify the flat frame107 ' flat_raw' => '-flat', # Specify the flat frame108 ' domeflat_raw' => '-flat', # Specify the flat frame109 ' skyflat_raw' => '-flat', # Specify the flat frame110 ' flat' => '-flat', # Specify the flat frame111 ' domeflat' => '-flat', # Specify the flat frame112 ' skyflat' => '-flat', # Specify the flat frame113 ' fringe' => '-fringe', # Specify the fringe frame114 ' mask' => '-mask', # Specify the mask frame115 ' darkmask' => '-mask', # Specify the mask frame116 ' flatmask' => '-mask', # Specify the mask frame117 ' ctemask' => '-mask', # Specify the mask frame102 'BIAS' => '-bias', # Specify the bias frame 103 'DARK' => '-dark', # Specify the dark frame 104 'DARK_PREMASK' => '-dark', # Specify the dark frame 105 'DARKTEST' => '-dark', # Specify the dark frame 106 'SHUTTER' => '-shutter', # Specify the shutter frame 107 'FLAT_PREMASK' => '-flat', # Specify the flat frame 108 'DOMEFLAT_PREMASK' => '-flat', # Specify the flat frame 109 'SKYFLAT_PREMASK' => '-flat', # Specify the flat frame 110 'FLAT_RAW' => '-flat', # Specify the flat frame 111 'DOMEFLAT_RAW' => '-flat', # Specify the flat frame 112 'SKYFLAT_RAW' => '-flat', # Specify the flat frame 113 'FLAT' => '-flat', # Specify the flat frame 114 'DOMEFLAT' => '-flat', # Specify the flat frame 115 'SKYFLAT' => '-flat', # Specify the flat frame 116 'FRINGE' => '-fringe', # Specify the fringe frame 117 'MASK' => '-mask', # Specify the mask frame 118 'DARKMASK' => '-mask', # Specify the mask frame 119 'FLATMASK' => '-mask', # Specify the mask frame 120 'CTEMASK' => '-mask', # Specify the mask frame 118 121 }; 119 122 … … 174 177 175 178 # Detrend to use in processing 176 my $detFlag = DETRENDS->{ lc($det_type)};179 my $detFlag = DETRENDS->{$det_type}; 177 180 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR) unless defined $detFlag; 178 181 $command .= " $detFlag $detrend"; -
trunk/ippScripts/scripts/detrend_stack.pl
r24722 r24764 188 188 $command = "$ppMerge $listName $outroot"; # Command to run 189 189 $command .= " -recipe PPMERGE $recipe"; 190 $command .= ' -type ' . uc($det_type); # Type of stacking to perform190 $command .= ' -type $det_type'; # Type of stacking to perform 191 191 $command .= " -stats $outputStats"; # Statistics output filename 192 192 $command .= " -recipe PPSTATS $statrecipe";
Note:
See TracChangeset
for help on using the changeset viewer.
