IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2010, 11:22:25 AM (16 years ago)
Author:
eugene
Message:

large update merging in changes for Ohana to support large files

Location:
trunk/Ohana
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/relphot/include/relphot.h

    r21508 r27435  
    77# define GRID_V2
    88# define NO_IMAGE -100
    9 
    10 # if (0)
    11 typedef struct {
    12   double xmin, xmax, ymin, ymax;
    13   int style, ptype, ltype, etype, color;
    14   double lweight, size;
    15 } Graphdata;
    16 # endif
    179
    1810typedef struct {
     
    110102
    111103# ifdef GRID_V1
    112 int setGridMeasure (int meas, int cat, double X, double Y);
     104int setGridMeasure (off_t meas, int cat, double X, double Y);
    113105# endif
    114106
    115107# ifdef GRID_V2
    116 int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum);
     108int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum);
    117109# endif
    118110
     
    122114char         *GetPhotnamebyCode   PROTO((PhotCodeData *photcodes, int code));
    123115void          InterpolateGrid     PROTO((float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords));
    124 int          *SelectRefMosaic     PROTO((Mosaic **refmosaic, int *Nimage));
     116off_t        *SelectRefMosaic     PROTO((Mosaic **refmosaic, off_t *Nimage));
    125117int           args                PROTO((int argc, char **argv));
    126118int           bcatalog            PROTO((Catalog *subcatalog, Catalog *catalog));
     
    137129
    138130void set_db (FITS_DB *in);
    139 int Shutdown (char *format, ...);
     131int Shutdown (char *format, ...) OHANA_FORMAT(printf, 1, 2) ;
    140132void TrapSignal (int sig);
    141133void SetProtect (int mode);
     
    147139void          free_catalogs       PROTO((Catalog *catalog, int Ncatalog));
    148140int           gcatalog            PROTO((Catalog *catalog, int FINAL));
    149 Coords       *getCoords           PROTO((int meas, int cat));
    150 int           getImageEntry       PROTO((int meas, int cat));
    151 float         getMcal             PROTO((int meas, int cat));
    152 float         getMgrid            PROTO((int meas, int cat));
    153 float         getMmos             PROTO((int meas, int cat));
    154 float         getMrel             PROTO((Catalog *catalog, int meas, int cat));
    155 Image        *getimage            PROTO((int N));
    156 Image        *getimages           PROTO((int *N));
     141Coords       *getCoords           PROTO((off_t meas, int cat));
     142off_t         getImageEntry       PROTO((off_t meas, int cat));
     143float         getMcal             PROTO((off_t meas, int cat));
     144float         getMgrid            PROTO((off_t meas, int cat));
     145float         getMmos             PROTO((off_t meas, int cat));
     146float         getMrel             PROTO((Catalog *catalog, off_t meas, int cat));
     147Image        *getimage            PROTO((off_t N));
     148Image        *getimages           PROTO((off_t *N));
    157149void          global_stats        PROTO((Catalog *catalog, int Ncatalog));
    158150void          initGrid            PROTO((int dX, int dY));
    159151void          initGridBins        PROTO((Catalog *catalog, int Ncatalog));
    160152void          initImageBins       PROTO((Catalog *catalog, int Ncatalog));
    161 void          initImages          PROTO((Image *input, int N));
     153void          initImages          PROTO((Image *input, off_t N));
    162154void          initMosaicBins      PROTO((Catalog *catalog, int Ncatalog));
    163 void          initMosaicGrid      PROTO((Image *image, int Nimage));
    164 void          initMosaics         PROTO((Image *image, int Nimage));
     155void          initMosaicGrid      PROTO((Image *image, off_t Nimage));
     156void          initMosaics         PROTO((Image *image, off_t Nimage));
    165157void          initMrel            PROTO((Catalog *catalog, int Ncatalog));
    166158void          initialize          PROTO((int argc, char **argv));
     
    169161Catalog       *load_catalogs      PROTO((SkyList *skylist, int *Ncatalog));
    170162SkyList      *load_images         PROTO((FITS_DB *db, char *regionName, SkyRegion *region, int RegionSelect));
    171 Image         *select_images      PROTO((SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage));
     163Image         *select_images      PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage));
    172164
    173165int           main                PROTO((int argc, char **argv));
    174 void          mark_images         PROTO((Image *image, int Nimage, Image *timage, int Ntimage));
    175 void          matchImage          PROTO((Catalog *catalog, int meas, int cat));
    176 void          matchMosaics        PROTO((Catalog *catalog, int meas, int cat));
     166void          mark_images         PROTO((Image *image, off_t Nimage, Image *timage, off_t Ntimage));
     167void          matchImage          PROTO((Catalog *catalog, off_t meas, int cat));
     168void          matchMosaics        PROTO((Catalog *catalog, off_t meas, int cat));
    177169double        opening_angle       PROTO((double x1, double y1, double x2, double y2, double x3, double y3));
    178170void          plot_chisq          PROTO((Catalog *catalog, int Ncatalog));
     
    180172void          plot_grid           PROTO((Catalog *catalog));
    181173void          plot_images         PROTO((void));
    182 void          plot_list           PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...));
     174void          plot_list           PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) );
    183175void          plot_mosaic_fields  PROTO((Catalog *catalog));
    184176void          plot_mosaics        PROTO((void));
     
    199191int           setMave             PROTO((Catalog *catalog, int Ncatalog));
    200192void          set_ZP              PROTO((double ZERO));
    201 int           setrefcode          PROTO((Image *image, int Nimage));
     193int           setrefcode          PROTO((Image *image, off_t Nimage));
    202194void          skip_measurements   PROTO((Catalog *catalog, int pass));
    203195void          sortA               PROTO((double *X, int N));
  • trunk/Ohana/src/relphot/src/GridOps.c

    r21508 r27435  
    77};
    88
    9 static int     Ngrid;
     9static int     Ngrid;  // number of grid elements (gridX * gridY)
    1010static float   *gridM; // magnitude offset for this grid cell
    1111static float   *gridS; // stdev of the magnitude offset for this grid cell
    1212static int     *gridN; // number of stars used to measure the magnitude offset for this grid cell
    1313static int     *gridV; // data mode for this cell: fitted, frozen, reference
    14 static int      gridX;
    15 static int      gridY;
    16 
    17 static int    **bin;
    18 static int    **Xmeas;
    19 static int    **Ymeas;
     14static int      gridX; // number of grid elements in X direction
     15static int      gridY; // number of grid elements in Y direction
     16
     17static int    **bin;   // link from catalog, measure to grid element
     18static int    **Xmeas; // grid x-coordinate for a measurement
     19static int    **Ymeas; // grid y-coordinate for a measurement
    2020
    2121static int    **clist; // link from measurement on a cell to catalog containing measurement
    22 static int    **mlist; // link from measurement on a cell to measurement in a catalog
    23 static int     *Nlist; // list of measurements for each grid cell
    24 static int     *NLIST;
     22static off_t  **mlist; // link from measurement on a cell to measurement in a catalog
     23static off_t   *Nlist; // number of measurements for each grid cell
     24static off_t   *NLIST; // allocated number of measurements for each grid cell
    2525
    2626static struct {
     
    159159  ALLOCATE (Ymeas, int *, Ncatalog);
    160160  for (i = 0; i < Ncatalog; i++) {
    161     ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));
     161    ALLOCATE (bin[i],   int, MAX (catalog[i].Nmeasure, 1));
    162162    ALLOCATE (Xmeas[i], int, MAX (catalog[i].Nmeasure, 1));
    163163    ALLOCATE (Ymeas[i], int, MAX (catalog[i].Nmeasure, 1));
     
    166166
    167167  /* define grid -> cat,meas pointers */
    168   ALLOCATE (Nlist, int, Ngrid);
    169   ALLOCATE (NLIST, int, Ngrid);
    170   ALLOCATE (clist, int *, Ngrid);
    171   ALLOCATE (mlist, int *, Ngrid);
     168  ALLOCATE (Nlist, off_t,  Ngrid);
     169  ALLOCATE (NLIST, off_t,  Ngrid);
     170  ALLOCATE (clist, int *,   Ngrid);
     171  ALLOCATE (mlist, off_t *, Ngrid);
    172172
    173173  for (i = 0; i < Ngrid; i++) {
    174174    Nlist[i] = 0;
    175175    NLIST[i] = 100;
    176     ALLOCATE (clist[i], int, NLIST[i]);
    177     ALLOCATE (mlist[i], int, NLIST[i]);
     176    ALLOCATE (clist[i], int,   NLIST[i]);
     177    ALLOCATE (mlist[i], off_t, NLIST[i]);
    178178  }
    179179}
     
    206206}
    207207
    208 int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum) {
     208int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum) {
    209209
    210210  int ix, iy, Cx, Cy, i;
     
    241241  if (Nlist[i] == NLIST[i]) {
    242242    NLIST[i] += 100;
    243     REALLOCATE (clist[i], int, NLIST[i]);
    244     REALLOCATE (mlist[i], int, NLIST[i]);
     243    REALLOCATE (clist[i], int,   NLIST[i]);
     244    REALLOCATE (mlist[i], off_t, NLIST[i]);
    245245  }     
    246246  return (TRUE);
     
    264264}
    265265
    266 float getMgrid (int meas, int cat) {
     266float getMgrid (off_t meas, int cat) {
    267267
    268268  int i;
     
    287287
    288288  int **gotstar, **gridmeas;
    289   int i, j, k, N, Ngood, Nbad, Nmos, Ncal, Nrel, Nsys;
     289  int i, j, k, Ngood, Nbad, Nmos, Ncal, Nrel, Nsys;
    290290  double **A, **B, *Mjx, *Wjx;
    291291  float Msys, Mcal, Mmos, Merr, Wsys;
     
    498498    gridM[i] = B[i][0];
    499499    gridS[i] = sqrt(A[i][i]);
    500     gridN[i] = N;
     500    gridN[i] = Ngood;
    501501  }
    502502
     
    673673void dump_grid () {
    674674
    675   int i, j, Nimage, Nbytes, Nformat;
    676   int *imlist;
     675  off_t i, Nimage;
     676  int j, Nbytes, Nformat;
     677  off_t *imlist;
    677678  FILE *f;
    678679  Header header, theader;
     
    702703  gfits_create_header (&header);
    703704  gfits_create_matrix (&header, &matrix);
    704   gfits_modify (&header, "NEXTEND", "%d", 1, Nimage + 3);
     705  gfits_modify (&header, "NEXTEND", "%lld", 1, (long long) Nimage + 3);
    705706  gfits_modify (&header, "FILTER", "%s", 1, photcode[0].name);
    706   gfits_modify (&header, "COMMENT", "%S", 1, "Mosaic Photometry Grid Analysis");
     707  gfits_modify_alt (&header, "COMMENT", "%S", 1, "Mosaic Photometry Grid Analysis");
    707708
    708709  // we need to add lines to the PHU to identify the camera and format; these are used by the ipp config system
  • trunk/Ohana/src/relphot/src/ImageOps.c

    r21508 r27435  
    33static unsigned int *start;
    44static unsigned int *stop;
    5 static int         **bin;
    6 
    7 static int         **clist;
    8 static int         **mlist;
    9 static int          *Nlist;
    10 static int          *NLIST;
     5static off_t       **bin;
     6
     7static off_t       **clist;
     8static off_t       **mlist;
     9static off_t        *Nlist;
     10static off_t        *NLIST;
    1111
    1212static Image        *image;
    13 static int          Nimage;
    14 
    15 void initImages (Image *input, int N) {
    16 
    17   int i;
     13static off_t        Nimage;
     14
     15void initImages (Image *input, off_t N) {
     16
     17  off_t i;
    1818
    1919  image = input;
     
    3131void initImageBins (Catalog *catalog, int Ncatalog) {
    3232
    33   int i, j;
    34 
    35   ALLOCATE (bin, int *, Ncatalog);
     33  off_t i, j;
     34
     35  ALLOCATE (bin, off_t *, Ncatalog);
    3636  for (i = 0; i < Ncatalog; i++) {
    37     ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));
     37    ALLOCATE (bin[i], off_t, MAX (catalog[i].Nmeasure, 1));
    3838    for (j = 0; j < catalog[i].Nmeasure; j++) bin[i][j] = -1;
    3939  }
    4040
    41   ALLOCATE (Nlist, int, Nimage);
    42   ALLOCATE (NLIST, int, Nimage);
    43   ALLOCATE (clist, int *, Nimage);
    44   ALLOCATE (mlist, int *, Nimage);
     41  ALLOCATE (Nlist, off_t, Nimage);
     42  ALLOCATE (NLIST, off_t, Nimage);
     43  ALLOCATE (clist, off_t *, Nimage);
     44  ALLOCATE (mlist, off_t *, Nimage);
    4545
    4646  for (i = 0; i < Nimage; i++) {
    4747    Nlist[i] = 0;
    4848    NLIST[i] = 100;
    49     ALLOCATE (clist[i], int, NLIST[i]);
    50     ALLOCATE (mlist[i], int, NLIST[i]);
     49    ALLOCATE (clist[i], off_t, NLIST[i]);
     50    ALLOCATE (mlist[i], off_t, NLIST[i]);
    5151  }
    5252}
     
    5454void freeImageBins (int Ncatalog) {
    5555
    56   int i;
     56  off_t i;
    5757
    5858  for (i = 0; i < Ncatalog; i++) {
     
    7070/* **** use this to mimic the Mosaic version ***/
    7171# if (0)
    72 void initImageGrid (Image *image, int Nimage) {
     72void initImageGrid (Image *image, off_t Nimage) {
    7373
    7474  /* find max dR, dD range for all mosaics */
     
    7676  /* send results to initGridBins */
    7777
    78   int i, j, m, NX, NY;
     78  off_t i, j, m, NX, NY;
    7979  int dXmax, dYmax;
    8080  double dS, dX, dY;
     
    151151void findImages (Catalog *catalog, int Ncatalog) {
    152152
    153   int i, j, ecode;
     153  off_t j;
     154  int i, ecode;
    154155
    155156  for (i = 0; i < Ncatalog; i++) {
     
    164165/* XXX convert this to use the values of measure->Xccd,Yccd */
    165166/* XXX need to apply the conversion for ELIXIR and LONEOS formats */
    166 void matchImage (Catalog *catalog, int meas, int cat) {
    167 
    168   int i, ccdnum;
     167void matchImage (Catalog *catalog, off_t meas, int cat) {
     168
     169  off_t i;
     170  int ccdnum;
    169171  double X, Y;
    170172  char *pname, *filter, *p, base[256];
     
    220222    if (Nlist[i] == NLIST[i]) {
    221223      NLIST[i] += 100;
    222       REALLOCATE (clist[i], int, NLIST[i]);
    223       REALLOCATE (mlist[i], int, NLIST[i]);
     224      REALLOCATE (clist[i], off_t, NLIST[i]);
     225      REALLOCATE (mlist[i], off_t, NLIST[i]);
    224226    }   
    225227    return;
     
    228230}
    229231
    230 int getImageEntry (int meas, int cat) {
    231 
    232   int i;
     232off_t getImageEntry (off_t meas, int cat) {
     233
     234  off_t i;
    233235
    234236  i = bin[cat][meas];
     
    236238}
    237239
    238 float getMcal (int meas, int cat) {
    239 
    240   int i;
     240float getMcal (off_t meas, int cat) {
     241
     242  off_t i;
    241243  float value;
    242244
     
    249251}
    250252
    251 Coords *getCoords (int meas, int cat) {
    252 
    253   int i;
     253Coords *getCoords (off_t meas, int cat) {
     254
     255  off_t i;
    254256
    255257  i = bin[cat][meas];
     
    261263void setMcal (Catalog *catalog, int PoorImages) {
    262264
    263   int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys;
     265  off_t i, j, m, c, n, N, Nmax, mark, bad;
     266  int Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys;
    264267  float Msys, Mrel, Mmos, Mgrid;
    265268  double *list, *dlist;
     
    359362void clean_images () {
    360363
    361   int i, N, mark, Nmark;
     364  int mark, Nmark;
     365  off_t i, N;
    362366  double *mlist, *slist, *dlist;
    363367  double MaxOffset, MaxScatter, MedOffset;
     
    409413void plot_images () {
    410414
    411   int i, bin;
     415  off_t i, bin;
    412416  double *xlist, *Mlist, *dlist;
    413417  Graphdata graphdata;
     
    457461StatType statsImageN (Catalog *catalog) {
    458462
    459   int i, j, m, c, n, N;
     463  off_t i, j, m, c, n, N;
    460464  double *list, *dlist;
    461465  float Mcal, Mmos, Mgrid;
     
    499503StatType statsImageX (Catalog *catalog) {
    500504
    501   int i, n;
     505  off_t i, n;
    502506  double *list, *dlist;
    503507  StatType stats;
     
    527531StatType statsImageM (Catalog *catalog) {
    528532
    529   int i, n;
     533  off_t i, n;
    530534  double *list, *dlist;
    531535  StatType stats;
     
    555559StatType statsImagedM (Catalog *catalog) {
    556560
    557   int i, n;
     561  off_t i, n;
    558562  double *list, *dlist;
    559563  StatType stats;
     
    581585}
    582586
    583 Image *getimages (int *N) {
     587Image *getimages (off_t *N) {
    584588
    585589  *N = Nimage;
     
    587591}
    588592
    589 Image *getimage (int N) {
     593Image *getimage (off_t N) {
    590594  return (&image[N]);
    591595}
  • trunk/Ohana/src/relphot/src/MosaicOps.c

    r21508 r27435  
    11# include "relphot.h"
    22
    3 Image *getimages (int *N);
    4 
    5 static int    Nmosaic;
     3static off_t  Nmosaic;
    64static Mosaic *mosaic;
    75
    8 static int    *Nimlist;
    9 static int   **imlist; /* mosaic -> image[] */
    10 static int   **bin;    /* catalog, measure -> mosaic */
    11 
    12 static int   **clist;  /* mosaic -> catalog[] */
    13 static int   **mlist;  /* mosiac -> measure[] */
    14 static int    *Nlist;
    15 static int    *NLIST;
     6static off_t  *Nimlist;
     7static off_t   **imlist; /* mosaic -> image[] */
     8static off_t   **bin;    /* catalog, measure -> mosaic */
     9
     10static int     **clist;  /* mosaic -> catalog[] */
     11static off_t   **mlist;  /* mosiac -> measure[] */
     12static off_t    *Nlist;
     13static off_t    *NLIST;
    1614
    1715/* find mosaic frames (unique time periods & photcode name matches mosaic) */
    18 void initMosaics (Image *image, int Nimage) {
    19 
    20   int i, j, status, found, NMOSAIC, *NIMLIST;
     16void initMosaics (Image *image, off_t Nimage) {
     17
     18  off_t i, j, status, found, NMOSAIC, *NIMLIST;
    2119  unsigned int start, stop;
    2220  char *pname;
     
    2826  ALLOCATE (mosaic, Mosaic, NMOSAIC);
    2927
    30   ALLOCATE (imlist, int *, NMOSAIC);
    31   ALLOCATE (Nimlist, int, NMOSAIC);
    32   ALLOCATE (NIMLIST, int, NMOSAIC);
     28  ALLOCATE (imlist,  off_t *, NMOSAIC);
     29  ALLOCATE (Nimlist, off_t,  NMOSAIC);
     30  ALLOCATE (NIMLIST, off_t,  NMOSAIC);
    3331
    3432  /* generate list of unique mosaics */
     
    5654      if (Nimlist[j] == NIMLIST[j]) {
    5755        NIMLIST[j] += 10;
    58         REALLOCATE (imlist[j], int, NIMLIST[j]);
     56        REALLOCATE (imlist[j], off_t, NIMLIST[j]);
    5957      }
    6058
     
    7472    NIMLIST[Nmosaic] = 10;
    7573    Nimlist[Nmosaic] = 1;
    76     ALLOCATE (imlist[Nmosaic], int, NIMLIST[Nmosaic]);
     74    ALLOCATE (imlist[Nmosaic], off_t, NIMLIST[Nmosaic]);
    7775    imlist[Nmosaic][0] = i;
    7876
     
    8078    if (Nmosaic == NMOSAIC) {
    8179      NMOSAIC += 10;
    82       REALLOCATE (mosaic, Mosaic, NMOSAIC);
    83       REALLOCATE (imlist, int *, NMOSAIC);
    84       REALLOCATE (Nimlist, int, NMOSAIC);
    85       REALLOCATE (NIMLIST, int, NMOSAIC);
     80      REALLOCATE (mosaic,  Mosaic, NMOSAIC);
     81      REALLOCATE (imlist,  off_t *, NMOSAIC);
     82      REALLOCATE (Nimlist, off_t,  NMOSAIC);
     83      REALLOCATE (NIMLIST, off_t,  NMOSAIC);
    8684    }
    8785  }
     
    9189}
    9290
    93 void initMosaicGrid (Image *image, int Nimage) {
     91void initMosaicGrid (Image *image, off_t Nimage) {
    9492
    9593  /* find max dR, dD range for all mosaics */
     
    9795  /* send results to initGridBins */
    9896
    99   int i, j, m, NX, NY;
     97  off_t i, j, m, NX, NY;
    10098  int dXmax, dYmax;
    10199  double dS, dX, dY;
     
    170168void setMcalFinal () {
    171169
    172   int i, j, im, Nimage;
     170  off_t i, j, im, Nimage;
    173171  Image *image;
    174172
     
    191189void initMosaicBins (Catalog *catalog, int Ncatalog) {
    192190
    193   int i, j;
     191  off_t i, j;
    194192
    195193  /* measure -> mosaic */
    196194  if (!MOSAIC_ZEROPT) return;
    197195
    198   ALLOCATE (bin, int *, Ncatalog);
     196  ALLOCATE (bin, off_t *, Ncatalog);
    199197  for (i = 0; i < Ncatalog; i++) {
    200     ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));
     198    ALLOCATE (bin[i], off_t, MAX (catalog[i].Nmeasure, 1));
    201199    for (j = 0; j < catalog[i].Nmeasure; j++) bin[i][j] = -1;
    202200  }
    203201
    204202  /* mosaic -> measure */
    205   ALLOCATE (Nlist, int, Nmosaic);
    206   ALLOCATE (NLIST, int, Nmosaic);
    207   ALLOCATE (clist, int *, Nmosaic);
    208   ALLOCATE (mlist, int *, Nmosaic);
     203  ALLOCATE (Nlist, off_t,  Nmosaic);
     204  ALLOCATE (NLIST, off_t,  Nmosaic);
     205  ALLOCATE (clist, int *,   Nmosaic);
     206  ALLOCATE (mlist, off_t *, Nmosaic);
    209207
    210208  for (i = 0; i < Nmosaic; i++) {
    211209    Nlist[i] = 0;
    212210    NLIST[i] = 100;
    213     ALLOCATE (clist[i], int, NLIST[i]);
    214     ALLOCATE (mlist[i], int, NLIST[i]);
     211    ALLOCATE (clist[i], int,   NLIST[i]);
     212    ALLOCATE (mlist[i], off_t, NLIST[i]);
    215213  }
    216214}
     
    218216void freeMosaicBins (int Ncatalog) {
    219217
    220   int i;
     218  off_t i;
    221219
    222220  /* measure -> mosaic */
     
    241239int findMosaics (Catalog *catalog, int Ncatalog) {
    242240 
    243   int i, j, ecode;
     241  int i, ecode;
     242  off_t j;
    244243
    245244  if (!MOSAIC_ZEROPT) return (FALSE);
     
    259258}
    260259
    261 void matchMosaics (Catalog *catalog, int meas, int cat) {
     260void matchMosaics (Catalog *catalog, off_t meas, int cat) {
    262261
    263262  int i;
     
    287286    if (Nlist[i] == NLIST[i]) {
    288287      NLIST[i] += 100;
    289       REALLOCATE (clist[i], int, NLIST[i]);
    290       REALLOCATE (mlist[i], int, NLIST[i]);
     288      REALLOCATE (clist[i], int,   NLIST[i]);
     289      REALLOCATE (mlist[i], off_t, NLIST[i]);
    291290    }   
    292291    return;
     
    296295}
    297296
    298 float getMmos (int meas, int cat) {
    299 
    300   int i;
     297float getMmos (off_t meas, int cat) {
     298
     299  off_t i;
    301300  float value;
    302301
     
    313312int setMmos (Catalog *catalog, int PoorImages) {
    314313
    315   int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys;
     314  off_t i, j, m, c, N, Nmax;
     315  int n, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys;
    316316  float Msys, Mrel, Mcal, Mgrid;
    317317  double *list, *dlist, *Mlist, *dMlist;
     
    392392      mark = (N < IMAGE_TOOFEW) || (N < IMAGE_GOOD_FRACTION*Nlist[i]);
    393393      if (mark) {
    394         fprintf (stderr, "marked image %s (%d), (%d < %d) || (%d < %f*%d)\n", image[imlist[i][0]].name, i, N, IMAGE_TOOFEW, N, IMAGE_GOOD_FRACTION, Nlist[i]);
     394        fprintf (stderr, "marked image %s (%lld), (%lld < %d) || (%lld < %f*%lld)\n", image[imlist[i][0]].name, (long long) i, (long long) N, IMAGE_TOOFEW, (long long) N, IMAGE_GOOD_FRACTION, (long long) Nlist[i]);
    395395        mosaic[i].flags |= ID_IMAGE_FEW;
    396396        Nfew ++;
     
    400400    }
    401401    liststats (list, dlist, N, &stats);
    402     if (PoorImages) fprintf (stderr, "Mmos: %f %f %d %d\n", stats.mean, stats.sigma, stats.Nmeas, N);
     402    if (PoorImages) fprintf (stderr, "Mmos: %f %f %d %lld\n", stats.mean, stats.sigma, stats.Nmeas, (long long) N);
    403403    mosaic[i].Mcal  = stats.mean;
    404404    mosaic[i].dMcal = stats.sigma;
     
    422422StatType statsMosaicM (Catalog *catalog) {
    423423
    424   int i, n;
     424  off_t i;
     425  int n;
    425426  double *list, *dlist;
    426427  StatType stats;
     
    448449StatType statsMosaicdM (Catalog *catalog) {
    449450
    450   int i, n;
     451  off_t i, n;
    451452  double *list, *dlist;
    452453  StatType stats;
     
    476477StatType statsMosaicN (Catalog *catalog) {
    477478
    478   int i, j, m, c, n, N;
     479  off_t i, j, m, c, n, N;
    479480  double *list, *dlist;
    480481  float Mcal, Mgrid, Mrel;
     
    510511    n++;
    511512  }
    512   fprintf (stderr, "Nmosaic: %d, n: %d\n", Nmosaic, n);
     513  fprintf (stderr, "Nmosaic: %lld, n: %lld\n", (long long) Nmosaic, (long long) n);
    513514
    514515  liststats (list, dlist, n, &stats);
     
    520521StatType statsMosaicX (Catalog *catalog) {
    521522
    522   int i, n;
     523  off_t i, n;
    523524  double *list, *dlist;
    524525  StatType stats;
     
    549550void clean_mosaics () {
    550551
    551   int i, N, mark, Nmark;
     552  off_t i, N, mark, Nmark;
    552553  double *mlist, *slist, *dlist;
    553554  double MaxOffset, MedOffset, MaxScatter;
     
    590591  }
    591592
    592   fprintf (stderr, "%d mosaics marked poor\n", Nmark);
     593  fprintf (stderr, "%lld mosaics marked poor\n", (long long) Nmark);
    593594  initstats (STATMODE);
    594595  free (mlist);
     
    599600void plot_mosaic_fields (Catalog *catalog) {
    600601
    601   int i, j, m, c, N, ave, Nimage;
     602  off_t i, j, m, c, N, ave, Nimage;
    602603  double *xlist, *ylist;
    603604  double Xmin, Xmax, Ymin, Ymax;
     
    634635    }
    635636 
    636     sprintf (string, "Mosaic %d", i);
     637    sprintf (string, "Mosaic %lld", (long long) i);
    637638    plot_defaults (&graphdata);
    638639    plot_list (&graphdata, xlist, ylist, N, string, NULL);
     
    645646void plot_mosaics () {
    646647
    647   int i, bin;
     648  off_t i, bin;
    648649  double *xlist, *Mlist, *dlist;
    649650  Graphdata graphdata;
     
    694695}
    695696
    696 int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage) {
    697 
    698   int i, Imax, Nmax;
     697off_t *SelectRefMosaic (Mosaic **refmosaic, off_t *Nimage) {
     698
     699  off_t i, Imax, Nmax;
    699700
    700701  Imax = 0;
  • trunk/Ohana/src/relphot/src/StarOps.c

    r25735 r27435  
    77void initMrel (Catalog *catalog, int Ncatalog) {
    88
    9   int i, j;
     9  off_t i, j;
    1010 
    1111  Nmax = 0;
     
    2020
    2121
    22 float getMrel (Catalog *catalog, int meas, int cat) {
     22float getMrel (Catalog *catalog, off_t meas, int cat) {
    2323
    2424  int ave;
     
    3434int setMrel (Catalog *catalog, int Ncatalog) {
    3535
    36   int i, j, k, m, N, Nfew, Nsys, Nbad, Ncal, Nmos, Ngrid;
     36  off_t j, k, m;
     37  int i, N, Nfew, Nsys, Nbad, Ncal, Nmos, Ngrid;
    3738  float Msys, Mcal, Mmos, Mgrid;
    3839  StatType stats;
     
    109110int setMrelOutput (Catalog *catalog, int Ncatalog, int mark) {
    110111
    111   int i, j, k, m, N, Nmax;
     112  int i, N;
     113  off_t j, k, m, Nmax;
    112114  float Msys, Mcal, Mmos, Mgrid;
    113115  double *list, *dlist;
     
    173175int setMave (Catalog *catalog, int Ncatalog) {
    174176
    175   int i, j, k, m, Ns, Nsecfilt, N, Nmax, Nc;
     177  off_t j, k, m, Nmax;
     178  int i, Ns, Nsecfilt, N, Nc;
    176179  float Msys;
    177180  double *list, *dlist;
     
    293296int setMcalOutput (Catalog *catalog, int Ncatalog) {
    294297
    295   int i, j, k, m;
     298  int i;
     299  off_t j, k, m;
    296300  float Mcal, Mmos, Mgrid;
    297301
     
    380384void clean_measures (Catalog *catalog, int Ncatalog, int final) {
    381385
    382   int i, j, k, m, N, Ndel, Nave, Nmax, image_bad, TOOFEW;
    383   int *ilist;
     386  off_t j, k, m, Nmax, Ndel, Nave;
     387  int i, N, image_bad, TOOFEW;
     388  off_t *ilist;
    384389  double *tlist, *list, *dlist, Ns;
    385390  float Msys, Mcal, Mmos, Mgrid;
     
    396401  ALLOCATE (list, double, MAX (1, Nmax));
    397402  ALLOCATE (dlist, double, MAX (1, Nmax));
    398   ALLOCATE (ilist, int, Nmax);
     403  ALLOCATE (ilist, off_t, Nmax);
    399404  ALLOCATE (tlist, double, Nmax);
    400405 
     
    480485  }
    481486  initstats (STATMODE);
    482   if (VERBOSE) fprintf (stderr, "%d measures marked poor, %d total\n", Ndel, Nave);
     487  if (VERBOSE) fprintf (stderr, "%lld measures marked poor, %lld total\n", (long long) Ndel, (long long) Nave);
    483488  free (ilist);
    484489  free (tlist);
     
    487492StatType statsStarN (Catalog *catalog, int Ncatalog) {
    488493
    489   int i, j, k, m, n, N, Ntot;
     494  off_t j, k, m, Ntot;
     495  int i, n, N;
    490496  double *list, *dlist;
    491497  float Mcal, Mmos, Mgrid;
     
    533539StatType statsStarX (Catalog *catalog, int Ncatalog) {
    534540
    535   int i, j, n, Ntot, Xm;
     541  off_t j, Ntot;
     542  int i, n, Xm;
    536543  double *list, *dlist;
    537544  StatType stats;
     
    568575StatType statsStarS (Catalog *catalog, int Ncatalog) {
    569576
    570   int i, j, n, Ntot;
     577  int i, n;
     578  off_t j, Ntot;
    571579  double *list, *dlist;
    572580  float dM;
     
    603611void plot_stars (Catalog *catalog, int Ncatalog) {
    604612
    605   int i, j, bin;
     613  int i, bin;
     614  off_t j;
    606615  float dMrel;
    607616  double *xlist, *Mlist;
     
    634643void plot_chisq (Catalog *catalog, int Ncatalog) {
    635644
    636   int i, j, N, Ntotal, value;
     645  off_t j, Ntotal;
     646  int i, N, value;
    637647  double *xlist, *ylist;
    638648  Graphdata graphdata;
     
    665675void plot_star_coords (Catalog *catalog, int Ncatalog) {
    666676
    667   int i, j, N;
     677  int i;
     678  off_t j, N;
    668679  double *xlist, *ylist;
    669680  double Xmin, Ymin, Xmax, Ymax;
  • trunk/Ohana/src/relphot/src/bcatalog.c

    r21508 r27435  
    33int bcatalog (Catalog *subcatalog, Catalog *catalog) {
    44 
    5   int i, j, offset, ecode;
    6   int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
     5  off_t i, j, offset;
     6  int ecode;
     7  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
    78  float mag;
    89
     
    113114
    114115  if (VERBOSE) {
    115     fprintf (stderr, "%d: using %d stars (%d measures) for catalog\n", i,
    116              subcatalog[0].Naverage, subcatalog[0].Nmeasure);
     116    fprintf (stderr, "%lld: using %lld stars (%lld measures) for catalog\n", (long long) i,
     117             (long long) subcatalog[0].Naverage, (long long) subcatalog[0].Nmeasure);
    117118  }
    118119  return (TRUE);
  • trunk/Ohana/src/relphot/src/load_images.c

    r25757 r27435  
    44
    55  Image     *image, *subset;
    6   int        Nimage, Nsubset, Nchar;
    7   int       *LineNumber;
     6  off_t      Nimage, Nsubset, Nchar;
     7  off_t     *LineNumber;
    88
    99  SkyTable *sky = NULL;
     
    4040
    4141  Image     *image;
    42   int        Nimage, Nx, i;
     42  off_t     Nimage, Nx, i;
    4343  VTable    *vtable;
    4444
     
    4747  vtable = &db[0].vtable;
    4848
    49   gfits_scan (vtable[0].header, "NAXIS1", "%d", 1, &Nx);
     49  gfits_scan (vtable[0].header, "NAXIS1", "%lld", 1, (long long *) &Nx);
    5050  for (i = 0; i < Nimage; i++) {
    5151    memcpy (vtable[0].buffer[i], &image[i], Nx);
  • trunk/Ohana/src/relphot/src/plot_scatter.c

    r21508 r27435  
    33void plot_scatter (Catalog *catalog, int Ncatalog) {
    44
    5   int i, j, k, m, N, Ntot;
     5  off_t i, j, k, m, N, Ntot;
    66  float Mrel, Mcal, Mmos, Mgrid;
    77  double *xlist, *ylist, *ilist;
  • trunk/Ohana/src/relphot/src/relphot_objects.c

    r25757 r27435  
    33int relphot_objects () {
    44
    5   int i, j, k, m;
     5  off_t i, j, k, m;
    66  int Nsecfilt;
    77
  • trunk/Ohana/src/relphot/src/select_images.c

    r21508 r27435  
    1313} SkyRegionCoords;
    1414
    15 Image *select_images (SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage) {
     15Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage) {
    1616 
    1717  Image *image;
    18   int i, j, k, m, found, nimage, NIMAGE;
    19   int InRange, ecode;
     18  off_t i, j, k, m;
     19  off_t *line_number, nimage, NIMAGE;
     20  int InRange, ecode, found;
    2021  double Ri[5], Di[5], Xi[5], Yi[5], dx, dy;
    21   int *line_number;
    2222  Coords tcoords;
    2323  SkyRegionCoords *skycoords;
     
    7171  NIMAGE = 100;
    7272  ALLOCATE (image, Image, NIMAGE);
    73   ALLOCATE (line_number, int, NIMAGE);
     73  ALLOCATE (line_number, off_t, NIMAGE);
    7474 
    7575  // go through the complete list of images, selecting ones which overlap any region
     
    146146        NIMAGE += 100;
    147147        REALLOCATE (image, Image, NIMAGE);
    148         REALLOCATE (line_number, int, NIMAGE);
     148        REALLOCATE (line_number, off_t, NIMAGE);
    149149      }
    150150    }
    151151  }
    152152     
    153   if (VERBOSE) fprintf (stderr, "found %d images\n", nimage);
     153  if (VERBOSE) fprintf (stderr, "found %lld images\n", (long long) nimage);
    154154
    155155  REALLOCATE (image, Image, MAX (nimage, 1));
    156   REALLOCATE (line_number, int, MAX (nimage, 1));
     156  REALLOCATE (line_number, off_t, MAX (nimage, 1));
    157157  free (skycoords);
    158158
  • trunk/Ohana/src/relphot/src/setExclusions.c

    r16810 r27435  
    33int setExclusions (Catalog *catalog, int Ncatalog) {
    44
    5   int i, j, k, m, Narea, Nnocal, Ngood, ecode;
     5  off_t i, j, k, m, Narea, Nnocal, Ngood;
     6  int ecode;
    67  Coords *coords;
    78  double r, d, x, y;
     
    4950    }
    5051  }
    51   if (VERBOSE) fprintf (stderr, "%d measurements marked by area\n", Narea);
    52   if (VERBOSE) fprintf (stderr, "%d measurements marked nocal\n", Nnocal);
    53   if (VERBOSE) fprintf (stderr, "%d measurements kept for analysis\n", Ngood);
     52  if (VERBOSE) fprintf (stderr, "%lld measurements marked by area\n",    (long long) Narea);
     53  if (VERBOSE) fprintf (stderr, "%lld measurements marked nocal\n",      (long long) Nnocal);
     54  if (VERBOSE) fprintf (stderr, "%lld measurements kept for analysis\n", (long long) Ngood);
    5455  return (TRUE);
    5556}
  • trunk/Ohana/src/relphot/src/setMrelFinal.c

    r26154 r27435  
    33void setMrelFinal (Catalog *catalog) {
    44
    5   int i, j, m, ecode;
     5  off_t i, j, m;
     6  int ecode;
    67
    78  /* if we reset the catalog, reset all the current measurements */
     
    3940
    4041  /* set catalog[0].found[i] = FALSE */
    41   ALLOCATE (catalog[0].found, int, MAX (1, catalog[0].Naverage));
     42  ALLOCATE (catalog[0].found, off_t, MAX (1, catalog[0].Naverage));
    4243  for (i = 0; i < catalog[0].Naverage; i++) {
    4344    catalog[0].found[i] = FALSE;
     
    6667void skip_measurements (Catalog *catalog, int pass) {
    6768
    68   int i, k, m, ecode, d1, d2;
    69   int Ntot, Ntry, Nkeep, Nskip;
     69  off_t i, k, m;
     70  int ecode;
     71  off_t Ntot, Ntry, Nkeep, Nskip;
    7072  float mag;
    7173
     
    136138    }
    137139  }
    138   if (VERBOSE) fprintf (stderr, "pass %d, Ntot: %d, Ntry: %d, Nskip: %d, Nkeep: %d\n",
    139                         pass, Ntot, Ntry, Nskip, Nkeep);
     140  if (VERBOSE) fprintf (stderr, "pass %d, Ntot: %lld, Ntry: %lld, Nskip: %lld, Nkeep: %lld\n",
     141                        pass, (long long) Ntot, (long long) Ntry, (long long) Nskip, (long long) Nkeep);
    140142}
    141143
Note: See TracChangeset for help on using the changeset viewer.