Changeset 9627 for trunk/psastro/src/psastroLoadRefstars.c
- Timestamp:
- Oct 18, 2006, 8:44:12 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadRefstars.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadRefstars.c
r9587 r9627 20 20 float DECmin = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MIN"); 21 21 float DECmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MAX"); 22 float MAGmax = psMetadataLookupF32(NULL, recipe, "MAG_MAX"); 22 23 23 24 char *CATDIR = psMetadataLookupStr(NULL, recipe, "DVO.CATDIR"); … … 38 39 close (fd); 39 40 41 psTimerStart ("psastro"); 42 40 43 // use fork to add timeout capability 41 44 // use cfitsio |filename format to avoid tempFile 42 45 # if ELIXIR_MODE 43 46 if (CATDIR) { 44 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT elixir -D CATMODE mef - region %f %f %f %f -o %s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile);47 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT elixir -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", CATDIR, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 45 48 } else { 46 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef - region %f %f %f %f -o %s", RAmin, DECmin, RAmax, DECmax, tempFile);49 sprintf (tempLine, "getstar -D CATFORMAT elixir -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 47 50 } 48 51 # else 49 52 if (CATDIR) { 50 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT panstarrs -D CATMODE mef - region %f %f %f %f -o %s", CATDIR, RAmin, DECmin, RAmax, DECmax, tempFile);53 sprintf (tempLine, "getstar -D CATDIR %s -D CATFORMAT panstarrs -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", CATDIR, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 51 54 } else { 52 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef - region %f %f %f %f -o %s", RAmin, DECmin, RAmax, DECmax, tempFile);55 sprintf (tempLine, "getstar -D CATFORMAT panstarrs -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 53 56 } 54 57 # endif … … 61 64 } 62 65 66 psLogMsg ("psastro", 3, "ran getstar : %f sec\n", psTimerMark ("psastro")); 67 63 68 // the output from getstar is a file with the Average table 64 69 psFits *fits = psFitsOpen (tempFile, "r"); … … 70 75 # endif 71 76 77 psTimerStart ("psastro"); 72 78 psMetadata *header = psFitsReadHeader (NULL, fits); 73 79 psArray *table = psFitsReadTable (fits); 74 80 psFitsClose (fits); 81 75 82 unlink (tempFile); 83 psLogMsg ("psastro", 3, "read getstar output table : %f sec\n", psTimerMark ("psastro")); 76 84 77 85 // convert the Average table to the pmAstromObj entries 86 psTimerStart ("psastro"); 78 87 psArray *refs = psArrayAlloc (table->n); 79 88 for (int i = 0; i < table->n; i++) { … … 98 107 psFree (header); 99 108 psFree (table); 109 psLogMsg ("psastro", 3, "converted table to pmAstromObj : %f sec\n", psTimerMark ("psastro")); 100 110 101 111 psTrace ("psastro", 3, "loaded %ld reference stars from (%10.6f,%10.6f) - (%10.6f,%10.6f)\n", 102 112 refs->n, RAmin, DECmin, RAmax, DECmax); 113 103 114 return refs; 104 115 }
Note:
See TracChangeset
for help on using the changeset viewer.
