IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

Added new members to psExposure.

Location:
trunk/psLib/src/astronomy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.