- Timestamp:
- Jul 18, 2015, 8:21:16 AM (11 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 8 edited
-
addstar/include/loadgalphot.h (modified) (1 diff)
-
addstar/src/args_loadgalphot.c (modified) (4 diffs)
-
addstar/src/loadgalphot.c (modified) (1 diff)
-
addstar/src/loadgalphot_readstars.c (modified) (4 diffs)
-
addstar/src/loadgalphot_table.c (modified) (1 diff)
-
libdvo/include/dvodb.h (modified) (1 diff)
-
libdvo/src/dbFields.c (modified) (2 diffs)
-
opihi/dvo/avextract.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/loadgalphot.h
r38553 r38600 36 36 } GalPhotIDset; 37 37 38 AddstarClientOptions args_loadgalphot (int argc, char **argv, AddstarClientOptions options);38 AddstarClientOptions args_loadgalphot (int *argc, char **argv, AddstarClientOptions options); 39 39 40 40 int loadgalphot_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options); 41 41 42 GalPhot_Stars *loadgalphot_readstars (char *filename, int *nstars );42 GalPhot_Stars *loadgalphot_readstars (char *filename, int *nstars, AddstarClientOptions *options); 43 43 44 44 int loadgalphot_sortStars (GalPhot_Stars *stars, int Nstars); -
trunk/Ohana/src/addstar/src/args_loadgalphot.c
r38553 r38600 4 4 static void help (void); 5 5 6 AddstarClientOptions args_loadgalphot (int argc, char **argv, AddstarClientOptions options) {6 AddstarClientOptions args_loadgalphot (int *argc, char **argv, AddstarClientOptions options) { 7 7 8 8 int N; 9 9 10 10 /* check for help request */ 11 if (get_argument ( argc, argv, "-help") ||12 get_argument ( argc, argv, "-h")) {11 if (get_argument (*argc, argv, "-help") || 12 get_argument (*argc, argv, "-h")) { 13 13 help (); 14 14 } … … 27 27 HOST_ID = 0; 28 28 PARALLEL = FALSE; 29 if ((N = get_argument ( argc, argv, "-parallel"))) {29 if ((N = get_argument (*argc, argv, "-parallel"))) { 30 30 PARALLEL = TRUE; 31 remove_argument (N, &argc, argv);31 remove_argument (N, argc, argv); 32 32 } 33 33 // this is a test mode : rather than launching the remote jobs and waiting for completion, 34 34 // relphot will simply list the remote command and wait for the user to signal completion 35 35 PARALLEL_MANUAL = FALSE; 36 if ((N = get_argument ( argc, argv, "-parallel-manual"))) {36 if ((N = get_argument (*argc, argv, "-parallel-manual"))) { 37 37 PARALLEL = TRUE; // -parallel-manual implies -parallel 38 38 PARALLEL_MANUAL = TRUE; 39 remove_argument (N, &argc, argv);39 remove_argument (N, argc, argv); 40 40 } 41 41 // this is a test mode : rather than launching the relphot_client jobs remotely, they are 42 42 // run in serial via 'system' 43 43 PARALLEL_SERIAL = FALSE; 44 if ((N = get_argument ( argc, argv, "-parallel-serial"))) {44 if ((N = get_argument (*argc, argv, "-parallel-serial"))) { 45 45 if (PARALLEL_MANUAL) { 46 46 fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n"); … … 49 49 PARALLEL = TRUE; // -parallel-serial implies -parallel 50 50 PARALLEL_SERIAL = TRUE; 51 remove_argument (N, &argc, argv);51 remove_argument (N, argc, argv); 52 52 } 53 53 54 54 /* only add to existing regions */ 55 55 options.existing_regions = FALSE; 56 if ((N = get_argument ( argc, argv, "-existing-regions"))) {56 if ((N = get_argument (*argc, argv, "-existing-regions"))) { 57 57 options.existing_regions = TRUE; 58 remove_argument (N, &argc, argv);58 remove_argument (N, argc, argv); 59 59 } 60 60 /* only add to existing objects */ 61 61 options.only_match = FALSE; 62 if ((N = get_argument ( argc, argv, "-only-match"))) {62 if ((N = get_argument (*argc, argv, "-only-match"))) { 63 63 options.only_match = TRUE; 64 remove_argument (N, &argc, argv);64 remove_argument (N, argc, argv); 65 65 } 66 66 /* replace measurement, don't duplicate (ref/cat only) */ 67 67 options.replace = FALSE; 68 if ((N = get_argument ( argc, argv, "-replace"))) {68 if ((N = get_argument (*argc, argv, "-replace"))) { 69 69 options.replace = TRUE; 70 remove_argument (N, &argc, argv); 70 remove_argument (N, argc, argv); 71 } 72 /* override any header PHOTCODE values */ 73 options.photcode = 0; 74 if ((N = get_argument (*argc, argv, "-p"))) { 75 remove_argument (N, argc, argv); 76 options.photcode = GetPhotcodeCodebyName (argv[N]); 77 remove_argument (N, argc, argv); 78 } 79 if ((N = get_argument (*argc, argv, "-photcode"))) { 80 remove_argument (N, argc, argv); 81 options.photcode = GetPhotcodeCodebyName (argv[N]); 82 remove_argument (N, argc, argv); 71 83 } 72 84 73 85 /* extra error messages */ 74 86 VERBOSE = FALSE; 75 if ((N = get_argument ( argc, argv, "-v"))) {87 if ((N = get_argument (*argc, argv, "-v"))) { 76 88 VERBOSE = TRUE; 77 remove_argument (N, &argc, argv);89 remove_argument (N, argc, argv); 78 90 } 79 91 80 92 /* other addstar options which cannot be used in loadgalphot */ 81 options.photcode = 0;82 93 options.timeref = 0; 83 94 options.mosaic = FALSE; … … 95 106 DUMP = NULL; 96 107 97 if ( argc < 2) {108 if (*argc < 2) { 98 109 fprintf (stderr, "USAGE: loadgalphot [options] (fitsfile) [..more files]\n"); 99 110 exit (2); -
trunk/Ohana/src/addstar/src/loadgalphot.c
r38553 r38600 14 14 // need to construct these options with args_loadgalphot... 15 15 options = ConfigInit (&argc, argv); 16 options = args_loadgalphot ( argc, argv, options);16 options = args_loadgalphot (&argc, argv, options); 17 17 18 18 // load the full sky description table (dvodb must exist) -
trunk/Ohana/src/addstar/src/loadgalphot_readstars.c
r38553 r38600 15 15 16 16 static float *chisqFit = NULL; 17 18 GalPhot_Stars *loadgalphot_readstars (char *filename, int *nstars) { 17 static float ZeroPt = 0; 18 19 GalPhot_Stars *loadgalphot_readstars (char *filename, int *nstars, AddstarClientOptions *options) { 19 20 20 21 // read in the full FITS files ('cause I don't have a partial read option) … … 67 68 namehash[i][2] = -1; 68 69 } 70 71 ZeroPt = GetZeroPoint(); 69 72 70 73 char name[256], tmpname[256]; … … 228 231 stars[i].galphot.modelType = MODEL_TYPE_gal[i]; 229 232 stars[i].galphot.detID = ID_gal[i]; 233 stars[i].galphot.photcode = options->photcode; 230 234 231 235 // I have a grid of measurements with (Flux, dFlux, Chisq) at each point … … 377 381 378 382 // use bilinear interpolation to choose Flux @ (Xmin,Ymin)? 379 galphot->mag = -2.5*log10(flux[iMin]) ; // correct for exptime?383 galphot->mag = -2.5*log10(flux[iMin]) + ZeroPt; // correct for exptime? 380 384 galphot->magErr = sqrt(fluxErr[iMin]) / flux[iMin]; 381 385 galphot->chisq = chisqMin; -
trunk/Ohana/src/addstar/src/loadgalphot_table.c
r38553 r38600 6 6 int i, Nstars; 7 7 8 GalPhot_Stars *stars = loadgalphot_readstars (filename, &Nstars );8 GalPhot_Stars *stars = loadgalphot_readstars (filename, &Nstars, options); 9 9 10 10 // sort the stars by RA -
trunk/Ohana/src/libdvo/include/dvodb.h
r38153 r38600 304 304 AVE_REF_COLOR_RED, 305 305 AVE_PHOT, // photometry class of values 306 AVE_GAL_MAG, 307 AVE_GAL_MAG_ERR, 308 AVE_GAL_MAJ, 309 AVE_GAL_MAJ_ERR, 310 AVE_GAL_MIN, 311 AVE_GAL_MIN_ERR, 312 AVE_GAL_THETA, 313 AVE_GAL_THETA_ERR, 314 AVE_GAL_INDEX, 315 AVE_GAL_CHISQ, 316 AVE_GAL_NPIX, 317 AVE_GAL_TYPE, 306 318 AVE_E_BV, // extinction (mags) 307 319 AVE_E_BV_ERR, -
trunk/Ohana/src/libdvo/src/dbFields.c
r38153 r38600 159 159 } 160 160 return FALSE; 161 } 162 163 int dbFieldNeedStarpar (dbField *fields, int Nfields, int isAverage) { 164 int i; 165 for (i = 0; i < Nfields; i++) { 166 if (isAverage) { 167 if (fields[i].ID == AVE_E_BV) return TRUE; 168 if (fields[i].ID == AVE_E_BV_ERR) return TRUE; 169 if (fields[i].ID == AVE_DISTANCE_MOD) return TRUE; 170 if (fields[i].ID == AVE_DISTANCE_MOD_ERR) return TRUE; 171 if (fields[i].ID == AVE_M_R) return TRUE; 172 if (fields[i].ID == AVE_M_R_ERR) return TRUE; 173 if (fields[i].ID == AVE_FEH) return TRUE; 174 if (fields[i].ID == AVE_FEH_ERR) return TRUE; 175 if (fields[i].ID == AVE_URA_GALMODEL) return TRUE; 176 if (fields[i].ID == AVE_UDEC_GALMODEL) return TRUE; 177 if (fields[i].ID == AVE_RA_GALMODEL) return TRUE; 178 if (fields[i].ID == AVE_DEC_GALMODEL) return TRUE; 179 } 180 } 161 181 } 162 182 … … 690 710 if (!strcasecmp (fieldName, "REF_COLOR_RED")) ESCAPE (AVE_REF_COLOR_RED, OPIHI_FLT); 691 711 712 if (!strcasecmp (fieldName, "GAL_MAG" )) ESCAPE (AVE_GAL_MAG , OPIHI_FLT); 713 if (!strcasecmp (fieldName, "GAL_MAG_ERR")) ESCAPE (AVE_GAL_MAG_ERR , OPIHI_FLT); 714 if (!strcasecmp (fieldName, "GAL_MAJ" )) ESCAPE (AVE_GAL_MAJ , OPIHI_FLT); 715 if (!strcasecmp (fieldName, "GAL_MAJ_ERR")) ESCAPE (AVE_GAL_MAJ_ERR , OPIHI_FLT); 716 if (!strcasecmp (fieldName, "GAL_MIN" )) ESCAPE (AVE_GAL_MIN , OPIHI_FLT); 717 if (!strcasecmp (fieldName, "GAL_MIN_ERR")) ESCAPE (AVE_GAL_MIN_ERR , OPIHI_FLT); 718 if (!strcasecmp (fieldName, "GAL_THETA" )) ESCAPE (AVE_GAL_THETA , OPIHI_FLT); 719 if (!strcasecmp (fieldName, "GAL_THETA_ERR")) ESCAPE (AVE_GAL_THETA_ERR , OPIHI_FLT); 720 if (!strcasecmp (fieldName, "GAL_INDEX" )) ESCAPE (AVE_GAL_INDEX , OPIHI_FLT); 721 if (!strcasecmp (fieldName, "GAL_CHISQ" )) ESCAPE (AVE_GAL_CHISQ , OPIHI_FLT); 722 if (!strcasecmp (fieldName, "GAL_NPIX" )) ESCAPE (AVE_GAL_NPIX , OPIHI_FLT); 723 if (!strcasecmp (fieldName, "GAL_TYPE" )) ESCAPE (AVE_GAL_TYPE , OPIHI_FLT); 724 692 725 if (!strcasecmp (fieldName, "E_BV")) ESCAPE (AVE_E_BV , OPIHI_FLT); 693 726 if (!strcasecmp (fieldName, "E_BV_ERR")) ESCAPE (AVE_E_BV_ERR , OPIHI_FLT); -
trunk/Ohana/src/opihi/dvo/avextract.c
r38471 r38600 167 167 int needLensobj = dbFieldNeedLensobj (fields, Nfields); 168 168 int needStarpar = dbFieldNeedStarpar (fields, Nfields, TRUE); 169 int needGalphot = dbFieldNeedGalphot (fields, Nfields, TRUE); 169 170 170 171 // grab data from all selected sky regions
Note:
See TracChangeset
for help on using the changeset viewer.
