IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 4, 2009, 12:32:32 PM (17 years ago)
Author:
bills
Message:

When destreaking chip stage images, use replace the mask from the chip
stage with the mask from the camera stage, destreaking them both.
Added program to prepare images for release by insuring that all masked
pixels are set to NAN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksio.c

    r20845 r21085  
    55static nebServer *ourNebServer = NULL;
    66
     7// open the files required for streaks procesing.
     8// if remove is true the calling program is streaksremove and the recovery files are outputs
     9// if false the recovery files are inputs
    710streakFiles *openFiles(pmConfig *config, bool remove)
    811{
     
    3033
    3134    if (remove) {
     35        // XXX: the recovery file should be required if stage is raw and the replace flag is set
     36        // that is if the input raw image is to be destroyed
    3237        sf->recImage = sFileOpen(config, stage, "RECOVERY", inputBasename, false);
    3338    } else {
     
    4550        }
    4651    }
     52    // If we're in streaksremove and operating on a chip stage image
     53    // if we are passed a mask it is camera stage mask and we also
     54    // need to destreak the chip level mask file as well
     55    if (remove && sf->inMask && (stage == IPP_STAGE_CHIP)) {
     56        sf->inChMask = sFileOpen(config, stage, "INPUT.CHMASK", NULL, true);
     57        inputBasename = basename(sf->inChMask->name);
     58        sf->outChMask = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
     59        sf->recChMask = sFileOpen(config, stage, "RECOVERY", inputBasename, false);
     60    }
     61
    4762    sf->inWeight = sFileOpen(config, stage, "INPUT.WEIGHT", NULL, false);
    4863    if (sf->inWeight) {
     
    421436    // XXX: This function assumes that it is only used for a single
    422437    // chip single cell FPA (i.e. a skycell)
     438    assert(sf->inImage->pmfile->fpa->chips->n == 1);
     439
    423440    pmFPAview *view = sf->view;
    424     assert(view->chip == 0);
     441    if (view) {
     442        // The view was allocated and the chip set by setupAstrometry()
     443        assert(view->chip == 0);
     444    } else {
     445        sf->view = pmFPAviewAlloc(0);
     446        view = sf->view;
     447        sf->chip = pmFPAviewNextChip(view, sf->inImage->pmfile->fpa, 1);
     448        assert(sf->chip != NULL);
     449    }
    425450    view->cell = 0;
    426451    sf->cell =  pmFPAviewThisCell(view, sf->inImage->pmfile->fpa);
     
    747772        closeImage(sf->recMask);
    748773    }
     774    if (sf->inChMask) {
     775        closeImage(sf->inChMask);
     776        closeImage(sf->outChMask);
     777        closeImage(sf->recChMask);
     778    }
    749779    if (sf->inWeight) {
    750780        closeImage(sf->inWeight);
Note: See TracChangeset for help on using the changeset viewer.