Changeset 9368 for trunk/psastro/src/psastroLoadReferences.c
- Timestamp:
- Oct 6, 2006, 3:00:41 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadReferences.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadReferences.c
r8780 r9368 1 #ifdef HAVE_CONFIG_H2 #include <config.h>3 #endif4 5 1 # include "psastro.h" 6 int mkstemp(char *template); 7 2 // int mkstemp(char *template); 8 3 # define ELIXIR_MODE 1 9 4 # define PIPE_MODE 0 … … 26 21 float DECmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MAX"); 27 22 23 char *CATDIR = psMetadataLookupStr(NULL, recipe, "DVO.CATDIR"); 24 if (CATDIR == NULL) { 25 psLogMsg ("psastro", 2, "warning: missing DVO.CATDIR, using HOME/.ptolemyrc definition\n"); 26 } 27 28 28 // XXX need to add a padding area 29 29 // issue the following command: 30 30 // getstar -region RAmin RAmax DECmin DECmax 31 32 # if PIPE_MODE33 // use fork to add timeout capability34 // use cfitsio |filename format to avoid tempFile35 # if ELIXIR_MODE36 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f |", RAmin, DECmin, RAmax, DECmax, tempFile);37 # else38 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f |", RAmin, DECmin, RAmax, DECmax, tempFile);39 # endif40 41 psTrace (__func__, 3, "%s\n", tempLine);42 43 // the output from getstar is a file with the Average table44 psFits *fits = psFitsOpen (tempLine, "r");45 46 # if ELIXIR_MODE47 psFitsMoveExtName (fits, "DVO_AVERAGE_ELIXIR");48 # else49 psFitsMoveExtName (fits, "DVO_AVERAGE_PANSTARRS");50 # endif51 52 psMetadata *header = psFitsReadHeader (NULL, fits);53 psArray *table = psFitsReadTable (fits);54 psFitsClose (fits);55 56 # else /***** use a temp file instead ****/57 31 58 32 char tempFile[64]; … … 67 41 // use cfitsio |filename format to avoid tempFile 68 42 # if ELIXIR_MODE 69 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f > %s", RAmin, DECmin, RAmax, DECmax, tempFile); 43 if (CATDIR) { 44 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f > %s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile); 45 } else { 46 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f > %s", RAmin, DECmin, RAmax, DECmax, tempFile); 47 } 70 48 # else 71 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f > %s", RAmin, DECmin, RAmax, DECmax, tempFile); 49 if (CATDIR) { 50 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f > %s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile); 51 } else { 52 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f > %s", RAmin, DECmin, RAmax, DECmax, tempFile); 53 } 72 54 # endif 73 55 … … 92 74 psFitsClose (fits); 93 75 unlink (tempFile); 94 95 # endif96 76 97 77 // convert the Average table to the pmAstromObj entries
Note:
See TracChangeset
for help on using the changeset viewer.
