Changeset 33655
- Timestamp:
- Apr 1, 2012, 3:06:30 PM (14 years ago)
- Location:
- trunk/Ohana/src/photdbc
- Files:
-
- 7 edited
- 19 copied
-
Makefile (modified) (4 diffs)
-
include/dvodist.h (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/include/dvodist.h )
-
include/md5.h (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/include/md5.h )
-
include/photdbc.h (modified) (3 diffs)
-
src/AssignSkyToHost.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/AssignSkyToHost.c )
-
src/ConfigInit.c (modified) (2 diffs)
-
src/CopyBackupToHost.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyBackupToHost.c )
-
src/CopyFromHostLocation.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyFromHostLocation.c )
-
src/CopyToHostLocation.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyToHostLocation.c )
-
src/FixSkyForHost.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/FixSkyForHost.c )
-
src/HostTableLoad.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/HostTableLoad.c )
-
src/PclientCommands.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/PclientCommands.c )
-
src/Shutdown_dvodist.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/Shutdown_dvodist.c )
-
src/UseBackupForHost.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/UseBackupForHost.c )
-
src/args.c (modified) (3 diffs)
-
src/copy_images.c (modified) (1 diff)
-
src/dvodist.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/dvodist.c )
-
src/initialize.c (modified) (3 diffs)
-
src/initialize_dvodist.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/initialize_dvodist.c )
-
src/md5.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/md5.c )
-
src/md5_ops.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/md5_ops.c )
-
src/memstr.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/memstr.c )
-
src/photdbc.c (modified) (2 diffs)
-
src/photdbc_catalogs.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/photdbc_catalogs.c )
-
src/photdbc_client.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/photdbc_client.c )
-
src/rconnect.c (copied) (copied from branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/rconnect.c )
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/photdbc/Makefile
r17284 r33655 1 default: photdbc 1 default: photdbc photdbc_client dvodist 2 2 help: 3 @echo "make options: photdbc (default)"3 @echo "make options: photdbc photdbc_client dvodist" 4 4 5 5 include ../../Makefile.System … … 18 18 19 19 photdbc: $(BIN)/photdbc.$(ARCH) 20 install: $(DESTBIN)/photdbc 20 photdbc_client: $(BIN)/photdbc_client.$(ARCH) 21 22 dvodist: $(BIN)/dvodist.$(ARCH) 23 24 install: $(DESTBIN)/photdbc $(DESTBIN)/photdbc_client $(DESTBIN)/dvodist 21 25 22 26 PHOTDBC = \ 23 27 $(SRC)/photdbc.$(ARCH).o \ 28 $(SRC)/photdbc_catalogs.$(ARCH).o \ 24 29 $(SRC)/initialize.$(ARCH).o \ 25 30 $(SRC)/ConfigInit.$(ARCH).o \ … … 29 34 $(SRC)/join_stars.$(ARCH).o \ 30 35 $(SRC)/make_subcatalog.$(ARCH).o 36 37 PHOTDBC_CLIENT = \ 38 $(SRC)/photdbc_client.$(ARCH).o \ 39 $(SRC)/photdbc_catalogs.$(ARCH).o \ 40 $(SRC)/initialize.$(ARCH).o \ 41 $(SRC)/ConfigInit.$(ARCH).o \ 42 $(SRC)/args.$(ARCH).o \ 43 $(SRC)/copy_images.$(ARCH).o \ 44 $(SRC)/Shutdown.$(ARCH).o \ 45 $(SRC)/join_stars.$(ARCH).o \ 46 $(SRC)/make_subcatalog.$(ARCH).o 47 48 DVODIST = \ 49 $(SRC)/dvodist.$(ARCH).o \ 50 $(SRC)/initialize_dvodist.$(ARCH).o \ 51 $(SRC)/Shutdown_dvodist.$(ARCH).o \ 52 $(SRC)/SetSignals.$(ARCH).o \ 53 $(SRC)/md5_ops.$(ARCH).o \ 54 $(SRC)/md5.$(ARCH).o \ 55 $(SRC)/memstr.$(ARCH).o \ 56 $(SRC)/HostTableLoad.$(ARCH).o \ 57 $(SRC)/AssignSkyToHost.$(ARCH).o \ 58 $(SRC)/CopyBackupToHost.$(ARCH).o \ 59 $(SRC)/UseBackupForHost.$(ARCH).o \ 60 $(SRC)/CopyToHostLocation.$(ARCH).o \ 61 $(SRC)/CopyFromHostLocation.$(ARCH).o \ 62 $(SRC)/FixSkyForHost.$(ARCH).o \ 63 $(SRC)/PclientCommands.$(ARCH).o 31 64 32 65 OLD = \ … … 50 83 $(SRC)/wcatalog.$(ARCH).o 51 84 52 53 85 $(PHOTDBC): $(INC)/photdbc.h 54 86 $(BIN)/photdbc.$(ARCH): $(PHOTDBC) 87 88 $(PHOTDBC_CLIENT): $(INC)/photdbc.h 89 $(BIN)/photdbc_client.$(ARCH): $(PHOTDBC_CLIENT) 90 91 $(DVODIST): $(INC)/dvodist.h 92 $(BIN)/dvodist.$(ARCH): $(DVODIST) -
trunk/Ohana/src/photdbc/include/photdbc.h
r31635 r33655 21 21 } StatType; 22 22 23 int PARALLEL; 24 int PARALLEL_MANUAL; 25 int PARALLEL_SERIAL; 26 27 int HOST_ID; 28 char *HOSTDIR; 29 23 30 // need to get RADIUS from Config 31 32 # define MAX_PATH_LENGTH 1024 24 33 25 34 /* global variables */ … … 29 38 double UNIQ_RADIUS; 30 39 double DMCAL_MIN;; 31 char ImageCat[ 256];32 char GSCFILE[ 256];33 char CATDIR[ 256];34 char CATMODE[16]; /* raw, mef, split, mysql */35 char CATFORMAT[16]; /* internal, elixir, loneos, panstarrs */36 char PhotCodeFile[ 256];40 char ImageCat[MAX_PATH_LENGTH]; 41 char GSCFILE[MAX_PATH_LENGTH]; 42 char CATDIR[MAX_PATH_LENGTH]; 43 char *CATMODE; /* raw, mef, split, mysql */ 44 char *CATFORMAT; /* internal, elixir, loneos, panstarrs */ 45 char PhotCodeFile[MAX_PATH_LENGTH]; 37 46 38 47 double RMIN; … … 124 133 int copy_images (char *outdir); 125 134 void usage(); 135 136 int photdbc_catalogs (char *outroot, SkyList *skylist, int hostID); 137 int photdbc_parallel (char *outroot, SkyList *skylist); 138 int args_client (int argc, char **argv); 139 void initialize_client (int argc, char **argv); -
trunk/Ohana/src/photdbc/src/ConfigInit.c
r30616 r33655 52 52 ScanConfig (config, "NMEAS_MIN_FILTERED", "%d", 0, &NMEAS_MIN_FILTERED); 53 53 54 WarnConfig (config, "GSCFILE", "%s", 0, GSCFILE); 54 // do not apply this limit for now 55 NCODE_MIN = 0; 56 55 57 WarnConfig (config, "CATDIR", "%s", 0, CATDIR); 56 ScanConfig (config, "CATMODE", "%s", 0, CATMODE); 57 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT); 58 char *tmpcatdir = abspath (CATDIR, MAX_PATH_LENGTH); 59 strcpy (CATDIR, tmpcatdir); 60 free (tmpcatdir); 61 58 62 ScanConfig (config, "PHOTCODE_FILE", "%s", 0, MasterPhotcodeFile); 59 63 … … 67 71 } 68 72 69 if (*CATMODE == 0) strcpy (CATMODE, "RAW");70 if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");71 72 73 /* XXX this does not yet write out the master photcode table */ 73 74 sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR); 74 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {75 fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);75 if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, TRUE)) { 76 fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile); 76 77 exit (1); 77 78 } -
trunk/Ohana/src/photdbc/src/args.c
r30616 r33655 40 40 remove_argument (N, &argc, argv); 41 41 MAX_MIN_MAG = atof(argv[N]); 42 remove_argument (N, &argc, argv); 43 } 44 45 // override input catalog format (PS1_V1, PS1_REF, etc) 46 CATFORMAT = NULL; 47 if ((N = get_argument (argc, argv, "-set-format"))) { 48 remove_argument (N, &argc, argv); 49 CATFORMAT = strcreate (argv[N]); 50 remove_argument (N, &argc, argv); 51 } 52 53 // override input catalog mode (raw, mef, split, mysql) 54 CATMODE = NULL; 55 if ((N = get_argument (argc, argv, "-set-mode"))) { 56 remove_argument (N, &argc, argv); 57 CATMODE = strcreate (argv[N]); 42 58 remove_argument (N, &argc, argv); 43 59 } … … 80 96 remove_argument (N, &argc, argv); 81 97 PHOTCODE_SKIP_LIST = strcreate(argv[N]); 98 remove_argument (N, &argc, argv); 99 } 100 101 // XXX for the moment, make this selection manual. it needs to be automatic 102 // based on the state of the SkyTable 103 PARALLEL = FALSE; 104 if ((N = get_argument (argc, argv, "-parallel"))) { 105 PARALLEL = TRUE; 106 remove_argument (N, &argc, argv); 107 } 108 // this is a test mode : rather than launching the remote jobs and waiting for completion, 109 // relphot will simply list the remote command and wait for the user to signal completion 110 PARALLEL_MANUAL = FALSE; 111 if ((N = get_argument (argc, argv, "-parallel-manual"))) { 112 PARALLEL = TRUE; // -parallel-manual implies -parallel 113 PARALLEL_MANUAL = TRUE; 114 remove_argument (N, &argc, argv); 115 } 116 // this is a test mode : rather than launching the relphot_client jobs remotely, they are 117 // run in serial via 'system' 118 PARALLEL_SERIAL = FALSE; 119 if ((N = get_argument (argc, argv, "-parallel-serial"))) { 120 if (PARALLEL_MANUAL) { 121 fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n"); 122 exit (1); 123 } 124 PARALLEL = TRUE; // -parallel-serial implies -parallel 125 PARALLEL_SERIAL = TRUE; 82 126 remove_argument (N, &argc, argv); 83 127 } … … 99 143 } 100 144 145 int args_client (int argc, char **argv) { 146 147 int N; 148 149 PARALLEL = FALSE; 150 PARALLEL_MANUAL = FALSE; 151 PARALLEL_SERIAL = FALSE; 152 153 HOST_ID = 0; 154 if ((N = get_argument (argc, argv, "-hostID"))) { 155 remove_argument (N, &argc, argv); 156 HOST_ID = atoi (argv[N]); 157 remove_argument (N, &argc, argv); 158 } 159 if (!HOST_ID) usage(); 160 161 HOSTDIR = NULL; 162 if ((N = get_argument (argc, argv, "-hostdir"))) { 163 remove_argument (N, &argc, argv); 164 HOSTDIR = strcreate (argv[N]); 165 remove_argument (N, &argc, argv); 166 } 167 if (!HOSTDIR) usage(); 168 169 VERBOSE = FALSE; 170 if ((N = get_argument (argc, argv, "-v"))) { 171 VERBOSE = TRUE; 172 remove_argument (N, &argc, argv); 173 } 174 175 SHOW_PARAMS = FALSE; 176 if ((N = get_argument (argc, argv, "-params"))) { 177 remove_argument (N, &argc, argv); 178 SHOW_PARAMS = TRUE; 179 } 180 181 ExcludeByInstMag = FALSE; 182 if ((N = get_argument (argc, argv, "-instmag"))) { 183 ExcludeByInstMag = TRUE; 184 remove_argument (N, &argc, argv); 185 INST_MAG_MIN = atof(argv[N]); 186 remove_argument (N, &argc, argv); 187 INST_MAG_MAX = atof(argv[N]); 188 remove_argument (N, &argc, argv); 189 } 190 191 ExcludeByMinSigma = FALSE; 192 if ((N = get_argument (argc, argv, "-min-sigma"))) { 193 ExcludeByMinSigma = TRUE; 194 remove_argument (N, &argc, argv); 195 SIGMA_MIN_KEEP = atof(argv[N]); 196 remove_argument (N, &argc, argv); 197 } 198 199 ExcludeByMaxMinMag = FALSE; 200 if ((N = get_argument (argc, argv, "-maxminmag"))) { 201 ExcludeByMaxMinMag = TRUE; 202 remove_argument (N, &argc, argv); 203 MAX_MIN_MAG = atof(argv[N]); 204 remove_argument (N, &argc, argv); 205 } 206 207 // override input catalog format (PS1_V1, PS1_REF, etc) 208 CATFORMAT = NULL; 209 if ((N = get_argument (argc, argv, "-set-format"))) { 210 remove_argument (N, &argc, argv); 211 CATFORMAT = strcreate (argv[N]); 212 remove_argument (N, &argc, argv); 213 } 214 215 // override input catalog mode (raw, mef, split, mysql) 216 CATMODE = NULL; 217 if ((N = get_argument (argc, argv, "-set-mode"))) { 218 remove_argument (N, &argc, argv); 219 CATMODE = strcreate (argv[N]); 220 remove_argument (N, &argc, argv); 221 } 222 223 /* specify portion of the sky */ 224 REGION.Rmin = 0; 225 REGION.Rmax = 360; 226 REGION.Dmin = -90; 227 REGION.Dmax = +90; 228 if ((N = get_argument (argc, argv, "-region"))) { 229 remove_argument (N, &argc, argv); 230 REGION.Rmin = atof (argv[N]); 231 remove_argument (N, &argc, argv); 232 REGION.Rmax = atof (argv[N]); 233 remove_argument (N, &argc, argv); 234 REGION.Dmin = atof (argv[N]); 235 remove_argument (N, &argc, argv); 236 REGION.Dmax = atof (argv[N]); 237 remove_argument (N, &argc, argv); 238 239 if (REGION.Rmin == REGION.Rmax) { 240 fprintf (stderr, "ERROR: selected region is ill-defined: Rmin == Rmax\n"); 241 exit (2); 242 } 243 if (REGION.Dmin == REGION.Dmax) { 244 fprintf (stderr, "ERROR: selected region is ill-defined: Dmin == Dmax\n"); 245 exit (2); 246 } 247 } 248 249 PHOTCODE_DROP_LIST = NULL; 250 if ((N = get_argument (argc, argv, "-photcode-drop"))) { 251 remove_argument (N, &argc, argv); 252 PHOTCODE_DROP_LIST = strcreate(argv[N]); 253 remove_argument (N, &argc, argv); 254 } 255 256 PHOTCODE_SKIP_LIST = NULL; 257 if ((N = get_argument (argc, argv, "-photcode-skip"))) { 258 remove_argument (N, &argc, argv); 259 PHOTCODE_SKIP_LIST = strcreate(argv[N]); 260 remove_argument (N, &argc, argv); 261 } 262 263 if (argc != 2) usage(); 264 265 if ((REGION.Rmin == 0) && (REGION.Rmax == 360) && (REGION.Dmin == -90) && (REGION.Dmax == +90)) { 266 int i; 267 fprintf (stderr, "you have requested a copy of the entire sky in one pass\n"); 268 fprintf (stderr, "this could be a time consuming operation. type Ctrl-C within 5 seconds to cancel\n"); 269 for (i = 5; i > 0; i--) { 270 fprintf (stderr, "%d.. ", i); 271 usleep (1000000); 272 } 273 fprintf (stderr, "\n"); 274 } 275 276 return (TRUE); 277 } 278 101 279 void usage() { 102 280 -
trunk/Ohana/src/photdbc/src/copy_images.c
r29001 r33655 41 41 if (out.dbstate != LCK_EMPTY) Shutdown ("ERROR: image table exists %s", ImageOut); 42 42 43 out.mode = dvo_catalog_catmode (CATMODE);44 out.format = dvo_catalog_catformat (CATFORMAT);43 out.mode = CATMODE ? dvo_catalog_catmode (CATMODE) : in.mode; 44 out.format = CATFORMAT ? dvo_catalog_catformat (CATFORMAT) : in.format; 45 45 dvo_image_create (&out, ZERO_POINT); 46 46 -
trunk/Ohana/src/photdbc/src/initialize.c
r30616 r33655 2 2 3 3 void initialize (int argc, char **argv) { 4 5 int NPHOTCODES;6 char *codename, *ptr, *list;7 4 8 5 /* are these set correctly? */ … … 15 12 args (argc, argv); 16 13 17 NphotcodesDrop = 0; 18 photcodesDrop = NULL; 19 if (PHOTCODE_DROP_LIST != NULL) { 20 NPHOTCODES = 10; 21 ALLOCATE (photcodesDrop, PhotCode *, NPHOTCODES); 22 23 /* parse the comma-separated list of photcodesDrop */ 24 list = PHOTCODE_DROP_LIST; 25 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 26 list = NULL; // pass NULL on successive strtok_r calls 27 fprintf (stderr, "PHOTCODE_LIST: %s\n", PHOTCODE_DROP_LIST); 28 fprintf (stderr, "codename: %s\n", codename); 29 if ((photcodesDrop[NphotcodesDrop] = GetPhotcodebyName (codename)) == NULL) { 30 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 31 exit (1); 32 } 33 NphotcodesDrop ++; 34 CHECK_REALLOCATE (photcodesDrop, PhotCode *, NPHOTCODES, NphotcodesDrop, 10); 35 } 36 } 37 38 NphotcodesSkip = 0; 39 photcodesSkip = NULL; 40 if (PHOTCODE_SKIP_LIST != NULL) { 41 NPHOTCODES = 10; 42 ALLOCATE (photcodesSkip, PhotCode *, NPHOTCODES); 43 44 /* parse the comma-separated list of photcodesSkip */ 45 list = PHOTCODE_SKIP_LIST; 46 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 47 list = NULL; // pass NULL on successive strtok_r calls 48 fprintf (stderr, "PHOTCODE_LIST: %s\n", PHOTCODE_SKIP_LIST); 49 fprintf (stderr, "codename: %s\n", codename); 50 if ((photcodesSkip[NphotcodesSkip] = GetPhotcodebyName (codename)) == NULL) { 51 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 52 exit (1); 53 } 54 NphotcodesSkip ++; 55 CHECK_REALLOCATE (photcodesSkip, PhotCode *, NPHOTCODES, NphotcodesSkip, 10); 56 } 57 } 14 photcodesDrop = ParsePhotcodeList (PHOTCODE_DROP_LIST, &NphotcodesDrop, FALSE); 15 photcodesSkip = ParsePhotcodeList (PHOTCODE_SKIP_LIST, &NphotcodesSkip, FALSE); 58 16 59 17 if (SHOW_PARAMS) { … … 84 42 } 85 43 44 void initialize_client (int argc, char **argv) { 45 46 /* are these set correctly? */ 47 if (get_argument (argc, argv, "-h")) usage(); 48 if (get_argument (argc, argv, "--h")) usage(); 49 if (get_argument (argc, argv, "-help")) usage(); 50 if (get_argument (argc, argv, "--help")) usage(); 51 52 ConfigInit (&argc, argv); 53 args_client (argc, argv); 54 55 photcodesDrop = ParsePhotcodeList (PHOTCODE_DROP_LIST, &NphotcodesDrop, FALSE); 56 photcodesSkip = ParsePhotcodeList (PHOTCODE_SKIP_LIST, &NphotcodesSkip, FALSE); 57 58 if (SHOW_PARAMS) { 59 fprintf (stderr, "current parameter settings:\n"); 60 fprintf (stderr, "VERBOSE: %d\n", VERBOSE); 61 fprintf (stderr, "JOIN_RADIUS: %lf\n", JOIN_RADIUS); 62 fprintf (stderr, "UNIQ_RADIUS: %lf\n", UNIQ_RADIUS); 63 64 fprintf (stderr, "XMIN: %lf\n", XMIN); 65 fprintf (stderr, "XMAX: %lf\n", XMAX); 66 fprintf (stderr, "YMIN: %lf\n", YMIN); 67 fprintf (stderr, "YMAX: %lf\n", YMAX); 68 fprintf (stderr, "MMIN: %lf\n", MMIN); 69 fprintf (stderr, "MMAX: %lf\n", MMAX); 70 fprintf (stderr, "DMCAL_MIN: %lf\n", DMCAL_MIN); 71 fprintf (stderr, "DMSYS: %lf\n", DMSYS); 72 73 fprintf (stderr, "CHISQ_MAX: %lf\n", CHISQ_MAX); 74 fprintf (stderr, "NMEAS_MIN: %d\n", NMEAS_MIN); 75 76 fprintf (stderr, "IMAGE_CATALOG %s\n", ImageCat); 77 fprintf (stderr, "GSCFILE %s\n", GSCFILE); 78 fprintf (stderr, "CATDIR %s\n", CATDIR); 79 fprintf (stderr, "PHOTCODE_FILE %s\n", PhotCodeFile); 80 81 exit (0); 82 } 83 } -
trunk/Ohana/src/photdbc/src/photdbc.c
r31635 r33655 3 3 int main (int argc, char **argv) { 4 4 5 int i;6 char *skyfile;7 Catalog incatalog;8 Catalog outcatalog;9 5 SkyTable *sky; 10 6 SkyList *skylist; … … 17 13 18 14 // the output catalog needs to inherit the SKY_DEPTH of the input catalog 19 sky = SkyTableLoadOptimal (CATDIR, NULL, GSCFILE, TRUE, SKY_DEPTH_HST, VERBOSE);15 sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, TRUE, 0, VERBOSE); 20 16 SkyTableSetFilenames (sky, CATDIR, "cpt"); 21 17 skylist = SkyListByPatch (sky, -1, ®ION); 22 for (i = 0; i < skylist[0].Nregions; i++) {23 if (VERBOSE) fprintf (stderr, "%s\n", skylist[0].regions[i][0].name);24 18 25 // set the parameters which guide catalog open/load/create 26 incatalog.filename = skylist[0].filename[i]; 27 incatalog.Nsecfilt = GetPhotcodeNsecfilt (); 28 incatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 19 // hostID is 0 for master program 20 photdbc_catalogs (argv[1], skylist, 0); 29 21 30 // an error exit status here is a significant error 31 if (!dvo_catalog_open (&incatalog, skylist[0].regions[i], VERBOSE, "r")) { 32 fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", incatalog.filename); 33 exit (2); 34 } 35 // skip empty input catalogs 36 if (!incatalog.Naves_disk) { 37 dvo_catalog_unlock (&incatalog); 38 dvo_catalog_free (&incatalog); 39 continue; 40 } 41 42 // create output catalog filename 43 outcatalog.filename = strsubs (incatalog.filename, CATDIR, argv[1]); 44 if (outcatalog.filename == NULL) Shutdown ("error with input catalog name"); 45 46 // define outcatalog open parameters 47 outcatalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 48 outcatalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 49 outcatalog.Nsecfilt = incatalog.Nsecfilt; // inherit from the incatalog 50 outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 51 52 // output catalogs always represent the same skyregions as the input catalogs 53 if (!dvo_catalog_open (&outcatalog, skylist[0].regions[i], VERBOSE, "w")) { 54 fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", outcatalog.filename); 55 exit (2); 56 } 57 58 // the output catalog needs to have the same values for 'objID' and 'sorted' as the input 59 outcatalog.objID = incatalog.objID; 60 outcatalog.sorted = incatalog.sorted; 61 if (!incatalog.sorted) { 62 fprintf (stderr, "ERROR: input db must be sorted: %s\n", incatalog.filename); 63 exit (2); 64 } 65 66 /* limit number of measures based on selections */ 67 make_subcatalog (&outcatalog, &incatalog, skylist[0].regions[i]); 68 69 // XXX add other filters here: 70 // join_stars (&outcatalog); 71 // unique_measures (catalog); 72 // flag_measures (&db, catalog); 73 // get_mags (catalog); 74 75 dvo_catalog_save (&outcatalog, VERBOSE); 76 dvo_catalog_unlock (&outcatalog); 77 dvo_catalog_free (&outcatalog); 78 79 dvo_catalog_unlock (&incatalog); 80 dvo_catalog_free (&incatalog); 81 } 82 83 ALLOCATE (skyfile, char, strlen(argv[1]) + strlen("/SkyTable.fits") + 1); 84 sprintf (skyfile, "%s/SkyTable.fits", argv[1]); 22 char *skyfile = SkyTableFilename (argv[1]); 85 23 SkyTableSave (sky, skyfile); 86 24 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
