IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13552


Ignore:
Timestamp:
May 30, 2007, 12:41:30 PM (19 years ago)
Author:
eugene
Message:

make jpeg recipe depend on the data type (bias, flat) and the mode (positive image, residual image)

Location:
trunk/ippScripts/scripts
Files:
4 edited

Legend:

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

    r13275 r13552  
    5656$ipprc->define_camera($camera);
    5757
    58 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
    59 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs
    60 
     58# Recipes to use, as a function of the detrend type
     59use constant RECIPES => {
     60    'bin1' => {         # We're creating a master --- already processed the input
     61        'bias'     => 'PPIMAGE_J1_IMAGE_B',     # Bias only
     62        'dark'     => 'PPIMAGE_J1_IMAGE_B',     # Dark only
     63        'shutter'  => 'PPIMAGE_J1_IMAGE_B',     # Shutter only
     64        'flat'     => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     65        'domeflat' => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     66        'skyflat'  => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     67        'fringe'   => 'PPIMAGE_J1_IMAGE_F',     # Fringe only
     68    },
     69    'bin2' => {         # We're checking the master --- input is not already processed
     70        'bias'     => 'PPIMAGE_J2_IMAGE_B',     # Bias only
     71        'dark'     => 'PPIMAGE_J2_IMAGE_B',     # Dark only
     72        'shutter'  => 'PPIMAGE_J2_IMAGE_B',     # Shutter only
     73        'flat'     => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     74        'domeflat' => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     75        'skyflat'  => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     76        'fringe'   => 'PPIMAGE_J2_IMAGE_F',     # Fringe only
     77    },
     78};
    6179
    6280# Look for programs we need
     
    134152my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    135153
     154# Recipes to use in processing
     155my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)};
     156&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
     157
     158my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)};
     159&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
     160
    136161unless ($no_op) {
    137162    # Make the jpeg for binning 1
    138163    {
    139         my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     164        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
    140165        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    141166            run(command => $command, verbose => 1);
     
    145170    # Make the jpeg for binning 2
    146171    {
    147         my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     172        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
    148173        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    149174            run(command => $command, verbose => 1);
     
    153178
    154179unless ($no_update) {
    155     my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter " .
    156         "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot " .
    157         "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
     180    my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter";
     181    $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot ";
     182    $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev";
    158183    $command .= " -dbname $dbname" if defined $dbname;
    159184    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/ippScripts/scripts/detrend_process_exp.pl

    r13275 r13552  
    5656$ipprc->define_camera($camera);
    5757
    58 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
    59 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs
    60 
     58# Recipes to use, as a function of the detrend type
     59use constant RECIPES => {
     60    'bin1' => {         # We're creating a master --- already processed the input
     61        'bias'     => 'PPIMAGE_J1_IMAGE_B',     # Bias only
     62        'dark'     => 'PPIMAGE_J1_IMAGE_B',     # Dark only
     63        'shutter'  => 'PPIMAGE_J1_IMAGE_B',     # Shutter only
     64        'flat'     => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     65        'domeflat' => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     66        'skyflat'  => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     67        'fringe'   => 'PPIMAGE_J1_IMAGE_F',     # Fringe only
     68    },
     69    'bin2' => {         # We're checking the master --- input is not already processed
     70        'bias'     => 'PPIMAGE_J2_IMAGE_B',     # Bias only
     71        'dark'     => 'PPIMAGE_J2_IMAGE_B',     # Dark only
     72        'shutter'  => 'PPIMAGE_J2_IMAGE_B',     # Shutter only
     73        'flat'     => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     74        'domeflat' => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     75        'skyflat'  => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     76        'fringe'   => 'PPIMAGE_J2_IMAGE_F',     # Fringe only
     77    },
     78};
    6179
    6280# Look for programs we need
     
    135153my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    136154
     155# Recipes to use in processing
     156my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)};
     157&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
     158
     159my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)};
     160&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
     161
    137162unless ($no_op) {
    138163    # Make the jpeg for binning 1
    139164    {
    140         my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     165        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
    141166        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    142167            run(command => $command, verbose => 1);
     
    150175    # Make the jpeg for binning 2
    151176    {
    152         my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     177        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
    153178        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    154179            run(command => $command, verbose => 1);
     
    162187
    163188unless ($no_update) {
    164     my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag " .
    165         "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot " .
    166         "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
     189    my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag";
     190    $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot";
     191    $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev";
    167192    $command .= " -dbname $dbname" if defined $dbname;
    168193    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r13275 r13552  
    6060$ipprc->define_camera($camera);
    6161
    62 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
    63 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs
     62# Recipes to use, as a function of the detrend type
     63use constant RECIPES => {
     64    'bin1' => {         # We're creating a master --- already processed the input
     65        'bias'     => 'PPIMAGE_J1_RESID_B',     # Bias only
     66        'dark'     => 'PPIMAGE_J1_RESID_B',     # Dark only
     67        'shutter'  => 'PPIMAGE_J1_RESID_B',     # Shutter only
     68        'flat'     => 'PPIMAGE_J1_RESID_F',     # Flat-field only
     69        'domeflat' => 'PPIMAGE_J1_RESID_F',     # Flat-field only
     70        'skyflat'  => 'PPIMAGE_J1_RESID_F',     # Flat-field only
     71        'fringe'   => 'PPIMAGE_J1_RESID_F',     # Fringe only
     72    },
     73    'bin2' => {         # We're checking the master --- input is not already processed
     74        'bias'     => 'PPIMAGE_J2_RESID_B',     # Bias only
     75        'dark'     => 'PPIMAGE_J2_RESID_B',     # Dark only
     76        'shutter'  => 'PPIMAGE_J2_RESID_B',     # Shutter only
     77        'flat'     => 'PPIMAGE_J2_RESID_F',     # Flat-field only
     78        'domeflat' => 'PPIMAGE_J2_RESID_F',     # Flat-field only
     79        'skyflat'  => 'PPIMAGE_J2_RESID_F',     # Flat-field only
     80        'fringe'   => 'PPIMAGE_J2_RESID_F',     # Fringe only
     81    },
     82};
    6483
    6584# Look for programs we need
     
    87106    }
    88107
     108    # XXX report an error message if stdout_buf is empty
     109
    89110    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    90111        &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR);
     112
    91113    $files = parse_md_list($metadata) or
    92114        &my_die("Unable to parse metadata list", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR);
    93115}
    94116
    95 
     117# XXX in debug mode, unlink = 0
    96118my ($list1File, $list1Name) = tempfile( "$exp_tag.detresid.$det_id.$iter.b1.list.XXXX", UNLINK => 1 );
    97119my ($list2File, $list2Name) = tempfile( "$exp_tag.detresid.$det_id.$iter.b2.list.XXXX", UNLINK => 1 );
     
    118140my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    119141
     142# Recipes to use in processing
     143my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)};
     144&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
     145
     146my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)};
     147&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
     148
    120149unless ($no_op) {
    121150
    122151    # Make the jpeg for binning 1
    123152    {
    124         my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     153        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
    125154        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    126155            run(command => $command, verbose => 1);
     
    134163    # Make the jpeg for binning 2
    135164    {
    136         my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     165        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
    137166        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    138167            run(command => $command, verbose => 1);
     
    159188my $logFile;
    160189unless ($no_op) {
     190    # XXX this will fail if the file exists (because of Nebulous rules)
    161191    $logFile = $ipprc->file_create_open( $logName );
    162192}
     
    298328
    299329unless ($no_update) {
    300     my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
    301         "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot "; # Command to run
     330    my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag";
     331    $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot ";
    302332    $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev";
    303333    $command .= ' -reject' if $reject;
  • trunk/ippScripts/scripts/detrend_resid.pl

    r13275 r13552  
    6969use constant RECIPES => {
    7070    'master' => {               # We're creating a master --- already processed the input
    71         'bias' => 'PPIMAGE_B',  # Bias only
    72         'dark' => 'PPIMAGE_D',  # Dark only
    73         'shutter' => 'PPIMAGE_S',       # Shutter only
    74         'flat' => 'PPIMAGE_F',  # Flat-field only
     71        'bias'     => 'PPIMAGE_B',      # Bias only
     72        'dark'     => 'PPIMAGE_D',      # Dark only
     73        'shutter'  => 'PPIMAGE_S',      # Shutter only
     74        'flat'     => 'PPIMAGE_F',      # Flat-field only
    7575        'domeflat' => 'PPIMAGE_F',      # Flat-field only
    76         'skyflat' => 'PPIMAGE_F',       # Flat-field only
    77         'fringe' => 'PPIMAGE_R',        # Fringe only
     76        'skyflat'  => 'PPIMAGE_F',      # Flat-field only
     77        'fringe'   => 'PPIMAGE_R',      # Fringe only
    7878    },
    7979    'verify' => {               # We're checking the master --- input is not already processed
    80         'bias' => 'PPIMAGE_OB', # Bias only
    81         'dark' => 'PPIMAGE_OBD',        # Dark only
    82         'shutter' => 'PPIMAGE_OBDS',    # Shutter only
    83         'flat' => 'PPIMAGE_OBDSF',      # Flat-field only
     80        'bias'     => 'PPIMAGE_OB',     # Bias only
     81        'dark'     => 'PPIMAGE_OBD',    # Dark only
     82        'shutter'  => 'PPIMAGE_OBDS',   # Shutter only
     83        'flat'     => 'PPIMAGE_OBDSF',  # Flat-field only
    8484        'domeflat' => 'PPIMAGE_OBDSF',  # Flat-field only
    85         'skyflat' => 'PPIMAGE_OBDSF',   # Flat-field only
    86         'fringe' => 'PPIMAGE_OBDSFR',   # Fringe only
     85        'skyflat'  => 'PPIMAGE_OBDSF',  # Flat-field only
     86        'fringe'   => 'PPIMAGE_OBDSFR', # Fringe only
    8787    },
    8888};
     
    9494    'shutter' => '-shutter',    # Specify the shutter frame
    9595    'flat' => '-flat',          # Specify the flat frame
    96     'domeflat' => '-flat',              # Specify the flat frame
    97     'skyflat' => '-flat',               # Specify the flat frame
     96    'domeflat' => '-flat',      # Specify the flat frame
     97    'skyflat' => '-flat',       # Specify the flat frame
    9898    'fringe' => '-fringe',      # Specify the fringe frame
    9999};
    100 
    101100
    102101use constant DELETE_STATS => 0; # Delete the statistics file when done?
Note: See TracChangeset for help on using the changeset viewer.