Changeset 12806
- Timestamp:
- Apr 11, 2007, 1:59:28 PM (19 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 4 added
- 29 edited
-
Makefile.am (modified) (1 diff)
-
psastro.c (modified) (4 diffs)
-
psastro.h (modified) (4 diffs)
-
psastroAnalysis.c (added)
-
psastroArguments.c (modified) (1 diff)
-
psastroAstromGuess.c (modified) (1 diff)
-
psastroChipAstrom.c (modified) (1 diff)
-
psastroChooseRefstars.c (modified) (1 diff)
-
psastroCleanup.c (modified) (1 diff)
-
psastroConvert.c (modified) (1 diff)
-
psastroDataLoad.c (modified) (1 diff)
-
psastroDataSave.c (modified) (1 diff)
-
psastroDefineFiles.c (added)
-
psastroDemoDump.c (modified) (1 diff)
-
psastroDemoPlot.c (modified) (1 diff)
-
psastroInternal.h (added)
-
psastroLoadRefstars.c (modified) (4 diffs)
-
psastroLuminosityFunction.c (modified) (1 diff)
-
psastroMosaicAstrom.c (modified) (1 diff)
-
psastroMosaicChipAstrom.c (modified) (1 diff)
-
psastroMosaicGetGrads.c (modified) (1 diff)
-
psastroMosaicGradients.c (modified) (1 diff)
-
psastroMosaicHeaders.c (modified) (1 diff)
-
psastroMosaicOneChip.c (modified) (1 diff)
-
psastroMosaicSetAstrom.c (modified) (1 diff)
-
psastroMosaicSetMatch.c (modified) (1 diff)
-
psastroOneChip.c (modified) (1 diff)
-
psastroParseCamera.c (modified) (2 diffs)
-
psastroRefstarSubset.c (modified) (1 diff)
-
psastroStandAlone.h (added)
-
psastroTestFuncs.c (modified) (1 diff)
-
psastroUtils.c (modified) (1 diff)
-
psastroVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/Makefile.am
r11554 r12806 9 9 10 10 psastro_SOURCES = \ 11 psastro.c 11 psastro.c \ 12 psastroArguments.c \ 13 psastroParseCamera.c \ 14 psastroDataLoad.c \ 15 psastroCleanup.c 16 17 ## move DataSave to psastro_SOURCES? 12 18 13 19 libpsastro_la_SOURCES = \ 14 psastroArguments.c \ 15 psastroErrorCodes.c \ 16 psastroVersion.c \ 17 psastroCleanup.c \ 18 psastroParseCamera.c \ 19 psastroDataLoad.c \ 20 psastroDataSave.c \ 21 psastroAstromGuess.c \ 22 psastroLoadRefstars.c \ 23 psastroChooseRefstars.c \ 24 psastroConvert.c \ 25 psastroChipAstrom.c \ 26 psastroOneChip.c \ 27 psastroUtils.c \ 28 psastroTestFuncs.c \ 29 psastroLuminosityFunction.c \ 30 psastroRefstarSubset.c \ 31 psastroMosaicAstrom.c \ 32 psastroMosaicGradients.c \ 33 psastroMosaicChipAstrom.c \ 34 psastroMosaicOneChip.c \ 35 psastroMosaicSetAstrom.c \ 36 psastroMosaicSetMatch.c \ 37 psastroDemoDump.c \ 38 psastroDemoPlot.c 20 psastroErrorCodes.c \ 21 psastroVersion.c \ 22 psastroDataSave.c \ 23 psastroDefineFiles.c \ 24 psastroAnalysis.c \ 25 psastroAstromGuess.c \ 26 psastroLoadRefstars.c \ 27 psastroChooseRefstars.c \ 28 psastroConvert.c \ 29 psastroChipAstrom.c \ 30 psastroOneChip.c \ 31 psastroUtils.c \ 32 psastroTestFuncs.c \ 33 psastroLuminosityFunction.c \ 34 psastroRefstarSubset.c \ 35 psastroMosaicAstrom.c \ 36 psastroMosaicGradients.c \ 37 psastroMosaicChipAstrom.c \ 38 psastroMosaicOneChip.c \ 39 psastroMosaicSetAstrom.c \ 40 psastroMosaicSetMatch.c \ 41 psastroDemoDump.c \ 42 psastroDemoPlot.c 39 43 40 44 include_HEADERS = \ 41 45 psastro.h \ 42 46 psastroErrorCodes.h 47 48 noinst_HEADERS = \ 49 psastroInternal.h \ 50 psastroStandAlone.h 43 51 44 52 clean-local: -
trunk/psastro/src/psastro.c
r12492 r12806 1 # include "psastro .h"1 # include "psastroStandAlone.h" 2 2 3 3 static void usage (void) { … … 9 9 10 10 pmConfig *config = NULL; 11 psArray *refs = NULL;12 11 13 12 psTimerStart ("complete"); … … 36 35 } 37 36 38 // interpret the available initial astrometric information 39 // apply the initial guess 40 if (!psastroAstromGuess (config)) { 41 psErrorStackPrint(stderr, "failed to determine initial astrometry guess\n"); 37 if (!psastroAnalysis (config)) { 38 psErrorStackPrint(stderr, "failure in psastro analysis\n"); 42 39 exit (1); 43 40 } 44 45 // load the reference stars overlapping the data stars 46 refs = psastroLoadRefstars (config); 47 if (!refs) { 48 psErrorStackPrint(stderr, "failed to load reference data\n"); 49 exit (1); 50 } 51 52 // choose reference stars corresponding to the selected chips 53 if (!psastroChooseRefstars (config, refs)) { 54 psErrorStackPrint(stderr, "failed to select reference data for chips\n"); 55 exit (1); 56 } 57 58 // XXX does this check the recipe?? 59 bool chipastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.CHIP.MODE"); 60 bool mosastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.MOSAIC.MODE"); 61 if (!chipastro && !mosastro) { 62 psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip mode\n"); 63 chipastro= true; 64 } 65 66 if (chipastro) { 67 if (!psastroChipAstrom (config, refs)) { 68 psErrorStackPrint(stderr, "failed to perform single chip astrometry\n"); 69 exit (1); 70 } 71 } 72 73 if (mosastro) { 74 if (!psastroMosaicAstrom (config, refs)) { 75 psErrorStackPrint(stderr, "failed to perform mosaic camera astrometry\n"); 76 exit (1); 77 } 78 } 79 80 // XXX how do we specify stack astrometry? 81 // psastroStackAstrom (config, refs); 82 41 83 42 // write out the results 84 43 if (!psastroDataSave (config)) { … … 89 48 psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete")); 90 49 91 psastroCleanup (config , refs);50 psastroCleanup (config); 92 51 exit (EXIT_SUCCESS); 93 52 } -
trunk/psastro/src/psastro.h
r12718 r12806 1 # ifdef HAVE_CONFIG_H 2 # include <config.h> 3 # endif 1 /* This file defines the library functions available to external programs. It must be included 2 * by programs which are compiled against psphot functions. 3 */ 4 4 5 # include <stdio.h> 6 # include <string.h> 7 # include <strings.h> // for strcasecmp 8 # include <unistd.h> // for unlink 9 # include <pslib.h> 10 # include <psmodules.h> 5 # ifndef PSASTRO_H 6 # define PSASTRO_H 11 7 12 8 # include "psastroErrorCodes.h" 13 # define PSASTRO_RECIPE "PSASTRO" // Name of the recipe to use9 # define PSASTRO_RECIPE "PSASTRO" // Name of the recipe to use 14 10 15 11 # define psMemCopy(A)(psMemIncrRefCounter((A))) … … 27 23 } pmLumFunc; 28 24 29 pmConfig *psastroArguments (int argc, char **argv);30 void psastroCleanup (pmConfig *config, psArray *refs);31 bool psastroParseCamera (pmConfig *config);32 bool psastroDataLoad (pmConfig *config);33 25 bool psastroDataSave (pmConfig *config); 26 bool psastroDefineFiles (pmConfig *config, pmFPAfile *input); 27 bool psastroAnalysis (pmConfig *config); 34 28 35 29 bool psastroConvertFPA (pmFPA *fpa, psMetadata *recipe); … … 38 32 bool psastroAstromGuess (pmConfig *config); 39 33 40 // bool pmAstromReadWCS (pmFPA *fpa, pmChip *chip, psMetadata *header, double plateScale, bool isMosaic);41 // bool pmAstromWriteWCS (psPlaneTransform *toFPA, psPlaneDistort *toTPA, psProjection *toSky, psMetadata *header, double plateScale);42 34 psPlaneDistort *psPlaneDistortIdentity (); 43 bool psPlaneDistortIsIdentity (psPlaneDistort *distort);35 bool psPlaneDistortIsIdentity (psPlaneDistort *distort); 44 36 45 37 psArray *psastroLoadRefstars (pmConfig *config); 46 bool psastroChipAstrom (pmConfig *config , psArray *refs);38 bool psastroChipAstrom (pmConfig *config); 47 39 bool psastroOneChip (pmFPA *fpa, pmChip *chip, psArray *refset, psArray *rawset, psMetadata *recipe, psMetadata *updates); 48 40 bool psastroChooseRefstars (pmConfig *config, psArray *refs); … … 56 48 57 49 // mosaic fitting functions 58 bool psastroMosaicGradients (pmFPA *fpa, psMetadata *recipe);59 bool psastroMosaicCommonScale (pmFPA *fpa, psMetadata *recipe);60 bool psastroMosaicAstrom (pmConfig *config, psArray *refs);61 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration);62 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration);63 bool psastroMosaicSetAstrom (pmFPA *fpa);64 bool psastroMosaicHeaders (pmConfig *config);65 bool psastroMosaicRescaleChips (pmFPA *fpa);66 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration);50 bool psastroMosaicGradients (pmFPA *fpa, psMetadata *recipe); 51 bool psastroMosaicCommonScale (pmFPA *fpa, psMetadata *recipe); 52 bool psastroMosaicAstrom (pmConfig *config); 53 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration); 54 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration); 55 bool psastroMosaicSetAstrom (pmFPA *fpa); 56 bool psastroMosaicHeaders (pmConfig *config); 57 bool psastroMosaicRescaleChips (pmFPA *fpa); 58 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration); 67 59 68 60 // Return version strings. 69 psString psastroVersion(void);70 psString psastroVersionLong(void);61 psString psastroVersion(void); 62 psString psastroVersionLong(void); 71 63 72 64 // demo plots 73 bool psastroPlotRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip);74 bool psastroPlotRefstars (psArray *refstars);75 bool psastroPlotOneChipFit (psArray *rawstars, psArray *refstars, psArray *match, pmAstromFitResults *results);65 bool psastroPlotRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip); 66 bool psastroPlotRefstars (psArray *refstars); 67 bool psastroPlotOneChipFit (psArray *rawstars, psArray *refstars, psArray *match, pmAstromFitResults *results); 76 68 77 bool psastroDumpRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip);78 bool psastroDumpRefstars (psArray *refstars, char *filename);79 bool psastroDumpMatches (pmFPA *fpa, char *filename);80 bool psastroDumpStars (psArray *stars, char *filename);69 bool psastroDumpRawstars (psArray *rawstars, pmFPA *fpa, pmChip *chip); 70 bool psastroDumpRefstars (psArray *refstars, char *filename); 71 bool psastroDumpMatches (pmFPA *fpa, char *filename); 72 bool psastroDumpStars (psArray *stars, char *filename); 81 73 82 bool psastroMosaicSetAstrom_tmp (pmFPA *fpa); 83 int psastroSortByMag (const void **a, const void **b); 74 bool psastroMosaicSetAstrom_tmp (pmFPA *fpa); 75 int psastroSortByMag (const void **a, const void **b); 76 77 # endif /* PSASTRO_H */ -
trunk/psastro/src/psastroArguments.c
r12793 r12806 1 # include "psastro .h"1 # include "psastroStandAlone.h" 2 2 3 3 pmConfig *psastroArguments (int argc, char **argv) { -
trunk/psastro/src/psastroAstromGuess.c
r12708 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 // this function loads the header WCS astrometry terms into the fpa terms and applies the -
trunk/psastro/src/psastroChipAstrom.c
r12718 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 # define NONLIN_TOL 0.001 /* tolerance in pixels */ 3 3 4 bool psastroChipAstrom (pmConfig *config , psArray *refs) {4 bool psastroChipAstrom (pmConfig *config) { 5 5 6 6 pmChip *chip = NULL; -
trunk/psastro/src/psastroChooseRefstars.c
r12718 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroChooseRefstars (pmConfig *config, psArray *refs) { -
trunk/psastro/src/psastroCleanup.c
r12492 r12806 1 # include "psastro .h"1 # include "psastroStandAlone.h" 2 2 3 void psastroCleanup (pmConfig *config , psArray *refs) {3 void psastroCleanup (pmConfig *config) { 4 4 5 psFree (refs);6 5 psFree (config); 7 6 -
trunk/psastro/src/psastroConvert.c
r11551 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 // leak free 2006.04.27 3 3 -
trunk/psastro/src/psastroDataLoad.c
r10438 r12806 1 # include "psastro .h"1 # include "psastroStandAlone.h" 2 2 // this loop loads the data from the input files and selects the 3 3 // brighter stars for astrometry -
trunk/psastro/src/psastroDataSave.c
r11269 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 // XXX leak free 2006.04.27 3 3 -
trunk/psastro/src/psastroDemoDump.c
r12492 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 // this function is used for test purposes (-trace psastro.dump.psastroAstromGuess 1) -
trunk/psastro/src/psastroDemoPlot.c
r11468 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 # if (HAVE_KAPA) -
trunk/psastro/src/psastroLoadRefstars.c
r12794 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 # define ELIXIR_MODE 1 3 3 … … 22 22 PS_ASSERT (CATDIR, NULL); 23 23 24 char *getstarCommand = psMe tadataLookupStr(NULL, recipe, "DVO.GETSTAR");24 char *getstarCommand = psMemIncrRefCounter(psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR")); 25 25 PS_ASSERT (getstarCommand, NULL); 26 26 … … 44 44 } 45 45 46 // XXX check for a default name (use .ptolemyrc)?47 if ( CATDIR) {46 // check for default name (use .ptolemyrc), or use specified CATDIR 47 if (strcasecmp(CATDIR, "NONE")) { 48 48 psStringAppend (&getstarCommand, " -D CATDIR %s", CATDIR); 49 } 49 } 50 50 51 51 // psStringAppend (&getstarCommand, " -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); … … 89 89 // convert the Average table to the pmAstromObj entries 90 90 psTimerStart ("psastro"); 91 91 92 psArray *refstars = psArrayAllocEmpty (table->n); 92 93 for (int i = 0; i < table->n; i++) { -
trunk/psastro/src/psastroLuminosityFunction.c
r12712 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 # define dMag 0.1 3 3 // XXX put this in config? -
trunk/psastro/src/psastroMosaicAstrom.c
r12718 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 # define NONLIN_TOL 0.001 /* tolerance in pixels */ 3 3 4 4 // XXX require this fpa to have multiple chip extensions and a PHU? 5 bool psastroMosaicAstrom (pmConfig *config , psArray *refs) {5 bool psastroMosaicAstrom (pmConfig *config) { 6 6 7 7 // select the current recipe -
trunk/psastro/src/psastroMosaicChipAstrom.c
r12718 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 # define NONLIN_TOL 0.001 /* tolerance in pixels */ 3 3 -
trunk/psastro/src/psastroMosaicGetGrads.c
r12492 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 psArray *psastroMosaicGetGrads (pmFPA *fpa, psMetadata *recipe) { -
trunk/psastro/src/psastroMosaicGradients.c
r12712 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroMosaicGradients (pmFPA *fpa, psMetadata *recipe) { -
trunk/psastro/src/psastroMosaicHeaders.c
r10613 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroMosaicHeaders (pmConfig *config) { -
trunk/psastro/src/psastroMosaicOneChip.c
r12718 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 # define REQUIRED_RECIPE_VALUE(VALUE, NAME, TYPE, MESSAGE)\ -
trunk/psastro/src/psastroMosaicSetAstrom.c
r10880 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroMosaicSetAstrom (pmFPA *fpa) { -
trunk/psastro/src/psastroMosaicSetMatch.c
r10880 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration) { -
trunk/psastro/src/psastroOneChip.c
r12718 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 # define REQUIRED_RECIPE_VALUE(VALUE, NAME, TYPE, MESSAGE)\ -
trunk/psastro/src/psastroParseCamera.c
r10855 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroParseCamera (pmConfig *config) { … … 12 12 } 13 13 14 // select recipe options supplied on command line 15 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 16 17 // set default recipe values here 18 psMetadataAddStr (recipe, PS_LIST_TAIL, "PHOTCODE", PS_META_NO_REPLACE, "", "NONE"); 19 psMetadataAddStr (recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_NO_REPLACE, "", "NONE"); 20 21 // these calls bind the I/O handle to the specified fpa 22 pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT"); 14 // define the additional input/output files associated with psphot 15 if (!psastroDefineFiles (config, input)) { 16 psError(PSASTRO_ERR_CONFIG, false, "Trouble defining the additional input/output files"); 17 return false; 18 } 23 19 24 20 // Chip selection: turn on only the chips specified (option is not required) -
trunk/psastro/src/psastroRefstarSubset.c
r12712 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 bool psastroRefstarSubset (pmReadout *readout) { -
trunk/psastro/src/psastroTestFuncs.c
r9574 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 3 3 // write out objects -
trunk/psastro/src/psastroUtils.c
r12712 r12806 1 # include "psastro .h"1 # include "psastroInternal.h" 2 2 # define RENORM 0 3 3 -
trunk/psastro/src/psastroVersion.c
r10292 r12806 1 #ifdef HAVE_CONFIG_H 2 #include <config.h> 3 #endif 4 5 #include <stdio.h> 6 #include <pslib.h> 7 #include <psmodules.h> 8 #include "psastro.h" 1 #include "psastroInternal.h" 9 2 10 3 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
Note:
See TracChangeset
for help on using the changeset viewer.
