WCSLIB  7.3.1
wcsfix.h
Go to the documentation of this file.
1 /*============================================================================
2  WCSLIB 7.3 - an implementation of the FITS WCS standard.
3  Copyright (C) 1995-2020, Mark Calabretta
4 
5  This file is part of WCSLIB.
6 
7  WCSLIB is free software: you can redistribute it and/or modify it under the
8  terms of the GNU Lesser General Public License as published by the Free
9  Software Foundation, either version 3 of the License, or (at your option)
10  any later version.
11 
12  WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
13  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15  more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with WCSLIB. If not, see http://www.gnu.org/licenses.
19 
20  Direct correspondence concerning WCSLIB to mark@calabretta.id.au
21 
22  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
23  http://www.atnf.csiro.au/people/Mark.Calabretta
24  $Id: wcsfix.h,v 7.3.1.2 2020/08/17 12:10:44 mcalabre Exp mcalabre $
25 *=============================================================================
26 *
27 * WCSLIB 7.3 - C routines that implement the FITS World Coordinate System
28 * (WCS) standard. Refer to the README file provided with WCSLIB for an
29 * overview of the library.
30 *
31 *
32 * Summary of the wcsfix routines
33 * ------------------------------
34 * Routines in this suite identify and translate various forms of construct
35 * known to occur in FITS headers that violate the FITS World Coordinate System
36 * (WCS) standard described in
37 *
38 = "Representations of world coordinates in FITS",
39 = Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)
40 =
41 = "Representations of celestial coordinates in FITS",
42 = Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II)
43 =
44 = "Representations of spectral coordinates in FITS",
45 = Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
46 = 2006, A&A, 446, 747 (WCS Paper III)
47 =
48 = "Representations of time coordinates in FITS -
49 = Time and relative dimension in space",
50 = Rots, A.H., Bunclark, P.S., Calabretta, M.R., Allen, S.L.,
51 = Manchester, R.N., & Thompson, W.T. 2015, A&A, 574, A36 (WCS Paper VII)
52 *
53 * Repairs effected by these routines range from the translation of
54 * non-standard values for standard WCS keywords, to the repair of malformed
55 * coordinate representations. Some routines are also provided to check the
56 * consistency of pairs of keyvalues that define the same measure in two
57 * different ways, for example, as a date and an MJD.
58 *
59 * Non-standard keyvalues:
60 * -----------------------
61 * AIPS-convention celestial projection types, NCP and GLS, and spectral
62 * types, 'FREQ-LSR', 'FELO-HEL', etc., set in CTYPEia are translated
63 * on-the-fly by wcsset() but without modifying the relevant ctype[], pv[] or
64 * specsys members of the wcsprm struct. That is, only the information
65 * extracted from ctype[] is translated when wcsset() fills in wcsprm::cel
66 * (celprm struct) or wcsprm::spc (spcprm struct).
67 *
68 * On the other hand, these routines do change the values of wcsprm::ctype[],
69 * wcsprm::pv[], wcsprm::specsys and other wcsprm struct members as
70 * appropriate to produce the same result as if the FITS header itself had
71 * been translated.
72 *
73 * Auxiliary WCS header information not used directly by WCSLIB may also be
74 * translated. For example, the older DATE-OBS date format (wcsprm::dateobs)
75 * is recast to year-2000 standard form, and MJD-OBS (wcsprm::mjdobs) will be
76 * deduced from it if not already set.
77 *
78 * Certain combinations of keyvalues that result in malformed coordinate
79 * systems, as described in Sect. 7.3.4 of Paper I, may also be repaired.
80 * These are handled by cylfix().
81 *
82 * Non-standard keywords:
83 * ----------------------
84 * The AIPS-convention CROTAn keywords are recognized as quasi-standard
85 * and as such are accomodated by wcsprm::crota[] and translated to
86 * wcsprm::pc[][] by wcsset(). These are not dealt with here, nor are any
87 * other non-standard keywords since these routines work only on the contents
88 * of a wcsprm struct and do not deal with FITS headers per se. In
89 * particular, they do not identify or translate CD00i00j, PC00i00j, PROJPn,
90 * EPOCH, VELREF or VSOURCEa keywords; this may be done by the FITS WCS
91 * header parser supplied with WCSLIB, refer to wcshdr.h.
92 *
93 * wcsfix() and wcsfixi() apply all of the corrections handled by the following
94 * specific functions which may also be invoked separately:
95 *
96 * - cdfix(): Sets the diagonal element of the CDi_ja matrix to 1.0 if all
97 * CDi_ja keywords associated with a particular axis are omitted.
98 *
99 * - datfix(): recast an older DATE-OBS date format in dateobs to year-2000
100 * standard form.
101 *
102 * Derive dateref from mjdref if not already set. Alternatively, if
103 * dateref is set and mjdref isn't, then derive mjdref from it. If both
104 * are set, then check consistency. Likewise for dateobs and mjdobs;
105 * datebeg and mjdbeg; dateavg and mjdavg; and dateend and mjdend.
106 *
107 * - obsfix(): if only one half of obsgeo[] is set, then derive the other
108 * half from it. If both halves are set, then check consistency.
109 *
110 * - unitfix(): translate some commonly used but non-standard unit strings in
111 * the CUNITia keyvalues, e.g. 'DEG' -> 'deg'.
112 *
113 * - spcfix(): translate AIPS-convention spectral types, 'FREQ-LSR',
114 * 'FELO-HEL', etc., in ctype[] as set from CTYPEia.
115 *
116 * - celfix(): translate AIPS-convention celestial projection types, NCP and
117 * GLS, in ctype[] as set from CTYPEia.
118 *
119 * - cylfix(): fixes WCS keyvalues for malformed cylindrical projections that
120 * suffer from the problem described in Sect. 7.3.4 of Paper I.
121 *
122 *
123 * wcsfix() - Translate a non-standard WCS struct
124 * ----------------------------------------------
125 * wcsfix() is identical to wcsfixi(), but lacks the info argument.
126 *
127 *
128 * wcsfixi() - Translate a non-standard WCS struct
129 * -----------------------------------------------
130 * wcsfixi() applies all of the corrections handled separately by cdfix(),
131 * datfix(), obsfix(), unitfix(), spcfix(), celfix(), and cylfix().
132 *
133 * Given:
134 * ctrl int Do potentially unsafe translations of non-standard
135 * unit strings as described in the usage notes to
136 * wcsutrn().
137 *
138 * naxis const int []
139 * Image axis lengths. If this array pointer is set to
140 * zero then cylfix() will not be invoked.
141 *
142 * Given and returned:
143 * wcs struct wcsprm*
144 * Coordinate transformation parameters.
145 *
146 * Returned:
147 * stat int [NWCSFIX]
148 * Status returns from each of the functions. Use the
149 * preprocessor macros NWCSFIX to dimension this vector
150 * and CDFIX, DATFIX, OBSFIX, UNITFIX, SPCFIX, CELFIX,
151 * and CYLFIX to access its elements. A status value
152 * of -2 is set for functions that were not invoked.
153 *
154 * info struct wcserr [NWCSFIX]
155 * Status messages from each of the functions. Use the
156 * preprocessor macros NWCSFIX to dimension this vector
157 * and CDFIX, DATFIX, OBSFIX, UNITFIX, SPCFIX, CELFIX,
158 * and CYLFIX to access its elements.
159 *
160 * Note that the memory allocated by wcsfixi() for the
161 * message in each wcserr struct (wcserr::msg, if
162 * non-zero) must be freed by the user. See
163 * wcsdealloc().
164 *
165 * Function return value:
166 * int Status return value:
167 * 0: Success.
168 * 1: One or more of the translation functions
169 * returned an error.
170 *
171 *
172 * cdfix() - Fix erroneously omitted CDi_ja keywords
173 * -------------------------------------------------
174 * cdfix() sets the diagonal element of the CDi_ja matrix to unity if all
175 * CDi_ja keywords associated with a given axis were omitted. According to
176 * Paper I, if any CDi_ja keywords at all are given in a FITS header then those
177 * not given default to zero. This results in a singular matrix with an
178 * intersecting row and column of zeros.
179 *
180 * Given and returned:
181 * wcs struct wcsprm*
182 * Coordinate transformation parameters.
183 *
184 * Function return value:
185 * int Status return value:
186 * -1: No change required (not an error).
187 * 0: Success.
188 * 1: Null wcsprm pointer passed.
189 *
190 *
191 * datfix() - Translate DATE-OBS and derive MJD-OBS or vice versa
192 * --------------------------------------------------------------
193 * datfix() translates the old DATE-OBS date format set in wcsprm::dateobs to
194 * year-2000 standard form (yyyy-mm-ddThh:mm:ss).
195 *
196 * datfix() derives wcsprm::dateref from wcsprm::mjdref if not already set.
197 * Alternatively, if dateref is set and mjdref isn't, then it derives mjdref
198 * from it. If both are set but disagree by more than 0.001 day (86.4 seconds)
199 * then status 5 is returned. Likewise for wcsprm::dateobs and wcsprm::mjdobs;
200 * wcsprm::datebeg and wcsprm::mjdbeg; wcsprm::dateavg and wcsprm::mjdavg; and
201 * wcsprm::dateend and wcsprm::mjdend.
202 *
203 * If neither dateobs nor mjdobs are set, but wcsprm::jepoch (primarily) or
204 * wcsprm::bepoch is, then both are derived from it. If jepoch and/or bepoch
205 * are set but disagree with dateobs or mjdobs by more than 0.000002 year
206 * (63.2 seconds), an informative message is produced.
207 *
208 * Given and returned:
209 * wcs struct wcsprm*
210 * Coordinate transformation parameters.
211 * wcsprm::dateref and/or wcsprm::mjdref may be changed.
212 * wcsprm::dateobs and/or wcsprm::mjdobs may be changed.
213 * wcsprm::datebeg and/or wcsprm::mjdbeg may be changed.
214 * wcsprm::dateavg and/or wcsprm::mjdavg may be changed.
215 * wcsprm::dateend and/or wcsprm::mjdend may be changed.
216 *
217 * Function return value:
218 * int Status return value:
219 * -1: No change required (not an error).
220 * 0: Success.
221 * 1: Null wcsprm pointer passed.
222 * 5: Invalid parameter value.
223 *
224 * For returns > 1, a detailed error message is set in
225 * wcsprm::err if enabled, see wcserr_enable().
226 *
227 * Notes:
228 * The MJD algorithms used by datfix() are from D.A. Hatcher, 1984, QJRAS,
229 * 25, 53-55, as modified by P.T. Wallace for use in SLALIB subroutines CLDJ
230 * and DJCL.
231 *
232 *
233 * obsfix() - complete the OBSGEO-[XYZLBH] vector of observatory coordinates
234 * -------------------------------------------------------------------------
235 * obsfix() completes the wcsprm::obsgeo vector of observatory coordinates.
236 * That is, if only the (x,y,z) Cartesian coordinate triplet or the (l,b,h)
237 * geodetic coordinate triplet are set, then it derives the other triplet from
238 * it. If both triplets are set, then it checks for consistency at the level
239 * of 1 metre.
240 *
241 * Given:
242 * ctrl int Flag that controls behaviour if one triplet is
243 * defined and the other is only partially defined:
244 * 0: Reset only the undefined elements of an
245 * incomplete coordinate triplet.
246 * 1: Reset all elements of an incomplete triplet.
247 * 2: Don't make any changes, check for consistency
248 * only. Returns an error if either of the two
249 * triplets is incomplete.
250 *
251 * Given and returned:
252 * wcs struct wcsprm*
253 * Coordinate transformation parameters.
254 * wcsprm::obsgeo may be changed.
255 *
256 * Function return value:
257 * int Status return value:
258 * -1: No change required (not an error).
259 * 0: Success.
260 * 1: Null wcsprm pointer passed.
261 * 5: Invalid parameter value.
262 *
263 * For returns > 1, a detailed error message is set in
264 * wcsprm::err if enabled, see wcserr_enable().
265 *
266 * Notes:
267 * 1: While the International Terrestrial Reference System (ITRS) is based
268 * solely on Cartesian coordinates, it recommends the use of the GRS80
269 * ellipsoid in converting to geodetic coordinates. However, while WCS
270 * Paper III recommends ITRS Cartesian coordinates, Paper VII prescribes
271 * the use of the IAU(1976) ellipsoid for geodetic coordinates, and
272 * consequently that is what is used here.
273 *
274 * 2: For reference, parameters of commonly used global reference ellipsoids:
275 *
276 = a (m) 1/f Standard
277 = --------- ------------- --------------------------------
278 = 6378140 298.2577 IAU(1976)
279 = 6378137 298.257222101 GRS80
280 = 6378137 298.257223563 WGS84
281 = 6378136 298.257 IERS(1989)
282 = 6378136.6 298.25642 IERS(2003,2010), IAU(2009/2012)
283 *
284 * where f = (a - b) / a is the flattening, and a and b are the semi-major
285 * and semi-minor radii in metres.
286 *
287 * 3: The transformation from geodetic (lng,lat,hgt) to Cartesian (x,y,z) is
288 *
289 = x = (n + hgt)*coslng*coslat,
290 = y = (n + hgt)*sinlng*coslat,
291 = z = (n*(1.0 - e^2) + hgt)*sinlat,
292 *
293 * where the "prime vertical radius", n, is a function of latitude
294 *
295 = n = a / sqrt(1 - (e*sinlat)^2),
296 *
297 * and a, the equatorial radius, and e^2 = (2 - f)*f, the (first)
298 * eccentricity of the ellipsoid, are constants. obsfix() inverts these
299 * iteratively by writing
300 *
301 = x = rho*coslng*coslat,
302 = y = rho*sinlng*coslat,
303 = zeta = rho*sinlat,
304 *
305 * where
306 *
307 = rho = n + hgt,
308 = = sqrt(x^2 + y^2 + zeta^2),
309 = zeta = z / (1 - n*e^2/rho),
310 *
311 * and iterating over the value of zeta. Since e is small, a good first
312 * approximation is given by zeta = z.
313 *
314 *
315 * unitfix() - Correct aberrant CUNITia keyvalues
316 * ----------------------------------------------
317 * unitfix() applies wcsutrn() to translate non-standard CUNITia keyvalues,
318 * e.g. 'DEG' -> 'deg', also stripping off unnecessary whitespace.
319 *
320 * Given:
321 * ctrl int Do potentially unsafe translations described in the
322 * usage notes to wcsutrn().
323 *
324 * Given and returned:
325 * wcs struct wcsprm*
326 * Coordinate transformation parameters.
327 *
328 * Function return value:
329 * int Status return value:
330 * -1: No change required (not an error).
331 * 0: Success (an alias was applied).
332 * 1: Null wcsprm pointer passed.
333 *
334 * When units are translated (i.e. status 0), status -2
335 * is set in the wcserr struct to allow an informative
336 * message to be returned.
337 *
338 *
339 * spcfix() - Translate AIPS-convention spectral types
340 * ---------------------------------------------------
341 * spcfix() translates AIPS-convention spectral coordinate types,
342 * '{FREQ,FELO,VELO}-{LSR,HEL,OBS}' (e.g. 'FREQ-OBS', 'FELO-HEL', 'VELO-LSR')
343 * set in wcsprm::ctype[], subject to VELREF set in wcsprm::velref.
344 *
345 * Note that if wcs::specsys is already set then it will not be overridden.
346 *
347 * Given and returned:
348 * wcs struct wcsprm*
349 * Coordinate transformation parameters. wcsprm::ctype[]
350 * and/or wcsprm::specsys may be changed.
351 *
352 * Function return value:
353 * int Status return value:
354 * -1: No change required (not an error).
355 * 0: Success.
356 * 1: Null wcsprm pointer passed.
357 * 2: Memory allocation failed.
358 * 3: Linear transformation matrix is singular.
359 * 4: Inconsistent or unrecognized coordinate axis
360 * types.
361 * 5: Invalid parameter value.
362 * 6: Invalid coordinate transformation parameters.
363 * 7: Ill-conditioned coordinate transformation
364 * parameters.
365 *
366 * For returns > 1, a detailed error message is set in
367 * wcsprm::err if enabled, see wcserr_enable().
368 *
369 *
370 * celfix() - Translate AIPS-convention celestial projection types
371 * ---------------------------------------------------------------
372 * celfix() translates AIPS-convention celestial projection types, NCP and
373 * GLS, set in the ctype[] member of the wcsprm struct.
374 *
375 * Two additional pv[] keyvalues are created when translating NCP, and three
376 * are created when translating GLS with non-zero reference point. If the pv[]
377 * array was initially allocated by wcsini() then the array will be expanded if
378 * necessary. Otherwise, error 2 will be returned if sufficient empty slots
379 * are not already available for use.
380 *
381 * Given and returned:
382 * wcs struct wcsprm*
383 * Coordinate transformation parameters. wcsprm::ctype[]
384 * and/or wcsprm::pv[] may be changed.
385 *
386 * Function return value:
387 * int Status return value:
388 * -1: No change required (not an error).
389 * 0: Success.
390 * 1: Null wcsprm pointer passed.
391 * 2: Memory allocation failed.
392 * 3: Linear transformation matrix is singular.
393 * 4: Inconsistent or unrecognized coordinate axis
394 * types.
395 * 5: Invalid parameter value.
396 * 6: Invalid coordinate transformation parameters.
397 * 7: Ill-conditioned coordinate transformation
398 * parameters.
399 *
400 * For returns > 1, a detailed error message is set in
401 * wcsprm::err if enabled, see wcserr_enable().
402 *
403 *
404 * cylfix() - Fix malformed cylindrical projections
405 * ------------------------------------------------
406 * cylfix() fixes WCS keyvalues for malformed cylindrical projections that
407 * suffer from the problem described in Sect. 7.3.4 of Paper I.
408 *
409 * Given:
410 * naxis const int []
411 * Image axis lengths.
412 *
413 * Given and returned:
414 * wcs struct wcsprm*
415 * Coordinate transformation parameters.
416 *
417 * Function return value:
418 * int Status return value:
419 * -1: No change required (not an error).
420 * 0: Success.
421 * 1: Null wcsprm pointer passed.
422 * 2: Memory allocation failed.
423 * 3: Linear transformation matrix is singular.
424 * 4: Inconsistent or unrecognized coordinate axis
425 * types.
426 * 5: Invalid parameter value.
427 * 6: Invalid coordinate transformation parameters.
428 * 7: Ill-conditioned coordinate transformation
429 * parameters.
430 * 8: All of the corner pixel coordinates are invalid.
431 * 9: Could not determine reference pixel coordinate.
432 * 10: Could not determine reference pixel value.
433 *
434 * For returns > 1, a detailed error message is set in
435 * wcsprm::err if enabled, see wcserr_enable().
436 *
437 *
438 * Global variable: const char *wcsfix_errmsg[] - Status return messages
439 * ---------------------------------------------------------------------
440 * Error messages to match the status value returned from each function.
441 *
442 *===========================================================================*/
443 
444 #ifndef WCSLIB_WCSFIX
445 #define WCSLIB_WCSFIX
446 
447 #include "wcs.h"
448 #include "wcserr.h"
449 
450 #ifdef __cplusplus
451 extern "C" {
452 #endif
453 
454 #define CDFIX 0
455 #define DATFIX 1
456 #define OBSFIX 2
457 #define UNITFIX 3
458 #define SPCFIX 4
459 #define CELFIX 5
460 #define CYLFIX 6
461 #define NWCSFIX 7
462 
463 extern const char *wcsfix_errmsg[];
464 #define cylfix_errmsg wcsfix_errmsg
465 
467  FIXERR_OBSGEO_FIX = -5, // Observatory coordinates amended.
468  FIXERR_DATE_FIX = -4, // Date string reformatted.
469  FIXERR_SPC_UPDATE = -3, // Spectral axis type modified.
470  FIXERR_UNITS_ALIAS = -2, // Units alias translation.
471  FIXERR_NO_CHANGE = -1, // No change.
472  FIXERR_SUCCESS = 0, // Success.
473  FIXERR_NULL_POINTER = 1, // Null wcsprm pointer passed.
474  FIXERR_MEMORY = 2, // Memory allocation failed.
475  FIXERR_SINGULAR_MTX = 3, // Linear transformation matrix is singular.
476  FIXERR_BAD_CTYPE = 4, // Inconsistent or unrecognized coordinate
477  // axis types.
478  FIXERR_BAD_PARAM = 5, // Invalid parameter value.
479  FIXERR_BAD_COORD_TRANS = 6, // Invalid coordinate transformation
480  // parameters.
481  FIXERR_ILL_COORD_TRANS = 7, // Ill-conditioned coordinate transformation
482  // parameters.
483  FIXERR_BAD_CORNER_PIX = 8, // All of the corner pixel coordinates are
484  // invalid.
485  FIXERR_NO_REF_PIX_COORD = 9, // Could not determine reference pixel
486  // coordinate.
487  FIXERR_NO_REF_PIX_VAL = 10 // Could not determine reference pixel value.
488 };
489 
490 int wcsfix(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[]);
491 
492 int wcsfixi(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[],
493  struct wcserr info[]);
494 
495 int cdfix(struct wcsprm *wcs);
496 
497 int datfix(struct wcsprm *wcs);
498 
499 int obsfix(int ctrl, struct wcsprm *wcs);
500 
501 int unitfix(int ctrl, struct wcsprm *wcs);
502 
503 int spcfix(struct wcsprm *wcs);
504 
505 int celfix(struct wcsprm *wcs);
506 
507 int cylfix(const int naxis[], struct wcsprm *wcs);
508 
509 
510 #ifdef __cplusplus
511 }
512 #endif
513 
514 #endif // WCSLIB_WCSFIX
FIXERR_OBSGEO_FIX
@ FIXERR_OBSGEO_FIX
Definition: wcsfix.h:467
datfix
int datfix(struct wcsprm *wcs)
Translate DATE-OBS and derive MJD-OBS or vice versa.
FIXERR_BAD_PARAM
@ FIXERR_BAD_PARAM
Definition: wcsfix.h:478
obsfix
int obsfix(int ctrl, struct wcsprm *wcs)
complete the OBSGEO-[XYZLBH] vector of observatory coordinates.
FIXERR_DATE_FIX
@ FIXERR_DATE_FIX
Definition: wcsfix.h:468
FIXERR_BAD_COORD_TRANS
@ FIXERR_BAD_COORD_TRANS
Definition: wcsfix.h:479
FIXERR_UNITS_ALIAS
@ FIXERR_UNITS_ALIAS
Definition: wcsfix.h:470
FIXERR_SINGULAR_MTX
@ FIXERR_SINGULAR_MTX
Definition: wcsfix.h:475
FIXERR_NO_REF_PIX_COORD
@ FIXERR_NO_REF_PIX_COORD
Definition: wcsfix.h:485
wcsprm
Coordinate transformation parameters.
Definition: wcs.h:1807
FIXERR_MEMORY
@ FIXERR_MEMORY
Definition: wcsfix.h:474
FIXERR_BAD_CORNER_PIX
@ FIXERR_BAD_CORNER_PIX
Definition: wcsfix.h:483
wcsfix_errmsg_enum
wcsfix_errmsg_enum
Definition: wcsfix.h:466
wcsfix_errmsg
const char * wcsfix_errmsg[]
Status return messages.
FIXERR_SUCCESS
@ FIXERR_SUCCESS
Definition: wcsfix.h:472
cdfix
int cdfix(struct wcsprm *wcs)
Fix erroneously omitted CDi_ja keywords.
FIXERR_NULL_POINTER
@ FIXERR_NULL_POINTER
Definition: wcsfix.h:473
wcs.h
FIXERR_NO_CHANGE
@ FIXERR_NO_CHANGE
Definition: wcsfix.h:471
FIXERR_BAD_CTYPE
@ FIXERR_BAD_CTYPE
Definition: wcsfix.h:476
wcsfixi
int wcsfixi(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[], struct wcserr info[])
Translate a non-standard WCS struct.
FIXERR_SPC_UPDATE
@ FIXERR_SPC_UPDATE
Definition: wcsfix.h:469
wcserr
Error message handling.
Definition: wcserr.h:222
unitfix
int unitfix(int ctrl, struct wcsprm *wcs)
Correct aberrant CUNITia keyvalues.
wcsfix
int wcsfix(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[])
Translate a non-standard WCS struct.
FIXERR_NO_REF_PIX_VAL
@ FIXERR_NO_REF_PIX_VAL
Definition: wcsfix.h:487
FIXERR_ILL_COORD_TRANS
@ FIXERR_ILL_COORD_TRANS
Definition: wcsfix.h:481
spcfix
int spcfix(struct wcsprm *wcs)
Translate AIPS-convention spectral types.
celfix
int celfix(struct wcsprm *wcs)
Translate AIPS-convention celestial projection types.
cylfix
int cylfix(const int naxis[], struct wcsprm *wcs)
Fix malformed cylindrical projections.
wcserr.h