Changeset 37570
- Timestamp:
- Nov 8, 2014, 7:34:47 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src
- Files:
-
- 2 added
- 12 edited
-
addstar/Makefile (modified) (5 diffs)
-
addstar/include/loadICRF.h (added)
-
addstar/src/args_loadICRF.c (modified) (9 diffs)
-
addstar/src/find_matches_ICRF.c (added)
-
addstar/src/loadICRF.c (modified) (3 diffs)
-
addstar/src/loadICRF_catalog.c (modified) (3 diffs)
-
addstar/src/loadICRF_client.c (modified) (3 diffs)
-
addstar/src/loadICRF_io.c (modified) (7 diffs)
-
addstar/src/loadICRF_make_subset.c (modified) (2 diffs)
-
addstar/src/loadICRF_readstars.c (modified) (3 diffs)
-
addstar/src/loadICRF_remote_hosts.c (modified) (1 diff)
-
addstar/src/loadICRF_save_remote.c (modified) (5 diffs)
-
addstar/src/loadICRF_table.c (modified) (3 diffs)
-
opihi/dvo/images.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/addstar/Makefile
r37422 r37570 26 26 loadstarpar : $(BIN)/loadstarpar.$(ARCH) 27 27 loadstarpar_client : $(BIN)/loadstarpar_client.$(ARCH) 28 loadICRF : $(BIN)/loadICRF.$(ARCH) 29 loadICRF_client : $(BIN)/loadICRF_client.$(ARCH) 28 30 loadwise : $(BIN)/loadwise.$(ARCH) 29 31 dumpskycells : $(BIN)/dumpskycells.$(ARCH) … … 33 35 mkcmf : $(BIN)/mkcmf.$(ARCH) 34 36 35 all: addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell36 37 INSTALL = addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell37 all: addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client loadICRF loadICRF_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell 38 39 INSTALL = addstar addstar_client sedstar load2mass loadstarpar loadstarpar_client loadICRF loadICRF_client skycells mkcmf loadwise loadsupercos dumpskycells findskycell 38 40 39 41 # I need to fix the client/server version of addstar now that I have dropped Stars … … 277 279 $(SRC)/psps_ids.$(ARCH).o 278 280 281 LOAD-ICRF = \ 282 $(SRC)/loadICRF.$(ARCH).o \ 283 $(SRC)/ConfigInit.$(ARCH).o \ 284 $(SRC)/SetSignals.$(ARCH).o \ 285 $(SRC)/Shutdown.$(ARCH).o \ 286 $(SRC)/SkyRegionUtils.$(ARCH).o \ 287 $(SRC)/args_loadICRF.$(ARCH).o \ 288 $(SRC)/find_matches_ICRF.$(ARCH).o \ 289 $(SRC)/loadICRF_catalog.$(ARCH).o \ 290 $(SRC)/loadICRF_io.$(ARCH).o \ 291 $(SRC)/loadICRF_make_subset.$(ARCH).o \ 292 $(SRC)/loadICRF_readstars.$(ARCH).o \ 293 $(SRC)/loadICRF_remote_hosts.$(ARCH).o \ 294 $(SRC)/loadICRF_save_remote.$(ARCH).o \ 295 $(SRC)/loadICRF_table.$(ARCH).o \ 296 $(SRC)/psps_ids.$(ARCH).o 297 298 LOAD-ICRF-CLIENT = \ 299 $(SRC)/loadICRF_client.$(ARCH).o \ 300 $(SRC)/ConfigInit.$(ARCH).o \ 301 $(SRC)/SetSignals.$(ARCH).o \ 302 $(SRC)/Shutdown.$(ARCH).o \ 303 $(SRC)/SkyRegionUtils.$(ARCH).o \ 304 $(SRC)/args_loadICRF.$(ARCH).o \ 305 $(SRC)/find_matches_ICRF.$(ARCH).o \ 306 $(SRC)/loadICRF_catalog.$(ARCH).o \ 307 $(SRC)/loadICRF_io.$(ARCH).o \ 308 $(SRC)/loadICRF_make_subset.$(ARCH).o \ 309 $(SRC)/loadICRF_readstars.$(ARCH).o \ 310 $(SRC)/loadICRF_remote_hosts.$(ARCH).o \ 311 $(SRC)/loadICRF_save_remote.$(ARCH).o \ 312 $(SRC)/loadICRF_table.$(ARCH).o \ 313 $(SRC)/psps_ids.$(ARCH).o 314 279 315 LOAD-WISE = \ 280 316 $(SRC)/loadwise.$(ARCH).o \ … … 356 392 $(LOAD-STARPAR) : $(INC)/addstar.h $(INC)/loadstarpar.h 357 393 $(LOAD-STARPAR-CLIENT) : $(INC)/addstar.h $(INC)/loadstarpar.h 394 $(LOAD-ICRF) : $(INC)/addstar.h $(INC)/loadICRF.h 395 $(LOAD-ICRF-CLIENT) : $(INC)/addstar.h $(INC)/loadICRF.h 358 396 $(LOAD-WISE) : $(INC)/addstar.h $(INC)/WISE.h 359 397 $(MKCMF) : $(INC)/mkcmf.h … … 370 408 $(BIN)/loadstarpar.$(ARCH) : $(LOAD-STARPAR) 371 409 $(BIN)/loadstarpar_client.$(ARCH) : $(LOAD-STARPAR-CLIENT) 410 $(BIN)/loadICRF.$(ARCH) : $(LOAD-ICRF) 411 $(BIN)/loadICRF_client.$(ARCH): $(LOAD-ICRF-CLIENT) 372 412 $(BIN)/loadsupercos.$(ARCH) : $(LOAD-SUPERCOS) 373 413 $(BIN)/skycells.$(ARCH) : $(SKYCELLS) -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/args_loadICRF.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 4 static void help (void); 5 5 static void help_client (void); 6 6 7 AddstarClientOptions args_load starpar(int argc, char **argv, AddstarClientOptions options) {7 AddstarClientOptions args_loadICRF (int argc, char **argv, AddstarClientOptions options) { 8 8 9 9 int N; … … 59 59 remove_argument (N, &argc, argv); 60 60 } 61 /* only add to existing objects */62 options.only_match = FALSE;63 if ((N = get_argument (argc, argv, "-only-match"))) {64 options.only_match = TRUE;65 remove_argument (N, &argc, argv);66 }67 61 /* replace measurement, don't duplicate (ref/cat only) */ 68 62 options.replace = FALSE; … … 79 73 } 80 74 81 /* other addstar options which cannot be used in load starpar*/75 /* other addstar options which cannot be used in loadICRF */ 82 76 options.photcode = 0; 83 77 options.timeref = 0; … … 97 91 98 92 if (argc < 2) { 99 fprintf (stderr, "USAGE: load starpar [options] (fitsfile) [..more files]\n");93 fprintf (stderr, "USAGE: loadICRF [options] (file) [..more files]\n"); 100 94 exit (2); 101 95 } … … 103 97 } 104 98 105 AddstarClientOptions args_load starpar_client (int argc, char **argv, AddstarClientOptions options) {99 AddstarClientOptions args_loadICRF_client (int argc, char **argv, AddstarClientOptions options) { 106 100 107 101 int N; … … 175 169 } 176 170 177 /* other addstar options which cannot be used in load starpar*/171 /* other addstar options which cannot be used in loadICRF */ 178 172 options.photcode = 0; 179 173 options.timeref = 0; … … 193 187 194 188 if (argc != 1) { 195 fprintf (stderr, "USAGE: load starpar_client -cpt (file) -input (file)\n");189 fprintf (stderr, "USAGE: loadICRF_client -cpt (file) -input (file)\n"); 196 190 exit (2); 197 191 } … … 201 195 static void help () { 202 196 203 fprintf (stderr, "USAGE: load starpar[options] (file) [..more files]\n");204 fprintf (stderr, " add data from stellar parameter fileto DVO\n\n");197 fprintf (stderr, "USAGE: loadICRF [options] (file) [..more files]\n"); 198 fprintf (stderr, " add data from ICRF list to DVO\n\n"); 205 199 206 200 fprintf (stderr, " optional flags:\n"); 207 fprintf (stderr, " -only-match : only add measurements to existing objects\n");208 201 fprintf (stderr, " -replace : replace time/photcode measurements (no duplication)\n"); 209 202 fprintf (stderr, " -v : verbose mode\n"); … … 215 208 static void help_client () { 216 209 217 fprintf (stderr, "USAGE: load starpar_client -D CATDIR catdir -hostID ID -hostdir (dir) -cpt (filename) -input (input) [options]\n");210 fprintf (stderr, "USAGE: loadICRF_client -D CATDIR catdir -hostID ID -hostdir (dir) -cpt (filename) -input (input) [options]\n"); 218 211 fprintf (stderr, " add data from stellar parameter file to DVO\n\n"); 219 212 220 213 fprintf (stderr, " optional flags:\n"); 221 fprintf (stderr, " -only-match : only add measurements to existing objects\n");222 214 fprintf (stderr, " -replace : replace time/photcode measurements (no duplication)\n"); 223 215 fprintf (stderr, " -v : verbose mode\n"); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 /* This is the DVO program to upload Greg Green's stellar parametersq into a DVO database.5 It is modeled on the loadwise program and is expected to be run only rarely (once?).6 The stellar parameter data are delivered as *.fits files. It does not allow a subset7 of the sky to be uploaded; entire stellar parameter files are loaded if supplied on the8 command line.4 /* This is the DVO program to upload ICRF QSO data (eg, from Leonid Petrov) into a DVO 5 database. It is modeled on the loadstarpar program and is expected to be run only 6 rarely (once?). The ICRF QSO parameter data are delivered as text file. It does not 7 allow a subset of the sky to be uploaded; entire QSO parameter files are loaded if 8 supplied on the command line. 9 9 10 USAGE: load starpar-D CATDIR (catdir) (file.fits) [...more files]10 USAGE: loadICRF -D CATDIR (catdir) (file.fits) [...more files] 11 11 */ 12 12 … … 16 16 AddstarClientOptions options; 17 17 18 // need to construct these options with args_loadstarpar...19 18 options = ConfigInit (&argc, argv); 20 options = args_load starpar (argc, argv, options);19 options = args_loadICRF (argc, argv, options); // XXX fix args after rest is done 21 20 22 21 // load the full sky description table (dvodb must exist) … … 47 46 SkyList *skylist = SkyListByPatch (sky, -1, &UserPatch); 48 47 48 // argv[i] are a list of input tables; load one at a time 49 49 for (i = 1; i < argc; i++) { 50 50 fprintf (stderr, "loading %s\n", argv[i]); 51 load starpar_table (skylist, hosts, argv[i], &options);51 loadICRF_table (skylist, hosts, argv[i], &options); 52 52 } 53 53 exit (0); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_catalog.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 int load starpar_catalog (StarPar_Stars *stars, int Nstars, SkyRegion *region, char *filename, AddstarClientOptions *options) {4 int loadICRF_catalog (ICRF_Stars *stars, int Nstars, SkyRegion *region, char *filename, AddstarClientOptions *options) { 5 5 6 6 Catalog catalog; … … 10 10 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 11 11 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 12 catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_ STARPAR;12 catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_MEAS; 13 13 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 14 14 … … 19 19 } 20 20 21 find_matches_ starpar(region, stars, Nstars, &catalog, options);21 find_matches_ICRF (region, stars, Nstars, &catalog, options); 22 22 23 23 dvo_catalog_save (&catalog, VERBOSE); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_client.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 4 int main (int argc, char **argv) { … … 6 6 AddstarClientOptions options; 7 7 8 // need to construct these options with args_load starpar...8 // need to construct these options with args_loadICRF... 9 9 options = ConfigInit (&argc, argv); 10 options = args_load starpar_client (argc, argv, options);10 options = args_loadICRF_client (argc, argv, options); 11 11 12 12 // client is called with a pointer to the file to be loaded … … 18 18 19 19 int Nstars; 20 StarPar_Stars *stars = loadstarpar_load_stars (INPUT, &Nstars);20 ICRF_Stars *stars = loadICRF_load_stars (INPUT, &Nstars); 21 21 22 load starpar_catalog (stars, Nstars, skylist->regions[0], CPT_FILE, &options);22 loadICRF_catalog (stars, Nstars, skylist->regions[0], CPT_FILE, &options); 23 23 24 24 free (stars); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_io.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 int load starpar_save_stars (char *filename, StarPar_Stars *stars, int Nstars) {4 int loadICRF_save_stars (char *filename, ICRF_Stars *stars, int Nstars) { 5 5 6 6 Header header; … … 24 24 gfits_free_matrix (&matrix); 25 25 26 gfits_create_table_header (&theader, "BINTABLE", " STARPAR");26 gfits_create_table_header (&theader, "BINTABLE", "ICRF"); 27 27 28 28 gfits_define_bintable_column (&theader, "D", "RA", "", "degree", 1.0, 0.0); 29 29 gfits_define_bintable_column (&theader, "D", "DEC", "", "degree", 1.0, 0.0); 30 gfits_define_bintable_column (&theader, "E", "GLON", "", "degree", 1.0, 0.0); 31 gfits_define_bintable_column (&theader, "D", "GLAT", "", "degree", 1.0, 0.0); 32 gfits_define_bintable_column (&theader, "E", "Ebv", "", "", 1.0, 0.0); 33 gfits_define_bintable_column (&theader, "E", "dEbv", "", "", 1.0, 0.0); 34 gfits_define_bintable_column (&theader, "E", "DistMag", "", "", 1.0, 0.0); 35 gfits_define_bintable_column (&theader, "E", "dDistMag", "", "", 1.0, 0.0); 36 gfits_define_bintable_column (&theader, "E", "M_r", "", "", 1.0, 0.0); 37 gfits_define_bintable_column (&theader, "E", "dM_r", "", "", 1.0, 0.0); 38 gfits_define_bintable_column (&theader, "E", "FeH", "", "", 1.0, 0.0); 39 gfits_define_bintable_column (&theader, "E", "dFeH", "", "", 1.0, 0.0); 40 gfits_define_bintable_column (&theader, "J", "averef", "", "", 1.0, FT_BZERO_INT32); 41 gfits_define_bintable_column (&theader, "J", "objID", "", "", 1.0, FT_BZERO_INT32); 42 gfits_define_bintable_column (&theader, "J", "catID", "", "", 1.0, FT_BZERO_INT32); 30 gfits_define_bintable_column (&theader, "E", "RA_ERR", "", "arcsec", 1.0, 0.0); 31 gfits_define_bintable_column (&theader, "E", "DEC_ERR", "", "arcsec", 1.0, 0.0); 32 gfits_define_bintable_column (&theader, "E", "F_PSF", "", "", 1.0, 0.0); 33 gfits_define_bintable_column (&theader, "E", "dF_PSF", "", "", 1.0, 0.0); 34 gfits_define_bintable_column (&theader, "E", "F_AP", "", "", 1.0, 0.0); 35 gfits_define_bintable_column (&theader, "E", "dF_AP", "", "", 1.0, 0.0); 36 gfits_define_bintable_column (&theader, "E", "M_PSF", "", "", 1.0, 0.0); 37 gfits_define_bintable_column (&theader, "E", "dM_PSF", "", "", 1.0, 0.0); 38 gfits_define_bintable_column (&theader, "E", "M_AP", "", "", 1.0, 0.0); 39 gfits_define_bintable_column (&theader, "E", "dM_AP", "", "", 1.0, 0.0); 40 gfits_define_bintable_column (&theader, "J", "PHOTCODE", "", "", 1.0, FT_BZERO_INT32); 41 gfits_define_bintable_column (&theader, "J", "FLAGS", "", "", 1.0, FT_BZERO_INT32); 43 42 44 43 int i; 45 double *ra = NULL; ALLOCATE (ra , double , Nstars); for (i = 0; i < Nstars; i++) ra [i] = stars[i].starpar.R ; 46 double *dec = NULL; ALLOCATE (dec , double , Nstars); for (i = 0; i < Nstars; i++) dec [i] = stars[i].starpar.D ; 47 float *glon = NULL; ALLOCATE (glon , float , Nstars); for (i = 0; i < Nstars; i++) glon [i] = stars[i].starpar.galLon ; 48 float *glat = NULL; ALLOCATE (glat , float , Nstars); for (i = 0; i < Nstars; i++) glat [i] = stars[i].starpar.galLat ; 49 float *Ebv = NULL; ALLOCATE (Ebv , float , Nstars); for (i = 0; i < Nstars; i++) Ebv [i] = stars[i].starpar.Ebv ; 50 float *dEbv = NULL; ALLOCATE (dEbv , float , Nstars); for (i = 0; i < Nstars; i++) dEbv [i] = stars[i].starpar.dEbv ; 51 float *DistMag = NULL; ALLOCATE (DistMag , float , Nstars); for (i = 0; i < Nstars; i++) DistMag [i] = stars[i].starpar.DistMag ; 52 float *dDistMag = NULL; ALLOCATE (dDistMag, float , Nstars); for (i = 0; i < Nstars; i++) dDistMag[i] = stars[i].starpar.dDistMag; 53 float *M_r = NULL; ALLOCATE (M_r , float , Nstars); for (i = 0; i < Nstars; i++) M_r [i] = stars[i].starpar.M_r ; 54 float *dM_r = NULL; ALLOCATE (dM_r , float , Nstars); for (i = 0; i < Nstars; i++) dM_r [i] = stars[i].starpar.dM_r ; 55 float *FeH = NULL; ALLOCATE (FeH , float , Nstars); for (i = 0; i < Nstars; i++) FeH [i] = stars[i].starpar.FeH ; 56 float *dFeH = NULL; ALLOCATE (dFeH , float , Nstars); for (i = 0; i < Nstars; i++) dFeH [i] = stars[i].starpar.dFeH ; 57 unsigned int *averef = NULL; ALLOCATE (averef , unsigned int, Nstars); for (i = 0; i < Nstars; i++) averef [i] = stars[i].starpar.averef ; 58 unsigned int *objID = NULL; ALLOCATE (objID , unsigned int, Nstars); for (i = 0; i < Nstars; i++) objID [i] = stars[i].starpar.objID ; 59 unsigned int *catID = NULL; ALLOCATE (catID , unsigned int, Nstars); for (i = 0; i < Nstars; i++) catID [i] = stars[i].starpar.catID ; 44 double *ra = NULL; ALLOCATE (ra , double , Nstars); for (i = 0; i < Nstars; i++) ra [i] = stars[i].R ; 45 double *dec = NULL; ALLOCATE (dec , double , Nstars); for (i = 0; i < Nstars; i++) dec [i] = stars[i].D ; 46 float *dR = NULL; ALLOCATE (dR , float , Nstars); for (i = 0; i < Nstars; i++) dR [i] = stars[i].measure.dXccd ; 47 float *dD = NULL; ALLOCATE (dD , float , Nstars); for (i = 0; i < Nstars; i++) dD [i] = stars[i].measure.dYccd ; 48 float *Fpsf = NULL; ALLOCATE (Fpsf , float , Nstars); for (i = 0; i < Nstars; i++) Fpsf [i] = stars[i].measure.FluxPSF ; 49 float *dFpsf = NULL; ALLOCATE (dFpsf , float , Nstars); for (i = 0; i < Nstars; i++) dFpsf [i] = stars[i].measure.dFluxPSF; 50 float *Fap = NULL; ALLOCATE (Fap , float , Nstars); for (i = 0; i < Nstars; i++) Fap [i] = stars[i].measure.FluxAp ; 51 float *dFap = NULL; ALLOCATE (dFap , float , Nstars); for (i = 0; i < Nstars; i++) dFap [i] = stars[i].measure.dFluxAp ; 52 float *Mpsf = NULL; ALLOCATE (Mpsf , float , Nstars); for (i = 0; i < Nstars; i++) Mpsf [i] = stars[i].measure.M ; 53 float *dMpsf = NULL; ALLOCATE (dMpsf , float , Nstars); for (i = 0; i < Nstars; i++) dMpsf [i] = stars[i].measure.dM ; 54 float *Map = NULL; ALLOCATE (Map , float , Nstars); for (i = 0; i < Nstars; i++) Map [i] = stars[i].measure.Map ; 55 float *dMap = NULL; ALLOCATE (dMap , float , Nstars); for (i = 0; i < Nstars; i++) dMap [i] = stars[i].measure.dMap ; 56 unsigned int *photcode = NULL; ALLOCATE (photcode, unsigned int, Nstars); for (i = 0; i < Nstars; i++) photcode[i] = stars[i].measure.photcode; 57 unsigned int *flags = NULL; ALLOCATE (flags , unsigned int, Nstars); for (i = 0; i < Nstars; i++) flags [i] = stars[i].measure.dbFlags ; 60 58 61 59 // generate the output array that carries the data … … 65 63 gfits_set_bintable_column (&theader, &ftable, "RA", ra , Nstars); 66 64 gfits_set_bintable_column (&theader, &ftable, "DEC", dec , Nstars); 67 gfits_set_bintable_column (&theader, &ftable, "GLON", glon , Nstars); 68 gfits_set_bintable_column (&theader, &ftable, "GLAT", glat , Nstars); 69 gfits_set_bintable_column (&theader, &ftable, "Ebv", Ebv , Nstars); 70 gfits_set_bintable_column (&theader, &ftable, "dEbv", dEbv , Nstars); 71 gfits_set_bintable_column (&theader, &ftable, "DistMag", DistMag , Nstars); 72 gfits_set_bintable_column (&theader, &ftable, "dDistMag", dDistMag, Nstars); 73 gfits_set_bintable_column (&theader, &ftable, "M_r", M_r , Nstars); 74 gfits_set_bintable_column (&theader, &ftable, "dM_r", dM_r , Nstars); 75 gfits_set_bintable_column (&theader, &ftable, "FeH", FeH , Nstars); 76 gfits_set_bintable_column (&theader, &ftable, "dFeH", dFeH , Nstars); 77 gfits_set_bintable_column (&theader, &ftable, "averef", averef , Nstars); 78 gfits_set_bintable_column (&theader, &ftable, "objID", objID , Nstars); 79 gfits_set_bintable_column (&theader, &ftable, "catID", catID , Nstars); 65 gfits_set_bintable_column (&theader, &ftable, "RA_ERR", dR , Nstars); 66 gfits_set_bintable_column (&theader, &ftable, "DEC_ERR", dD , Nstars); 67 gfits_set_bintable_column (&theader, &ftable, "F_PSF", Fpsf , Nstars); 68 gfits_set_bintable_column (&theader, &ftable, "dF_PSF", dFpsf , Nstars); 69 gfits_set_bintable_column (&theader, &ftable, "F_AP", Fap , Nstars); 70 gfits_set_bintable_column (&theader, &ftable, "dF_AP", dFap , Nstars); 71 gfits_set_bintable_column (&theader, &ftable, "M_PSF", Mpsf , Nstars); 72 gfits_set_bintable_column (&theader, &ftable, "dM_PSF", dMpsf , Nstars); 73 gfits_set_bintable_column (&theader, &ftable, "M_AP", Map , Nstars); 74 gfits_set_bintable_column (&theader, &ftable, "dM_AP", dMap , Nstars); 75 gfits_set_bintable_column (&theader, &ftable, "PHOTCODE", photcode, Nstars); 76 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags , Nstars); 80 77 81 78 gfits_fwrite_Theader (f, &theader); … … 92 89 myAssert (!strcmp(type, #TYPE), "wrong column type"); 93 90 94 StarPar_Stars *loadstarpar_load_stars (char *filename, int *nstars) {91 ICRF_Stars *loadICRF_load_stars (char *filename, int *nstars) { 95 92 96 93 int i, Ncol; … … 98 95 char type[16]; 99 96 100 StarPar_Stars *stars = NULL;97 ICRF_Stars *stars = NULL; 101 98 102 99 Header header; … … 134 131 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) goto escape; 135 132 136 GET_COLUMN(ra , "RA" , double); 137 GET_COLUMN(dec , "DEC" , double); 138 GET_COLUMN(glon , "GLON" , float); 139 GET_COLUMN(glat , "GLAT" , float); 140 GET_COLUMN(Ebv , "Ebv" , float); 141 GET_COLUMN(dEbv , "dEbv" , float); 142 GET_COLUMN(DistMag , "DistMag" , float); 143 GET_COLUMN(dDistMag, "dDistMag" , float); 144 GET_COLUMN(M_r , "M_r" , float); 145 GET_COLUMN(dM_r , "dM_r" , float); 146 GET_COLUMN(FeH , "FeH" , float); 147 GET_COLUMN(dFeH , "dFeH" , float); 148 GET_COLUMN(averef , "averef" , unsigned int); 149 GET_COLUMN(objID , "objID" , unsigned int); 150 GET_COLUMN(catID , "catID" , unsigned int); 133 GET_COLUMN(ra , "RA", double); 134 GET_COLUMN(dec , "DEC", double); 135 GET_COLUMN(dR , "RA_ERR", float); 136 GET_COLUMN(dD , "DEC_ERR", float); 137 GET_COLUMN(Fpsf , "F_PSF", float); 138 GET_COLUMN(dFpsf , "dF_PSF", float); 139 GET_COLUMN(Fap , "F_AP", float); 140 GET_COLUMN(dFap , "dF_AP", float); 141 GET_COLUMN(Mpsf , "M_PSF", float); 142 GET_COLUMN(dMpsf , "dM_PSF", float); 143 GET_COLUMN(Map , "M_AP", float); 144 GET_COLUMN(dMap , "dM_AP", float); 145 GET_COLUMN(photcode, "PHOTCODE", unsigned int); 146 GET_COLUMN(flags , "FLAGS", unsigned int); 151 147 152 148 gfits_free_header (&theader); … … 155 151 gfits_free_matrix (&matrix); 156 152 157 ALLOCATE (stars, StarPar_Stars, Nrow);153 ALLOCATE (stars, ICRF_Stars, Nrow); 158 154 159 155 for (i = 0; i < Nrow; i++) { 160 stars[i].R = ra [i];161 stars[i]. D = dec[i];162 stars[i]. starpar.R = ra[i];163 stars[i]. starpar.D = dec[i];164 stars[i]. starpar.galLon = glon[i];165 stars[i]. starpar.galLat = glat[i];166 stars[i]. starpar.Ebv = Ebv[i];167 stars[i]. starpar.dEbv = dEbv[i];168 stars[i]. starpar.DistMag = DistMag[i];169 stars[i]. starpar.dDistMag = dDistMag[i];170 stars[i]. starpar.M_r = M_r[i];171 stars[i]. starpar.dM_r = dM_r[i];172 stars[i]. starpar.FeH = FeH[i];173 stars[i]. starpar.dFeH = dFeH[i];174 stars[i]. starpar.averef = averef[i];175 stars[i]. starpar.objID = objID[i];176 stars[i]. starpar.catID = catID[i];156 InitICRF_Star (&stars[i]); 157 stars[i].R = ra [i]; 158 stars[i].D = dec [i]; 159 stars[i].measure.R = ra [i]; 160 stars[i].measure.D = dec [i]; 161 stars[i].measure.dXccd = dR [i]; 162 stars[i].measure.dYccd = dD [i]; 163 stars[i].measure.FluxPSF = Fpsf [i]; 164 stars[i].measure.dFluxPSF= dFpsf [i]; 165 stars[i].measure.FluxAp = Fap [i]; 166 stars[i].measure.dFluxAp = dFap [i]; 167 stars[i].measure.M = Mpsf [i]; 168 stars[i].measure.dM = dMpsf [i]; 169 stars[i].measure.Map = Map [i]; 170 stars[i].measure.dMap = dMap [i]; 171 stars[i].measure.photcode= photcode[i]; 172 stars[i].measure.dbFlags = flags [i]; 177 173 } 178 174 -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_make_subset.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 4 // assign stars in the given region to the subset (NOTE: stars are sorted by RA, start is 5 5 // first entry in stars array in this region) 6 6 7 StarPar_Stars *loadstarpar_make_subset (StarPar_Stars *stars, int Nstars, int start, SkyRegion *region, int *nsubset) {7 ICRF_Stars *loadICRF_make_subset (ICRF_Stars *stars, int Nstars, int start, SkyRegion *region, int *nsubset) { 8 8 9 9 int i; 10 10 11 StarPar_Stars *subset = NULL;11 ICRF_Stars *subset = NULL; 12 12 13 13 // collect array of (Stars *) stars in a new output catalog 14 14 int Nsubset = 0; 15 15 int NSUBSET = 3000; 16 ALLOCATE (subset, StarPar_Stars, NSUBSET);16 ALLOCATE (subset, ICRF_Stars, NSUBSET); 17 17 18 18 // find the rest of the stars in this output region … … 35 35 Nsubset ++; 36 36 37 stars[i].flag = TRUE; 37 stars[i].flag = TRUE; // set flag for stars we have already assigned to a subset 38 38 39 CHECK_REALLOCATE (subset, StarPar_Stars, NSUBSET, Nsubset, 10000);39 CHECK_REALLOCATE (subset, ICRF_Stars, NSUBSET, Nsubset, 10000); 40 40 } 41 41 -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_readstars.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 # define GET_COLUMN(OUT,NAME,TYPE) \ 5 TYPE *OUT = gfits_get_bintable_column_data (&theader, &ftable, NAME, type, &Nrow, &Ncol); \ 6 myAssert (!strcmp(type, #TYPE), "wrong column type"); 4 // ICRF table is ASCII text, with the following interesting columns (fixed bytes) 5 // 0 : type (C - calibrator, N - non-calibrator, U - unreliable) 6 // 3 - 21 : names (make into an extID?) 7 // 24 - 39 : RA (ICRF) 8 // 40 - 55 : DEC (ICRF) 9 // 57 - 62 : dR (mas) [use dX,dY in milliarcsec 'pixels'] 10 // 64 - 69 : dD (mas) 11 // 79 - 84 : Number of observations used (put in dt?) 12 // 87 - 92 : S-band total flux density integrated over entire map, Jy (note 87 may be <) : 13 // 94 - 99 : S-band unresolved flux density at long VLBA baselines, Jy 14 // 102 - 107 : C-band total flux density integrated over entire map, Jy 15 // 109 - 114 : C-band unresolved flux density at long VLBA baselines, Jy 16 // 117 - 122 : X-band total flux density integrated over entire map, Jy 17 // 124 - 129 : X-band unresolved flux density at long VLBA baselines, Jy 18 // 132 - 137 : U-band total flux density integrated over entire map, Jy 19 // 139 - 144 : U-band unresolved flux density at long VLBA baselines, Jy 20 // 147 - 152 : K-band total flux density integrated over entire map, Jy 21 // 154 - 159 : K-band unresolved flux density at long VLBA baselines, Jy 7 22 8 StarPar_Stars *loadstarpar_readstars (char *filename, int *nstars) { 23 // I'm going to save these are FluxPSF (total), FluxAp (unresolved), and mags for 24 // the signficant ones (AB_m from Jy). Use new photcodes to represent C,X,U,K 25 26 /* 27 # IVS name J2000 name Right ascension Declination D_alp D_Del Corr #Obs S-band flux C-band Flux X-band Flux U-band flux K-band Flux Type Cat 28 # Total Unres Total Unres Total Unres Total Unres Total Unres 29 # hr mn seconds deg mn seconds mas mas Jy Jy Jy Jy Jy Jy Jy Jy Jy Jy 30 C 2357+080 J0000+0816 00 00 07.031141 +08 16 45.05175 0.46 0.85 0.758 41 -1.00 -1.00 -1.00 -1.00 0.020 <0.014 -1.00 -1.00 -1.00 -1.00 X rfc_2014c 31 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 32 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 33 */ 34 35 36 int loadICRF_addstar(ICRF_Stars *star, float fluxPSF, float fluxAp, double R, double D, float dX, float dY, int photcode); 37 38 ICRF_Stars *loadICRF_readstars (char *filename, int *nstars) { 9 39 10 40 // read in the full FITS files ('cause I don't have a partial read option) … … 12 42 if (f == NULL) Shutdown ("can't read stellar parameter file: %s", filename); 13 43 14 int i, Ncol; 15 off_t Nrow; 44 int Nstars = 0; 45 int NSTARS = 1000; 46 ICRF_Stars *stars = NULL; 47 ALLOCATE (stars, ICRF_Stars, NSTARS); 16 48 17 Header header; 18 Matrix matrix; 19 Header theader; 20 FTable ftable; 21 22 // load in PHU segment (ignore) 23 if (!gfits_fread_header (f, &header)) { 24 if (VERBOSE) fprintf (stderr, "can't read image subset header\n"); 25 fclose (f); 26 return NULL; 49 double R, D; 50 51 // ICRF QSO photcodes (we store flux in Jy and AB mags) 52 PhotCode *codeS = GetPhotcodebyName ("ICRF_S"); 53 PhotCode *codeC = GetPhotcodebyName ("ICRF_C"); 54 PhotCode *codeX = GetPhotcodebyName ("ICRF_X"); 55 PhotCode *codeU = GetPhotcodebyName ("ICRF_U"); 56 PhotCode *codeK = GetPhotcodebyName ("ICRF_K"); 57 58 /* read in stars line-by-line */ 59 char line[1024]; 60 while (scan_line (f, line) != EOF) { 61 stripwhite (line); 62 if (line[0] == 0) continue; 63 if (line[0] == '#') continue; 64 65 // objects with values other than "C" in the first column are not good for 66 // calibration, so just skip. 67 if (line[0] != 'C') continue; 68 69 // terminate the partial strings containing RA and DEC: 70 char cr = line[39]; line[39] = 0; 71 char cd = line[55]; line[55] = 0; 72 73 if (!ohana_str_to_radec (&R, &D, &line[24], &line[40])) { 74 line[39] = cr; 75 line[55] = cd; 76 fprintf (stderr, "problem with coords: %s\n", line); 77 exit (1); 78 } 79 R = ohana_normalize_angle (R); 80 81 line[63] = 0; 82 float dR = atof(&line[57]); 83 line[70] = 0; 84 float dD = atof(&line[64]); 85 86 int dX = 1000.0*100*dR; 87 int dY = 1000.0*100*dD; 88 89 // XXX set this somewhere? 90 // line[85] = 0; 91 // int Nmeas = atoi(&line[79]); 92 93 line[ 93] = 0; float fluxSt = (line[ 87] == '<') ? NAN : atof(&line[ 87]); if (fluxSt == -1.0) fluxSt = NAN; 94 line[100] = 0; float fluxSu = (line[ 94] == '<') ? NAN : atof(&line[ 94]); if (fluxSu == -1.0) fluxSu = NAN; 95 line[108] = 0; float fluxCt = (line[102] == '<') ? NAN : atof(&line[102]); if (fluxCt == -1.0) fluxCt = NAN; 96 line[115] = 0; float fluxCu = (line[109] == '<') ? NAN : atof(&line[109]); if (fluxCu == -1.0) fluxCu = NAN; 97 line[123] = 0; float fluxXt = (line[117] == '<') ? NAN : atof(&line[117]); if (fluxXt == -1.0) fluxXt = NAN; 98 line[130] = 0; float fluxXu = (line[124] == '<') ? NAN : atof(&line[124]); if (fluxXu == -1.0) fluxXu = NAN; 99 line[138] = 0; float fluxUt = (line[132] == '<') ? NAN : atof(&line[132]); if (fluxUt == -1.0) fluxUt = NAN; 100 line[145] = 0; float fluxUu = (line[139] == '<') ? NAN : atof(&line[139]); if (fluxUu == -1.0) fluxUu = NAN; 101 line[153] = 0; float fluxKt = (line[147] == '<') ? NAN : atof(&line[147]); if (fluxKt == -1.0) fluxKt = NAN; 102 line[160] = 0; float fluxKu = (line[154] == '<') ? NAN : atof(&line[154]); if (fluxKu == -1.0) fluxKu = NAN; 103 104 // we treat each valid flux as a new star 105 if (isfinite(fluxSt)) { 106 loadICRF_addstar (&stars[Nstars], fluxSt, fluxSu, R, D, dX, dY, codeS->code); 107 Nstars++; 108 CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000); 109 } 110 if (isfinite(fluxCt)) { 111 loadICRF_addstar (&stars[Nstars], fluxCt, fluxCu, R, D, dX, dY, codeC->code); 112 Nstars++; 113 CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000); 114 } 115 if (isfinite(fluxXt)) { 116 loadICRF_addstar (&stars[Nstars], fluxXt, fluxXu, R, D, dX, dY, codeX->code); 117 Nstars++; 118 CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000); 119 } 120 if (isfinite(fluxUt)) { 121 loadICRF_addstar (&stars[Nstars], fluxUt, fluxUu, R, D, dX, dY, codeU->code); 122 Nstars++; 123 CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000); 124 } 125 if (isfinite(fluxKt)) { 126 loadICRF_addstar (&stars[Nstars], fluxKt, fluxKu, R, D, dX, dY, codeK->code); 127 Nstars++; 128 CHECK_REALLOCATE (stars, ICRF_Stars, NSTARS, Nstars, 1000); 129 } 130 27 131 } 28 if (!gfits_fread_matrix (f, &matrix, &header)) {29 if (VERBOSE) fprintf (stderr, "can't read image subset matrix\n");30 gfits_free_header (&header);31 fclose (f);32 return NULL;33 }34 35 ftable.header = &theader;36 37 // load data for this header38 if (!gfits_load_header (f, &theader)) {39 fclose (f);40 return NULL;41 }42 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {43 fclose (f);44 return (NULL);45 }46 47 char type[16];48 49 GET_COLUMN (glat, "l", float);50 GET_COLUMN (glon, "b", float);51 GET_COLUMN (conv, "conv", byte);52 GET_COLUMN (lnZ, "lnZ", float);53 GET_COLUMN (DistMag, "DM", float);54 GET_COLUMN (Ebv, "EBV", float);55 GET_COLUMN (M_r, "Mr", float);56 GET_COLUMN (FeH, "FeH", float);57 58 // free the memory associated with the FITS files59 gfits_free_header (&header);60 gfits_free_matrix (&matrix);61 gfits_free_header (&theader);62 gfits_free_table (&ftable);63 64 // the next FITS extension contains the error information65 if (!gfits_fread_header (f, &header)) {66 if (VERBOSE) fprintf (stderr, "can't read image subset header\n");67 fclose (f);68 return NULL;69 }70 if (!gfits_fread_matrix (f, &matrix, &header)) {71 if (VERBOSE) fprintf (stderr, "can't read image subset matrix\n");72 gfits_free_header (&header);73 fclose (f);74 return NULL;75 }76 fclose (f);77 78 double *errImage = (double *) matrix.buffer;79 80 myAssert (Nrow == matrix.Naxis[2], "size mismatch?");81 82 int NstarsIn = matrix.Naxis[2];83 84 double Rmin = +360.0;85 double Rmax = -360.0;86 double Dmin = +360.0;87 double Dmax = -360.0;88 89 int Nstars = 0;90 int NSTARS = 0.1*NstarsIn;91 92 StarPar_Stars *stars = NULL;93 ALLOCATE (stars, StarPar_Stars, NSTARS);94 95 // libdvo uses Liu et al 2011 (A&A 526, A16) for default galactic coords,96 // but Greg Green / LSD use the older Reid et al 2004 (ApJ 616, 872) definition97 CoordTransform *transform = InitTransform (COORD_GALACTIC_REID_2004, COORD_CELESTIAL);98 99 for (i = 0; i < NstarsIn; i++) {100 101 // skip stars based on conv and lnZ102 if (!conv[i]) continue;103 if (lnZ[i] < -15.0) continue;104 105 double R, D;106 ApplyTransform (&R, &D, glon[i], glat[i], transform);107 108 Rmin = MIN (Rmin, R);109 Rmax = MAX (Rmax, R);110 Dmin = MIN (Dmin, D);111 Dmax = MAX (Dmax, D);112 113 float dEbv = 0.5*(errImage[i*20 + 5*0 + 3] - errImage[i*20 + 5*0 + 1]);114 float dDistMag = 0.5*(errImage[i*20 + 5*1 + 3] - errImage[i*20 + 5*1 + 1]);115 float dM_r = 0.5*(errImage[i*20 + 5*2 + 3] - errImage[i*20 + 5*2 + 1]);116 float dFeH = 0.5*(errImage[i*20 + 5*3 + 3] - errImage[i*20 + 5*3 + 1]);117 118 stars[Nstars].R = R;119 stars[Nstars].D = D;120 stars[Nstars].flag = FALSE;121 stars[Nstars].found = FALSE;122 123 // NOTE that we have both stars.R,D and stars.starpar.R,D. stars.R,D are used124 // here (in parallel with addstar) to locate the objects. BUT, in the database,125 // starpar.R,D is the authoratative position for the object (either that coming126 // from Greg / Eddie's table or that coming from the simulation)127 stars[Nstars].starpar.R = R;128 stars[Nstars].starpar.D = D;129 stars[Nstars].starpar.galLon = glon[i];130 stars[Nstars].starpar.galLat = glat[i];131 132 stars[Nstars].starpar.Ebv = Ebv[i] ;133 stars[Nstars].starpar.dEbv = dEbv ;134 stars[Nstars].starpar.DistMag = DistMag[i];135 stars[Nstars].starpar.dDistMag = dDistMag ;136 stars[Nstars].starpar.M_r = M_r[i] ;137 stars[Nstars].starpar.dM_r = dM_r ;138 stars[Nstars].starpar.FeH = FeH[i] ;139 stars[Nstars].starpar.dFeH = dFeH ;140 141 Nstars ++;142 143 CHECK_REALLOCATE (stars, StarPar_Stars, NSTARS, Nstars, 10000);144 }145 gfits_free_header (&header);146 gfits_free_matrix (&matrix);147 148 132 *nstars = Nstars; 149 133 return (stars); 150 134 } 151 135 152 int load starpar_sortStars (StarPar_Stars *stars, int Nstars) {136 int loadICRF_addstar(ICRF_Stars *star, float fluxPSF, float fluxAp, double R, double D, float dX, float dY, int photcode) { 153 137 154 # define SWAPFUNC(A,B){ StarPar_Stars temp = stars[A]; stars[A] = stars[B]; stars[B] = temp; } 138 InitICRF_Star (star); 139 140 star->R = R; 141 star->D = D; 142 star->measure.R = R; 143 star->measure.D = D; 144 star->measure.dXccd = dX; // in centi-pixels, where 1 pixel = 1 mas 145 star->measure.dYccd = dY; // in centi-pixels, where 1 pixel = 1 mas 146 147 star->measure.FluxPSF = fluxPSF; // flux in Jy 148 star->measure.dFluxPSF = 0.01; // this is just a guess 149 star->measure.FluxAp = fluxAp; // flux in Jy 150 star->measure.dFluxAp = 0.01; // this is just a guess 151 152 star->measure.M = (fluxPSF > 0.0) ? 8.9 - 2.5*log10(fluxPSF) : NAN; 153 star->measure.dM = (fluxPSF > 0.0) ? 0.01 / fluxPSF : NAN; 154 star->measure.Map = (fluxAp > 0.0) ? 8.9 - 2.5*log10(fluxAp) : NAN; 155 star->measure.dMap = (fluxAp > 0.0) ? 0.01 / fluxAp: NAN; 156 star->measure.photcode = photcode; 157 star->measure.dbFlags |= ID_MEAS_ICRF_QSO; 158 return TRUE; 159 } 160 161 int loadICRF_sortStars (ICRF_Stars *stars, int Nstars) { 162 163 # define SWAPFUNC(A,B){ ICRF_Stars temp = stars[A]; stars[A] = stars[B]; stars[B] = temp; } 155 164 # define COMPARE(A,B)(stars[A].R < stars[B].R) 156 165 … … 163 172 } 164 173 174 int InitICRF_Star (ICRF_Stars *star) { 175 176 dvo_measure_init (&star[0].measure); 177 star[0].found = FALSE; // FALSE = not yet assigned to an object 178 star[0].flag = FALSE; // FALSE = not yet assigned to a subset 179 return TRUE; 180 } -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_remote_hosts.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 # include <sys/types.h> 4 4 # include <sys/wait.h> -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_save_remote.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 # define DEBUG 1 4 4 … … 16 16 } 17 17 18 int load starpar_save_remote (StarPar_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {18 int loadICRF_save_remote (ICRF_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) { 19 19 20 20 char uniquer[12]; … … 25 25 // if this region is a parallel thing, save and launch remote 26 26 if (!PARALLEL) { 27 load starpar_catalog (stars, Nstars, region, fullname, options);27 loadICRF_catalog (stars, Nstars, region, fullname, options); 28 28 } else { 29 29 int N = hosts->index[region->hostID]; … … 31 31 32 32 // save to a unique filename 33 char filename[1024]; // CATDIR/tmpdir/ starpar.PID.index.fits34 snprintf (filename, 1024, "%s/tmpdir/ starpar.%s.%05d.fits", CATDIR, uniquer, region->index);33 char filename[1024]; // CATDIR/tmpdir/ICRF.PID.index.fits 34 snprintf (filename, 1024, "%s/tmpdir/ICRF.%s.%05d.fits", CATDIR, uniquer, region->index); 35 35 36 36 // write the data to the given FITS file 37 load starpar_save_stars (filename, stars, Nstars);37 loadICRF_save_stars (filename, stars, Nstars); 38 38 39 39 int slot = -1; … … 63 63 // need to generate the remote command 64 64 char command[1024]; 65 snprintf (command, 1024, "load starpar_client");65 snprintf (command, 1024, "loadICRF_client"); 66 66 strextend (command, "-hostID %d", host->hostID); 67 67 strextend (command, "-D CATDIR %s", CATDIR); -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_table.c
r37567 r37570 1 1 # include "addstar.h" 2 # include "load starpar.h"2 # include "loadICRF.h" 3 3 4 4 # define GET_COLUMN(OUT,NAME,TYPE) \ … … 6 6 myAssert (!strcmp(type, #TYPE), "wrong column type"); 7 7 8 int load starpar_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options) {8 int loadICRF_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options) { 9 9 10 10 int i, Nstars; 11 11 12 StarPar_Stars *stars = loadstarpar_readstars (filename, &Nstars);12 ICRF_Stars *stars = loadICRF_readstars (filename, &Nstars); 13 13 14 14 // sort the stars by RA 15 load starpar_sortStars (stars, Nstars);15 loadICRF_sortStars (stars, Nstars); 16 16 17 17 // scan through the stars, loading the containing catalogs … … 36 36 // select stars matching this region 37 37 int Nsubset; 38 StarPar_Stars *subset = loadstarpar_make_subset (stars, Nstars, i, region, &Nsubset);38 ICRF_Stars *subset = loadICRF_make_subset (stars, Nstars, i, region, &Nsubset); 39 39 40 40 // In parallel mode, write out the subset to a disk file. Block until a remote host 41 41 // is available. In serial mode, just match against the appropriate region and save 42 load starpar_save_remote (subset, Nsubset, hosts, region, skylist[0].filename[0], options);42 loadICRF_save_remote (subset, Nsubset, hosts, region, skylist[0].filename[0], options); 43 43 } 44 44 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/images.c
r37378 r37570 132 132 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (TRUE); 133 133 BuildChipMatch (image, Nimage); 134 135 // XXX push this and BuildChipMatch into LoadImagesDVO? 136 char mapfile[DVO_MAX_PATH]; 137 char *catdir = dvo_get_catdir (); 138 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", catdir); 139 AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, FALSE); 140 141 // assign images.coords.offsetMap -> table->map[i] 142 if (table) { 143 AstromOffsetTableMatchChips (image, Nimage, table); 144 } 134 145 135 146 if (SOLO_MOSAIC && photcode) {
Note:
See TracChangeset
for help on using the changeset viewer.
