IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2009, 6:52:51 PM (17 years ago)
Author:
Paul Price
Message:

Making ppSub inverse mode work. Seems to work now --- produces the correct output files for inverse mode on and off, photometry on and off.

Location:
branches/pap/ppSub/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ppSub/src

    • Property svn:ignore
      •  

        old new  
        1010stamp-h1
        1111ppSubKernel
         12ppSubErrorCodes.h
         13ppSubErrorCodes.c
  • branches/pap/ppSub/src/ppSubReadoutJpeg.c

    r23711 r23719  
    99#include "ppSub.h"
    1010
    11 bool ppSubReadoutJpeg(pmConfig *config, ppSubData *data, const pmFPAview *view)
     11bool ppSubReadoutJpeg(pmConfig *config)
    1212{
    1313    psAssert(config, "Require configuration");
    14     psAssert(view, "Require view");
    1514
    16     bool mdok = false;                  // Status of MD lookup
     15    pmFPAview *view = ppSubViewReadout(); // View to readout
     16    pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Readout to jpeg
    1717
    1818    // Look up recipe values
    19     psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSUB_RECIPE); // Recipe for ppSim
     19    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim
    2020    psAssert(recipe, "We checked this earlier, so it should be here.");
    2121
    2222    // Generate binned JPEGs
    23     {
    24         psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels
     23    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels
    2524
    26         int bin1 = psMetadataLookupS32(NULL, recipe, "BIN1"); // First binning level
    27         int bin2 = psMetadataLookupS32(NULL, recipe, "BIN2"); // Second binning level
     25    int bin1 = psMetadataLookupS32(NULL, recipe, "BIN1"); // First binning level
     26    int bin2 = psMetadataLookupS32(NULL, recipe, "BIN2"); // Second binning level
    2827
    29         // Target cells
    30         pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG1"); // Rebinned cell once
    31         pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG2"); // Rebinned cell twice
     28    // Target cells
     29    pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG1"); // Rebinned cell once
     30    pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT.JPEG2"); // Rebinned cell twice
     31    psFree(view);
    3232
    33         pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts
    34         if (!pmReadoutRebin(ro1, outRO, maskBad, bin1, bin1)) {
    35             psError(PS_ERR_UNKNOWN, false, "Unable to bin output (1st binning)");
    36             psFree(ro1);
    37             psFree(ro2);
    38             return false;
    39         }
    40         if (!pmReadoutRebin(ro2, ro1, 0, bin2, bin2)) {
    41             psError(PS_ERR_UNKNOWN, false, "Unable to bin output (2nd binning)");
    42             psFree(ro1);
    43             psFree(ro2);
    44             return false;
    45         }
     33    pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts
     34    if (!pmReadoutRebin(ro1, outRO, maskBad, bin1, bin1)) {
     35        psError(PS_ERR_UNKNOWN, false, "Unable to bin output (1st binning)");
    4636        psFree(ro1);
    4737        psFree(ro2);
     38        return false;
    4839    }
     40    if (!pmReadoutRebin(ro2, ro1, 0, bin2, bin2)) {
     41        psError(PS_ERR_UNKNOWN, false, "Unable to bin output (2nd binning)");
     42        psFree(ro1);
     43        psFree(ro2);
     44        return false;
     45    }
     46    psFree(ro1);
     47    psFree(ro2);
    4948
    5049    return true;
Note: See TracChangeset for help on using the changeset viewer.