Changeset 6968
- Timestamp:
- Apr 24, 2006, 12:54:02 PM (20 years ago)
- Location:
- trunk/Ohana/src/getstar
- Files:
-
- 3 added
- 8 deleted
- 9 edited
-
Makefile (modified) (1 diff)
-
include/getstar.h (modified) (1 diff)
-
src/ConfigInit.c (modified) (3 diffs)
-
src/SetSignals.c (added)
-
src/aregion.c (deleted)
-
src/args.c (modified) (3 diffs)
-
src/clean_stars.c (deleted)
-
src/find_matches.c (deleted)
-
src/gcatalog.c (modified) (3 diffs)
-
src/getstar.c (modified) (4 diffs)
-
src/gimages.c (deleted)
-
src/gregions.c (deleted)
-
src/image-db.c (deleted)
-
src/init_catalog.c (added)
-
src/load_pt_catalog.c (added)
-
src/mkcatalog.c (modified) (2 diffs)
-
src/select_by_region.c (modified) (4 diffs)
-
src/sort_lists.c (deleted)
-
src/wcatalog.c (modified) (1 diff)
-
src/wstars.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/getstar/Makefile
r5242 r6968 19 19 20 20 GETSTAR = \ 21 $(SRC)/getstar.$(ARCH).o $(SRC)/gcatalog.$(ARCH).o \ 22 $(SRC)/gregions.$(ARCH).o $(SRC)/gimages.$(ARCH).o \ 23 $(SRC)/wstars.$(ARCH).o $(SRC)/find_matches.$(ARCH).o \ 24 $(SRC)/sort_lists.$(ARCH).o $(SRC)/ConfigInit.$(ARCH).o \ 25 $(SRC)/aregion.$(ARCH).o $(SRC)/clean_stars.$(ARCH).o \ 26 $(SRC)/args.$(ARCH).o 21 $(SRC)/getstar.$(ARCH).o \ 22 $(SRC)/args.$(ARCH).o \ 23 $(SRC)/ConfigInit.$(ARCH).o \ 24 $(SRC)/Shutdown.$(ARCH).o \ 25 $(SRC)/SetSignals.$(ARCH).o \ 26 $(SRC)/gcatalog.$(ARCH).o \ 27 $(SRC)/load_pt_catalog.$(ARCH).o \ 28 $(SRC)/select_by_region.$(ARCH).o \ 29 $(SRC)/wcatalog.$(ARCH).o \ 30 $(SRC)/init_catalog.$(ARCH).o \ 31 $(SRC)/mkcatalog.$(ARCH).o 27 32 28 33 OBJ = $(GETSTAR) -
trunk/Ohana/src/getstar/include/getstar.h
r6812 r6968 10 10 BY_IMAGE, 11 11 BY_IMMATCH, 12 BY_IMLIST, 12 13 }; 13 14 14 # if (0) 15 typedef struct { 16 double X; 17 double Y; 18 double R; 19 double D; 20 double M, dM; 21 char dophot; 22 double sky; 23 double fx, fy, df; 24 double Mgal, Map; 25 int found; 26 } Stars; 27 # endif 15 int VERBOSE; 16 int MODE; 17 SkyRegion REGION; 18 char *IMAGENAME; 28 19 29 /* global variables set in parameter file */ 30 # if (0) 31 char ImageCat[256]; 32 char ImageTemplate[256]; 33 char CatTemplate[256]; 34 char GSCFILE[256]; 35 char CATDIR[256]; 36 char CATMODE[16]; /* raw, mef, split, mysql */ 37 char CATFORMAT[16]; /* internal, elixir, loneos, panstarrs */ 38 double DEFAULT_RADIUS, NSIGMA, SNLIMIT; 39 double ZeroPt; 40 int SKIP_MISSED; 41 int XOVERSCAN, YOVERSCAN; 42 int XMIN, XMAX, YMIN, YMAX; 43 int ACCEPT_ASTROM; 44 # endif 20 char OUTPUT[256]; 21 char GSCFILE[256]; 22 char CATDIR[256]; 23 char CATMODE[16]; /* raw, mef, split, mysql */ 24 char CATFORMAT[16]; /* internal, elixir, loneos, panstarrs */ 25 char SKY_TABLE[256]; 26 int SKY_DEPTH; 45 27 46 int VERBOSE; 47 int MODE; 48 SkyRegion REGION; 49 char *IMAGENAME; 50 51 PhotCode *thiscode; 52 53 char DateKeyword[64]; 54 char DateMode[64]; 55 char UTKeyword[64]; 56 char MJDKeyword[64]; 57 char JDKeyword[64]; 58 char ExptimeKeyword[64]; 59 char AirmassKeyword[64]; 60 char CCDNumKeyword[64]; 61 62 int CalReference; 63 int CalColor; 64 int CALIBRATE; 65 int DUMP_MATCHES; 66 int ONLY_IMAGES; 28 int args PROTO((int argc, char **argv)); 29 int ConfigInit PROTO((int *argc, char **argv)); 30 int Shutdown PROTO((char *format, ...)); 31 int load_pt_catalog PROTO((Catalog *catalog, SkyRegion *region)); 32 int select_by_region PROTO((Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end)); 33 void set_db PROTO((FITS_DB *in)); 34 void wcatalog PROTO((char *filename, Catalog *catalog)); 35 void mkcatalog PROTO((Catalog *catalog)); 36 void init_catalog PROTO((Catalog *catalog)); 37 void TrapSignal PROTO((int sig)); 38 void SetProtect PROTO((int mode)); 39 int SetSignals PROTO(()); 40 int gcatalog PROTO((Catalog *catalog)); -
trunk/Ohana/src/getstar/src/ConfigInit.c
r4828 r6968 1 1 # include "getstar.h" 2 2 3 ConfigInit (int *argc, char **argv) {3 int ConfigInit (int *argc, char **argv) { 4 4 5 5 char *config, *file; 6 char RadiusWord[80];7 6 char PhotCodeFile[256]; 8 7 … … 17 16 if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file); 18 17 19 ScanConfig (config, "RADIUS", "%s", 0, RadiusWord);20 if (!strcasecmp (RadiusWord, "header")) {21 DEFAULT_RADIUS = 0;22 } else {23 DEFAULT_RADIUS = atof (RadiusWord);24 }25 26 XMIN = XMAX = YMIN = YMAX = 0;27 ScanConfig (config, "NSIGMA", "%lf", 0, &NSIGMA);28 ScanConfig (config, "XOVERSCAN", "%d", 0, &XOVERSCAN);29 ScanConfig (config, "YOVERSCAN", "%d", 0, &YOVERSCAN);30 ScanConfig (config, "ZERO_PT", "%lf", 0, &ZeroPt);31 32 ScanConfig (config, "ADDSTAR_XMIN", "%d", 0, &XMIN);33 ScanConfig (config, "ADDSTAR_XMAX", "%d", 0, &XMAX);34 ScanConfig (config, "ADDSTAR_YMIN", "%d", 0, &YMIN);35 ScanConfig (config, "ADDSTAR_YMAX", "%d", 0, &YMAX);36 37 ScanConfig (config, "IMAGE_CATALOG", "%s", 0, ImageCat);38 ScanConfig (config, "IMAGE_CATALOG_TEMPLATE", "%s", 0, ImageTemplate);39 ScanConfig (config, "CATALOG_TEMPLATE", "%s", 0, CatTemplate);40 18 ScanConfig (config, "GSCFILE", "%s", 0, GSCFILE); 41 19 ScanConfig (config, "CATDIR", "%s", 0, CATDIR); 42 20 ScanConfig (config, "CATMODE", "%s", 0, CATMODE); 43 21 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT); 44 ScanConfig (config, "MIN_SN_FSTAT", "%lf", 0, &SNLIMIT);45 22 ScanConfig (config, "PHOTCODE_FILE", "%s", 0, PhotCodeFile); 46 47 ScanConfig (config, "DATE-KEYWORD", "%s", 0, DateKeyword); 48 ScanConfig (config, "DATE-MODE", "%s", 0, DateMode); 49 ScanConfig (config, "UT-KEYWORD", "%s", 0, UTKeyword); 50 ScanConfig (config, "MJD-KEYWORD", "%s", 0, MJDKeyword); 51 ScanConfig (config, "JD-KEYWORD", "%s", 0, JDKeyword); 52 53 ScanConfig (config, "EXPTIME-KEYWORD", "%s", 0, ExptimeKeyword); 54 ScanConfig (config, "AIRMASS-KEYWORD", "%s", 0, AirmassKeyword); 55 ScanConfig (config, "CCDNUM-KEYWORD", "%s", 0, CCDNumKeyword); 23 if (!ScanConfig (config, "SKY_DEPTH", "%d", 0, &SKY_DEPTH)) { 24 SKY_DEPTH = 2; 25 } 26 if (!ScanConfig (config, "SKY_TABLE", "%s", 0, SKY_TABLE)) { 27 SKY_TABLE[0] = 0; 28 } 56 29 57 30 if (*CATMODE == 0) strcpy (CATMODE, "RAW"); … … 66 39 free (file); 67 40 41 return (TRUE); 68 42 } -
trunk/Ohana/src/getstar/src/args.c
r6239 r6968 8 8 "getstar -image name\n" 9 9 "getstar -immatch partial-name\n\n" 10 "other options:\n" 11 " -smf (file) : return smf file (-image only)\n" 12 " -smp (file) : return smp file (-image only)\n" 13 " -meas (file) : return measurements\n" 14 " -aves (file) : return average / secfilt table *default*\n" 15 " -imtable (file) : return image table\n"); 10 " option options: \n" 11 " -o output : defaults to stdout\n" 12 " -v : verbose mode\n" 13 " -h / -help : this list\n" 14 ); 16 15 exit (2); 17 16 } … … 34 33 if ((N = get_argument (argc, argv, "-v"))) { 35 34 VERBOSE = TRUE; 35 remove_argument (N, &argc, argv); 36 } 37 38 /* check for command line options */ 39 strcpy (OUTPUT, "stdout"); 40 if ((N = get_argument (argc, argv, "-o"))) { 41 remove_argument (N, &argc, argv); 42 strcpy (OUTPUT, argv[N]); 36 43 remove_argument (N, &argc, argv); 37 44 } … … 92 99 } 93 100 if (MODE == BY_NOTHING) help (); 101 return (TRUE); 94 102 } 95 103 -
trunk/Ohana/src/getstar/src/gcatalog.c
r4828 r6968 4 4 5 5 int Nsecfilt; 6 char mode; 7 8 /* no autodetect for CATMODE yet */ 9 strcpy (catalog[0].catmode, CATMODE); 6 int i, j, Nextra, in, out; 7 SecFilt *insec, *outsec; 10 8 11 9 /* read catalog header */ 12 mode = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 13 if (!load_catalog (catalog, mode, VERBOSE)) { 10 if (!load_catalog (catalog, VERBOSE)) { 14 11 fprintf (stderr, "ERROR: failure loading catalog\n"); 15 12 exit (1); … … 20 17 if (catalog[0].Nsecfilt < Nsecfilt) { 21 18 22 int i, j, Nextra, in, out;23 SecFilt *insec, *outsec;24 25 19 Nextra = Nsecfilt - catalog[0].Nsecfilt; 26 20 insec = catalog[0].secfilt; … … 28 22 for (in = out = i = 0; i < catalog[0].Naverage; i++) { 29 23 for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) { 30 outsec[out].M = insec[in].M; 24 outsec[out].M_PS = insec[in].M_PS; 25 outsec[out].dM_PS = insec[in].dM_PS; 31 26 outsec[out].Xm = insec[in].Xm; 32 27 } 33 28 for (j = 0; j < Nextra; j++, out++) { 34 outsec[out].M = NO_MAG; 35 outsec[out].Xm = NO_MAG; 29 outsec[out].M_PS = NO_MAG; 30 outsec[out].dM_PS = NO_MAG; 31 outsec[out].Xm = NO_MAG; 36 32 } 37 33 } -
trunk/Ohana/src/getstar/src/getstar.c
r6812 r6968 1 1 # include "getstar.h" 2 2 3 main (int argc, char **argv) {3 int main (int argc, char **argv) { 4 4 5 int i, Nstars, Nregions; 6 Image *image, *gimages(), *gtimes(), *find_images(); 5 int i; 6 SkyTable *sky; 7 SkyList *skylist; 7 8 Catalog catalog; 8 GSCRegion *region, *tregion, *gregions();9 Stars *stars;10 9 Catalog output; 10 FITS_DB db; 11 11 12 args (argc, argv); 12 13 set_db (&db); … … 16 17 17 18 /* choose elements to load based on options */ 18 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 19 20 Nstars = 0; 21 stars = NULL; 19 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 20 init_catalog (&output); 22 21 23 22 switch (MODE) { … … 45 44 # if (0) 46 45 /* load corresponding sky regions */ 47 skylist = SkyListByImage (sky, -1, &image );46 skylist = SkyListByImage (sky, -1, &image, &Nimage); 48 47 for (i = 0; i < skylist[0].Nregions; i++) { 49 48 catalog.filename = skylist[0].filename[i]; … … 56 55 } 57 56 # endif 57 fprintf (stderr, "error: BY_IMAGE not implemented\n"); 58 exit (1); 58 59 break; 59 60 60 61 case BY_CATALOG: 61 /* not implemented */ 62 fprintf (stderr, "error: BY_CATALOG not implemented\n"); 63 exit (1); 62 64 break; 63 64 /* not implemented */ 65 break; 65 66 default: 67 fprintf (stderr, "error: invalid options\n"); 68 exit (1); 66 69 } 67 70 68 71 /* write out the selected stars */ 69 wcatalog ( argv[2],output);72 wcatalog (OUTPUT, &output); 70 73 fprintf (stderr, "SUCCESS\n"); 71 74 exit (0); -
trunk/Ohana/src/getstar/src/mkcatalog.c
r6812 r6968 1 # include " addstar.h"1 # include "getstar.h" 2 2 3 void mkcatalog ( SkyRegion *region,Catalog *catalog) {3 void mkcatalog (Catalog *catalog) { 4 4 5 int i; 6 double Rmin, Rmax, Dmin, Dmax; 5 7 int length, status; 6 8 char *path, *root, *file, *line; … … 94 96 } 95 97 98 /* determine RA,DEC range */ 99 Rmin = 360.0; 100 Rmax = 0.0; 101 Dmin = +90.0; 102 Dmax = -90.0; 103 for (i = 0; i < catalog[0].Naverage; i++) { 104 Rmin = MIN (Rmin, catalog[0].average[i].R); 105 Rmax = MAX (Rmax, catalog[0].average[i].R); 106 Dmin = MIN (Dmin, catalog[0].average[i].D); 107 Dmax = MAX (Dmax, catalog[0].average[i].D); 108 } 109 96 110 /* write RA,DEC range in header */ 97 fits_modify (&catalog[0].header, "RA0", "%lf", 1, region[0].Rmin);98 fits_modify (&catalog[0].header, "DEC0", "%lf", 1, region[0].Dmin);99 fits_modify (&catalog[0].header, "RA1", "%lf", 1, region[0].Rmax);100 fits_modify (&catalog[0].header, "DEC1", "%lf", 1, region[0].Dmax);111 fits_modify (&catalog[0].header, "RA0", "%lf", 1, Rmin); 112 fits_modify (&catalog[0].header, "DEC0", "%lf", 1, Dmin); 113 fits_modify (&catalog[0].header, "RA1", "%lf", 1, Rmax); 114 fits_modify (&catalog[0].header, "DEC1", "%lf", 1, Dmax); 101 115 102 116 /* write creation date in header */ -
trunk/Ohana/src/getstar/src/select_by_region.c
r6812 r6968 1 1 # include "getstar.h" 2 2 3 /* return 'stars' or return 'average' / 'measure' entries?*/4 boolselect_by_region (Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end) {3 /* add selected catalog objects to the output catalog */ 4 int select_by_region (Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end) { 5 5 6 int i, n, N, NSTARS; 7 int photcode; 6 int i, j, n, Nm, offset, Nsecfilt; 7 int Nave, NAVE, Nmeas, NMEAS; 8 double R, D; 9 10 Nsecfilt = output[0].Nsecfilt; 8 11 9 12 if (output == NULL) Shutdown ("output not defined"); 10 13 11 14 /* identify selection criteria */ 12 if (VERBOSE) fprintf (stderr, "extracting for range %d to %d (photcode %s)\n", start, end, photcode);15 if (VERBOSE) fprintf (stderr, "extracting for range %d to %d\n", start, end); 13 16 14 17 /* select the average objects in this region */ 15 18 Nave = output[0].Naverage; 16 19 NAVE = output[0].Naverage + 1000; 17 REALLOCATE (output[0].average, Average, NOUT); 20 REALLOCATE (output[0].average, Average, NAVE); 21 REALLOCATE (output[0].secfilt, SecFilt, NAVE*Nsecfilt); 18 22 19 23 Nmeas = output[0].Nmeasure; … … 28 32 29 33 if (R < region[0].Rmin) continue; 30 if (R > region[0].Rma n) continue;34 if (R > region[0].Rmax) continue; 31 35 if (D < region[0].Dmin) continue; 32 36 if (D > region[0].Dmax) continue; … … 34 38 output[0].average[Nave] = catalog[0].average[i]; 35 39 output[0].average[Nave].offset = Nmeas; 36 for (j = 0; j < PhotNsec; j++) {37 output[0].secfilt[ PhotNsec*Nave + j] = catalog[0].secfilt[PhotNsec*i + j];40 for (j = 0; j < Nsecfilt; j++) { 41 output[0].secfilt[Nsecfilt*Nave + j] = catalog[0].secfilt[Nsecfilt*i + j]; 38 42 } 39 43 … … 53 57 NAVE += 1000; 54 58 REALLOCATE (output[0].average, Average, NAVE); 55 REALLOCATE (output[0].secfilt, SecFilt, NAVE*PhotNsec); 59 REALLOCATE (output[0].secfilt, SecFilt, NAVE*Nsecfilt); 60 } 56 61 } 57 62 return (TRUE); 58 63 } 59 -
trunk/Ohana/src/getstar/src/wcatalog.c
r6812 r6968 1 # include " uniphot.h"1 # include "getstar.h" 2 2 3 3 void wcatalog (char *filename, Catalog *catalog) { 4 4 5 5 /* CATMODE and CATFORMAT determined from catalog */ 6 // XXX 'stdout' and SPLIT are not compatible 7 8 catalog[0].filename = filename; 9 mkcatalog (catalog); 6 10 7 11 /* open file as appropriate */
Note:
See TracChangeset
for help on using the changeset viewer.
