IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 14, 2006, 4:20:43 PM (20 years ago)
Author:
eugene
Message:

adding autoconf stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroLoadReferences.c

    r7332 r7573  
    33
    44# define ELIXIR_MODE 1
     5# define PIPE_MODE 1
    56
    67psArray *psastroLoadReferences (pmConfig *config) {
     
    89    int fd;
    910    bool status;
    10     char tempFile[64], tempLine[256];
     11    char tempLine[256];
    1112
    1213    // select the DVO database?
     
    2526    // getstar -region RAmin RAmax DECmin DECmax
    2627
     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];
    2755    sprintf (tempFile, "/tmp/psastro.XXXXXX");
    2856    if ((fd = mkstemp (tempFile)) == -1) {
     
    6189    unlink (tempFile);
    6290
     91# endif
     92
    6393    // convert the Average table to the pmAstromObj entries
    6494    psArray *refs = psArrayAlloc (table->n);
Note: See TracChangeset for help on using the changeset viewer.