Changeset 7573 for trunk/psastro/src/psastroLoadReferences.c
- Timestamp:
- Jun 14, 2006, 4:20:43 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadReferences.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadReferences.c
r7332 r7573 3 3 4 4 # define ELIXIR_MODE 1 5 # define PIPE_MODE 1 5 6 6 7 psArray *psastroLoadReferences (pmConfig *config) { … … 8 9 int fd; 9 10 bool status; 10 char temp File[64], tempLine[256];11 char tempLine[256]; 11 12 12 13 // select the DVO database? … … 25 26 // getstar -region RAmin RAmax DECmin DECmax 26 27 28 # if PIPE_MODE 29 // use fork to add timeout capability 30 // use cfitsio |filename format to avoid tempFile 31 # if ELIXIR_MODE 32 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f |", RAmin, DECmin, RAmax, DECmax, tempFile); 33 # else 34 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f |", RAmin, DECmin, RAmax, DECmax, tempFile); 35 # endif 36 37 psTrace (__func__, 3, "%s\n", tempLine); 38 39 // the output from getstar is a file with the Average table 40 psFits *fits = psFitsOpen (tempLine, "r"); 41 42 # if ELIXIR_MODE 43 psFitsMoveExtName (fits, "DVO_AVERAGE_ELIXIR"); 44 # else 45 psFitsMoveExtName (fits, "DVO_AVERAGE_PANSTARRS"); 46 # endif 47 48 psMetadata *header = psFitsReadHeader (NULL, fits); 49 psArray *table = psFitsReadTable (fits); 50 psFitsClose (fits); 51 52 # else /***** use a temp file instead ****/ 53 54 char tempFile[64]; 27 55 sprintf (tempFile, "/tmp/psastro.XXXXXX"); 28 56 if ((fd = mkstemp (tempFile)) == -1) { … … 61 89 unlink (tempFile); 62 90 91 # endif 92 63 93 // convert the Average table to the pmAstromObj entries 64 94 psArray *refs = psArrayAlloc (table->n);
Note:
See TracChangeset
for help on using the changeset viewer.
