IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24764


Ignore:
Timestamp:
Jul 12, 2009, 11:06:44 AM (17 years ago)
Author:
eugene
Message:

make the use of det_type consistently upper-case in the scripts; change detType to det_type as needed

Location:
trunk/ippScripts/scripts
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_correct_imfile.pl

    r23688 r24764  
    5757    and defined $outroot
    5858    and defined $camera;
     59
     60# force det_type to be upper-case in this script
     61$det_type = uc($det_type);
    5962
    6063my $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  
    6262    defined $outroot;
    6363
     64# force det_type to be upper-case in this script
     65$det_type = uc($det_type);
     66
    6467my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    6568
     
    7275# Define which detrend types we normalise
    7376use 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',
    9396    };
    9497
    9598# 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};
     100my $det_type_real = DETTYPE()->{$det_type};
    98101
    99102&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);
     
    107110$ipprc->outroot_prepare($outroot);
    108111
    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...)
     112my $outFile = ($det_type_real eq "MASK") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...)
     113
     114my $RECIPE_PPSTATS = ($det_type_real eq "DARK") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...)
    112115
    113116my $output    = $ipprc->filename($outFile,        $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     
    123126
    124127    # 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') {
    126129        $RECIPE_PPIMAGE = 'PPIMAGE_BIN';
    127130        my $input_real = $ipprc->file_resolve($input_uri, 0);
     
    135138    $command .= " -recipe PPSTATS $RECIPE_PPSTATS";
    136139    $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';
    139142    $command .= " -tracedest $traceDest -log $logDest";
    140143    $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_norm_calc.pl

    r24741 r24764  
    3333
    3434# Parse command-line arguments
    35 my ($det_id, $iter, $detType, $outroot, $dbname, $verbose, $no_update, $no_op, $redirect );
     35my ($det_id, $iter, $det_type, $outroot, $dbname, $verbose, $no_update, $no_op, $redirect );
    3636GetOptions(
    3737    'det_id|d=s'        => \$det_id,    # Detrend id
    3838    'iteration|i=s'     => \$iter,      # Iteration
    39     'det_type|t=s'      => \$detType,   # Detrend type
     39    'det_type|t=s'      => \$det_type,   # Detrend type
    4040    'outroot|w=s'       => \$outroot,   # output file base name
    4141    'dbname|d=s'        => \$dbname,    # Database name
     
    5252    defined $det_id  and
    5353    defined $iter    and
    54     defined $detType and
     54    defined $det_type and
    5555    defined $outroot;
     56
     57# force det_type to be upper-case in this script
     58my $det_type = uc($det_type);
    5659
    5760my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    6467# Define which detrend types we normalise
    6568use 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,
    8588    };
    8689
    87 &my_die("Unrecognised detrend type: $detType", $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};
    8891
    8992my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
     
    125128
    126129my $norms;                      # MDC with normalisations
    127 if (NORMALIZE()->{lc($detType)} and not $no_op) {
     130if (NORMALIZE()->{$det_type} and not $no_op) {
    128131
    129132    my %matrix; # Matrix of statistics as a function of exposures and classes
  • trunk/ippScripts/scripts/detrend_norm_exp.pl

    r23688 r24764  
    5858    defined $outroot;
    5959
     60$det_type = uc($det_type);
     61
    6062my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    6163my $logfile = $outroot . ".log";
  • trunk/ippScripts/scripts/detrend_process_exp.pl

    r23688 r24764  
    6161    defined $outroot;
    6262
     63$det_type = uc($det_type);
     64
    6365my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $exp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    6466if ($redirect) {
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r24721 r24764  
    6363    defined $outroot;
    6464
     65# force det_type to be upper-case in this script
     66$det_type = uc($det_type);
     67
    6568my $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
    6669my $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);
     
    6972# Recipes to use as a function of detrend type
    7073$reduction = "DETREND" unless defined $reduction;
    71 my $ppimage_recipe = $ipprc->reduction($reduction, uc($det_type) . '_PROCESS'); # Recipe name for ppImage
    72 my $jpeg_recipe = $ipprc->reduction($reduction, uc($det_type) . '_JPEG_IMAGE'); # Recipe name for JPEG
     74my $ppimage_recipe = $ipprc->reduction($reduction, $det_type . '_PROCESS'); # Recipe name for ppImage
     75my $jpeg_recipe = $ipprc->reduction($reduction, $det_type . '_JPEG_IMAGE'); # Recipe name for JPEG
    7376
    7477# The output file rule name depends on the detrend type
  • trunk/ippScripts/scripts/detrend_reject_exp.pl

    r23688 r24764  
    5858    defined $outroot;
    5959
     60$det_type = uc($det_type);
     61
    6062my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    6163$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  
    7979    defined $outroot;
    8080
     81# force det_type to be upper-case in this script
     82$det_type = uc($det_type);
     83
    8184# load IPP config information for the specified camera
    8285my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $exp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    8790$reduction = 'DETREND' unless defined $reduction;
    8891
    89 my $recipe = $ipprc->reduction($reduction, uc($det_type) . '_JPEG_RESID'); # Recipe to use
     92my $recipe = $ipprc->reduction($reduction, $det_type . '_JPEG_RESID'); # Recipe to use
    9093&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $PS_EXIT_PROG_ERROR) unless defined $recipe;
    9194
  • trunk/ippScripts/scripts/detrend_resid_imfile.pl

    r24741 r24764  
    7474    defined $detrend;
    7575
     76# force det_type to be upper-case in this script
     77$det_type = uc($det_type);
     78
    7679my $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
    7780my $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 );
     
    8386my $recipe;                     # Name of recipe to use
    8487if ($mode eq 'master') {
    85     $recipe = uc($det_type) . '_RESID';
     88    $recipe = $det_type . '_RESID';
    8689} elsif ($mode eq 'verify') {
    87     $recipe = uc($det_type) . '_VERIFY';
     90    $recipe = $det_type . '_VERIFY';
    8891} else {
    8992    &my_die("Unrecognised mode: $mode", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     
    9295print "raw recipe: $recipe\n";
    9396my $ppimage_recipe = $ipprc->reduction($reduction, $recipe);
    94 my $jpeg_recipe = $ipprc->reduction($reduction, uc($det_type) . '_JPEG_RESID');
     97my $jpeg_recipe = $ipprc->reduction($reduction, $det_type . '_JPEG_RESID');
    9598print "real recipe: $recipe\n";
    9699
    97100# Flags to specify the particular detrend to use
    98101use constant DETRENDS => {
    99     'bias'             => '-bias',      # Specify the bias frame
    100     'dark'             => '-dark',      # Specify the dark frame
    101     'darktest'         => '-dark',      # Specify the dark frame
    102     'dark_premask'     => '-dark',      # Specify the dark frame
    103     'shutter'          => '-shutter',   # Specify the shutter frame
    104     'flat_premask'     => '-flat',      # Specify the flat frame
    105     'domeflat_premask' => '-flat',      # Specify the flat frame
    106     'skyflat_premask'  => '-flat',      # Specify the flat frame
    107     'flat_raw'         => '-flat',      # Specify the flat frame
    108     'domeflat_raw'     => '-flat',      # Specify the flat frame
    109     'skyflat_raw'      => '-flat',      # Specify the flat frame
    110     'flat'             => '-flat',      # Specify the flat frame
    111     'domeflat'         => '-flat',      # Specify the flat frame
    112     'skyflat'          => '-flat',      # Specify the flat frame
    113     'fringe'           => '-fringe',    # Specify the fringe frame
    114     'mask'             => '-mask',      # Specify the mask frame
    115     'darkmask'         => '-mask',      # Specify the mask frame
    116     'flatmask'         => '-mask',      # Specify the mask frame
    117     'ctemask'          => '-mask',      # Specify the mask frame
     102    '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
    118121};
    119122
     
    174177
    175178    # Detrend to use in processing
    176     my $detFlag = DETRENDS->{lc($det_type)};
     179    my $detFlag = DETRENDS->{$det_type};
    177180    &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR) unless defined $detFlag;
    178181    $command .= " $detFlag $detrend";
  • trunk/ippScripts/scripts/detrend_stack.pl

    r24722 r24764  
    188188$command = "$ppMerge $listName $outroot"; # Command to run
    189189$command .= " -recipe PPMERGE $recipe";
    190 $command .= ' -type ' . uc($det_type); # Type of stacking to perform
     190$command .= ' -type $det_type'; # Type of stacking to perform
    191191$command .= " -stats $outputStats";     # Statistics output filename
    192192$command .= " -recipe PPSTATS $statrecipe";
Note: See TracChangeset for help on using the changeset viewer.