IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35685 for trunk


Ignore:
Timestamp:
Jun 19, 2013, 10:21:44 AM (13 years ago)
Author:
bills
Message:

Add ppImage recipe value APPLY.BURNTOOL defaults to TRUE.
If USE.DEBURNED.IMAGE is set burntool will be applied in ppImage
if APPLY.BURNTOOL is true. If APPLY.BURNTOOL is false burntool will
be applied using the burntool program by chip_imfile.pl. If USE.DEBURNED.IMAGE
is false (default for other cameras) burntool will not be applied at all.
Also added recipe CHIP_PRESERVE_BG_AUXMASK which will be used for M31
processing. CHIP_PRESERVE_BG changed to set MASK.AUXMASK false
Added M31_BG_PRESERVE reduction

Location:
trunk
Files:
3 added
10 edited

Legend:

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

    r35668 r35685  
    228228    ## XXX make the feature more general?
    229229    my $useDeburnedImage = metadataLookupBool($recipeData, 'USE.DEBURNED.IMAGE');
     230    my $ppImageApplyBurntool = metadataLookupBool($recipeData, 'APPLY.BURNTOOL');
     231    my $burntoolArgument;
    230232
    231233    if ($useDeburnedImage) {
     
    328330        }
    329331
    330         ## We now know that we have an image that has been burntooled.
    331         my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.deburned.XXXX",
     332        # if recipe option to have ppImage apply burntool is set and the burntool information is store in
     333        # an external table, check the existence of that table file and set $burntoolArgument.
     334        # If burntool state does not match fall through to the code that uses the burntool program
     335        if ($ppImageApplyBurntool && ($burntoolState == -1 * $burntoolStateGood)) {
     336            my $burntoolTable_uri = $uri;
     337            $burntoolTable_uri =~ s/fits$/burn.tbl/;
     338            my $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri );
     339            if ((!$burntoolTable_uriReal)||(!($ipprc->file_exists($burntoolTable_uri)))) {
     340                my $repair_cmd = "$nebrepair $burntoolTable_uri";
     341                my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
     342                unless ($repair_success) {
     343                    &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     344                }
     345                $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri );
     346            }
     347            unless ($ipprc->file_exists($burntoolTable_uri)) {
     348                # Catch errors here
     349                &my_die("Couldn't find burntool table: $burntoolTable_uri",$exp_id,$chip_id,$class_id, $PS_EXIT_SYS_ERROR);
     350            }
     351            $burntoolArgument = " -burntool $burntoolTable_uri";
     352        } else {
     353
     354            ## We now know that we have an image that has been burntooled.
     355            my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.deburned.XXXX",
    332356                                              UNLINK => !$save_temps, SUFFIX => '.fits' );
    333357
    334         # get the UNIX version of the (possible) neb: or path: filename
    335         my $uriReal = $ipprc->file_resolve( $uri );
    336         # Catch errors here
    337         if (!$uriReal) {
    338             my $repair_cmd = "$nebrepair $uri";
    339             my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
    340             unless ($repair_success) {
    341                 &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    342             }
    343             $uriReal = $ipprc->file_resolve( $uri );
    344         }
    345            
    346         &my_die("Unable to resolve $uri on $host", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) if !$uriReal;
    347 
    348         # funpack into the temp file.
    349         my $funpack_cmd = "$funpack -S $uriReal > $tempName";
    350         ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $funpack_cmd, verbose => $verbose);
    351         unless ($success) {
    352             # Catch errors here
    353             my $repair_cmd = "$nebrepair $uri";
    354             my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
    355             unless ($repair_success) {
    356                 &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    357             }
    358             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $funpack_cmd, verbose => $verbose);
    359         }
    360         unless ($success) {
    361             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    362             &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    363         }
    364 
    365         ## Construct commands to apply the pre-calculated burntool trailfits to the pixel data.
    366         my ($burntoolTable_uri, $burntoolTable_uriReal);
    367         my $burntool_cmd = "$burntool ";
    368 
    369         if ($burntoolState == -1 * $burntoolStateGood) {   # Burntool information stored in an external table.
    370             $burntoolTable_uri = $uri;
    371             $burntoolTable_uri =~ s/fits$/burn.tbl/;
    372             $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri );
    373             if ((!$burntoolTable_uriReal)||(!($ipprc->file_exists($burntoolTable_uri)))) {
    374                 my $repair_cmd = "$nebrepair $burntoolTable_uri";
    375                 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
    376                 unless ($repair_success) {
    377                     &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    378                 }
    379                 $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri );
    380             }
    381             unless ($ipprc->file_exists($burntoolTable_uri)) {
    382                 # Catch errors here
    383                 &my_die("Couldn't find burntool table: $burntoolTable_uri",$exp_id,$chip_id,$class_id, $PS_EXIT_SYS_ERROR);
    384             }
    385 
    386             $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} persist=t apply=t";
    387         }
    388         elsif ($burntoolState == $burntoolStateGood) { # Burntool information stored in a header table.
    389             $burntool_cmd .= "$tempName persist=t apply=t";
    390         }
    391         else {
    392             &my_die("Image data not properly burntooled, impossible state", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    393         }
    394 
    395         ## Run burntool to change the pixels of tempfile, and repoint $uri to that file.
    396         ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) =
    397             run(command => $burntool_cmd, verbose => $verbose);
    398         unless ($success) {
    399             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    400             &my_die("Unable to perform burntool: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    401         }
    402 
    403         $uri = $tempName;
    404         unless ($ipprc->file_exists($uri)) {
    405             &my_die("Couldn't find deburned input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    406         }
    407 
    408 #       print STDERR "$uri $uriReal $tempName $burntoolTable_uri $burntoolTable_uriReal $burntool_cmd $save_temps\n";
    409 #       exit(100);
     358            # get the UNIX version of the (possible) neb: or path: filename
     359            my $uriReal = $ipprc->file_resolve( $uri );
     360                # Catch errors here
     361            if (!$uriReal) {
     362                my $repair_cmd = "$nebrepair $uri";
     363                my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
     364                unless ($repair_success) {
     365                    &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     366                }
     367                $uriReal = $ipprc->file_resolve( $uri );
     368            }
     369               
     370            &my_die("Unable to resolve $uri on $host", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) if !$uriReal;
     371
     372            # funpack into the temp file.
     373            my $funpack_cmd = "$funpack -S $uriReal > $tempName";
     374            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $funpack_cmd, verbose => $verbose);
     375            unless ($success) {
     376                # Catch errors here
     377                my $repair_cmd = "$nebrepair $uri";
     378                my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
     379                unless ($repair_success) {
     380                    &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     381                }
     382                ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $funpack_cmd, verbose => $verbose);
     383            }
     384            unless ($success) {
     385                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     386                &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     387            }
     388
     389            ## Construct commands to apply the pre-calculated burntool trailfits to the pixel data.
     390            my ($burntoolTable_uri, $burntoolTable_uriReal);
     391            my $burntool_cmd = "$burntool ";
     392
     393            if ($burntoolState == -1 * $burntoolStateGood) {   # Burntool information stored in an external table.
     394                $burntoolTable_uri = $uri;
     395                $burntoolTable_uri =~ s/fits$/burn.tbl/;
     396                $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri );
     397                if ((!$burntoolTable_uriReal)||(!($ipprc->file_exists($burntoolTable_uri)))) {
     398                    my $repair_cmd = "$nebrepair $burntoolTable_uri";
     399                    my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
     400                    unless ($repair_success) {
     401                        &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     402                    }
     403                    $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri );
     404                }
     405                unless ($ipprc->file_exists($burntoolTable_uri)) {
     406                    # Catch errors here
     407                    &my_die("Couldn't find burntool table: $burntoolTable_uri",$exp_id,$chip_id,$class_id, $PS_EXIT_SYS_ERROR);
     408                }
     409
     410                $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} persist=t apply=t";
     411            }
     412            elsif ($burntoolState == $burntoolStateGood) { # Burntool information stored in a header table.
     413                $burntool_cmd .= "$tempName persist=t apply=t";
     414            }
     415            else {
     416                &my_die("Image data not properly burntooled, impossible state", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     417            }
     418
     419            ## Run burntool to change the pixels of tempfile, and repoint $uri to that file.
     420            ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) =
     421                run(command => $burntool_cmd, verbose => $verbose);
     422            unless ($success) {
     423                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     424                &my_die("Unable to perform burntool: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     425            }
     426
     427            $uri = $tempName;
     428            unless ($ipprc->file_exists($uri)) {
     429                &my_die("Couldn't find deburned input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     430            }
     431
     432    #       print STDERR "$uri $uriReal $tempName $burntoolTable_uri $burntoolTable_uriReal $burntool_cmd $save_temps\n";
     433    #       exit(100);
     434        }
    410435    }
    411436
     
    483508        $command .= " -R PPIMAGE.CHIP FITS.TYPE NONE";
    484509    }
     510    $command .= $burntoolArgument if $burntoolArgument;
    485511    $command .= " -threads $threads" if defined $threads;
    486512    $command .= " -image_id $chip_imfile_id" if defined $chip_imfile_id;
  • trunk/ippconfig/gpc1/ppImage.config

    r35531 r35685  
    2121USE.DEBURNED.IMAGE      BOOL    TRUE           # use burntool-repaired image?
    2222USE.BEST.BURNTOOL       BOOL    TRUE           # require the best burntooled data
    23 MASK.BURNTOOL           BOOL    FALSE           # Mask potential burntool trails
     23MASK.BURNTOOL           BOOL    FALSE          # Mask potential burntool trails
    2424TILTYSTREAK.APPLY       BOOL    FALSE          # apply the 'tiltystreak' tool
    2525NOISEMAP                BOOL    FALSE          # Apply read noise map
     26
     27APPLY.BURNTOOL          BOOL    TRUE           # apply burntool correction in ppImage
    2628
    2729# Final detrending options
     
    3032USE.VIDEO.MASK  BOOL    TRUE            # Use a video mask if we have video data?
    3133
    32 # aditional auxillary mask applied to corners of all chips in video cells.
     34# aditional auxiliary mask applied to corners of all chips in video cells.
    3335# Is only applied if MASK.AUXMASK and USE.VIDEO.MASK are both true
    3436AUX.VIDEO.MASK  STR     neb://any/gpc1/auxmask/mpg.20130506/mask_video_cell_corners.fits
     
    153155FRINGE.FILTERS  STR y.00000
    154156
    155 # Standard chip processing (NOTE: when changing this be sure to check whether changes should be applied toCHIP_BGPRESEVE and/or CHIP_AUXMASK
     157# Standard chip processing (NOTE: when changing this be sure to check whether changes should be applied to
     158# CHIP_PRESERVE_BG CHIP_AUXMASK or CHIP_PRESERVE_BG_AUXMASK
    156159CHIP METADATA
    157160  BASE.FITS          BOOL    FALSE           # Save base detrended image?
     
    172175  MASK.BUILD         BOOL    TRUE            # Build internal mask?
    173176  MASK.BURNTOOL      BOOL    TRUE            # Mask potential burntool trails
    174   MASK.AUXMASK       BOOL    FALSE           # augment with more restrictive auxillary mask
     177  MASK.AUXMASK       BOOL    FALSE           # augment mask with more restrictive auxiliary mask
    175178  PATTERN.ROW        BOOL    TRUE            # Row pattern correction
    176179  PATTERN.CELL       BOOL    FALSE           # Cell pattern correction
     
    12241227END
    12251228
    1226 # Standard chip processing + auxillary mask
     1229# Standard chip processing + auxiliary mask
    12271230CHIP_AUXMASK METADATA
    12281231  BASE.FITS          BOOL    FALSE           # Save base detrended image?
     
    12431246  MASK.BUILD         BOOL    TRUE            # Build internal mask?
    12441247  MASK.BURNTOOL      BOOL    TRUE            # Mask potential burntool trails
    1245   MASK.AUXMASK       BOOL    TRUE            # augment with more restrictive auxillary mask
     1248  MASK.AUXMASK       BOOL    TRUE            # augment mask with more restrictive auxiliary mask
    12461249  PATTERN.ROW        BOOL    TRUE            # Row pattern correction
    12471250  PATTERN.CELL       BOOL    FALSE           # Cell pattern correction
     
    12551258  BACKGROUND         BOOL    TRUE            # Subtract background?
    12561259  CROSSTALK.MEASURE  BOOL    TRUE            # Subtract model background?
    1257 END
    1258 
    1259 # Standard chip processing without any background removal
     1260  NO.COMPRESS        BOOL    TRUE            # turn off image compression
     1261END
     1262
     1263# Standard chip processing without background subtraction or pattern correction
    12601264CHIP_PRESERVE_BG        METADATA
    12611265  BASE.FITS          BOOL    FALSE           # Save base detrended image?
     
    12691273  BIAS               BOOL    FALSE           # Bias subtraction
    12701274  DARK               BOOL    TRUE            # Dark subtraction
    1271   NOISEMAP           BOOL    FALSE
     1275  NOISEMAP           BOOL    TRUE
    12721276  REMNANCE           BOOL    FALSE           # Remnance masking
    12731277  SHUTTER            BOOL    FALSE           # Shutter correction
     
    12761280  MASK.BUILD         BOOL    TRUE            # Build internal mask?
    12771281  MASK.BURNTOOL      BOOL    TRUE            # Mask potential burntool trails
    1278   MASK.AUXMASK       BOOL    TRUE            # augment with more restrictive auxillary mask
     1282  MASK.AUXMASK       BOOL    FALSE           # augment mask with more restrictive auxiliary mask
    12791283  PATTERN.ROW        BOOL    FALSE           # Row pattern correction
    12801284  PATTERN.CELL       BOOL    FALSE           # Cell pattern correction
     1285  PATTERN.CONTINUITY BOOL    FALSE           # Cell pattern coorection using edge continuity
    12811286  FRINGE             BOOL    TRUE            # Fringe subtraction
    12821287  BIN1.FITS          BOOL    TRUE            # Save 1st binned chip image?
     
    12871292  BACKGROUND         BOOL    FALSE           # Subtract background?
    12881293  CROSSTALK.MEASURE  BOOL    TRUE            # Subtract model background?
     1294END
     1295
     1296# Standard chip processing without background subtraction, pattern correction, or photometry bug applying auxiliary mask
     1297CHIP_PRESERVE_BG_AUXMASK        METADATA
     1298  BASE.FITS          BOOL    FALSE           # Save base detrended image?
     1299  BASE.MASK.FITS     BOOL    FALSE           # Save base detrended image?
     1300  BASE.VARIANCE.FITS BOOL    FALSE           # Save base detrended image?
     1301  CHIP.FITS          BOOL    TRUE            # Save chip-mosaic-ed image?
     1302  CHIP.MASK.FITS     BOOL    TRUE            # Save chip-mosaic-ed image?
     1303  CHIP.VARIANCE.FITS BOOL    TRUE            # Save chip-mosaic-ed image?
     1304  OVERSCAN           BOOL    TRUE            # Overscan subtraction
     1305  NONLIN             BOOL    TRUE            # apply non-linearity correction
     1306  BIAS               BOOL    FALSE           # Bias subtraction
     1307  DARK               BOOL    TRUE            # Dark subtraction
     1308  NOISEMAP           BOOL    TRUE
     1309  REMNANCE           BOOL    FALSE           # Remnance masking
     1310  SHUTTER            BOOL    FALSE           # Shutter correction
     1311  FLAT               BOOL    TRUE            # Flat-field normalisation
     1312  MASK               BOOL    TRUE            # Mask bad pixels
     1313  MASK.BUILD         BOOL    TRUE            # Build internal mask?
     1314  MASK.BURNTOOL      BOOL    TRUE            # Mask potential burntool trails
     1315  MASK.AUXMASK       BOOL    TRUE            # augment mask with more restrictive auxiliary mask
     1316  PATTERN.ROW        BOOL    FALSE           # Row pattern correction
     1317  PATTERN.CELL       BOOL    FALSE           # Cell pattern correction
     1318  PATTERN.CONTINUITY BOOL    TRUE            # Cell pattern coorection using edge continuity
     1319  FRINGE             BOOL    TRUE            # Fringe subtraction
     1320  BIN1.FITS          BOOL    TRUE            # Save 1st binned chip image?
     1321  BIN2.FITS          BOOL    TRUE            # Save 2nd binned chip image?
     1322  PHOTOM             BOOL    FALSE           # Source identification and photometry
     1323  ASTROM.CHIP        BOOL    FALSE           # Astrometry per chip?
     1324  ASTROM.MOSAIC      BOOL    FALSE           # Astrometry for mosaic?
     1325  BACKGROUND         BOOL    FALSE           # Subtract background?
     1326  CROSSTALK.MEASURE  BOOL    TRUE            # Subtract model background?
     1327  NO.COMPRESS        BOOL    TRUE            # turn off image compression
    12891328END
    12901329
  • trunk/ippconfig/recipes/ppImage.config

    r35531 r35685  
    1818MASK.BURNTOOL      BOOL    FALSE           # Mask potential burntool trails
    1919MASK.AUXMASK       BOOL    FALSE           # augment mask with auxillary mask
    20 AUX.VIDEO.MASK     STR     NULL
     20AUX.VIDEO.MASK     STR     NULL            # name of aditional masking for video cells
     21APPLY.BURNTOOL     BOOL    FALSE           # apply burntool coorection
    2122VARIANCE.BUILD     BOOL    FALSE           # Build internal variance image
    2223ADDNOISE           BOOL    FALSE           # Add noise to degrade an MD image to a 3pi image?
     
    4748TILTYSTREAK.BY.CLASS METADATA              # apply the 'tiltystreak' tool
    4849END
     50NO.COMPRESS        BOOL     FALSE
    4951
    5052# output data formats to save
     
    21392141  MASK               BOOL    TRUE            # Mask bad pixels
    21402142  MASK.BUILD         BOOL    TRUE            # Build internal mask?
     2143  PATTERN.ROW        BOOL    FALSE           # Subtract pattern noise
     2144  PATTERN.CELL       BOOL    FALSE           # Subtract pattern noise
     2145  FRINGE             BOOL    TRUE            # Fringe subtraction
     2146  BIN1.FITS          BOOL    TRUE            # Save 1st binned chip image?
     2147  BIN2.FITS          BOOL    TRUE            # Save 2nd binned chip image?
     2148  PHOTOM             BOOL    TRUE            # Source identification and photometry
     2149  ASTROM.CHIP        BOOL    FALSE           # Astrometry per chip?
     2150  ASTROM.MOSAIC      BOOL    FALSE           # Astrometry for mosaic?
     2151  BACKGROUND         BOOL    FALSE           # Subtract background?
     2152  MASK.STATS         BOOL    TRUE            # Calculate Mask statistics
     2153END
     2154
     2155# Standard chip processing with auxiliary mask but without any background removal or pattern correction
     2156CHIP_PRESERVE_BG_AUXMASK        METADATA
     2157  BASE.FITS          BOOL    FALSE           # Save base detrended image?
     2158  BASE.MASK.FITS     BOOL    FALSE           # Save base detrended image?
     2159  BASE.VARIANCE.FITS BOOL    FALSE           # Save base detrended image?
     2160  CHIP.FITS          BOOL    TRUE            # Save chip-mosaic-ed image?
     2161  CHIP.MASK.FITS     BOOL    TRUE            # Save chip-mosaic-ed image?
     2162  CHIP.VARIANCE.FITS BOOL    TRUE            # Save chip-mosaic-ed image?
     2163  OVERSCAN           BOOL    TRUE            # Overscan subtraction
     2164  NONLIN             BOOL    FALSE           # Overscan subtraction
     2165  BIAS               BOOL    TRUE            # Bias subtraction
     2166  DARK               BOOL    TRUE            # Dark subtraction
     2167  SHUTTER            BOOL    FALSE           # Shutter correction
     2168  FLAT               BOOL    TRUE            # Flat-field normalisation
     2169  MASK               BOOL    TRUE            # Mask bad pixels
     2170  MASK.BUILD         BOOL    TRUE            # Build internal mask?
     2171  MASK.AUXMASK       BOOL    TRUE            # augment mask with more restrictive auxiliary mask
    21412172  PATTERN.ROW        BOOL    FALSE           # Subtract pattern noise
    21422173  PATTERN.CELL       BOOL    FALSE           # Subtract pattern noise
  • trunk/ippconfig/recipes/reductionClasses.mdc

    r35581 r35685  
    10471047END
    10481048
    1049 M31_DATASET             METADATA
     1049M31_BG_SUBTRACT         METADATA
    10501050        CHIP_PPIMAGE      STR     CHIP_AUXMASK
    10511051        CHIP_PSPHOT       STR     CHIP
    1052         WARP_PSWARP       STR     WARP
     1052        WARP_PSWARP       STR     WARP_NOCOMPRESS
     1053        STACK_PPSTACK     STR     STACK
     1054        STACK_PPSUB       STR     STACK
     1055        STACK_PSPHOT      STR     STACK
     1056        DIFF_PPSUB        STR     DIFF
     1057        DIFF_PSPHOT       STR     DIFF
     1058        JPEG_BIN1         STR     PPIMAGE_J1
     1059        JPEG_BIN2         STR     PPIMAGE_J2
     1060        FAKEPHOT          STR     FAKEPHOT
     1061        ADDSTAR           STR     ADDSTAR
     1062        PSASTRO           STR     DEFAULT_RECIPE
     1063        STACKPHOT_PSPHOT  STR     STACKPHOT
     1064        STACKPHOT_PPSUB   STR     STACKPHOT
     1065        STACKPHOT_PPSTACK STR     STACKPHOT
     1066        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     1067        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     1068        BACKGROUND_PSWARP       STR     BACKGROUND
     1069        PSVIDEOPHOT             STR     PSVIDEOPHOT
     1070        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
     1071END
     1072
     1073M31_BG_PRESERVE         METADATA
     1074        CHIP_PPIMAGE      STR     CHIP_PRESERVE_BG_AUXMASK
     1075        CHIP_PSPHOT       STR     CHIP
     1076        WARP_PSWARP       STR     WARP_NOCOMPRESS
    10531077        STACK_PPSTACK     STR     STACK
    10541078        STACK_PPSUB       STR     STACK
  • trunk/ppImage/src/Makefile.am

    r35531 r35685  
    6666        ppImageAddNoise.c \
    6767        ppImageRandomGaussian.c \
    68         ppImageAuxiliaryMask.c
     68        ppImageAuxiliaryMask.c \
     69        ppImageBurntoolApply.c
    6970
    7071CLEANFILES = *~
  • trunk/ppImage/src/ppImage.h

    r35533 r35685  
    2626    bool doMaskBuild;                   // Build internal mask
    2727    bool doVarianceBuild;               // Build internal variance map
     28    bool doApplyBurntool;               // apply burntool correction
    2829    bool doMaskBurntool;                // mask potential burntool trails
    2930    bool doMaskSat;                     // mask saturated pixels
     
    182183bool ppImageCheckNoise(pmConfig *config, ppImageOptions *options, pmFPAview *view);
    183184
    184 bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask);
     185bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *readout);
     186bool ppImageBurntoolMaskFromTable(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *readout);
     187
     188bool ppImageBurntoolApply(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *readout);
    185189
    186190bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options);
  • trunk/ppImage/src/ppImageArguments.c

    r31155 r35685  
    117117    pmConfigFileSetsMD (config->arguments, &argc, argv, "LINEARITY", "-linearity", "-linearlist");
    118118
     119    if ((argnum = psArgumentGet(argc, argv, "-burntool"))) {
     120        psArgumentRemove(argnum, &argc, argv);
     121        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "BURNTOOL.TABLE", PS_META_REPLACE, "", argv[argnum]);
     122        psArgumentRemove(argnum, &argc, argv);
     123    }
     124
    119125    // chip selection is used to limit chips to be processed
    120126    if ((argnum = psArgumentGet (argc, argv, "-chip"))) {
  • trunk/ppImage/src/ppImageDetrendReadout.c

    r35531 r35685  
    5656    }
    5757    done_video_check:
    58    
     58
    5959    // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine.
    6060    if (options->doMaskBuild) {
     
    7474      pmMaskBadPixels(input, mask, options->maskValue);
    7575    }
     76
     77    if (options->doApplyBurntool)
     78    {
     79        // extern bool ppImageBurntoolApply(pmConfig *, ppImageOptions *, pmFPAview *, pmReadout *);
     80        ppImageBurntoolApply(config, options, view, input);
     81    }
     82   
    7683    if (options->doMaskBurntool) {
    77       ppImageBurntoolMask(config,options,view,input);
     84        if (options->doApplyBurntool) {
     85            // build burntool mask from data input burntool table
     86            ppImageBurntoolMaskFromTable(config,options,view,input);
     87        } else {
     88            // build burntool mask from data in the input image's fits extension
     89            ppImageBurntoolMask(config,options,view,input);
     90        }
    7891    }
    7992
  • trunk/ppImage/src/ppImageOptions.c

    r35531 r35685  
    2323    options->doMaskLow       = false;   // mask low pixels
    2424    options->doMaskBurntool  = false;   // mask potential burntool trails
     25    options->doApplyBurntool = false;   // apply burntool correction
    2526    options->doVarianceBuild = false;   // Build internal variance
    2627    options->doMask          = false;   // Mask bad pixels
     
    231232    options->doMaskLow       = psMetadataLookupBool(NULL, recipe, "MASK.LOW");
    232233    options->doMaskBurntool  = psMetadataLookupBool(NULL, recipe, "MASK.BURNTOOL");
     234    options->doApplyBurntool = psMetadataLookupBool(NULL, recipe, "APPLY.BURNTOOL");
    233235    options->doVarianceBuild = psMetadataLookupBool(NULL, recipe, "VARIANCE.BUILD");
    234236    options->doAuxMask       = psMetadataLookupBool(NULL, recipe, "MASK.AUXMASK");
  • trunk/ppImage/src/ppImageParseCamera.c

    r35557 r35685  
    184184        }
    185185        outCTE->save = true;
     186    }
     187    if (options->doApplyBurntool) {
     188        // If no burntool file was supplied do not fail. (camera_exp.pl does not supply it
     189        // for example.
     190        if (!psMetadataLookupStr(NULL, config->arguments, "BURNTOOL.TABLE")) {
     191            psWarning("BURNTOOL.TABLE not supplied setting doApplyBurntool to false");
     192            options->doApplyBurntool = false;
     193        }
    186194    }
    187195
Note: See TracChangeset for help on using the changeset viewer.