IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 2, 2005, 3:30:32 PM (21 years ago)
Author:
Paul Price
Message:

Working with release 8. Overscan, bias, flat-fielding all working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/scripts/src/phase2/pmFlatField.c

    r5107 r5462  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2005-09-23 02:58:30 $
     20 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2005-11-03 01:30:32 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    2424 */
    2525
    26 #include <stdio.h>
     26#if HAVE_CONFIG_H
     27#include <config.h>
     28#endif
     29
     30#include<stdio.h>
     31#include<math.h>
    2732#include <string.h>
     33
    2834#include "pslib.h"
    29 
    30 #include "pmFPA.h"
    3135#include "pmFlatField.h"
    3236#include "pmMaskBadPixels.h"
     
    3438
    3539
    36 bool pmFlatField(pmReadout *in, const pmReadout *flat)
     40bool pmFlatField(pmReadout *in, pmReadout *mask, const pmReadout *flat)
    3741{
     42    // XXX: Not sure if this is correct.  Must consult with IfA.
     43    PS_ASSERT_PTR_NON_NULL(mask, false);
    3844    int i = 0;
    3945    int j = 0;
     
    6773                 PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE);
    6874        return false;
    69     } else if(in->mask == NULL) {
    70         in->mask = psImageAlloc(inImage->numCols, inImage->numRows, PS_TYPE_MASK);
    71         memset(in->mask->data.V[0], 0, inImage->numCols*inImage->numRows*PSELEMTYPE_SIZEOF(PS_TYPE_MASK));
    7275    }
    73     inMask = in->mask;
     76    inMask = mask->image;
    7477
    7578    // Check input image and its mask are not larger than flat image
    76     if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) {
     79
     80    if (inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) {
    7781        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    7882                 PS_ERRORTEXT_pmFlatField_SIZE_INPUT_IMAGE,
    7983                 inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols);
    8084        return false;
    81     } else if(inMask->numRows>flatImage->numRows || inMask->numCols > flatImage->numCols) {
     85    }
     86    if (inMask->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols) {
    8287        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    8388                 PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE,
Note: See TracChangeset for help on using the changeset viewer.