Changeset 38711
- Timestamp:
- Sep 6, 2015, 3:12:26 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150625/Ohana/src/addstar
- Files:
-
- 1 added
- 9 edited
-
Makefile (modified) (2 diffs)
-
include/loadstarpar.h (modified) (3 diffs)
-
src/args_loadstarpar.c (modified) (8 diffs)
-
src/find_matches_starpar.c (modified) (1 diff)
-
src/loadstarpar.c (modified) (2 diffs)
-
src/loadstarpar_client.c (modified) (2 diffs)
-
src/loadstarpar_extras.c (added)
-
src/loadstarpar_io.c (modified) (3 diffs)
-
src/loadstarpar_readstars.c (modified) (1 diff)
-
src/loadstarpar_save_remote.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/addstar/Makefile
r38616 r38711 283 283 $(SRC)/loadstarpar_save_remote.$(ARCH).o \ 284 284 $(SRC)/loadstarpar_table.$(ARCH).o \ 285 $(SRC)/loadstarpar_extras.$(ARCH).o \ 285 286 $(SRC)/psps_ids.$(ARCH).o 286 287 … … 300 301 $(SRC)/loadstarpar_save_remote.$(ARCH).o \ 301 302 $(SRC)/loadstarpar_table.$(ARCH).o \ 303 $(SRC)/loadstarpar_extras.$(ARCH).o \ 302 304 $(SRC)/psps_ids.$(ARCH).o 303 305 -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/include/loadstarpar.h
r37807 r38711 12 12 char *INPUT; 13 13 14 AddstarClientOptions args_loadstarpar (int argc, char **argv, AddstarClientOptions options);15 AddstarClientOptions args_loadstarpar_client (int argc, char **argv, AddstarClientOptions options);14 AddstarClientOptions args_loadstarpar (int *argc, char **argv, AddstarClientOptions options); 15 AddstarClientOptions args_loadstarpar_client (int *argc, char **argv, AddstarClientOptions options); 16 16 17 17 int loadstarpar_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options); … … 23 23 int save_remote_host (HostInfo *host); 24 24 25 int init_remote_hosts ( );26 int find_empty_slot ( );27 int harvest_all ( );28 int harvest_host ( );25 int init_remote_hosts (void); 26 int find_empty_slot (void); 27 int harvest_all (void); 28 int harvest_host (void); 29 29 30 30 int loadstarpar_catalog (StarPar_Stars *stars, int Nstars, SkyRegion *region, char *filename, AddstarClientOptions *options); … … 40 40 41 41 int loadstarpar_sortStars (StarPar_Stars *stars, int Nstars); 42 43 int loadstarpar_tmpdir (void); -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/args_loadstarpar.c
r37807 r38711 5 5 static void help_client (void); 6 6 7 AddstarClientOptions args_loadstarpar (int argc, char **argv, AddstarClientOptions options) {7 AddstarClientOptions args_loadstarpar (int *argc, char **argv, AddstarClientOptions options) { 8 8 9 9 int N; 10 10 11 11 /* check for help request */ 12 if (get_argument ( argc, argv, "-help") ||13 get_argument ( argc, argv, "-h")) {12 if (get_argument (*argc, argv, "-help") || 13 get_argument (*argc, argv, "-h")) { 14 14 help (); 15 15 } … … 28 28 HOST_ID = 0; 29 29 PARALLEL = FALSE; 30 if ((N = get_argument ( argc, argv, "-parallel"))) {30 if ((N = get_argument (*argc, argv, "-parallel"))) { 31 31 PARALLEL = TRUE; 32 remove_argument (N, &argc, argv);32 remove_argument (N, argc, argv); 33 33 } 34 34 // this is a test mode : rather than launching the remote jobs and waiting for completion, 35 35 // relphot will simply list the remote command and wait for the user to signal completion 36 36 PARALLEL_MANUAL = FALSE; 37 if ((N = get_argument ( argc, argv, "-parallel-manual"))) {37 if ((N = get_argument (*argc, argv, "-parallel-manual"))) { 38 38 PARALLEL = TRUE; // -parallel-manual implies -parallel 39 39 PARALLEL_MANUAL = TRUE; 40 remove_argument (N, &argc, argv);40 remove_argument (N, argc, argv); 41 41 } 42 42 // this is a test mode : rather than launching the relphot_client jobs remotely, they are 43 43 // run in serial via 'system' 44 44 PARALLEL_SERIAL = FALSE; 45 if ((N = get_argument ( argc, argv, "-parallel-serial"))) {45 if ((N = get_argument (*argc, argv, "-parallel-serial"))) { 46 46 if (PARALLEL_MANUAL) { 47 47 fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n"); … … 50 50 PARALLEL = TRUE; // -parallel-serial implies -parallel 51 51 PARALLEL_SERIAL = TRUE; 52 remove_argument (N, &argc, argv);53 } 54 55 /* only add to existing regions */52 remove_argument (N, argc, argv); 53 } 54 55 /* only add to existing regions */ 56 56 options.existing_regions = FALSE; 57 if ((N = get_argument (argc, argv, "-existing-regions"))) { 58 options.existing_regions = TRUE; 59 remove_argument (N, &argc, argv); 60 } 57 // XXX NOT USED if ((N = get_argument (*argc, argv, "-existing-regions"))) { 58 // XXX NOT USED options.existing_regions = TRUE; 59 // XXX NOT USED remove_argument (N, argc, argv); 60 // XXX NOT USED } 61 61 62 /* only add to existing objects */ 62 63 options.only_match = FALSE; 63 if ((N = get_argument ( argc, argv, "-only-match"))) {64 if ((N = get_argument (*argc, argv, "-only-match"))) { 64 65 options.only_match = TRUE; 65 remove_argument (N, &argc, argv); 66 } 66 remove_argument (N, argc, argv); 67 } 68 67 69 /* replace measurement, don't duplicate (ref/cat only) */ 68 70 options.replace = FALSE; 69 if ((N = get_argument ( argc, argv, "-replace"))) {71 if ((N = get_argument (*argc, argv, "-replace"))) { 70 72 options.replace = TRUE; 71 remove_argument (N, &argc, argv);73 remove_argument (N, argc, argv); 72 74 } 73 75 74 76 /* extra error messages */ 75 77 VERBOSE = FALSE; 76 if ((N = get_argument ( argc, argv, "-v"))) {78 if ((N = get_argument (*argc, argv, "-v"))) { 77 79 VERBOSE = TRUE; 78 remove_argument (N, &argc, argv);80 remove_argument (N, argc, argv); 79 81 } 80 82 … … 96 98 DUMP = NULL; 97 99 98 if ( argc < 2) {100 if (*argc < 2) { 99 101 fprintf (stderr, "USAGE: loadstarpar [options] (fitsfile) [..more files]\n"); 100 102 exit (2); … … 103 105 } 104 106 105 AddstarClientOptions args_loadstarpar_client (int argc, char **argv, AddstarClientOptions options) {107 AddstarClientOptions args_loadstarpar_client (int *argc, char **argv, AddstarClientOptions options) { 106 108 107 109 int N; 108 110 109 111 /* check for help request */ 110 if (get_argument ( argc, argv, "-help") ||111 get_argument ( argc, argv, "-h")) {112 if (get_argument (*argc, argv, "-help") || 113 get_argument (*argc, argv, "-h")) { 112 114 help (); 113 115 } … … 118 120 119 121 HOST_ID = 0; 120 if ((N = get_argument ( argc, argv, "-hostID"))) {121 remove_argument (N, &argc, argv);122 if ((N = get_argument (*argc, argv, "-hostID"))) { 123 remove_argument (N, argc, argv); 122 124 HOST_ID = atoi (argv[N]); 123 remove_argument (N, &argc, argv);125 remove_argument (N, argc, argv); 124 126 } 125 127 if (!HOST_ID) help_client(); 126 128 127 129 HOSTDIR = NULL; 128 if ((N = get_argument ( argc, argv, "-hostdir"))) {129 remove_argument (N, &argc, argv);130 if ((N = get_argument (*argc, argv, "-hostdir"))) { 131 remove_argument (N, argc, argv); 130 132 HOSTDIR = strcreate (argv[N]); 131 remove_argument (N, &argc, argv);133 remove_argument (N, argc, argv); 132 134 } 133 135 if (!HOSTDIR) help_client(); 134 136 135 137 CPT_FILE = NULL; 136 if ((N = get_argument ( argc, argv, "-cpt"))) {137 remove_argument (N, &argc, argv);138 if ((N = get_argument (*argc, argv, "-cpt"))) { 139 remove_argument (N, argc, argv); 138 140 CPT_FILE = strcreate (argv[N]); 139 remove_argument (N, &argc, argv);141 remove_argument (N, argc, argv); 140 142 } 141 143 if (!CPT_FILE) help_client(); 142 144 143 145 INPUT = NULL; 144 if ((N = get_argument ( argc, argv, "-input"))) {145 remove_argument (N, &argc, argv);146 if ((N = get_argument (*argc, argv, "-input"))) { 147 remove_argument (N, argc, argv); 146 148 INPUT = strcreate (argv[N]); 147 remove_argument (N, &argc, argv);149 remove_argument (N, argc, argv); 148 150 } 149 151 if (!INPUT) help_client(); … … 157 159 /* only add to existing objects */ 158 160 options.only_match = FALSE; 159 if ((N = get_argument ( argc, argv, "-only-match"))) {161 if ((N = get_argument (*argc, argv, "-only-match"))) { 160 162 options.only_match = TRUE; 161 remove_argument (N, &argc, argv);163 remove_argument (N, argc, argv); 162 164 } 163 165 /* replace measurement, don't duplicate (ref/cat only) */ 164 166 options.replace = FALSE; 165 if ((N = get_argument ( argc, argv, "-replace"))) {167 if ((N = get_argument (*argc, argv, "-replace"))) { 166 168 options.replace = TRUE; 167 remove_argument (N, &argc, argv);169 remove_argument (N, argc, argv); 168 170 } 169 171 170 172 /* extra error messages */ 171 173 VERBOSE = FALSE; 172 if ((N = get_argument ( argc, argv, "-v"))) {174 if ((N = get_argument (*argc, argv, "-v"))) { 173 175 VERBOSE = TRUE; 174 remove_argument (N, &argc, argv);176 remove_argument (N, argc, argv); 175 177 } 176 178 … … 192 194 DUMP = NULL; 193 195 194 if ( argc != 1) {196 if (*argc != 1) { 195 197 fprintf (stderr, "USAGE: loadstarpar_client -cpt (file) -input (file)\n"); 196 198 exit (2); -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/find_matches_starpar.c
r38467 r38711 131 131 132 132 /** add starpar for this star **/ 133 134 // set the new starparments 135 catalog[0].starpar[Nstarpar] = stars[N].starpar; 136 catalog[0].starpar[Nstarpar].averef = n; 137 catalog[0].starpar[Nstarpar].objID = catalog[0].average[n].objID; 138 catalog[0].starpar[Nstarpar].catID = catID; 139 140 // NOTE: include R,D in starpar? 141 // XXX if I add R,D to starpar, I should rationalize R,D to the same boundary? 142 133 off_t m; 134 if (options->replace && catalog[0].average[n].Nstarpar) { 135 m = catalog[0].average[n].starparOffset; 136 } else { 137 m = Nstarpar; 138 catalog[0].average[n].starparOffset = m; 139 catalog[0].average[n].Nstarpar ++; 140 Nstarpar ++; 141 } 142 catalog[0].starpar[m] = stars[N].starpar; 143 catalog[0].starpar[m].averef = n; 144 catalog[0].starpar[m].objID = catalog[0].average[n].objID; 145 catalog[0].starpar[m].catID = catID; 143 146 stars[N].found = TRUE; 144 catalog[0].average[n].Nstarpar ++;145 Nstarpar ++;146 147 i++; 147 148 } -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/loadstarpar.c
r38618 r38711 19 19 SetSignals (); 20 20 options = ConfigInit (&argc, argv); 21 options = args_loadstarpar ( argc, argv, options);21 options = args_loadstarpar (&argc, argv, options); 22 22 23 23 // load the full sky description table (dvodb must exist) … … 25 25 SkyTableSetFilenames (sky, CATDIR, "cpt"); 26 26 27 // make the tmpdir if needed 28 if (!loadstarpar_tmpdir()) exit (1); 29 27 30 // load the list of hosts 28 31 HostTable *hosts = NULL; -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/loadstarpar_client.c
r38618 r38711 9 9 SetSignals (); 10 10 options = ConfigInit (&argc, argv); 11 options = args_loadstarpar_client ( argc, argv, options);11 options = args_loadstarpar_client (&argc, argv, options); 12 12 13 13 // client is called with a pointer to the file to be loaded … … 21 21 StarPar_Stars *stars = loadstarpar_load_stars (INPUT, &Nstars); 22 22 23 loadstarpar_catalog (stars, Nstars, skylist->regions[0], CPT_FILE, &options); 23 char filename[DVO_MAX_PATH]; 24 snprintf (filename, DVO_MAX_PATH, "%s/%s.cpt", HOSTDIR, CPT_FILE); 25 26 loadstarpar_catalog (stars, Nstars, skylist->regions[0], filename, &options); 24 27 25 28 free (stars); -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/loadstarpar_io.c
r37807 r38711 29 29 gfits_define_bintable_column (&theader, "D", "DEC", "", "degree", 1.0, 0.0); 30 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);31 gfits_define_bintable_column (&theader, "E", "GLAT", "", "degree", 1.0, 0.0); 32 32 gfits_define_bintable_column (&theader, "E", "Ebv", "", "", 1.0, 0.0); 33 33 gfits_define_bintable_column (&theader, "E", "dEbv", "", "", 1.0, 0.0); … … 84 84 gfits_free_table (&ftable); 85 85 86 fflush (f); 87 fclose (f); 88 86 89 return TRUE; 87 90 } 88 91 89 92 90 # define GET_COLUMN(OUT,NAME,TYPE ) \93 # define GET_COLUMN(OUT,NAME,TYPE,RTYPE) \ 91 94 TYPE *OUT = gfits_get_bintable_column_data (&theader, &ftable, NAME, type, &Nrow, &Ncol); \ 92 myAssert (!strcmp(type, # TYPE), "wrong column type");95 myAssert (!strcmp(type, #RTYPE), "wrong column type"); 93 96 94 97 StarPar_Stars *loadstarpar_load_stars (char *filename, int *nstars) { … … 134 137 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) goto escape; 135 138 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 );139 GET_COLUMN(ra , "RA" , double , double ); 140 GET_COLUMN(dec , "DEC" , double , double ); 141 GET_COLUMN(glon , "GLON" , float , float ); 142 GET_COLUMN(glat , "GLAT" , float , float ); 143 GET_COLUMN(Ebv , "Ebv" , float , float ); 144 GET_COLUMN(dEbv , "dEbv" , float , float ); 145 GET_COLUMN(DistMag , "DistMag" , float , float ); 146 GET_COLUMN(dDistMag, "dDistMag" , float , float ); 147 GET_COLUMN(M_r , "M_r" , float , float ); 148 GET_COLUMN(dM_r , "dM_r" , float , float ); 149 GET_COLUMN(FeH , "FeH" , float , float ); 150 GET_COLUMN(dFeH , "dFeH" , float , float ); 151 GET_COLUMN(averef , "averef" , unsigned int, int ); 152 GET_COLUMN(objID , "objID" , unsigned int, int ); 153 GET_COLUMN(catID , "catID" , unsigned int, int ); 151 154 152 155 gfits_free_header (&theader); -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/loadstarpar_readstars.c
r37807 r38711 47 47 char type[16]; 48 48 49 GET_COLUMN (gl at, "l", float);50 GET_COLUMN (gl on, "b", float);49 GET_COLUMN (glon, "l", float); 50 GET_COLUMN (glat, "b", float); 51 51 GET_COLUMN (conv, "conv", byte); 52 52 GET_COLUMN (lnZ, "lnZ", float); -
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/loadstarpar_save_remote.c
r38441 r38711 18 18 19 19 // save to a unique filename 20 char filename[ 1024]; // CATDIR/tmpdir/starpar.PID.index.fits21 snprintf (filename, 1024, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index);20 char filename[DVO_MAX_PATH]; // CATDIR/tmpdir/starpar.PID.index.fits 21 snprintf (filename, DVO_MAX_PATH, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index); 22 22 23 23 // write the data to the given FITS file … … 57 57 strextend (&command, "-input %s", filename); 58 58 59 if (options->only_match) strextend (&command, "-only-match"); 60 if (options->replace) strextend (&command, "-replace"); 61 62 fprintf (stderr, "command: %s\n", command); 63 59 64 // launch the job on the remote machine (no handshake) 60 65 int errorInfo = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
