Changeset 36617
- Timestamp:
- Mar 29, 2014, 12:54:58 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140206/Ohana/src/relastro/src
- Files:
-
- 5 edited
-
ImagePosIO.c (modified) (3 diffs)
-
MosaicOps.c (modified) (4 diffs)
-
UpdateObjects.c (modified) (3 diffs)
-
relastro_client.c (modified) (2 diffs)
-
select_images.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/ImagePosIO.c
r36616 r36617 53 53 fclose (f); 54 54 55 // a bit annoying :we read the entire block of data, then extract the columns, then set the image structure values.56 // this means I need 3 copies in memory at some point. ugh.55 // we read the entire block of data, then extract the columns, then set the image structure values. 56 // I free the FITS table data after extracting the colums to avoid having 3 copies in memory. 57 57 58 58 char type[16]; … … 77 77 GET_COLUMN (flags, "FLAGS", int); 78 78 79 // free the memory associated with the FITS files 80 gfits_free_header (&header); 81 gfits_free_matrix (&matrix); 82 gfits_free_header (&theader); 83 gfits_free_table (&ftable); 84 79 85 ALLOCATE (image_pos, ImagePos, Nrow); 80 86 for (i = 0; i < Nrow; i++) { … … 120 126 free (nFitAstrom); 121 127 free (flags ); 122 123 gfits_free_header (&header);124 gfits_free_matrix (&matrix);125 gfits_free_header (&theader);126 gfits_free_table (&ftable);127 128 128 129 *nimage_pos = Nrow; -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/MosaicOps.c
r36574 r36617 136 136 ALLOCATE (mosaic_for_images, off_t, Nmosaic_for_images); 137 137 138 // emit an error if we miss mosaics, but stop if we miss too many 139 int NmissMosaic = 0; 140 int NtestMosaic = 0; 141 138 142 /* now assign the WRP images to these mosaics */ 139 143 for (i = 0; i < Nimage; i++) { … … 141 145 142 146 if (strcmp(&image[i].coords.ctype[4], "-WRP")) continue; 147 NtestMosaic ++; 143 148 144 149 /* set image time range */ … … 148 153 Nmos = getMosaicByTimes (start, stop, startMos, stopMos, indexMos); 149 154 if (Nmos == -1) { 150 fprintf (stderr, "cannot match mosaic for %s\n", image[i].name); 155 if (NmissMosaic < 1000) { 156 fprintf (stderr, "cannot match mosaic for %s\n", image[i].name); 157 } 158 NmissMosaic ++; 151 159 continue; 152 160 } … … 165 173 } 166 174 175 fprintf (stderr, "mosaic matching : %d of possible %d failed to match\n", NmissMosaic, NtestMosaic); 176 if (NmissMosaic > 0.5*NtestMosaic) { 177 fprintf (stderr, "serious problem with mosaic matching\n"); 178 exit (5); 179 } 180 167 181 free (startMos); 168 182 free (stopMos); -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/UpdateObjects.c
r36574 r36617 1 1 # include "relastro.h" 2 2 3 static off_t Nmax;3 static off_t Nmax; 4 4 static double *X, *dX; 5 5 static double *Y, *dY; … … 36 36 ALLOCATE (pX, double, MAX (1, Nmax)); 37 37 ALLOCATE (pY, double, MAX (1, Nmax)); 38 } 39 40 void freeObjectData () { 41 42 free (R); 43 free (D); 44 free (T); 45 free (X); 46 free (Y); 47 48 free (dR); 49 free (dD); 50 free (dT); 51 free (dX); 52 free (dY); 53 54 free (pX); 55 free (pY); 38 56 } 39 57 … … 412 430 } 413 431 432 freeObjectData (); 433 414 434 if (VERBOSE) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n", (NaveSum + NpmSum + NparSum), NaveSum, NpmSum, NparSum, NskipSum, NoffSum); 415 435 return (TRUE); -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/relastro_client.c
r36574 r36617 35 35 Catalog *catalog = load_catalogs (skylist, &Ncatalog, TRUE, HOST_ID, HOSTDIR); 36 36 if (!catalog) { 37 fprintf (stderr, "ERROR loading catalogs from %s\n", CATDIR);38 exit (2);37 fprintf (stderr, "ERROR loading catalogs from %s\n", CATDIR); 38 exit (2); 39 39 } 40 40 BrightCatalog *bcatalog = BrightCatalogMerge (catalog, Ncatalog); 41 41 if (!BrightCatalogSave (BCATALOG, bcatalog)) { 42 fprintf (stderr, "ERROR saving bright catalog from %s\n", CATDIR);43 exit (2);42 fprintf (stderr, "ERROR saving bright catalog from %s\n", CATDIR); 43 exit (2); 44 44 } 45 45 break; … … 64 64 } 65 65 66 // XXX loading the images is fairly costly -- see if we can do an image subset 66 // XXX loading the images is fairly costly -- see if we can do an image subset? 67 67 case OP_UPDATE_OFFSETS: { 68 68 FITS_DB db; -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/select_images.c
r36569 r36617 125 125 if (NphotcodesKeep > 0) { 126 126 found = FALSE; 127 // XXX this bit of code excludes DIS mosaics and should be fixed 127 // we have to keep DIS mosaics explicitly (photcode = 0) 128 if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) found = TRUE; 128 129 for (k = 0; (k < NphotcodesKeep) && !found; k++) { 129 130 if (photcodesKeep[k][0].code == timage[i].photcode) found = TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.
