IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2006, 3:00:41 PM (20 years ago)
Author:
eugene
Message:

added DVO.CATDIR to config data (what about PHOTCODE_FILE?)

File:
1 edited

Legend:

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

    r8780 r9368  
    1 #ifdef HAVE_CONFIG_H
    2 #include <config.h>
    3 #endif
    4 
    51# include "psastro.h"
    6 int mkstemp(char *template);
    7 
     2// int mkstemp(char *template);
    83# define ELIXIR_MODE 1
    94# define PIPE_MODE 0
     
    2621    float DECmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MAX");
    2722
     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
    2828    // XXX need to add a padding area
    2929    // issue the following command:
    3030    // getstar -region RAmin RAmax DECmin DECmax
    31 
    32 # if PIPE_MODE
    33     // use fork to add timeout capability
    34     // use cfitsio |filename format to avoid tempFile
    35     # if ELIXIR_MODE
    36     sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -region %f %f %f %f |", RAmin, DECmin, RAmax, DECmax, tempFile);
    37     # else
    38     sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -region %f %f %f %f |", RAmin, DECmin, RAmax, DECmax, tempFile);
    39     # endif
    40 
    41     psTrace (__func__, 3, "%s\n", tempLine);
    42 
    43     // the output from getstar is a file with the Average table
    44     psFits *fits = psFitsOpen (tempLine, "r");
    45 
    46     # if ELIXIR_MODE
    47     psFitsMoveExtName (fits, "DVO_AVERAGE_ELIXIR");
    48     # else
    49     psFitsMoveExtName (fits, "DVO_AVERAGE_PANSTARRS");
    50     # endif
    51 
    52     psMetadata *header = psFitsReadHeader (NULL, fits);
    53     psArray *table = psFitsReadTable (fits);
    54     psFitsClose (fits);
    55 
    56 # else /***** use a temp file instead ****/
    5731
    5832    char tempFile[64];
     
    6741    // use cfitsio |filename format to avoid tempFile
    6842    # 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    }
    7048    # 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    }
    7254    # endif
    7355
     
    9274    psFitsClose (fits);
    9375    unlink (tempFile);
    94 
    95 # endif
    9676
    9777    // convert the Average table to the pmAstromObj entries
Note: See TracChangeset for help on using the changeset viewer.