Changeset 27096
- Timestamp:
- Feb 25, 2010, 4:26:50 PM (16 years ago)
- Location:
- trunk/pswarp/src
- Files:
-
- 14 edited
-
pswarp.c (modified) (2 diffs)
-
pswarp.h (modified) (1 diff)
-
pswarpArguments.c (modified) (4 diffs)
-
pswarpCleanup.c (modified) (1 diff)
-
pswarpDefine.c (modified) (6 diffs)
-
pswarpDefineSkycell.c (modified) (9 diffs)
-
pswarpHeadersLoad.c (modified) (3 diffs)
-
pswarpLoop.c (modified) (11 diffs)
-
pswarpParseCamera.c (modified) (13 diffs)
-
pswarpSetMaskBits.c (modified) (4 diffs)
-
pswarpSetThreads.c (modified) (1 diff)
-
pswarpTransformReadout.c (modified) (4 diffs)
-
pswarpTransformSources.c (modified) (4 diffs)
-
pswarpTransformTile.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarp.c
r23195 r27096 28 28 29 29 psLibInit(NULL); 30 31 // model inits are needed in pmSourceIO32 // models defined in psphot/src/models are not available in psastro33 30 pmModelClassInit(); 34 35 // init various psphot pieces (errors, models, threads)36 31 psphotInit(); 37 32 … … 64 59 } 65 60 66 psLogMsg("pswarp", 3, "complete pswarp run: %f sec\n", psTimerMark("pswarp"));67 pswarpCleanup(config); 68 ps LibFinalize();69 exit( PS_EXIT_SUCCESS);61 psLogMsg("pswarp", PS_LOG_INFO, "complete pswarp run: %f sec\n", psTimerMark("pswarp")); 62 63 psExit exitValue = pswarpCleanup(config); 64 exit(exitValue); 70 65 } -
trunk/pswarp/src/pswarp.h
r23688 r27096 81 81 bool pswarpDefine (pmConfig *config); 82 82 bool pswarpLoop (pmConfig *config); 83 voidpswarpCleanup (pmConfig *config);83 psExit pswarpCleanup (pmConfig *config); 84 84 bool pswarpTransformReadout (pmReadout *output, pmReadout *input, pmConfig *config); 85 85 bool pswarpTransformSources(pmReadout *output, pmReadout *input, pmConfig *config); -
trunk/pswarp/src/pswarpArguments.c
r25538 r27096 26 26 // load config data from default locations 27 27 pmConfig *config = pmConfigRead(&argc, argv, PSWARP_RECIPE); 28 if ( config == NULL) {29 psError( PSWARP_ERR_CONFIG, false, "Can't read siteconfiguration");28 if (!config) { 29 psError(psErrorCodeLast(), false, "Can't read configuration"); 30 30 return NULL; 31 31 } … … 33 33 // save the following additional recipe values based on command-line options 34 34 // these options override the PSWARP recipe values loaded from recipe files 35 pmConfigRecipeOptions (config, PSWARP_RECIPE); 35 if (!pmConfigRecipeOptions(config, PSWARP_RECIPE)) { 36 psError(psErrorCodeLast(), false, "Can't do something with recipes"); 37 psFree(config); 38 return NULL; 39 } 36 40 37 41 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); … … 72 76 psThreadPoolInit (nThreads); 73 77 } 74 pswarpSetThreads ();78 pswarpSetThreads(); 75 79 76 80 if ((N = psArgumentGet(argc, argv, "-dumpconfig"))) { … … 160 164 bool PSF = psMetadataLookupBool(&status, recipe, "PSF"); ///< Generate a PSF model? 161 165 if (!status) { 162 PSF = true;166 PSF = true; 163 167 psWarning("PSF is not set in the %s recipe --- defaulting to TRUE.", PSWARP_RECIPE); 164 168 } -
trunk/pswarp/src/pswarpCleanup.c
r21323 r27096 13 13 # include "pswarp.h" 14 14 15 void pswarpCleanup (pmConfig *config) { 15 psExit pswarpCleanup (pmConfig *config) 16 { 17 psExit exitValue = PS_EXIT_SUCCESS; // Exit value for program 18 psErrorCode errorCode = psErrorCodeLast(); // Error code 19 if (errorCode != PS_ERR_NONE) { 20 psErrorStackPrint(stderr, "Unable to perform warp."); 21 switch (errorCode) { 22 case PSWARP_ERR_UNKNOWN: 23 case PS_ERR_UNKNOWN: 24 exitValue = PS_EXIT_UNKNOWN_ERROR; 25 break; 26 case PS_ERR_IO: 27 case PS_ERR_DB_CLIENT: 28 case PS_ERR_DB_SERVER: 29 case PS_ERR_BAD_FITS: 30 case PS_ERR_OS_CALL_FAILED: 31 case PSWARP_ERR_IO: 32 exitValue = PS_EXIT_SYS_ERROR; 33 break; 34 case PS_ERR_BAD_PARAMETER_VALUE: 35 case PS_ERR_BAD_PARAMETER_TYPE: 36 case PS_ERR_BAD_PARAMETER_NULL: 37 case PS_ERR_BAD_PARAMETER_SIZE: 38 case PSWARP_ERR_ARGUMENTS: 39 case PSWARP_ERR_CONFIG: 40 exitValue = PS_EXIT_CONFIG_ERROR; 41 break; 42 case PSWARP_ERR_DATA: 43 case PSWARP_ERR_NO_OVERLAP: 44 exitValue = PS_EXIT_DATA_ERROR; 45 break; 46 case PS_ERR_UNEXPECTED_NULL: 47 case PS_ERR_PROGRAMMING: 48 case PSWARP_ERR_NOT_IMPLEMENTED: 49 default: 50 // It's a programming error if we're not dealing with the error correctly 51 exitValue = PS_EXIT_PROG_ERROR; 52 break; 53 } 54 } 16 55 17 psFree (config); 56 psThreadPoolFinalize(); 57 psMemCheckCorruption(stderr, true); 18 58 19 psTimerStop (); 20 psMemCheckCorruption(stderr, true); 21 pmModelClassCleanup (); 22 psTimeFinalize (); 23 psThreadPoolFinalize (); 24 pmConceptsDone (); 25 pmConfigDone (); 26 // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "pswarp"); 27 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "pswarp"); 59 psFree(config); 28 60 29 return; 61 psTimerStop(); 62 pmVisualClose(); 63 pmModelClassCleanup(); 64 pmConceptsDone(); 65 pmConfigDone(); 66 psLibFinalize(); 67 68 return exitValue; 30 69 } -
trunk/pswarp/src/pswarpDefine.c
r26896 r27096 49 49 { 50 50 if (!pmFPAReadHeaderSet(skycell->fpa, skycell->fits, config)) { 51 psError( PS_ERR_UNKNOWN, false, "Unable to read headers for skycell.");51 psError(psErrorCodeLast(), false, "Unable to read headers for skycell."); 52 52 psFree(view); 53 53 return false; … … 59 59 pmHDU *hdu = pmHDUFromCell(source); ///< HDU for source 60 60 if (!hdu || !hdu->header) { 61 psError(P S_ERR_UNEXPECTED_NULL, false, "Unable to find header for sky cell.");61 psError(PM_ERR_PROG, false, "Unable to find header for sky cell."); 62 62 psFree(view); 63 63 return false; … … 65 65 int numCols = psMetadataLookupS32(NULL, hdu->header, "NAXIS1"); ///< Number of columns 66 66 int numRows = psMetadataLookupS32(NULL, hdu->header, "NAXIS2"); ///< Number of rows 67 if ((numCols == 0) || (numRows == 0)) {68 psError(PS _ERR_UNKNOWN, false, "skycell has invalid dimensions %d x %d", numCols, numRows);67 if ((numCols == 0) || (numRows == 0)) { 68 psError(PSWARP_ERR_DATA, false, "skycell has invalid dimensions %d x %d", numCols, numRows); 69 69 psFree(view); 70 70 return false; … … 77 77 psFree(readout); // Drop reference 78 78 79 bool status = false;79 bool status = false; 80 80 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XBIN"); 81 81 psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YBIN"); … … 106 106 if (bilevelAstrometry) { 107 107 if (!pmAstromReadBilevelMosaic(output->fpa, phu->header)) { 108 psError( PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for skycell.");108 psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for skycell."); 109 109 psFree(view); 110 110 return false; 111 111 } 112 112 if (!pmAstromReadBilevelChip(outputChip, hdu->header)) { 113 psError( PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for skycell.");113 psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for skycell."); 114 114 psFree(view); 115 115 return false; … … 118 118 // we use a default FPA pixel scale of 1.0 119 119 if (!pmAstromReadWCS(output->fpa, outputChip, hdu->header, 1.0)) { 120 psError( PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for skycell.");120 psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for skycell."); 121 121 psFree(view); 122 122 return false; -
trunk/pswarp/src/pswarpDefineSkycell.c
r21323 r27096 47 47 } 48 48 if (infiles->n != 1) { 49 psError(PS _ERR_IO, false, "Found n == %ld files in %s in arguments\n", infiles->n, argname);49 psError(PSWARP_ERR_CONFIG, false, "Found n == %ld files in %s in arguments\n", infiles->n, argname); 50 50 return false; 51 51 } … … 54 54 psString realName = pmConfigConvertFilename (infiles->data[0], config, false, false); 55 55 if (!realName) { 56 psError( PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]);56 psError(psErrorCodeLast(), false, "Failed to convert file name %s\n", (char *) infiles->data[0]); 57 57 return false; 58 58 } … … 61 61 fits = psFitsOpen (realName, "r"); 62 62 if (!fits) { 63 psError( PS_ERR_IO, false, "Failed to open file %s\n", realName);63 psError(psErrorCodeLast(), false, "Failed to open file %s\n", realName); 64 64 psFree (realName); 65 65 return false; … … 67 67 phu = psFitsReadHeader (NULL, fits); 68 68 if (!phu) { 69 psError( PS_ERR_IO, false, "Failed to read file header %s\n", realName);69 psError(psErrorCodeLast(), false, "Failed to read file header %s\n", realName); 70 70 psFree (realName); 71 71 return false; … … 87 87 format = pmConfigCameraFormatFromHeader (NULL, NULL, NULL, skyConfig, phu, false); 88 88 if (!format) { 89 psError( PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);89 psError(psErrorCodeLast(), false, "Failed to read CCD format from %s\n", realName); 90 90 psFree(phu); 91 91 psFree (realName); … … 100 100 fpa = pmFPAConstruct (skyConfig->camera, skyConfig->cameraName); 101 101 if (!fpa) { 102 psError( PS_ERR_IO, false, "Failed to construct FPA from %s", realName);102 psError(psErrorCodeLast(), false, "Failed to construct FPA from %s", realName); 103 103 psFree (realName); 104 104 return false; … … 110 110 file = pmFPAfileDefineInput (skyConfig, fpa, NULL, filename); 111 111 if (!file) { 112 psError( PS_ERR_IO, false, "file %s not defined\n", filename);112 psError(psErrorCodeLast(), false, "file %s not defined\n", filename); 113 113 psFree(phu); 114 114 psFree(fpa); … … 126 126 file->fileLevel = pmFPAPHULevel(format); 127 127 if (file->fileLevel == PM_FPA_LEVEL_NONE) { 128 psError(PS _ERR_IO, true, "Unable to determine file level for %s\n", file->name);128 psError(PSWARP_ERR_CONFIG, true, "Unable to determine file level for %s\n", file->name); 129 129 psFree(phu); 130 130 psFree(fpa); … … 137 137 pmFPAview *view = pmFPAAddSourceFromHeader (fpa, phu, format); 138 138 if (!view) { 139 psError( PS_ERR_IO, false, "Unable to determine source for %s", file->name);139 psError(psErrorCodeLast(), false, "Unable to determine source for %s", file->name); 140 140 psFree(phu); 141 141 psFree (fpa); -
trunk/pswarp/src/pswarpHeadersLoad.c
r21323 r27096 74 74 if (bilevelAstrometry) { 75 75 if (!pmAstromReadBilevelMosaic(input->fpa, phu->header)) { 76 psError( PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input.");76 psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for input."); 77 77 psFree(view); 78 78 return false; … … 92 92 if (bilevelAstrometry) { 93 93 if (!pmAstromReadBilevelChip (chip, hdu->header)) { 94 psError( PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input.");94 psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for input."); 95 95 psFree(view); 96 96 return false; … … 99 99 // we use a default FPA pixel scale of 1.0 100 100 if (!pmAstromReadWCS(input->fpa, chip, hdu->header, 1.0)) { 101 psError( PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input.");101 psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for input."); 102 102 psFree(view); 103 103 return false; -
trunk/pswarp/src/pswarpLoop.c
r27063 r27096 84 84 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSWARP_RECIPE); 85 85 if (!recipe) { 86 psError(PS PHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);86 psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE); 87 87 return false; 88 88 } 89 89 90 90 if (!pswarpSetMaskBits(config)) { 91 psError( PS_ERR_IO, false, "failed to set mask bits");91 psError(psErrorCodeLast(), false, "failed to set mask bits"); 92 92 return NULL; 93 93 } … … 111 111 112 112 if (astrom->camera != input->camera) { 113 psError(PS _ERR_UNKNOWN, true, "Input camera and astrometry camera do not match.");113 psError(PSWARP_ERR_DATA, true, "Input camera and astrometry camera do not match."); 114 114 return false; 115 115 } … … 211 211 if (bilevelAstrometry) { 212 212 if (!pmAstromReadBilevelMosaic(input->fpa, phu->header)) { 213 psError( PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input FPA.");213 psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for input FPA."); 214 214 psFree(view); 215 215 psFree(stats); … … 237 237 if (bilevelAstrometry) { 238 238 if (!pmAstromReadBilevelChip (chip, hdu->header)) { 239 psError( PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input FPA.");239 psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for input FPA."); 240 240 psFree(view); 241 241 psFree(stats); … … 245 245 // we use a default FPA pixel scale of 1.0 246 246 if (!pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0)) { 247 psError( PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input FPA.");247 psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for input FPA."); 248 248 psFree(view); 249 249 psFree(stats); … … 312 312 313 313 if (!pswarpPixelsLit(output, stats, config)) { 314 psError( PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions.");314 psError(psErrorCodeLast(), false, "Unable to calculate pixel regions."); 315 315 psFree(cells); 316 316 psFree(view); … … 349 349 350 350 if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) { 351 psError( PS_ERR_UNKNOWN, false, "Unable to average cell concepts.");351 psError(psErrorCodeLast(), false, "Unable to average cell concepts."); 352 352 psFree(stats); 353 353 psFree(cells); … … 361 361 362 362 if (!psMetadataCopy(outFPA->concepts, input->fpa->concepts)) { 363 psError( PS_ERR_UNKNOWN, false, "Unable to copy FPA concepts from input to output.");363 psError(psErrorCodeLast(), false, "Unable to copy FPA concepts from input to output."); 364 364 psFree(stats); 365 365 psFree(view); … … 388 388 pmHDU *skyHDU = pmHDUFromCell(cell); ///< HDU 389 389 if (!skyHDU) { 390 psError(PS _ERR_UNEXPECTED_NULL, false, "Unable to find skycell HDU.");390 psError(PSWARP_ERR_DATA, false, "Unable to find skycell HDU."); 391 391 psFree(view); 392 392 return false; … … 398 398 399 399 if (!pmAstromWriteWCS(hdu->header, outFPA, outChip, WCS_NONLIN_TOL)) { 400 psError( PS_ERR_UNKNOWN, false, "Unable to generate WCS header.");400 psError(psErrorCodeLast(), false, "Unable to generate WCS header."); 401 401 psFree(stats); 402 402 return false; … … 428 428 psArray *sources = psphotLoadPSFSources (config, view); 429 429 if (!sources) { 430 psError( PS_ERR_UNKNOWN, false, "No sources supplied to measure PSF");430 psError(psErrorCodeLast(), false, "No sources supplied to measure PSF"); 431 431 return false; 432 432 } -
trunk/pswarp/src/pswarpParseCamera.c
r26896 r27096 31 31 } 32 32 if (!status) { 33 psError( PSWARP_ERR_CONFIG, false, "Failed to load file definition for %s", filerule);33 psError(psErrorCodeLast(), false, "Failed to load file definition for %s", filerule); 34 34 return false; 35 35 } … … 38 38 file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return 39 39 if (!status) { 40 psError( PSWARP_ERR_CONFIG, false, "Failed to load file definition for %s", filerule);40 psError(psErrorCodeLast(), false, "Failed to load file definition for %s", filerule); 41 41 return NULL; 42 42 } … … 65 65 pmFPAfile *input = defineInputFile(config, NULL, "PSWARP.INPUT", "INPUT", PM_FPA_FILE_IMAGE); 66 66 if (!input) { 67 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT");67 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.INPUT"); 68 68 return false; 69 69 } … … 89 89 bool status = pswarpDefineSkycell(&skycell, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL"); 90 90 if (!status) { 91 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.SKYCELL");91 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.SKYCELL"); 92 92 return false; 93 93 } … … 97 97 pmFPAfile *output = pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT"); 98 98 if (!output) { 99 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT");99 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT"); 100 100 return false; 101 101 } … … 104 104 pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.MASK"); 105 105 if (!outMask) { 106 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.MASK");106 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.MASK"); 107 107 return false; 108 108 } … … 112 112 pmFPAfile *outVariance = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.VARIANCE"); 113 113 if (!outVariance) { 114 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE");114 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE"); 115 115 return false; 116 116 } … … 121 121 pmFPAfile *outSources = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.SOURCES"); 122 122 if (!outSources) { 123 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.SOURCES");123 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.SOURCES"); 124 124 return false; 125 125 } … … 129 129 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSWARP_RECIPE); 130 130 if (!recipe) { 131 psError(PS PHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);131 psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE); 132 132 return false; 133 133 } … … 139 139 pmFPAfile *psphotInput = pmFPAfileDefineSkycell(config, NULL, "PSPHOT.INPUT"); 140 140 if (!psphotInput) { 141 psError( PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT"));141 psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT")); 142 142 return false; 143 143 } 144 144 psphotInput->src = psMemIncrRefCounter(output->fpa); 145 // specify the number of psphot input images146 psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1);145 // specify the number of psphot input images 146 psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1); 147 147 148 148 pmFPAfile *psphotInSources = pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF"); 149 149 if (!psphotInSources) { 150 psError( PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT.CMF"));150 psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT.CMF")); 151 151 return false; 152 152 } … … 155 155 psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes, PSPHOT_RECIPE); // Recipe 156 156 if (!psphotRecipe) { 157 psError(PS _ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE);157 psError(PSWARP_ERR_CONFIG, false, "Unable to find %s recipe.", PSPHOT_RECIPE); 158 158 return false; 159 159 } … … 162 162 // Define associated psphot input/output files 163 163 if (!psphotDefineFiles(config, psphotInput)) { 164 psError(PS PHOT_ERR_CONFIG, false,164 psError(PSWARP_ERR_CONFIG, false, 165 165 "Unable to define the additional input/output files for psphot"); 166 166 return false; … … 183 183 int chipNum = atoi(chips->data[i]); 184 184 if (! pmFPASelectChip(input->fpa, chipNum, false)) { 185 psError(PSWARP_ERR_ CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum);185 psError(PSWARP_ERR_ARGUMENTS, true, "Chip number %d doesn't exist in camera.\n", chipNum); 186 186 return false; 187 187 } -
trunk/pswarp/src/pswarpSetMaskBits.c
r26013 r27096 28 28 // this function sets the required single-image mask bits 29 29 if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) { 30 psError ( PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");30 psError (psErrorCodeLast(), false, "Unable to define the mask bit values"); 31 31 return false; 32 32 } … … 64 64 } 65 65 if (!markOut) { 66 psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!");66 psError(PSWARP_ERR_CONFIG, true, "Unable to define the MARK bit mask: all bits taken!"); 67 67 return false; 68 68 } … … 71 71 psMetadata *warpRecipe = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE); 72 72 if (!warpRecipe) { 73 psError(PS PHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);73 psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE); 74 74 return false; 75 75 } … … 85 85 psMetadata *psphotRecipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 86 86 if (!psphotRecipe) { 87 psError(PS PHOT_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE);87 psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE); 88 88 return false; 89 89 } -
trunk/pswarp/src/pswarpSetThreads.c
r23487 r27096 19 19 { 20 20 pswarpTransformTileArgs *args = job->args->data[0]; 21 bool status = pswarpTransformTile (args); 22 return status; 21 return pswarpTransformTile(args); 23 22 } 24 23 25 bool pswarpSetThreads(void) { 26 27 psThreadTask *task = NULL; 28 29 task = psThreadTaskAlloc("PSWARP_TRANSFORM_TILE", 1); 24 bool pswarpSetThreads(void) 25 { 26 psThreadTask *task = psThreadTaskAlloc("PSWARP_TRANSFORM_TILE", 1); 30 27 task->function = &pswarpThread_pswarpTransformTile; 31 28 psThreadTaskAdd(task); -
trunk/pswarp/src/pswarpTransformReadout.c
r26896 r27096 89 89 90 90 if (!pmReadoutMaskNonfinite(input, pmConfigMaskGet("SAT", config))) { 91 psError( PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in input.");91 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in input."); 92 92 return false; 93 93 } … … 129 129 psArrayAdd(job->args, 1, args); 130 130 if (!psThreadJobAddPending(job)) { 131 psError( PS_ERR_UNKNOWN, false, "Unable to warp image.");131 psError(psErrorCodeLast(), false, "Unable to warp image."); 132 132 return false; 133 133 } … … 140 140 // wait here for the threaded jobs to finish 141 141 if (!psThreadPoolWait (false)) { 142 psError( PS_ERR_UNKNOWN, false, "Unable to interpolate image.");142 psError(psErrorCodeLast(), false, "Unable to interpolate image."); 143 143 return false; 144 144 } … … 185 185 if (goodPixels > 0) { 186 186 if (!pswarpTransformSources(output, input, config)) { 187 psError( PS_ERR_UNKNOWN, false, "Unable to interpolate image.");187 psError(psErrorCodeLast(), false, "Unable to interpolate image."); 188 188 return false; 189 189 } -
trunk/pswarp/src/pswarpTransformSources.c
r26896 r27096 45 45 psArray *outSources = outDetections->allSources; 46 46 if (!outSources) { 47 outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);48 outSources = outDetections->allSources;47 outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER); 48 outSources = outDetections->allSources; 49 49 } 50 50 … … 61 61 int xGrid, yGrid; ///< Grid coordinates for local map 62 62 if (!pswarpMapGridSetGrid(sourceGrid, xIn + 0.5, yIn + 0.5, &xGrid, &yGrid)) { 63 psError( PS_ERR_UNKNOWN, false, "Unable to get grid coordinates for source at %f,%f\n",63 psError(psErrorCodeLast(), false, "Unable to get grid coordinates for source at %f,%f\n", 64 64 xIn, yIn); 65 65 psFree(outDetections); … … 76 76 double xOut, yOut; ///< Output coordinates 77 77 if (!pswarpMapApply(&xOut, &yOut, map, xIn + 0.5, yIn + 0.5)) { 78 psError( PS_ERR_UNKNOWN, false, "Unable to transform coordinates for source at %f,%f\n",78 psError(psErrorCodeLast(), false, "Unable to transform coordinates for source at %f,%f\n", 79 79 xIn, yIn); 80 80 psFree(outDetections); … … 111 111 112 112 new->modelPSF = pmModelAlloc(source->modelPSF->type); 113 new->modelPSF->params->data.F32[PM_PAR_I0]=114 (isfinite(new->psfMag) ? pow(10.0, -0.4*new->psfMag) : NAN);115 new->modelPSF->dparams->data.F32[PM_PAR_I0]=116 (isfinite(new->psfMag) ? new->errMag*pow(10.0, -0.4*new->psfMag) : NAN);113 new->modelPSF->params->data.F32[PM_PAR_I0]= 114 (isfinite(new->psfMag) ? pow(10.0, -0.4*new->psfMag) : NAN); 115 new->modelPSF->dparams->data.F32[PM_PAR_I0]= 116 (isfinite(new->psfMag) ? new->errMag*pow(10.0, -0.4*new->psfMag) : NAN); 117 117 118 118 #if 0 -
trunk/pswarp/src/pswarpTransformTile.c
r23487 r27096 98 98 psImageMaskType maskValue = inMaskData ? inMaskData[(int)yIn][(int)xIn] : 0; // Value of mask 99 99 if (!psImageInterpolate(&imageValue, &varValue, &maskValue, xIn, yIn, args->interp)) { 100 psError( PS_ERR_UNKNOWN, false, "Unable to interpolate image.");100 psError(psErrorCodeLast(), false, "Unable to interpolate image."); 101 101 return false; 102 102 }
Note:
See TracChangeset
for help on using the changeset viewer.
