Changeset 13937 for trunk/ippScripts/scripts
- Timestamp:
- Jun 21, 2007, 2:10:11 PM (19 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 6 edited
-
chip_imfile.pl (modified) (6 diffs)
-
detrend_process_imfile.pl (modified) (4 diffs)
-
detrend_resid.pl (modified) (5 diffs)
-
detrend_stack.pl (modified) (4 diffs)
-
ipp_serial_chip.pl (modified) (1 diff)
-
ipp_serial_detrend.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/chip_imfile.pl
r13926 r13937 29 29 use Pod::Usage qw( pod2usage ); 30 30 31 my $RECIPE = 'PPIMAGE_OBDSFRA'; # Recipe to use32 33 31 # Parse the command-line arguments 34 32 my ($exp_id, # Exposure identifier … … 36 34 $class_id, # Class identifier 37 35 $input, # Input FITS file 38 $recipe, # Recipe to use39 36 $camera, # Camera 40 37 $dbname, # Database name 41 38 $workdir, # Working directory, for output files 39 $reduction, # Reduction class 42 40 $no_update, # Don't update the database? 43 41 $no_op, # Don't do any operations? … … 48 46 'class_id=s' => \$class_id, 49 47 'uri|u=s' => \$input, 50 'recipe=s' => \$recipe,51 48 'camera|c=s' => \$camera, 52 49 'dbname|d=s' => \$dbname, # Database name 53 50 'workdir|w=s' => \$workdir, 51 'reduction=s' => \$reduction, 54 52 'no-update' => \$no_update, 55 53 'no-op' => \$no_op, … … 67 65 68 66 $ipprc->define_camera($camera); 67 $reduction = 'DEFAULT' unless defined $reduction; 68 my $recipe = $ipprc->reduction($reduction, 'CHIP'); # Recipe to use 69 69 70 70 # Look for programs we need … … 97 97 98 98 my $command = "$ppImage -file $input $outputRoot"; 99 $command .= " -recipe PPIMAGE $ RECIPE";99 $command .= " -recipe PPIMAGE $recipe"; 100 100 $command .= " -recipe PPSTATS CHIPSTATS"; 101 101 $command .= " -stats $outputStats"; # Command to run ppImage … … 130 130 my $bg_stdev = ($stats->bg_stdev() or 'NAN'); 131 131 my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN'); 132 my $fringe_0 = (${$stats->fringe() [0]}or 'NAN');133 my $fringe_1 = (${$stats->fringe_err() [0]}or 'NAN');132 my $fringe_0 = (${$stats->fringe()}[0] or 'NAN'); 133 my $fringe_1 = (${$stats->fringe_err()}[0] or 'NAN'); 134 134 my $fringe_2 = 'NAN'; 135 135 -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r13748 r13937 32 32 use Pod::Usage qw( pod2usage ); 33 33 34 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $ no_update, $no_op);34 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $reduction, $no_update, $no_op); 35 35 GetOptions( 36 36 'det_id|d=s' => \$det_id, … … 42 42 'dbname|d=s' => \$dbname, # Database name 43 43 'workdir|w=s' => \$workdir, # Working directory, for output files 44 'reduction=s' => \$reduction, # Reduction class 44 45 'no-update' => \$no_update, 45 46 'no-op' => \$no_op, … … 60 61 $ipprc->define_camera($camera); 61 62 62 # Recipes to use, as a function of the detrend type 63 use constant RECIPES => { 64 'bias' => 'PPIMAGE_O', # Overscan only 65 'dark' => 'PPIMAGE_OB', # Overscan and bias only 66 'shutter' => 'PPIMAGE_OBD', # Overscan, bias and dark only 67 'flat' => 'PPIMAGE_OBDS', # Overscan, bias, dark and shutter only 68 'domeflat' => 'PPIMAGE_OBDS', # Overscan, bias, dark and shutter only 69 'skyflat' => 'PPIMAGE_OBDS', # Overscan, bias, dark and shutter only 70 'fringe' => 'PPIMAGE_OBDSF',# Overscan, bias, dark, shutter and flat only 71 }; 63 $reduction = "DETREND" unless defined $reduction; 64 my $recipe = $ipprc->reduction($reduction, $det_type . '_PROCESS'); # Recipe name to use 72 65 73 66 # Look for programs we need … … 80 73 } 81 74 $ppImage .= " -dbname $dbname" if defined $dbname; 82 83 # Recipe to use in processing84 my $recipe = RECIPES->{lc($det_type)};85 unless (defined $recipe) {86 warn("Unrecognised detrend type: $det_type");87 exit($PS_EXIT_CONFIG_ERROR);88 }89 75 90 76 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; -
trunk/ippScripts/scripts/detrend_resid.pl
r13926 r13937 34 34 35 35 my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend, 36 $input_uri, $camera, $mode, $dbname, $workdir, $ no_update, $no_op);36 $input_uri, $camera, $mode, $dbname, $workdir, $reduction, $no_update, $no_op); 37 37 GetOptions( 38 38 'det_id|d=s' => \$det_id, … … 47 47 'dbname|d=s' => \$dbname, # Database name 48 48 'workdir|w=s' => \$workdir, # Working directory, for output files 49 'reduction=s' => \$reduction, # Reduction class 49 50 'no-update' => \$no_update, 50 51 'no-op' => \$no_op, … … 67 68 $ipprc->define_camera($camera); 68 69 69 # Recipes to use, as a function of the detrend type 70 use constant RECIPES => { 71 'master' => { # We're creating a master --- already processed the input 72 'bias' => 'PPIMAGE_B', # Bias only 73 'dark' => 'PPIMAGE_D', # Dark only 74 'shutter' => 'PPIMAGE_S', # Shutter only 75 'flat' => 'PPIMAGE_F', # Flat-field only 76 'domeflat' => 'PPIMAGE_F', # Flat-field only 77 'skyflat' => 'PPIMAGE_F', # Flat-field only 78 'fringe' => 'PPIMAGE_R', # Fringe only 79 }, 80 'verify' => { # We're checking the master --- input is not already processed 81 'bias' => 'PPIMAGE_OB', # Bias only 82 'dark' => 'PPIMAGE_OBD', # Dark only 83 'shutter' => 'PPIMAGE_OBDS', # Shutter only 84 'flat' => 'PPIMAGE_OBDSF', # Flat-field only 85 'domeflat' => 'PPIMAGE_OBDSF', # Flat-field only 86 'skyflat' => 'PPIMAGE_OBDSF', # Flat-field only 87 'fringe' => 'PPIMAGE_OBDSFR', # Fringe only 88 }, 89 }; 70 $reduction = 'DETREND' unless defined $reduction; 71 my $recipe; # Name of recipe to use 72 if ($mode eq 'master') { 73 $recipe = $det_type . '_RESID'; 74 } elsif ($mode eq 'verify') { 75 $recipe = $det_type . '_VERIFY'; 76 } else { 77 &my_die("Unrecognised mode: $mode", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR); 78 } 79 $recipe = $ipprc->reduction($reduction, $recipe); 90 80 91 81 # Flags to specify the particular detrend to use … … 113 103 $ppImage .= " -dbname $dbname" if defined $dbname; 114 104 115 # Recipe to use in processing116 &my_die("Unrecognised mode: $mode", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR) unless defined RECIPES->{$mode};117 my $recipe = RECIPES->{$mode}->{lc($det_type)};118 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR) unless defined $recipe;119 120 105 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 121 106 … … 183 168 my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN'); 184 169 my $bin_stdev = ($binnedStats->bg_stdev() or 'NAN'); 185 my $fringe_0 = (${$stats->fringe() [0]}or 'NAN');186 my $fringe_1 = (${$stats->fringe_err() [0]}or 'NAN');170 my $fringe_0 = (${$stats->fringe()}[0] or 'NAN'); 171 my $fringe_1 = (${$stats->fringe_err()}[0] or 'NAN'); 187 172 my $fringe_2 = 'NAN'; 188 173 -
trunk/ippScripts/scripts/detrend_stack.pl
r13748 r13937 33 33 use Pod::Usage qw( pod2usage ); 34 34 35 my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $workdir, $ no_update, $no_op, $quiet);35 my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $workdir, $reduction, $no_update, $no_op, $quiet); 36 36 GetOptions( 37 37 'det_id|d=s' => \$det_id, … … 42 42 'dbname|d=s' => \$dbname, # Database name 43 43 'workdir|w=s' => \$workdir, # Working directory, for output files 44 'reduction=s' => \$reduction, # Reduction class for processing 44 45 'no-update' => \$no_update, 45 46 'no-op' => \$no_op, … … 58 59 if (defined $quiet) { $verbose = 0; } 59 60 61 $ipprc->define_camera($camera); 62 60 63 # Recipes to use as a function of detrend type 61 use constant RECIPES => { 62 'bias' => 'PPMERGE_BIAS', 63 'dark' => 'PPMERGE_DARK', 64 'shutter' => 'PPMERGE_SHUTTER', 65 'flat' => 'PPMERGE_FLAT', 66 'domeflat' => 'PPMERGE_FLAT', 67 'skyflat' => 'PPMERGE_FLAT', 68 'fringe' => 'PPMERGE_FRINGE', 69 }; 64 $reduction = "DETREND" unless defined $reduction; 65 my $recipe = $ipprc->reduction($reduction, $det_type . '_STACK'); # Recipe name to use 70 66 71 67 # Look for programs we need … … 77 73 exit($PS_EXIT_CONFIG_ERROR); 78 74 } 79 80 my $recipe = RECIPES()->{lc($det_type)}; # Recipe to use in stacking81 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless defined $recipe;82 75 83 76 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files -
trunk/ippScripts/scripts/ipp_serial_chip.pl
r12800 r13937 54 54 my $class_id = $item->{class_id}; 55 55 my $uri = $item->{uri}; 56 my $reduction = $item->{reduction}; 56 57 57 58 my $command = "$chip --chip_id $chip_id --exp_id $exp_id --class_id $class_id --uri $uri --dbname $dbname --camera $camera"; 59 $command .= " --reduction $reduction" if defined $reduction; 58 60 $command .= " --no-op" if defined $no_op; 59 61 $command .= " --no-update" if defined $no_update; -
trunk/ippScripts/scripts/ipp_serial_detrend.pl
r12800 r13937 65 65 my $camera = $item->{camera}; 66 66 my $workdir = $item->{workdir}; 67 67 my $reduction = $item->{reduction}; 68 68 69 my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname"; 70 $command .= " --reduction $reduction" if defined $reduction; 69 71 $command .= " --workdir $workdir" if defined $workdir; 70 72 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 119 121 my $camera = $item->{camera}; 120 122 my $workdir = $item->{workdir}; 123 my $reduction = $item->{reduction}; 121 124 122 125 my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera --dbname $dbname"; 126 $command .= " --reduction $reduction" if defined $reduction; 123 127 $command .= " --workdir $workdir" if defined $workdir; 124 128 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 235 239 my $mode = $item->{mode}; 236 240 my $workdir = $item->{workdir}; 241 my $reduction = $item->{reduction}; 237 242 238 243 my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname"; 244 $command .= " --reduction $reduction" if defined $reduction; 239 245 $command .= " --detrend $detrend" if defined $detrend; 240 246 $command .= " --workdir $workdir" if defined $workdir;
Note:
See TracChangeset
for help on using the changeset viewer.
