Changeset 12794 for trunk/psastro/src/psastroLoadRefstars.c
- Timestamp:
- Apr 10, 2007, 3:50:04 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadRefstars.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadRefstars.c
r12718 r12794 6 6 int fd; 7 7 bool status; 8 char *catformat = NULL;9 char *getstarLine = NULL;10 11 // select the DVO database?12 8 13 9 // select the current recipe … … 24 20 // XXX which is then selected from the top-level ipprc.config 25 21 char *CATDIR = psMetadataLookupStr(NULL, recipe, "DVO.CATDIR"); 26 if (CATDIR == NULL) { 27 psLogMsg ("psastro", 2, "warning: missing DVO.CATDIR, using ~/.ptolemyrc definition\n"); 28 } 22 PS_ASSERT (CATDIR, NULL); 23 24 char *getstarCommand = psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR"); 25 PS_ASSERT (getstarCommand, NULL); 29 26 30 27 // issue the following command: 31 28 // getstar -region RAmin RAmax DECmin DECmax 32 33 29 char tempFile[64]; 34 30 sprintf (tempFile, "/tmp/psastro.XXXXXX"); … … 43 39 // use fork to add timeout capability 44 40 if (ELIXIR_MODE) { 45 psStringAppend (& catformat, "-D CATFORMAT elixir");41 psStringAppend (&getstarCommand, " -D CATFORMAT elixir"); 46 42 } else { 47 psStringAppend (& catformat, "-D CATFORMAT panstarrs");43 psStringAppend (&getstarCommand, " -D CATFORMAT panstarrs"); 48 44 } 49 45 46 // XXX check for a default name (use .ptolemyrc)? 50 47 if (CATDIR) { 51 psStringAppend (& catformat, "-D CATDIR %s", CATDIR);48 psStringAppend (&getstarCommand, " -D CATDIR %s", CATDIR); 52 49 } 53 50 54 // XXX set getstar in config?51 // psStringAppend (&getstarCommand, " -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 55 52 // XXX TEST : no magnitude limit 56 // psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 57 // psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 58 psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -region %f %f %f %f -o %s", catformat, RAmin, DECmin, RAmax, DECmax, tempFile); 59 psTrace ("psastro", 3, "%s\n", getstarLine); 53 psStringAppend (&getstarCommand, " -D CATMODE mef -region %f %f %f %f -o %s", RAmin, DECmin, RAmax, DECmax, tempFile); 54 psTrace ("psastro", 3, "%s\n", getstarCommand); 60 55 61 56 // XXX use psPipe: catch stderr, stdout, allow for Nsec timeout... 62 status = system (getstar Line);57 status = system (getstarCommand); 63 58 if (status) { 64 59 psError(PSASTRO_ERR_REFSTARS, true, "error loading reference data\n"); 65 60 return NULL; 66 61 } 67 psFree (getstarLine); 68 psFree (catformat); 62 psFree (getstarCommand); 69 63 70 64 psLogMsg ("psastro", 3, "ran getstar : %f sec\n", psTimerMark ("psastro"));
Note:
See TracChangeset
for help on using the changeset viewer.
