IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18045


Ignore:
Timestamp:
Jun 9, 2008, 5:20:11 PM (18 years ago)
Author:
eugene
Message:

convert psastro DVO.CATDIR to PSASTRO.CATDIR; lookup recipe name as possible abstraction to PSASTRO.CATDIR

File:
1 edited

Legend:

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

    r17999 r18045  
    2828    DECmax += dDEC * fieldPadding;
    2929
    30     // XXX CATDIR needs to look up abstracted name from psastro.config
    31     // XXX which is then selected from the top-level ipprc.config
    32     char *catdir = psMetadataLookupStr(NULL, recipe, "DVO.CATDIR");
     30    // grab the PSASTRO.CATDIR name from the PSASTRO recipe
     31    char *catdir_recipe = psMetadataLookupStr(&status, recipe, "PSASTRO.CATDIR");
     32    psAssert (catdir_recipe, NULL);
     33
     34    // substitute abstract name with concrete name, if present in PSASTRO.CATDIRS
     35    psMetadata *catdirs = psMetadataLookupMetadata(&status, config->complete, "PSASTRO.CATDIRS"); // List of cameras
     36    if (!catdirs) {
     37        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSASTRO.CATDIRS in the system configuration.\n");
     38        return false;
     39    }
     40    char *catdir_virtual = psMetadataLookupStr(&status, catdirs, catdir_recipe);
     41    char *catdir = (catdir_virtual == NULL) ? catdir_recipe : catdir_virtual;
     42
     43    // convert the uri to a real filename (ie, path://foobar)
    3344    psString CATDIR = pmConfigConvertFilename(catdir, config, false); // Resolved filename
    3445    PS_ASSERT (CATDIR, NULL);
Note: See TracChangeset for help on using the changeset viewer.