Changeset 9732 for trunk/psastro/src/psastroLoadRefstars.c
- Timestamp:
- Oct 24, 2006, 1:58:13 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadRefstars.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadRefstars.c
r9645 r9732 24 24 char *CATDIR = psMetadataLookupStr(NULL, recipe, "DVO.CATDIR"); 25 25 if (CATDIR == NULL) { 26 psLogMsg ("psastro", 2, "warning: missing DVO.CATDIR, using ~/.ptolemyrc definition\n");26 psLogMsg ("psastro", 2, "warning: missing DVO.CATDIR, using ~/.ptolemyrc definition\n"); 27 27 } 28 28 … … 33 33 sprintf (tempFile, "/tmp/psastro.XXXXXX"); 34 34 if ((fd = mkstemp (tempFile)) == -1) { 35 psError(PSASTRO_ERR_REFSTARS, true, "error creating temp output file\n");35 psError(PSASTRO_ERR_REFSTARS, true, "error creating temp output file\n"); 36 36 return NULL; 37 37 } … … 42 42 // use fork to add timeout capability 43 43 if (ELIXIR_MODE) { 44 psStringAppend (&catformat, "-D CATFORMAT elixir ");44 psStringAppend (&catformat, "-D CATFORMAT elixir "); 45 45 } else { 46 psStringAppend (&catformat, "-D CATFORMAT panstarrs ");47 } 46 psStringAppend (&catformat, "-D CATFORMAT panstarrs "); 47 } 48 48 49 49 if (CATDIR) { 50 psStringAppend (&catformat, "-D CATDIR %s ", CATDIR);51 } 50 psStringAppend (&catformat, "-D CATDIR %s ", CATDIR); 51 } 52 52 53 53 psStringAppend (&getstarLine, "getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); … … 57 57 status = system (getstarLine); 58 58 if (status) { 59 psError(PSASTRO_ERR_REFSTARS, true, "error loading reference data\n");59 psError(PSASTRO_ERR_REFSTARS, true, "error loading reference data\n"); 60 60 return NULL; 61 61 } … … 69 69 70 70 if (ELIXIR_MODE) { 71 psFitsMoveExtName (fits, "DVO_AVERAGE_ELIXIR");71 psFitsMoveExtName (fits, "DVO_AVERAGE_ELIXIR"); 72 72 } else { 73 psFitsMoveExtName (fits, "DVO_AVERAGE_PANSTARRS");73 psFitsMoveExtName (fits, "DVO_AVERAGE_PANSTARRS"); 74 74 } 75 75 … … 84 84 // convert the Average table to the pmAstromObj entries 85 85 psTimerStart ("psastro"); 86 psArray *refs = psArrayAlloc (table->n);86 psArray *refs = psArrayAllocEmpty (table->n); 87 87 for (int i = 0; i < table->n; i++) { 88 88 pmAstromObj *ref = pmAstromObjAlloc (); … … 91 91 92 92 // DVO tables are stored in degrees 93 if (ELIXIR_MODE) {94 ref->sky->r = RAD_DEG*psMetadataLookupF32 (&status, row, "RA");95 ref->sky->d = RAD_DEG*psMetadataLookupF32 (&status, row, "DEC");96 ref->Mag = 0.001*psMetadataLookupS32 (&status, row, "MAG"); // ELIXIR uses millimags93 if (ELIXIR_MODE) { 94 ref->sky->r = RAD_DEG*psMetadataLookupF32 (&status, row, "RA"); 95 ref->sky->d = RAD_DEG*psMetadataLookupF32 (&status, row, "DEC"); 96 ref->Mag = 0.001*psMetadataLookupS32 (&status, row, "MAG"); // ELIXIR uses millimags 97 97 } else { 98 ref->sky->r = RAD_DEG*psMetadataLookupF64 (&status, row, "RA");99 ref->sky->d = RAD_DEG*psMetadataLookupF64 (&status, row, "DEC");100 ref->Mag = psMetadataLookupF32 (&status, row, "MAG"); // PANSTARRS uses mags101 }98 ref->sky->r = RAD_DEG*psMetadataLookupF64 (&status, row, "RA"); 99 ref->sky->d = RAD_DEG*psMetadataLookupF64 (&status, row, "DEC"); 100 ref->Mag = psMetadataLookupF32 (&status, row, "MAG"); // PANSTARRS uses mags 101 } 102 102 103 103 psArrayAdd (refs, 100, ref);
Note:
See TracChangeset
for help on using the changeset viewer.
