IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2058


Ignore:
Timestamp:
Oct 12, 2004, 10:53:02 AM (22 years ago)
Author:
gusciora
Message:

Added new members to psExposure.

Location:
trunk/psLib/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r1615 r2058  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-25 01:38:30 $
     12*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-12 20:53:02 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232/******************************************************************************/
    3333
     34#define PS_COT(X) (1.0 / atan(X))
     35
     36/******************************************************************************/
     37/*  TYPE DEFINITIONS                                                          */
     38/******************************************************************************/
     39
    3440// None
    3541
    36 /******************************************************************************/
    37 /*  TYPE DEFINITIONS                                                          */
    38 /******************************************************************************/
     42/*****************************************************************************/
     43/*  GLOBAL VARIABLES                                                         */
     44/*****************************************************************************/
    3945
    4046// None
    4147
    4248/*****************************************************************************/
    43 /*  GLOBAL VARIABLES                                                         */
     49/*  FILE STATIC VARIABLES                                                    */
    4450/*****************************************************************************/
    4551
     
    4753
    4854/*****************************************************************************/
    49 /*  FILE STATIC VARIABLES                                                    */
    50 /*****************************************************************************/
    51 
    52 // None
    53 
    54 /*****************************************************************************/
    5555/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
    5656/*****************************************************************************/
    5757
    58 static float p_psCot(float x);
    5958static float p_psArg(float x, float y);
    6059
    6160/******************************************************************************
    62 XXX: Do this with a macro.
    63  *****************************************************************************/
    64 float p_psCot(float x)
    65 {
    66     return (1.0 / atan(x));
    67 }
    68 
    69 /******************************************************************************
    7061XXX: Verify this arc tan function.
    71  *****************************************************************************/
     62XXX: macro
     63 *****************************************************************************/
     64
    7265float p_psArg(float x,
    7366              float y)
     
    240233
    241234    if (projection->type == PS_PROJ_TAN) {
    242         R = p_psCot(coord->r) * (180.0 / M_PI);
     235        R = PS_COT(coord->r) * (180.0 / M_PI);
    243236        tmp->x = R * sin(coord->d);
    244237        tmp->y = R * cos(coord->d);
  • trunk/psLib/src/astronomy/psAstrometry.c

    r2052 r2058  
    88 *  @author George Gusciora, MHPCC
    99 *
    10  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-10-12 19:10:00 $
     10 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-10-12 20:53:02 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424#include "psMemory.h"
    2525#include "psAbort.h"
     26#include "psError.h"
     27#include "psConstants.h"
    2628#include "slalib.h"
    2729
     
    199201{
    200202    if (fp != NULL) {
    201         for (int i = 0; i < fp->nX; i++) {
     203        for (int i = 0; i < fp->p_ps_xRows; i++) {
    202204            psFree(fp->x[i]);
    203205        }
    204206
    205         for (int j = 0; j < fp->nY; j++) {
     207        for (int j = 0; j < fp->p_ps_yRows; j++) {
    206208            psFree(fp->y[j]);
    207209        }
     
    221223 * XXX: Verify that you interpreted the SDR correctly.
    222224 *
     225 * XXX: This assumes that x,y must be of type F64
    223226 */
    224227psFixedPattern* psFixedPatternAlloc(double x0,
     
    233236    int j;
    234237
     238    PS_CHECK_NULL_IMAGE_RETURN_NULL(x);
     239    PS_CHECK_NULL_IMAGE_RETURN_NULL(y);
     240    PS_CHECK_IMAGE_TYPE_RETURN_NULL(x, PS_TYPE_F64);
     241    PS_CHECK_IMAGE_TYPE_RETURN_NULL(y, PS_TYPE_F64);
     242
    235243    tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
    236     tmp->nX = x->numCols;
    237     tmp->nY = y->numRows;
     244    // XXX: Is this correct?
     245    tmp->nX = (x->numCols * x->numRows);
     246    tmp->nY = (y->numCols * y->numRows);
    238247    tmp->x0 = x0;
    239248    tmp->y0 = y0;
    240249    tmp->xScale = xScale;
    241250    tmp->yScale = yScale;
    242     tmp->x = (double **) psAlloc(x->numRows * sizeof(float *));
     251    tmp->p_ps_xRows = x->numRows;
     252    tmp->p_ps_xCols = x->numCols;
     253    tmp->p_ps_yRows = y->numRows;
     254    tmp->p_ps_yCols = y->numCols;
     255    tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
    243256    for (i=0;i<x->numRows;i++) {
    244         (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(float));
     257        (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
    245258    }
    246259    for (i=0;i<x->numRows;i++) {
    247         for (j=0;j<x->numRows;j++) {
     260        for (j=0;j<x->numCols;j++) {
    248261            (tmp->x)[i][j] = x->data.F64[i][j];
    249262        }
    250263    }
    251264
    252     tmp->y = (double **) psAlloc(y->numRows * sizeof(float *));
     265    tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
    253266    for (i=0;i<y->numRows;i++) {
    254         (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(float));
     267        (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
    255268    }
    256269    for (i=0;i<y->numRows;i++) {
    257         for (j=0;j<y->numRows;j++) {
     270        for (j=0;j<y->numCols;j++) {
    258271            (tmp->y)[i][j] = y->data.F64[i][j];
    259272        }
  • trunk/psLib/src/astronomy/psAstrometry.h

    r2048 r2058  
    88*  @author George Gusciora, MHPCC
    99*
    10 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-10-12 01:34:09 $
     10*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-10-12 20:53:02 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7878    double xScale;                     ///< Scale of the grid in x direction
    7979    double yScale;                     ///< Scale of the grid in x direction
     80    /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures.
     81    int p_ps_xRows;                    ///< Number of rows in the x member
     82    int p_ps_xCols;                    ///< Number of cols in the x member
     83    int p_ps_yRows;                    ///< Number of rows in the y member
     84    int p_ps_yCols;                    ///< Number of cols in the y member
    8085    double **x;                        ///< The grid of offsets in x
    8186    double **y;                        ///< The grid of offsets in y
  • trunk/psLib/src/astronomy/psCoord.c

    r1615 r2058  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-25 01:38:30 $
     12*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-12 20:53:02 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232/******************************************************************************/
    3333
     34#define PS_COT(X) (1.0 / atan(X))
     35
     36/******************************************************************************/
     37/*  TYPE DEFINITIONS                                                          */
     38/******************************************************************************/
     39
    3440// None
    3541
    36 /******************************************************************************/
    37 /*  TYPE DEFINITIONS                                                          */
    38 /******************************************************************************/
     42/*****************************************************************************/
     43/*  GLOBAL VARIABLES                                                         */
     44/*****************************************************************************/
    3945
    4046// None
    4147
    4248/*****************************************************************************/
    43 /*  GLOBAL VARIABLES                                                         */
     49/*  FILE STATIC VARIABLES                                                    */
    4450/*****************************************************************************/
    4551
     
    4753
    4854/*****************************************************************************/
    49 /*  FILE STATIC VARIABLES                                                    */
    50 /*****************************************************************************/
    51 
    52 // None
    53 
    54 /*****************************************************************************/
    5555/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
    5656/*****************************************************************************/
    5757
    58 static float p_psCot(float x);
    5958static float p_psArg(float x, float y);
    6059
    6160/******************************************************************************
    62 XXX: Do this with a macro.
    63  *****************************************************************************/
    64 float p_psCot(float x)
    65 {
    66     return (1.0 / atan(x));
    67 }
    68 
    69 /******************************************************************************
    7061XXX: Verify this arc tan function.
    71  *****************************************************************************/
     62XXX: macro
     63 *****************************************************************************/
     64
    7265float p_psArg(float x,
    7366              float y)
     
    240233
    241234    if (projection->type == PS_PROJ_TAN) {
    242         R = p_psCot(coord->r) * (180.0 / M_PI);
     235        R = PS_COT(coord->r) * (180.0 / M_PI);
    243236        tmp->x = R * sin(coord->d);
    244237        tmp->y = R * cos(coord->d);
  • trunk/psLib/src/dataManip/psConstants.h

    r1964 r2058  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-05 23:14:15 $
     8 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-12 20:53:02 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    150150}
    151151
     152#define PS_CHECK_IMAGE_TYPE_RETURN_NULL(NAME, TYPE) \
     153if (NAME->type.type != TYPE) { \
     154    psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \
     155    return(NULL); \
     156}
     157
     158
    152159#define PS_CHECK_NULL_1DPOLY_RETURN_NULL(NAME)                                                          \
    153160if (NAME == NULL || NAME->coeff == NULL) {                                                         \
  • trunk/psLib/src/dataManip/psStats.c

    r1964 r2058  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-10-05 23:14:15 $
     11 *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-10-12 20:53:02 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    520520    XXX: use a static variable for gaussianCoefs[] and compute them once.
    521521 *****************************************************************************/
    522 psVector* p_psVectorsmoothHistGaussian(psHistogram* robustHistogram, float sigma)
     522psVector* p_psVectorsmoothHistGaussian(psHistogram* robustHistogram,
     523                                       float sigma)
    523524{
    524525    int i = 0;                  // Loop index variable
     
    543544            gaussianCoefs[i] = exp(expo / denom);
    544545
     546            //printf("p_psVectorsmoothHistGaussian(): gaussianCoefs[%d] is %f\n", i, gaussianCoefs[i]);
    545547            // NOTE: Gaussian smoothing just isn't working with low sigma
    546548            // values.  The problem is that the Gaussian coefficients are
     
    12001202    // Smooth the histogram.
    12011203    // XXX: is that the right stdev?
    1202     robustHistogramVector = p_psVectorsmoothHistGaussian(robustHistogram, tmpStats->clippedStdev / 4.0f);
     1204    robustHistogramVector = p_psVectorsmoothHistGaussian(robustHistogram,
     1205                            tmpStats->clippedStdev / 4.0f);
    12031206
    12041207    // The following was necessary to fit a gaussian to the data, since
  • trunk/psLib/src/math/psConstants.h

    r1964 r2058  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-05 23:14:15 $
     8 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-12 20:53:02 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    150150}
    151151
     152#define PS_CHECK_IMAGE_TYPE_RETURN_NULL(NAME, TYPE) \
     153if (NAME->type.type != TYPE) { \
     154    psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \
     155    return(NULL); \
     156}
     157
     158
    152159#define PS_CHECK_NULL_1DPOLY_RETURN_NULL(NAME)                                                          \
    153160if (NAME == NULL || NAME->coeff == NULL) {                                                         \
  • trunk/psLib/src/math/psStats.c

    r1964 r2058  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-10-05 23:14:15 $
     11 *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-10-12 20:53:02 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    520520    XXX: use a static variable for gaussianCoefs[] and compute them once.
    521521 *****************************************************************************/
    522 psVector* p_psVectorsmoothHistGaussian(psHistogram* robustHistogram, float sigma)
     522psVector* p_psVectorsmoothHistGaussian(psHistogram* robustHistogram,
     523                                       float sigma)
    523524{
    524525    int i = 0;                  // Loop index variable
     
    543544            gaussianCoefs[i] = exp(expo / denom);
    544545
     546            //printf("p_psVectorsmoothHistGaussian(): gaussianCoefs[%d] is %f\n", i, gaussianCoefs[i]);
    545547            // NOTE: Gaussian smoothing just isn't working with low sigma
    546548            // values.  The problem is that the Gaussian coefficients are
     
    12001202    // Smooth the histogram.
    12011203    // XXX: is that the right stdev?
    1202     robustHistogramVector = p_psVectorsmoothHistGaussian(robustHistogram, tmpStats->clippedStdev / 4.0f);
     1204    robustHistogramVector = p_psVectorsmoothHistGaussian(robustHistogram,
     1205                            tmpStats->clippedStdev / 4.0f);
    12031206
    12041207    // The following was necessary to fit a gaussian to the data, since
Note: See TracChangeset for help on using the changeset viewer.