IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2021, 2:07:05 PM (5 years ago)
Author:
eugene
Message:

added code to output a basic dump of the grid corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relphot.20210521/src/GridOps.c

    r41608 r41610  
    1616 */
    1717
    18 typedef struct {
    19   unsigned short photcode;
    20   float **Mgrid; // grid of average corrections
    21   float **dMgrid; // grid of stdev of corrections
    22     int **nMgrid; // grid of number of stars for corrections
    23   int Nx; // bin = int(Xchip * (Nx / NxChip))
    24   int Ny; // bin = int(Ychip * (Ny / NyChip))
    25   float dX; // bin = int(Xchip * dX), dX = Nx / NxChip
    26   float dY; // bin = int(Ychip * dY), dY = Ny / NyChip
    27   // NxChip, NyChip = 4900,4900 for now
    28 } GridCorrectionType;
    29 
    3018static GridCorrectionType **GridCorr = NULL;
    3119static int                 NGridCorr = 0;
     
    9583
    9684  return;
     85}
     86
     87GridCorrectionType *getGridCorr (int *Nlast) {
     88
     89  if (GridCorr == NULL) return NULL;
     90
     91  if (*Nlast >= NGridCorr) return NULL;
     92
     93  if (*Nlast < 0) *Nlast = -1;
     94
     95  GridCorrectionType *result = NULL;
     96  for (int i = *Nlast + 1; i < NGridCorr; i++) {
     97    if (GridCorr[i] == NULL) continue;
     98    result = GridCorr[i];
     99    *Nlast = i;
     100  }
     101  return result;
    97102}
    98103
Note: See TracChangeset for help on using the changeset viewer.