Changeset 33229
- Timestamp:
- Feb 10, 2012, 7:28:13 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/uniphot
- Files:
-
- 1 added
- 4 edited
-
Makefile (modified) (1 diff)
-
include/uniphot.h (modified) (1 diff)
-
src/setphot.c (modified) (1 diff)
-
src/update_catalog_setphot.c (modified) (1 diff)
-
src/update_dvo_setphot.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/uniphot/Makefile
r33228 r33229 53 53 $(SRC)/match_zpts_to_images.$(ARCH).o \ 54 54 $(SRC)/match_flatcorr_to_images.$(ARCH).o \ 55 $(SRC)/update_dvo_setphot.$(ARCH).o \ 55 56 $(SRC)/update_catalog_setphot.$(ARCH).o \ 56 57 $(SRC)/SetSignals.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/uniphot/include/uniphot.h
r33228 r33229 134 134 Image *load_images_setphot PROTO((FITS_DB *db, off_t *Nimage)); 135 135 int match_zpts_to_images PROTO((Image *image, off_t Nimage, ZptTable *zpts, int Nzpts)); 136 int update_ setphotPROTO((Image *image, off_t Nimage, FlatCorrectionTable *flatcorr));136 int update_dvo_setphot PROTO((Image *image, off_t Nimage, FlatCorrectionTable *flatcorr)); 137 137 void update_catalog_setphot PROTO((Catalog *catalog, Image *image, off_t *index, off_t Nimage, FlatCorrectionTable *flatcorr)); 138 138 -
branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/setphot.c
r33180 r33229 41 41 } 42 42 43 update_ setphot(image, Nimage, &flatcorrTable);43 update_dvo_setphot (image, Nimage, &flatcorrTable); 44 44 45 45 // write image table -
branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_catalog_setphot.c
r33169 r33229 1 1 # include "uniphot.h" 2 2 # include <glob.h> 3 4 int update_setphot (Image *image, off_t Nimage, FlatCorrectionTable *flatcorr) {5 6 SkyRegion UserPatch;7 SkyTable *sky = NULL;8 SkyList *skylist = NULL;9 Catalog catalog;10 off_t i, maxID, *index;11 12 // create an index for the image IDs13 maxID = 0;14 for (i = 0; i < Nimage; i++) {15 maxID = MAX(maxID, image[i].imageID);16 }17 ALLOCATE (index, off_t, maxID + 1);18 for (i = 0; i < Nimage; i++) {19 if (!image[i].imageID) continue; // images with ID == 0 are virtual20 index[image[i].imageID] = i;21 }22 23 24 // load the current sky table (layout of all SkyRegions)25 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);26 SkyTableSetFilenames (sky, CATDIR, "cpt");27 28 // determine the populated SkyRegions overlapping the requested area (default depth)29 UserPatch.Rmin = 0;30 UserPatch.Rmax = 360;31 UserPatch.Dmin = -90;32 UserPatch.Dmax = +90;33 skylist = SkyListByPatch (sky, -1, &UserPatch);34 35 // update measurements for each populated catalog36 for (i = 0; i < skylist[0].Nregions; i++) {37 38 // set up the basic catalog info39 catalog.filename = skylist[0].filename[i];40 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data41 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data42 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;43 catalog.Nsecfilt = GetPhotcodeNsecfilt ();44 45 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {46 fprintf (stderr, "ERROR: failure reading catalog %s\n", catalog.filename);47 exit (1);48 }49 if (!catalog.Naves_disk) {50 if (VERBOSE) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);51 dvo_catalog_unlock (&catalog);52 dvo_catalog_free (&catalog);53 continue;54 }55 56 update_catalog_setphot (&catalog, image, index, Nimage, flatcorr);57 58 if (!UPDATE) {59 dvo_catalog_unlock (&catalog);60 dvo_catalog_free (&catalog);61 continue;62 }63 64 if (VERBOSE) fprintf (stderr, "saving catalog %s\n", catalog.filename);65 66 dvo_catalog_save (&catalog, VERBOSE);67 dvo_catalog_unlock (&catalog);68 dvo_catalog_free (&catalog);69 }70 return (TRUE);71 }72 3 73 4 void update_catalog_setphot (Catalog *catalog, Image *image, off_t *index, off_t Nimage, FlatCorrectionTable *flatcorr) {
Note:
See TracChangeset
for help on using the changeset viewer.
