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:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/getstar/include/dvoImageExtract.h

    r21153 r27435  
    2121int  args_extract        PROTO((int argc, char **argv));
    2222int  ConfigInit_extract  PROTO((int *argc, char **argv));
    23 int  Shutdown            PROTO((char *format, ...));
     23int  Shutdown            PROTO((char *format, ...)) OHANA_FORMAT(printf, 1, 2);
    2424void TrapSignal          PROTO((int sig));
    2525void SetProtect          PROTO((int mode));
     
    3030
    3131int  WriteImageFITS (FILE *f, Image *image);
    32 int  WriteImages (char *filename, Image *images, int Nimages, int *matches, int Nmatches);
    33 int *SelectImages (char *filename, Image *dbImages, int NdbImages, int *Nmatch);
     32int  WriteImages (char *filename, Image *images, off_t Nimages, off_t *matches, off_t Nmatches);
     33off_t *SelectImages (char *filename, Image *dbImages, off_t NdbImages, off_t *Nmatch);
  • trunk/Ohana/src/getstar/include/dvoImageOverlaps.h

    r21153 r27435  
    2424int  args_overlaps       PROTO((int argc, char **argv));
    2525int  ConfigInit_overlaps PROTO((int *argc, char **argv));
    26 int  Shutdown         PROTO((char *format, ...));
     26int  Shutdown         PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2));
    2727void TrapSignal       PROTO((int sig));
    2828void SetProtect       PROTO((int mode));
    2929int  SetSignals       PROTO((void));
    3030
    31 Image *ReadImageFiles (char *filename, int *Nimages);
     31Image *ReadImageFiles (char *filename, off_t *Nimages);
    3232int ReadImageHeader (Header *header, Image *image);
    33 int *MatchImage (Image *dbImages, int NdbImages, Image *image, int *Nmatch);
    34 int ListImageOverlaps (Image *dbImages, Image *image, int *matches, int Nmatches);
     33off_t *MatchImage (Image *dbImages, off_t NdbImages, Image *image, off_t *Nmatch);
     34int ListImageOverlaps (Image *dbImages, Image *image, off_t *matches, off_t Nmatches);
    3535
    3636int GetFileMode (Header *header);
  • trunk/Ohana/src/getstar/include/dvoImagesAtCoords.h

    r26288 r27435  
    3939int  args_coords         PROTO((int argc, char **argv));
    4040int  ConfigInit_coords PROTO((int *argc, char **argv));
    41 int  Shutdown         PROTO((char *format, ...));
     41int  Shutdown         PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2));
    4242void TrapSignal       PROTO((int sig));
    4343void SetProtect       PROTO((int mode));
    4444int  SetSignals       PROTO((void));
    4545
    46 Image *ReadImageFiles (char *filename, int *Nimages);
     46Image *ReadImageFiles (char *filename, off_t *Nimages);
    4747int ReadImageHeader (Header *header, Image *image);
    48 int MatchCoords(Image *, int, Point *, int);
     48off_t MatchCoords (Image *dbImages, off_t NdbImages, Point *points, int Npoints);
    4949
    5050int GetFileMode (Header *header);
  • trunk/Ohana/src/getstar/include/getstar.h

    r21153 r27435  
    3737int  args                    PROTO((int argc, char **argv));
    3838int  ConfigInit              PROTO((int *argc, char **argv));
    39 int  Shutdown                PROTO((char *format, ...));
     39int  Shutdown                PROTO((char *format, ...)) OHANA_FORMAT(printf, 1, 2);
    4040int  load_pt_catalog         PROTO((Catalog *catalog, SkyRegion *region));
    4141int  select_by_region        PROTO((Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end));
  • trunk/Ohana/src/getstar/src/ConfigInit_coords.c

    r27142 r27435  
    44
    55  char *config, *file;
    6   char CatdirPhotcodeFile[256];
    7   char MasterPhotcodeFile[256];
    86
    97  /*** load configuration info ***/
     
    2119  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
    2220  ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
    23   ScanConfig (config, "PHOTCODE_FILE",          "%s",  0, MasterPhotcodeFile);
    2421  if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
    2522    SKY_DEPTH = 2;
  • trunk/Ohana/src/getstar/src/ConfigInit_extract.c

    r25757 r27435  
    44
    55  char *config, *file;
    6   char CatdirPhotcodeFile[256];
    7   char MasterPhotcodeFile[256];
    86
    97  /*** load configuration info ***/
     
    2119  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
    2220  ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
    23   ScanConfig (config, "PHOTCODE_FILE",          "%s",  0, MasterPhotcodeFile);
    2421  if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
    2522    SKY_DEPTH = 2;
     
    3330  if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");
    3431
    35   /* XXX this does not yet write out the master photcode table */
    36   sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
    37   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {
    38     fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
    39     exit (1);
    40   }
    41 
    4232  free (config);
    4333  free (file);
  • trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c

    r25757 r27435  
    44
    55  char *config, *file;
    6   char CatdirPhotcodeFile[256];
    7   char MasterPhotcodeFile[256];
    86
    97  /*** load configuration info ***/
     
    2119  ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
    2220  ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
    23   ScanConfig (config, "PHOTCODE_FILE",          "%s",  0, MasterPhotcodeFile);
    2421  if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
    2522    SKY_DEPTH = 2;
     
    3330  if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");
    3431
    35   /* XXX this does not yet write out the master photcode table */
    36   sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
    37   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, FALSE)) {
    38     fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
    39     exit (1);
    40   }
    41 
    4232  free (config);
    4333  free (file);
  • trunk/Ohana/src/getstar/src/GetFileMode.c

    r19065 r27435  
    88  int simple, extend, haveNaxis, haveCTYPE;
    99
    10   gfits_scan (header, "SIMPLE", "%t", 1, &simple);
     10  gfits_scan_alt (header, "SIMPLE", "%t", 1, &simple);
    1111  haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
    1212  haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
    1313
    14   gfits_scan (header, "EXTEND", "%t", 1, &extend);
     14  gfits_scan_alt (header, "EXTEND", "%t", 1, &extend);
    1515   
    1616  if ((Naxis == 2) || !simple) {
  • trunk/Ohana/src/getstar/src/ListImageOverlaps.c

    r12774 r27435  
    22
    33/* given image, find catalog images which overlap it */
    4 int ListImageOverlaps (Image *dbImages, Image *image, int *matches, int Nmatches) {
     4int ListImageOverlaps (Image *dbImages, Image *image, off_t *matches, off_t Nmatches) {
    55 
    6   int i, N;
     6  off_t i, N;
    77
    88  for (i = 0; i < Nmatches; i++) {
  • trunk/Ohana/src/getstar/src/MatchCoords.c

    r26142 r27435  
    55
    66/* given coordinate, find images in list that contain the point */
    7 int MatchCoords (Image *dbImages, int NdbImages, Point *points, int Npoints) {
     7off_t MatchCoords (Image *dbImages, off_t NdbImages, Point *points, int Npoints) {
    88 
    9   int i, j, N;
     9  off_t i;
     10  int j;
    1011  int totalMatches = 0;
    11   Coords tcoords;
    12   double r, d;
    13   double Xi[4], Yi[4], Xo[4], Yo[4];  /* image and original corners */
    14   double Xmin, Xmax, Ymin, Ymax;
     12  double Xi[4], Yi[4];  /* image and original corners */
    1513  double xmin, xmax, ymin, ymax;
    1614
  • trunk/Ohana/src/getstar/src/MatchImages.c

    r14590 r27435  
    55
    66/* given image, find catalog images which overlap it */
    7 int *MatchImage (Image *dbImages, int NdbImages, Image *image, int *Nmatch) {
     7off_t *MatchImage (Image *dbImages, off_t NdbImages, Image *image, off_t *Nmatch) {
    88 
    9   int i, j, N, addtolist, status;
    10   int NMATCH, nmatch, *match;
     9  off_t i, NMATCH, nmatch, *match;
     10  int j, N, addtolist, status;
    1111  Coords tcoords;
    1212  double r, d;
     
    6464  nmatch = 0;
    6565  NMATCH = 20;
    66   ALLOCATE (match, int, NMATCH);
     66  ALLOCATE (match, off_t, NMATCH);
    6767
    6868  /* setup links for mosaic WRP and DIS entries */
     
    128128    if (nmatch == NMATCH) {
    129129      NMATCH += 20;
    130       REALLOCATE (match, int, NMATCH);
     130      REALLOCATE (match, off_t, NMATCH);
    131131    }
    132132  }
    133133 
    134   if (VERBOSE) fprintf (stderr, "found %d overlapping images\n", nmatch);
     134  if (VERBOSE) fprintf (stderr, "found %lld overlapping images\n", (long long) nmatch);
    135135
    136136  *Nmatch = nmatch;
  • trunk/Ohana/src/getstar/src/ReadImageFiles.c

    r24418 r27435  
    22# define DVO_IMAGE_NAME_LEN 128
    33
    4 Image *ReadImageFiles (char *filename, int *Nimages) {
    5 
    6   int i, j, N, Nfile, Nheader, NHEADER, Nimage, NIMAGE;
    7   int Nskip, Nhead, Ndata, done, status, mode;
     4Image *ReadImageFiles (char *filename, off_t *Nimages) {
     5
     6  off_t Nskip, *extsize;
     7  int i, j, N, Nfile, Nheader, Nimage, NHEADER, NIMAGE;
     8  int Nhead, Ndata, done, status, mode;
    89  char **file, *name;
    910  FILE *f;
    1011  glob_t globList;
    1112  char **exthead, **extdata, **exttype, tmpword[80];
    12   int *extnum_head, *extnum_data, *extsize;
     13  int *extnum_head, *extnum_data;
    1314  Header *header, **headers;
    1415  Image *image;
     
    8990  headers[0] = header;
    9091  Nskip = gfits_data_size (header);
    91   fseek (f, Nskip, SEEK_CUR);
     92  fseeko (f, Nskip, SEEK_CUR);
    9293
    9394  // load all headers into memory
     
    118119  ALLOCATE (extnum_head, int, NIMAGE);
    119120  ALLOCATE (extnum_data, int, NIMAGE);
    120   ALLOCATE (extsize, int, Nheader);
     121  ALLOCATE (extsize, off_t, Nheader);
    121122
    122123  if (mode == MOSAIC_MEF) {
     
    130131  // now examine the headers, count the table entries, find corresponding headers
    131132  for (i = 0; i < Nheader; i++) {
    132       extsize[i] = headers[i][0].size + gfits_data_size (headers[i]);
     133      extsize[i] = headers[i][0].datasize + gfits_data_size (headers[i]);
    133134      gfits_scan (headers[i], "EXTTYPE", "%s", 1, tmpword);
    134135
     
    166167  // extension matched to the header in the PHU
    167168  if (Nimage == 0) {
    168       extsize[0] = headers[0][0].size + gfits_data_size (headers[0]);
    169       extsize[1] = headers[1][0].size + gfits_data_size (headers[1]);
     169      extsize[0] = headers[0][0].datasize + gfits_data_size (headers[0]);
     170      extsize[1] = headers[1][0].datasize + gfits_data_size (headers[1]);
    170171      gfits_scan (headers[1], "EXTNAME", "%s", 1, tmpword);
    171172      if (!strcmp (tmpword, "SMPFILE")) {
  • trunk/Ohana/src/getstar/src/SelectImages.c

    r14590 r27435  
    22
    33/* given image, find catalog images which overlap it */
    4 int *SelectImages (char *filename, Image *images, int Nimages, int *Nmatch) {
     4off_t *SelectImages (char *filename, Image *images, off_t Nimages, off_t *Nmatch) {
    55 
    6   int i, Nchar;
    7   int NMATCH, nmatch, *match;
     6  int Nchar;
     7  off_t i, NMATCH, nmatch, *match;
    88
    99  /* matches here are only based on string comparisons */
     
    1212  nmatch = 0;
    1313  NMATCH = 20;
    14   ALLOCATE (match, int, NMATCH);
     14  ALLOCATE (match, off_t, NMATCH);
    1515
    1616  /* setup links for mosaic WRP and DIS entries */
     
    2727    if (nmatch == NMATCH) {
    2828      NMATCH += 20;
    29       REALLOCATE (match, int, NMATCH);
     29      REALLOCATE (match, off_t, NMATCH);
    3030    }
    3131  } 
    3232
    33   if (VERBOSE) fprintf (stderr, "found %d matching images\n", nmatch);
     33  if (VERBOSE) fprintf (stderr, "found %lld matching images\n", (long long) nmatch);
    3434
    3535  *Nmatch = nmatch;
  • trunk/Ohana/src/getstar/src/WriteImages.c

    r14590 r27435  
    22
    33/* given image, find catalog images which overlap it */
    4 int WriteImages (char *filename, Image *images, int Nimages, int *matches, int Nmatches) {
     4int WriteImages (char *filename, Image *images, off_t Nimages, off_t *matches, off_t Nmatches) {
    55 
    66  int i, N;
  • trunk/Ohana/src/getstar/src/dvoImageExtract.c

    r14590 r27435  
    33int main (int argc, char **argv) {
    44
    5   int Nimages, status;
    6   int Nmatches, *matches;
     5  off_t Nimages, Nmatches, *matches;
     6  int status;
    77  Image *images;
    88  FITS_DB db;
  • trunk/Ohana/src/getstar/src/dvoImageOverlaps.c

    r14590 r27435  
    33int main (int argc, char **argv) {
    44
    5   int i, Nimages, NdbImages, status;
    6   int Nmatches, *matches;
     5  off_t NdbImages, Nimages;
     6  int status;
     7  off_t i, Nmatches, *matches;
    78  Image *images, *dbImages;
    89  FITS_DB db;
  • trunk/Ohana/src/getstar/src/dvoImagesAtCoords.c

    r26288 r27435  
    1212int main (int argc, char **argv) {
    1313
    14   int i, Nimages, NdbImages, status;
    15   int Nmatches, *matches;
     14  off_t NdbImages;
     15  int status;
    1616  Image *dbImages;
    1717  int Npoints;
  • trunk/Ohana/src/getstar/src/select_by_region.c

    r20266 r27435  
    156156  output[0].Nsecf_mem = Nave*Nsecfilt;
    157157
    158   fprintf (stderr, "output catalog has %d stars (%d measures, %d secfilt)\n",
    159            output[0].Naverage, output[0].Nmeasure, output[0].Nsecfilt);
     158  fprintf (stderr, "output catalog has %lld stars (%lld measures, %d secfilt)\n",
     159           (long long) output[0].Naverage, (long long) output[0].Nmeasure, output[0].Nsecfilt);
    160160  return (TRUE);
    161161}
Note: See TracChangeset for help on using the changeset viewer.