IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2010, 2:52:38 PM (16 years ago)
Author:
eugene
Message:

more largefile support mods -- code now builds

Location:
branches/eam_branches/largefiles.20100314/Ohana/src
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/include/relastro.h

    r24308 r27312  
    140140char         *GetPhotnamebyCode   PROTO((PhotCodeData *photcodes, int code));
    141141void          InterpolateGrid     PROTO((float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords));
    142 int          *SelectRefMosaic     PROTO((Mosaic **refmosaic, int *Nimage));
     142off_t          *SelectRefMosaic     PROTO((Mosaic **refmosaic, off_t *Nimage));
    143143int           args                PROTO((int argc, char **argv));
    144144int           bcatalog            PROTO((Catalog *subcatalog, Catalog *catalog));
     
    153153void          findImages          PROTO((Catalog *catalog, int Ncatalog));
    154154int           findMosaics         PROTO((Catalog *catalog, int Ncatalog));
    155 Image        *find_images         PROTO((FITS_DB *db, GSCRegion *region, int Nregion, int *Nimage, int **LineNum));
     155Image        *find_images         PROTO((FITS_DB *db, GSCRegion *region, off_t Nregion, off_t *Nimage, off_t **LineNum));
    156156void set_db (FITS_DB *in);
    157157int Shutdown (char *format, ...);
     
    160160int SetSignals (void);
    161161
    162 GSCRegion    *find_regions        PROTO((Image *image, int Nimage, int *Nregions, GSCRegion *fullregion));
     162GSCRegion    *find_regions        PROTO((Image *image, off_t Nimage, int *Nregions, GSCRegion *fullregion));
    163163void          freeGridBins        PROTO((int Ncatalog));
    164164void          freeImageBins       PROTO((int Ncatalog));
     
    166166void          free_catalogs       PROTO((Catalog *catalog, int Ncatalog));
    167167int           gcatalog            PROTO((Catalog *catalog, int FINAL));
    168 Coords       *getCoords           PROTO((int meas, int cat));
    169 float         getMcal             PROTO((int meas, int cat));
    170 float         getMgrid            PROTO((int meas, int cat));
    171 float         getMmos             PROTO((int meas, int cat));
    172 float         getMrel             PROTO((Catalog *catalog, int meas, int cat));
    173 GSCRegion    *get_regions         PROTO((double minRa, double maxRa, double minDec, double maxDec, int *Nregions));
    174 void          getfullregion       PROTO((Image *image, int Nimage, GSCRegion *fullregion));
    175 Image        *getimage            PROTO((int N));
    176 Image        *getimages           PROTO((int *N));
     168Coords       *getCoords           PROTO((off_t meas, int cat));
     169float         getMcal             PROTO((off_t meas, int cat));
     170float         getMgrid            PROTO((off_t meas, int cat));
     171float         getMmos             PROTO((off_t meas, int cat));
     172float         getMrel             PROTO((Catalog *catalog, off_t meas, int cat));
     173GSCRegion    *get_regions         PROTO((double minRa, double maxRa, double minDec, double maxDec, off_t *Nregions));
     174void          getfullregion       PROTO((Image *image, off_t Nimage, GSCRegion *fullregion));
     175Image        *getimage            PROTO((off_t N));
     176Image        *getimages           PROTO((off_t *N));
    177177void          global_stats        PROTO((Catalog *catalog, int Ncatalog));
    178178void          initGrid            PROTO((int dX, int dY));
    179179void          initGridBins        PROTO((Catalog *catalog, int Ncatalog));
    180180void          initImageBins       PROTO((Catalog *catalog, int Ncatalog));
    181 void          initImages          PROTO((Image *input, int N));
     181void          initImages          PROTO((Image *input, off_t N));
    182182void          initMosaicBins      PROTO((Catalog *catalog, int Ncatalog));
    183 void          initMosaicGrid      PROTO((Image *image, int Nimage));
    184 void          initMosaics         PROTO((Image *image, int Nimage));
     183void          initMosaicGrid      PROTO((Image *image, off_t Nimage));
     184void          initMosaics         PROTO((Image *image, off_t Nimage));
    185185void          initMrel            PROTO((Catalog *catalog, int Ncatalog));
    186186void          initialize          PROTO((int argc, char **argv));
     
    189189Catalog      *load_catalogs       PROTO((SkyList *skylist, int *Ncatalog, int subselect));
    190190SkyList      *load_images         PROTO((FITS_DB *db, SkyRegion *region));
    191 Image        *select_images       PROTO((SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage));
     191Image        *select_images       PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage));
    192192
    193193void check_permissions (char *basefile);
     
    198198
    199199int           main                PROTO((int argc, char **argv));
    200 void          mark_images         PROTO((Image *image, int Nimage, Image *timage, int Ntimage));
    201 void          matchImage          PROTO((Catalog *catalog, int meas, int cat));
    202 void          matchMosaics        PROTO((Catalog *catalog, int meas, int cat));
    203 GSCRegion    *name_region         PROTO((char *name, int *Nregions));
     200void          mark_images         PROTO((Image *image, off_t Nimage, Image *timage, off_t Ntimage));
     201void          matchImage          PROTO((Catalog *catalog, off_t meas, int cat));
     202void          matchMosaics        PROTO((Catalog *catalog, off_t meas, int cat));
     203GSCRegion    *name_region         PROTO((char *name, off_t *Nregions));
    204204double        opening_angle       PROTO((double x1, double y1, double x2, double y2, double x3, double y3));
    205205void          plot_chisq          PROTO((Catalog *catalog, int Ncatalog));
     
    224224int           setMrelOutput       PROTO((Catalog *catalog, int Ncatalog, int mark));
    225225void          set_ZP              PROTO((double ZERO));
    226 int           setrefcode          PROTO((Image *image, int Nimage));
     226int           setrefcode          PROTO((Image *image, off_t Nimage));
    227227void          skip_measurements   PROTO((Catalog *catalog, int pass));
    228228void          sortA               PROTO((double *X, int N));
     
    268268int UpdateMosaic (Catalog *catalog, int Ncatalog);
    269269int UpdateMeasures (Catalog *catalog, int Ncatalog);
    270 void fixImageRaw (Catalog *catalog, int Ncatalog, int im);
     270void fixImageRaw (Catalog *catalog, int Ncatalog, off_t im);
    271271void FlagOutliers(Catalog *catalog);
    272272int MeasFilterTest(Measure *measure);
     
    278278int FitPMandPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts);
    279279
    280 Mosaic *getMosaicForImage (int N);
    281 
    282 StarData *getImageRef (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode);
    283 StarData *getImageRaw (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode);
    284 
    285 Mosaic *getmosaics (int *N);
    286 void initMosaics (Image *image, int Nimage);
    287 StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, int mos, int *Nstars);
    288 StarData *getMosaicRef (Catalog *catalog, int Ncatalog, int mos, int *Nstars);
    289 Mosaic *getMosaicForImage (int im);
     280Mosaic *getMosaicForImage (off_t N);
     281
     282StarData *getImageRef (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode);
     283StarData *getImageRaw (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode);
     284
     285Mosaic *getmosaics (off_t *N);
     286void initMosaics (Image *image, off_t Nimage);
     287StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars);
     288StarData *getMosaicRef (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars);
     289Mosaic *getMosaicForImage (off_t im);
    290290
    291291double getMeanR (Measure *measure, Average *average, SecFilt *secfilt);
     
    297297int relastro_objects (void);
    298298int UpdateObjectOffsets (SkyList *skylist);
     299
     300int relastroVisualPlotRawRef(StarData *raw, StarData *ref, double dRmax, int numObj);
     301int relastroVisualPlotScatter(double values[], double thresh, int npts);
     302int relastroVisualPlotOutliers(Catalog *catalog, int offset, int Nmeasure,
     303                               StatType statsR, StatType statsD, double thresh);
     304
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/ImageOps.c

    r24308 r27312  
    44static unsigned int *start;
    55static unsigned int *stop;
    6 static int         **bin;
    7 
    8 static int         **clist;
    9 static int         **mlist;
    10 static int          *Nlist;
    11 static int          *NLIST;
    12 
    13 static Image        *image;
    14 static int          Nimage;
    15 
    16 Image *getimages (int *N) {
     6
     7static off_t       **bin;     // link from catalog,measure to image
     8static int         **clist;   // catalog which supplied measurement on image
     9static off_t       **mlist;   // measure reference for measurement on image
     10static off_t        *Nlist;   // number of measurements on image
     11static off_t        *NLIST;   // allocated number of measurements on image
     12
     13static Image        *image;   // list of available images
     14static off_t        Nimage;   // number of available images
     15
     16Image *getimages (off_t *N) {
    1717  *N = Nimage;
    1818  return (image);
    1919}
    2020
    21 Image *getimage (int N) {
     21Image *getimage (off_t N) {
    2222  return (&image[N]);
    2323}
    2424
    25 void initImages (Image *input, int N) {
    26 
    27   int i;
     25void initImages (Image *input, off_t N) {
     26
     27  off_t i;
    2828
    2929  image = input;
     
    4141void initImageBins (Catalog *catalog, int Ncatalog) {
    4242
    43   int i, j;
    44 
    45   ALLOCATE (bin, int *, Ncatalog);
     43  off_t i, j;
     44
     45  ALLOCATE (bin, off_t *, Ncatalog);
    4646  for (i = 0; i < Ncatalog; i++) {
    47     ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));
     47    ALLOCATE (bin[i], off_t, MAX (catalog[i].Nmeasure, 1));
    4848    for (j = 0; j < catalog[i].Nmeasure; j++) bin[i][j] = -1;
    4949  }
    5050
    51   ALLOCATE (Nlist, int, Nimage);
    52   ALLOCATE (NLIST, int, Nimage);
    53   ALLOCATE (clist, int *, Nimage);
    54   ALLOCATE (mlist, int *, Nimage);
     51  ALLOCATE (Nlist, off_t,  Nimage);
     52  ALLOCATE (NLIST, off_t,  Nimage);
     53  ALLOCATE (clist, int *,   Nimage);
     54  ALLOCATE (mlist, off_t *, Nimage);
    5555
    5656  for (i = 0; i < Nimage; i++) {
     
    5858    NLIST[i] = 100;
    5959    ALLOCATE (clist[i], int, NLIST[i]);
    60     ALLOCATE (mlist[i], int, NLIST[i]);
     60    ALLOCATE (mlist[i], off_t, NLIST[i]);
    6161  }
    6262}
     
    6464void freeImageBins (int Ncatalog) {
    6565
    66   int i;
     66  off_t i;
    6767
    6868  for (i = 0; i < Ncatalog; i++) {
     
    8181void findImages (Catalog *catalog, int Ncatalog) {
    8282
    83   int i, j;
     83  off_t i, j;
    8484  char *name;
    8585
     
    9292  for (i = 0; VERBOSE && (i < Nimage); i++) {
    9393    name = GetPhotcodeNamebyCode (image[i].photcode);
    94     fprintf (stderr, "image %d has %d measures (%s, %s)\n", i, Nlist[i],
     94    fprintf (stderr, "image %lld has %lld measures (%s, %s)\n", (long long) i, (long long) Nlist[i],
    9595             ohana_sec_to_date(image[i].tzero), name);
    9696  }
     
    9898
    9999/* modify this function to use the measure->imageID field */
    100 void matchImage (Catalog *catalog, int meas, int cat) {
    101 
    102   int i;
     100void matchImage (Catalog *catalog, off_t meas, int cat) {
     101
     102  off_t i;
    103103  Measure *measure;
    104104
     
    124124    if (Nlist[i] == NLIST[i]) {
    125125      NLIST[i] += 100;
    126       REALLOCATE (clist[i], int, NLIST[i]);
    127       REALLOCATE (mlist[i], int, NLIST[i]);
     126      REALLOCATE (clist[i], int,   NLIST[i]);
     127      REALLOCATE (mlist[i], off_t, NLIST[i]);
    128128    }
    129129    return;
     
    131131}
    132132
    133 Coords *getCoords (int meas, int cat) {
    134 
    135   int i;
     133Coords *getCoords (off_t meas, int cat) {
     134
     135  off_t i;
    136136
    137137  i = bin[cat][meas];
     
    142142void plot_images () {
    143143
    144   int i, bin;
     144  off_t i, bin;
    145145  double *xlist, *Mlist, *dlist;
    146146  Graphdata graphdata;
     
    188188// return StarData values for detections in the specified image, converting coordinates from the
    189189// chip positions: X,Y -> L,M -> P,Q -> R,D
    190 void fixImageRaw (Catalog *catalog, int Ncatalog, int im) {
    191 
    192   int i, m, c, n;
     190void fixImageRaw (Catalog *catalog, int Ncatalog, off_t im) {
     191
     192  off_t i, m, c, n;
    193193  double X, Y, L, M, P, Q, R, D, dR, dD;
    194194
     
    257257// chip positions: X,Y -> L,M -> P,Q -> R,D.  This function is used by the image fitting steps, for
    258258// which the detections have already been filtered when they were loaded (bcatalog)
    259 StarData *getImageRaw (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode) {
    260 
    261   int i, m, c, n;
     259StarData *getImageRaw (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode) {
     260
     261  off_t i, m, c, n;
    262262
    263263  Mosaic *mosaic;
     
    332332// the sky positions: R,D -> P,Q -> L,M -> X,Y
    333333
    334 StarData *getImageRef (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode) {
    335 
    336   int i, m, c, n;
     334StarData *getImageRef (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode) {
     335
     336  off_t i, m, c, n;
    337337
    338338  Mosaic *mosaic;
     
    399399  return;
    400400
    401   int i, j, k, m, N, Ndel, Nave, Nmax, TOOFEW, Nsecfilt;
     401  int Ndel, Nave;
     402  off_t i, j, k, m, N, Nmax, TOOFEW, Nsecfilt;
    402403  double Ns, theta, x, y;
    403404  double *R, *D, *dR, *dD;
     
    490491void FlagOutliers2D (Catalog *catalog) {
    491492
    492   int i, j, k, m, N, Ndel, Nave, Nmax, TOOFEW, Nsecfilt;
     493  int Ndel, Nave;
     494  off_t i, j, k, m, N, Nmax, TOOFEW, Nsecfilt;
    493495  double *index;
    494496  double Ns, theta, x, y;
     
    569571    // recalculate image center, sigma based on closest 50% of points
    570572    for(k = 0;  k < N; k++) {
    571       int ind = (int) index[k];
     573      off_t ind = (off_t) index[k];
    572574      R[k] = catalog[0].measure[ind].dR;
    573575      D[k] = catalog[0].measure[ind].dD;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/MosaicOps.c

    r21508 r27312  
    22
    33// array of mosaic definition structures
    4 static int    Nmosaic;
     4static off_t    Nmosaic;
    55static Mosaic *mosaic;
    66
    77// list of all images associated with a mosaic
    8 static int   *Nmosaic_own_images; // number of images for this mosaic
    9 static int   *Amosaic_own_images; // size of allocated array
    10 static int   **mosaic_own_images; // array of arrays: mosaic -> images
     8static off_t   *Nmosaic_own_images; // number of images for this mosaic
     9static off_t   *Amosaic_own_images; // size of allocated array
     10static off_t   **mosaic_own_images; // array of arrays: mosaic -> images
    1111
    1212// list of mosaic associated with each image 
    13 static int    Nmosaic_for_images; // number of images (for internal checks)
    14 static int    *mosaic_for_images; // array of: image -> mosaic
     13static off_t    Nmosaic_for_images; // number of images (for off_ternal checks)
     14static off_t    *mosaic_for_images; // array of: image -> mosaic
    1515
    16 Mosaic *getmosaics (int *N) {
     16Mosaic *getmosaics (off_t *N) {
    1717  *N = Nmosaic;
    1818  return (mosaic);
     
    2020
    2121// find mosaic frames (unique time periods & photcode name matches mosaic)
    22 void initMosaics (Image *image, int Nimage) {
     22void initMosaics (Image *image, off_t Nimage) {
    2323
    24   int i, j, found, NMOSAIC;
     24  off_t i, j, found, NMOSAIC;
    2525  unsigned int start, stop;
    2626
     
    2929  ALLOCATE (mosaic, Mosaic, NMOSAIC);
    3030
    31   ALLOCATE (Nmosaic_own_images, int, NMOSAIC);
    32   ALLOCATE (Amosaic_own_images, int, NMOSAIC);
    33   ALLOCATE (mosaic_own_images, int *, NMOSAIC);
     31  ALLOCATE (Nmosaic_own_images, off_t, NMOSAIC);
     32  ALLOCATE (Amosaic_own_images, off_t, NMOSAIC);
     33  ALLOCATE (mosaic_own_images, off_t *, NMOSAIC);
    3434
    3535  /* find the mosaic images (coords.ctype = DIS); generate list of unique mosaics */
     
    5454    Nmosaic_own_images[Nmosaic] = 0;
    5555    Amosaic_own_images[Nmosaic] = 10;
    56     ALLOCATE (mosaic_own_images[Nmosaic], int, Amosaic_own_images[Nmosaic]);
     56    ALLOCATE (mosaic_own_images[Nmosaic], off_t, Amosaic_own_images[Nmosaic]);
    5757
    5858    Nmosaic ++;
     
    6060      NMOSAIC += 10;
    6161      REALLOCATE (mosaic, Mosaic, NMOSAIC);
    62       REALLOCATE (mosaic_own_images, int *, NMOSAIC);
    63       REALLOCATE (Nmosaic_own_images, int, NMOSAIC);
    64       REALLOCATE (Amosaic_own_images, int, NMOSAIC);
     62      REALLOCATE (mosaic_own_images, off_t *, NMOSAIC);
     63      REALLOCATE (Nmosaic_own_images, off_t, NMOSAIC);
     64      REALLOCATE (Amosaic_own_images, off_t, NMOSAIC);
    6565    }
    6666  }
     
    6868  // array to store image->mosaic index
    6969  Nmosaic_for_images = Nimage;
    70   ALLOCATE (mosaic_for_images, int, Nmosaic_for_images);
     70  ALLOCATE (mosaic_for_images, off_t, Nmosaic_for_images);
    7171
    7272  /* now assign the WRP images to these mosaics */
     
    9999    if (Nmosaic_own_images[j] == Amosaic_own_images[j]) {
    100100      Amosaic_own_images[j] += 10;
    101       REALLOCATE (mosaic_own_images[j], int, Amosaic_own_images[j]);
     101      REALLOCATE (mosaic_own_images[j], off_t, Amosaic_own_images[j]);
    102102    }
    103103    assert (Nmosaic_own_images[j] < Amosaic_own_images[j]);
     
    109109// return StarData values for detections in the specified image, converting coordinates from the
    110110// chip positions: X,Y -> L,M -> P,Q -> R,D
    111 StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, int mos, int *Nstars) {
     111StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars) {
    112112
    113   int i, j, im, Nraw, Nnew;
     113  off_t i, j, im, Nraw, Nnew;
    114114  StarData *raw, *new;
    115115
     
    142142// return StarData values for averages positions in the specified image, converting coordinates from
    143143// the sky positions: R,D -> P,Q -> L,M -> X,Y
    144 StarData *getMosaicRef (Catalog *catalog, int Ncatalog, int mos, int *Nstars) {
     144StarData *getMosaicRef (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars) {
    145145
    146   int i, j, im, Nref, Nnew;
     146  off_t i, j, im, Nref, Nnew;
    147147  StarData *ref, *new;
    148148 
     
    172172}
    173173
    174 Mosaic *getMosaicForImage (int im) {
     174Mosaic *getMosaicForImage (off_t im) {
    175175
    176   int mos;
     176  off_t mos;
    177177
    178178  if (im < 0) abort();
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateChips.c

    r17151 r27312  
    44
    55  /* we can measure new image parameters for each non-mosaic chip independently */
    6   int i, Nimage, Nraw, Nref;
     6  off_t i, Nimage, Nraw, Nref;
    77  Image *image;
    88  StarData *raw, *ref;
     
    2525
    2626    // FitChip does iterative, clipped fitting
    27     fprintf (stderr, "image %d : Nstars: %d\n", i, Nraw);
     27    fprintf (stderr, "image %lld : Nstars: %lld\n", (long long) i, (long long) Nraw);
    2828    FitChip (raw, ref, Nraw, &image[i].coords);
    2929
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMeasures.c

    r16810 r27312  
    33int UpdateMeasures (Catalog *catalog, int Ncatalog) {
    44
    5   int i, Nimage;
     5  off_t i, Nimage;
    66  Image *image;
    77
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMosaic.c

    r15600 r27312  
    44
    55  /* we can measure new image parameters for each mosaic independently */
    6   int i, Nmosaic, Nstars;
     6  off_t i, Nmosaic, Nstars;
    77  Mosaic *mosaic;
    88  StarData *raw, *ref;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateObjects.c

    r24308 r27312  
    11# include "relastro.h"
    22
    3 static int Nmax;
     3static off_t  Nmax;
    44static double *X, *dX;
    55static double *Y, *dY;
     
    1313void initObjectData (Catalog *catalog, int Ncatalog) {
    1414
    15   int i, j;
     15  off_t i, j;
    1616 
    1717  Nmax = 0;
     
    4040int UpdateObjects (Catalog *catalog, int Ncatalog) {
    4141
    42   int i, j, k, m, N, Nsecfilt, found, kp;
     42  int i, j, k, m, N, Nsecfilt;
    4343  StatType statsR, statsD;
    4444  Coords coords;
     
    4747  int mode, Nave, Npm, Npar, Nskip;
    4848  double Tmin, Tmax;
    49   float mag;
    50   int mask;
    51   PhotCode *code;
    5249
    5350  initObjectData (catalog, Ncatalog);
     
    7471  for (i = 0; i < Ncatalog; i++) {
    7572
    76     if (VERBOSE) fprintf (stderr, "astrometrize catalog %d : %d ave, %d meas\n", i, catalog[i].Naverage, catalog[i].Nmeasure);
     73    if (VERBOSE) fprintf (stderr, "astrometrize catalog %d : %lld ave, %lld meas\n", i, (long long) catalog[i].Naverage, (long long) catalog[i].Nmeasure);
    7774
    7875    Nskip = 0;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/bcatalog.c

    r24308 r27312  
    33int bcatalog (Catalog *subcatalog, Catalog *catalog) {
    44
    5   int i, j, k, offset, found;
    6   int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt;
    7   float mag;
    8   int mask;
    9   PhotCode *code;
     5  off_t i, j, offset;
     6  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
     7  int Nsecfilt;
    108
    119  // XXX in the future, use catalog[0].Nsecfilt only?  allow catalogs to have variable Nsecfilt?
     
    106104
    107105  if (VERBOSE) {
    108     fprintf (stderr, "%d: using %d stars (%d measures) for catalog\n", i,
    109              subcatalog[0].Naverage, subcatalog[0].Nmeasure);
     106    fprintf (stderr, "%lld: using %lld stars (%lld measures) for catalog\n", (long long) i, (long long) subcatalog[0].Naverage, (long long) subcatalog[0].Nmeasure);
    110107   }
    111108  return (TRUE);
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/load_images.c

    r25757 r27312  
    44
    55  Image     *image, *subset;
    6   int        Nimage, Nsubset;
    7   int       *LineNumber;
     6  off_t      Nimage, Nsubset;
     7  off_t     *LineNumber;
    88
    99  SkyTable *sky = NULL;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/select_images.c

    r21508 r27312  
    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;
     18  off_t i, j, k, m, nimage, NIMAGE;
     19  int InRange, found;
    2020  double Ri[5], Di[5], Xi[5], Yi[5], dx, dy;
    21   int *line_number;
     21  off_t *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
     
    161161        NIMAGE += 100;
    162162        REALLOCATE (image, Image, NIMAGE);
    163         REALLOCATE (line_number, int, NIMAGE);
     163        REALLOCATE (line_number, off_t, NIMAGE);
    164164      }
    165165    }
    166166  }
    167167     
    168   if (VERBOSE) fprintf (stderr, "found %d images\n", nimage);
     168  if (VERBOSE) fprintf (stderr, "found %lld images\n", (long long) nimage);
    169169
    170170  REALLOCATE (image, Image, MAX (nimage, 1));
    171   REALLOCATE (line_number, int, MAX (nimage, 1));
     171  REALLOCATE (line_number, off_t, MAX (nimage, 1));
    172172  free (skycoords);
    173173
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h

    r27306 r27312  
    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
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/GridOps.c

    r27305 r27312  
    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;
     
    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;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c

    r27306 r27312  
    165165/* XXX convert this to use the values of measure->Xccd,Yccd */
    166166/* XXX need to apply the conversion for ELIXIR and LONEOS formats */
    167 void matchImage (Catalog *catalog, off_t meas, off_t cat) {
    168 
    169   off_t i, ccdnum;
     167void matchImage (Catalog *catalog, off_t meas, int cat) {
     168
     169  off_t i;
     170  int ccdnum;
    170171  double X, Y;
    171172  char *pname, *filter, *p, base[256];
     
    229230}
    230231
    231 off_t getImageEntry (off_t meas, off_t cat) {
     232off_t getImageEntry (off_t meas, int cat) {
    232233
    233234  off_t i;
     
    237238}
    238239
    239 float getMcal (off_t meas, off_t cat) {
     240float getMcal (off_t meas, int cat) {
    240241
    241242  off_t i;
     
    250251}
    251252
    252 Coords *getCoords (off_t meas, off_t cat) {
     253Coords *getCoords (off_t meas, int cat) {
    253254
    254255  off_t i;
     
    262263void setMcal (Catalog *catalog, int PoorImages) {
    263264
    264   off_t 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;
    265267  float Msys, Mrel, Mmos, Mgrid;
    266268  double *list, *dlist;
     
    360362void clean_images () {
    361363
    362   off_t i, N, mark, Nmark;
     364  int mark, Nmark;
     365  off_t i, N;
    363366  double *mlist, *slist, *dlist;
    364367  double MaxOffset, MaxScatter, MedOffset;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c

    r27306 r27312  
    88static off_t   **bin;    /* catalog, measure -> mosaic */
    99
    10 static off_t   **clist;  /* mosaic -> catalog[] */
     10static int     **clist;  /* mosaic -> catalog[] */
    1111static off_t   **mlist;  /* mosiac -> measure[] */
    1212static off_t    *Nlist;
     
    2626  ALLOCATE (mosaic, Mosaic, NMOSAIC);
    2727
    28   ALLOCATE (imlist, off_t *, NMOSAIC);
    29   ALLOCATE (Nimlist, off_t, NMOSAIC);
    30   ALLOCATE (NIMLIST, off_t, NMOSAIC);
     28  ALLOCATE (imlist,  off_t *, NMOSAIC);
     29  ALLOCATE (Nimlist, off_t,   NMOSAIC);
     30  ALLOCATE (NIMLIST, off_t,   NMOSAIC);
    3131
    3232  /* generate list of unique mosaics */
     
    7878    if (Nmosaic == NMOSAIC) {
    7979      NMOSAIC += 10;
    80       REALLOCATE (mosaic, Mosaic, NMOSAIC);
    81       REALLOCATE (imlist, off_t *, NMOSAIC);
    82       REALLOCATE (Nimlist, off_t, NMOSAIC);
    83       REALLOCATE (NIMLIST, off_t, NMOSAIC);
     80      REALLOCATE (mosaic,  Mosaic, NMOSAIC);
     81      REALLOCATE (imlist,  off_t *, NMOSAIC);
     82      REALLOCATE (Nimlist, off_t,   NMOSAIC);
     83      REALLOCATE (NIMLIST, off_t,   NMOSAIC);
    8484    }
    8585  }
     
    201201
    202202  /* mosaic -> measure */
    203   ALLOCATE (Nlist, off_t, Nmosaic);
    204   ALLOCATE (NLIST, off_t, Nmosaic);
    205   ALLOCATE (clist, off_t *, Nmosaic);
     203  ALLOCATE (Nlist, off_t,   Nmosaic);
     204  ALLOCATE (NLIST, off_t,   Nmosaic);
     205  ALLOCATE (clist, int *,  Nmosaic);
    206206  ALLOCATE (mlist, off_t *, Nmosaic);
    207207
     
    209209    Nlist[i] = 0;
    210210    NLIST[i] = 100;
    211     ALLOCATE (clist[i], off_t, NLIST[i]);
     211    ALLOCATE (clist[i], int,  NLIST[i]);
    212212    ALLOCATE (mlist[i], off_t, NLIST[i]);
    213213  }
     
    239239int findMosaics (Catalog *catalog, int Ncatalog) {
    240240 
     241  int i, ecode;
    241242  off_t j;
    242   int i, ecode;
    243243
    244244  if (!MOSAIC_ZEROPT) return (FALSE);
     
    260260void matchMosaics (Catalog *catalog, off_t meas, int cat) {
    261261
    262   int off_t;
     262  int i;
    263263
    264264  for (i = 0; i < Nmosaic; i++) {
     
    286286    if (Nlist[i] == NLIST[i]) {
    287287      NLIST[i] += 100;
    288       REALLOCATE (clist[i], int, NLIST[i]);
    289       REALLOCATE (mlist[i], int, NLIST[i]);
     288      REALLOCATE (clist[i], int,   NLIST[i]);
     289      REALLOCATE (mlist[i], off_t, NLIST[i]);
    290290    }   
    291291    return;
     
    295295}
    296296
    297 float getMmos (off_t meas, off_t cat) {
     297float getMmos (off_t meas, int cat) {
    298298
    299299  off_t i;
     
    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;
     
    511511    n++;
    512512  }
    513   fprintf (stderr, "Nmosaic: %d, n: %d\n", Nmosaic, n);
     513  fprintf (stderr, "Nmosaic: %lld, n: %lld\n", (long long) Nmosaic, (long long) n);
    514514
    515515  liststats (list, dlist, n, &stats);
     
    591591  }
    592592
    593   fprintf (stderr, "%d mosaics marked poor\n", Nmark);
     593  fprintf (stderr, "%lld mosaics marked poor\n", (long long) Nmark);
    594594  initstats (STATMODE);
    595595  free (mlist);
     
    635635    }
    636636 
    637     sprintf (string, "Mosaic %d", i);
     637    sprintf (string, "Mosaic %lld", (long long) i);
    638638    plot_defaults (&graphdata);
    639639    plot_list (&graphdata, xlist, ylist, N, string, NULL);
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/StarOps.c

    r27305 r27312  
    2020
    2121
    22 float getMrel (Catalog *catalog, int meas, int cat) {
     22float getMrel (Catalog *catalog, off_t meas, int cat) {
    2323
    2424  int ave;
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/select_images.c

    r27305 r27312  
    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));
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setExclusions.c

    r27305 r27312  
    5050    }
    5151  }
    52   if (VERBOSE) fprintf (stderr, "%d measurements marked by area\n", Narea);
    53   if (VERBOSE) fprintf (stderr, "%d measurements marked nocal\n", Nnocal);
    54   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);
    5555  return (TRUE);
    5656}
  • branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setMrelFinal.c

    r27305 r27312  
    6868
    6969  off_t i, k, m;
    70   int ecode, d1, d2;
     70  int ecode;
    7171  off_t Ntot, Ntry, Nkeep, Nskip;
    7272  float mag;
  • branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/ftable.c

    r27295 r27312  
    213213        fprintf (stderr, "missing %s\n", axisname);
    214214      }
    215       fprintf (stdout, " %7d", Nelem);
     215      fprintf (stdout, " %7lld", (long long) Nelem);
    216216    }
    217217    fprintf (stdout, "\n");
     
    358358          if (!strcmp (type, "int64_t")) {
    359359            memcpy (line, &data[i*Nv*Nb + Nb*j], Nb);
    360             fprintf (stdout, "%d ", *(int64_t*)line);
     360            fprintf (stdout, "%lld ", (long long) *(int64_t*)line);
    361361          }
    362362          if (!strcmp (type, "float")) {
  • branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/mktemp.c

    r25757 r27312  
    55# define FALSE 0
    66# define TRUE 1
     7
     8void usage(void);
    79
    810int main (int argc, char **argv) {
     
    9597
    9698  if (make_directory) {
    97     if (mkdtemp (template) == -1) {
     99    if (mkdtemp (template) == NULL) {
    98100      if (!fail_silently) fprintf (stderr, "failed to make temp file from %s\n", template);
    99101      exit (1);
     
    111113}
    112114 
    113 usage() {
     115void usage(void) {
    114116  fprintf (stderr, "Usage: mktemp [-V] | [-dqtu] [-p prefix] [template]\n");
    115117  exit (1);
  • branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/include/uniphot.h

    r21153 r27312  
    9393void          wcatalog           PROTO((Catalog *catalog));
    9494void          wimages            PROTO((Image *image, int Nimage));
    95 void check_permissions (char *basefile);
    96 void lock_image_db (FITS_DB *db, char *filename);
    97 void unlock_image_db (FITS_DB *db);
    98 void create_image_db (FITS_DB *db);
    99 void set_db (FITS_DB *in);
    100 int Shutdown (char *format, ...);
    101 void TrapSignal (int sig);
    102 void SetProtect (int mode);
    103 int SetSignals (void);
    104 int subset_images (FITS_DB *db);
    105 void update (FITS_DB *db, Group *sgroup, int Nsgroup);
    106 void sort_time (unsigned int *value, int N);
     95void          check_permissions  PROTO((char *basefile));
     96void          lock_image_db      PROTO((FITS_DB *db, char *filename));
     97void          unlock_image_db    PROTO((FITS_DB *db));
     98void          create_image_db    PROTO((FITS_DB *db));
     99void          set_db             PROTO((FITS_DB *in));
     100int           Shutdown           PROTO((char *format, ...));
     101void          TrapSignal         PROTO((int sig));
     102void          SetProtect         PROTO((int mode));
     103int           SetSignals         PROTO((void));
     104int           subset_images      PROTO((FITS_DB *db));
     105void          update             PROTO((FITS_DB *db, Group *sgroup, int Nsgroup));
     106void          sort_time          PROTO((unsigned int *value, int N));
  • branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_sgroups.c

    r21508 r27312  
    33Group *find_image_sgroups (FITS_DB *db, ImageLink **Imlink, int *Nsgroup) {
    44
    5   int i, j, Nimage, Ngroup, Nentry, NENTRY;
     5  off_t i, Nimage;
     6  int j, Ngroup, Nentry, NENTRY;
    67  double r, d, x, y, radius;
    78  Group *group;
  • branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_tgroups.c

    r21508 r27312  
    44
    55  char *start, *stop;
    6   int i, j, Nimage, Ngroup, NGROUP, Nentry, NENTRY;
     6  int j, Ngroup, NGROUP, Nentry, NENTRY;
     7  off_t i, Nimage;
    78  unsigned int *time, *tmin, *tmax;
    89  Group *group;
  • branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/subset_images.c

    r21508 r27312  
    33int subset_images (FITS_DB *db) {
    44
    5   int    i, Nimage, equiv;
    6   int    Nkeep, *keep;
     5  off_t i, Nimage, Nkeep, *keep;
     6  int equiv;
    77  Image *image;
    88
     
    1111
    1212  Nkeep = 0;
    13   ALLOCATE (keep, int, Nimage);
     13  ALLOCATE (keep, off_t, Nimage);
    1414
    1515  /* mark images to be calibrated */
  • branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/update.c

    r21508 r27312  
    44void update (FITS_DB *db, Group *sgroup, int Nsgroup) {
    55
    6   int i, j, status, Nmin, Nimage;
     6  off_t i, Nimage;
     7  int j, status, Nmin;
    78  char line[256];
    89  glob_t pglob;
Note: See TracChangeset for help on using the changeset viewer.