WCSLIB  4.25.1
dis.h
Go to the documentation of this file.
1 /*============================================================================
2 
3  WCSLIB 5.1 - an implementation of the FITS WCS standard.
4  Copyright (C) 1995-2015, Mark Calabretta
5 
6  This file is part of WCSLIB.
7 
8  WCSLIB is free software: you can redistribute it and/or modify it under the
9  terms of the GNU Lesser General Public License as published by the Free
10  Software Foundation, either version 3 of the License, or (at your option)
11  any later version.
12 
13  WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
16  more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with WCSLIB. If not, see http://www.gnu.org/licenses.
20 
21  Direct correspondence concerning WCSLIB to mark@calabretta.id.au
22 
23  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
24  http://www.atnf.csiro.au/people/Mark.Calabretta
25  $Id: dis.h,v 5.1 2015/04/07 10:56:36 mcalabre Exp $
26 *=============================================================================
27 *
28 * WCSLIB 5.1 - experimental C routines that implement proposed extensions to
29 * the FITS World Coordinate System (WCS) standard. Refer to
30 *
31 * "Representations of distortions in FITS world coordinate systems",
32 * Calabretta, M.R. et al. (Paper IV), draft dated 2004/04/22 available from
33 * http://www.atnf.csiro.au/people/Mark.Calabretta
34 *
35 * Refer to the README file provided with WCSLIB for an overview of the
36 * library.
37 *
38 *
39 * Summary of the dis routines
40 * ---------------------------
41 * These routines apply the distortion functions defined by the extension to
42 * the FITS WCS standard proposed in Paper IV. They are based on the disprm
43 * struct which contains all information needed for the computations. The
44 * struct contains some members that must be set by the user, and others that
45 * are maintained by these routines, somewhat like a C++ class but with no
46 * encapsulation.
47 *
48 * Four routines, disini(), disparms(), discpy(), and disfree() are provided to
49 * manage the disprm struct, and another, disprt(), prints its contents.
50 *
51 * A setup routine, disset(), computes intermediate values in the disprm struct
52 * from parameters in it that were supplied by the user. The struct always
53 * needs to be set up by disset(), though disset() need not be called
54 * explicitly - refer to the explanation of disprm::flag.
55 *
56 * disp2x() and disx2p() implement the WCS distortion functions, disp2x() using
57 * separate functions, such as tpv1(), to do the computation.
58 *
59 * An auxiliary routine, diswarp(), computes various measures of the distortion
60 * over a specified range of pixels.
61 *
62 *
63 * disini() - Default constructor for the disprm struct
64 * ----------------------------------------------------
65 * disini() allocates memory for arrays in a disprm struct and sets all members
66 * of the struct to default values.
67 *
68 * In general, different distortion functions may be associated with each axis,
69 * and at the point where disini() is invoked, it is usually not known how many
70 * distortion parameters may be required for each. Hence a separate routine,
71 * disparms(), is provided to allocate memory for the parameter arrays if
72 * desired. One way or the other, after invoking disini(), it is the caller's
73 * responsibility to allocate memory (if necessary) for the distortion
74 * parameters. If disparms() is used for this purpose, then disfree() will
75 * free it and subsequent calls to disini() will manage it, e.g. if naxis
76 * changes. Of course, if there is no distortion function on an axis then
77 * there is no need to allocate memory for any parameters.
78 *
79 * PLEASE NOTE: every disprm struct must be initialized by disini(), possibly
80 * repeatedly. On the first invokation, and only the first invokation,
81 * disprm::flag must be set to -1 to initialize memory management, regardless
82 * of whether disini() will actually be used to allocate memory.
83 *
84 * Given:
85 * alloc int If true, allocate memory unconditionally for arrays in
86 * the disprm struct.
87 *
88 * If false, it is assumed that pointers to these arrays
89 * have been set by the user except if they are null
90 * pointers in which case memory will be allocated for
91 * them regardless. (In other words, setting alloc true
92 * saves having to initalize these pointers to zero.)
93 *
94 * naxis int The number of world coordinate axes, used to determine
95 * array sizes.
96 *
97 * Given and returned:
98 * dis struct disprm*
99 * Distortion function parameters. Note that, in order
100 * to initialize memory management disprm::flag must be
101 * set to -1 when dis is initialized for the first time
102 * (memory leaks may result if it had already been
103 * initialized).
104 *
105 * Function return value:
106 * int Status return value:
107 * 0: Success.
108 * 1: Null disprm pointer passed.
109 * 2: Memory allocation failed.
110 *
111 * For returns > 1, a detailed error message is set in
112 * disprm::err if enabled, see wcserr_enable().
113 *
114 *
115 * disparms() - Allocate memory for parameters in a disprm struct
116 * --------------------------------------------------------------
117 * disparms() allocates memory for the arrays of distortion function parameters
118 * in a disprm struct. It relies on disprm::nparm[] having been set to
119 * determine the number of parameters for each distortion function. The
120 * allocated memory will be freed by disfree().
121 *
122 * Given and returned:
123 * dis struct disprm*
124 * disprm::nparm[] is used to determine the number of
125 * parameters in each distortion function. Memory is
126 * allocated for the distortion function parameters,
127 * disprm::parms[][], and it is initialized to zero.
128 *
129 * Function return value:
130 * int Status return value:
131 * 0: Success.
132 * 1: Null disprm pointer passed.
133 * 2: Memory allocation failed.
134 *
135 * For returns > 1, a detailed error message is set in
136 * disprm::err if enabled, see wcserr_enable().
137 *
138 *
139 * discpy() - Copy routine for the disprm struct
140 * ---------------------------------------------
141 * discpy() does a deep copy of one disprm struct to another, using disini() to
142 * allocate memory unconditionally for its arrays if required. Only the
143 * "information to be provided" part of the struct is copied; a call to
144 * disset() is required to initialize the remainder.
145 *
146 * Given:
147 * alloc int If true, allocate memory unconditionally for arrays in
148 * the destination, including the parameter array via a
149 * call to disparms(). Otherwise, it is assumed that
150 * pointers to these arrays have been set by the user
151 * except if they are null pointers in which case memory
152 * will be allocated for them regardless.
153 *
154 * dissrc const struct disprm*
155 * Struct to copy from.
156 *
157 * Given and returned:
158 * disdst struct disprm*
159 * Struct to copy to. disprm::flag should be set to -1
160 * if disdst was not previously initialized (memory leaks
161 * may result if it was previously initialized).
162 *
163 * Function return value:
164 * int Status return value:
165 * 0: Success.
166 * 1: Null disprm pointer passed.
167 * 2: Memory allocation failed.
168 *
169 * For returns > 1, a detailed error message is set in
170 * disprm::err if enabled, see wcserr_enable().
171 *
172 *
173 * disfree() - Destructor for the disprm struct
174 * --------------------------------------------
175 * disfree() frees memory allocated for the disprm arrays by disini() and/or
176 * disparms(). disini() and disparms() keep a record of the memory they
177 * allocate and disfree() will only attempt to free this.
178 *
179 * PLEASE NOTE: disfree() must not be invoked on a disprm struct that was not
180 * initialized by disini().
181 *
182 * Given:
183 * dis struct disprm*
184 * Distortion function parameters.
185 *
186 * Function return value:
187 * int Status return value:
188 * 0: Success.
189 * 1: Null disprm pointer passed.
190 *
191 *
192 * disprt() - Print routine for the disprm struct
193 * ----------------------------------------------
194 * disprt() prints the contents of a disprm struct using wcsprintf(). Mainly
195 * intended for diagnostic purposes.
196 *
197 * Given:
198 * dis const struct disprm*
199 * Distortion function parameters.
200 *
201 * Function return value:
202 * int Status return value:
203 * 0: Success.
204 * 1: Null disprm pointer passed.
205 *
206 *
207 * disset() - Setup routine for the disprm struct
208 * ----------------------------------------------
209 * disset(), sets up the disprm struct according to information supplied within
210 * it - refer to the explanation of disprm::flag.
211 *
212 * Note that this routine need not be called directly; it will be invoked by
213 * disp2x() and disx2p() if the disprm::flag is anything other than a
214 * predefined magic value.
215 *
216 * Given and returned:
217 * dis struct disprm*
218 * Distortion function parameters.
219 *
220 * Function return value:
221 * int Status return value:
222 * 0: Success.
223 * 1: Null disprm pointer passed.
224 * 2: Memory allocation failed.
225 * 3: Invalid parameter.
226 *
227 * For returns > 1, a detailed error message is set in
228 * disprm::err if enabled, see wcserr_enable().
229 *
230 *
231 * disp2x() - Apply distortion function
232 * ------------------------------------
233 * disp2x() applies the distortion functions. By definition, the distortion
234 * is in the pixel-to-world direction.
235 *
236 * Depending on the point in the algorithm chain at which it is invoked,
237 * disp2x() may transform pixel coordinates to corrected pixel coordinates, or
238 * intermediate pixel coordinates to corrected intermediate pixel coordinates,
239 * or image coordinates to corrected image coordinates.
240 *
241 *
242 * Given and returned:
243 * dis struct disprm*
244 * Distortion function parameters.
245 *
246 * Given:
247 * rawcrd const double[naxis]
248 * Array of coordinates.
249 *
250 * Returned:
251 * discrd double[naxis]
252 * Array of coordinates to which the distortion functions
253 * have been applied.
254 *
255 * Function return value:
256 * int Status return value:
257 * 0: Success.
258 * 1: Null disprm pointer passed.
259 * 2: Memory allocation failed.
260 * 3: Invalid parameter.
261 * 4: Distort error.
262 *
263 * For returns > 1, a detailed error message is set in
264 * disprm::err if enabled, see wcserr_enable().
265 *
266 *
267 * disx2p() - Apply de-distortion function
268 * ---------------------------------------
269 * disx2p() applies the inverse of the distortion functions. By definition,
270 * the de-distortion is in the world-to-pixel direction.
271 *
272 * Depending on the point in the algorithm chain at which it is invoked,
273 * disx2p() may transform corrected pixel coordinates to pixel coordinates, or
274 * corrected intermediate pixel coordinates to intermediate pixel coordinates,
275 * or corrected image coordinates to image coordinates.
276 *
277 * disx2p() iteratively solves for the inverse using disp2x(). It assumes
278 * that the distortion is small and the functions are well-behaved, being
279 * continuous and with continuous derivatives. Also that, to first order
280 * in the neighbourhood of the solution, discrd[j] ~= a + b*rawcrd[j], i.e.
281 * independent of rawcrd[i], where i != j. This is effectively equivalent to
282 * assuming that the distortion functions are separable to first order.
283 * Furthermore, a is assumed to be small, and b close to unity.
284 *
285 * Given and returned:
286 * dis struct disprm*
287 * Distortion function parameters.
288 *
289 * Given:
290 * discrd const double[naxis]
291 * Array of coordinates.
292 *
293 * Returned:
294 * rawcrd double[naxis]
295 * Array of coordinates to which the inverse distortion
296 * functions have been applied.
297 *
298 * Function return value:
299 * int Status return value:
300 * 0: Success.
301 * 1: Null disprm pointer passed.
302 * 2: Memory allocation failed.
303 * 3: Invalid parameter.
304 * 5: De-distort error.
305 *
306 * For returns > 1, a detailed error message is set in
307 * disprm::err if enabled, see wcserr_enable().
308 *
309 *
310 * diswarp() - Compute measures of distortion
311 * ------------------------------------------
312 * diswarp() computes various measures of the distortion over the specified
313 * range of coordinates.
314 *
315 * For prior distortions, the measures may be interpreted simply as an offset
316 * in pixel coordinates. For sequent distortions, the interpretation depends
317 * on the nature of the linear transformation matrix (PCi_ja or CDi_ja). If
318 * the latter introduces a scaling, then the measures will also be scaled.
319 * Note also that the image domain, which is rectangular in pixel coordinates,
320 * may be rotated, skewed, and/or stretched in intermediate pixel coordinates,
321 * and in general cannot be defined using pixblc[] and pixtrc[].
322 *
323 * PLEASE NOTE: the measures of total distortion may be essentially meaningless
324 * if there are multiple sequent distortions with different scaling.
325 *
326 * See also linwarp().
327 *
328 * Given and returned:
329 * dis struct disprm*
330 * Distortion function parameters.
331 *
332 * Given:
333 * pixblc const double[naxis]
334 * Start of the range of pixel coordinates (for prior
335 * distortions), or intermediate pixel coordinates (for
336 * sequent distortions). May be specified as a NULL
337 * pointer which is interpreted as (1,1,...).
338 *
339 * pixtrc const double[naxis]
340 * End of the range of pixel coordinates (prior) or
341 * intermediate pixel coordinates (sequent).
342 *
343 * pixsamp const double[naxis]
344 * If positive or zero, the increment on the particular
345 * axis, starting at pixblc[]. Zero is interpreted as a
346 * unit increment. pixsamp may also be specified as a
347 * NULL pointer which is interpreted as all zeroes, i.e.
348 * unit increments on all axes.
349 *
350 * If negative, the grid size on the particular axis (the
351 * absolute value being rounded to the nearest integer).
352 * For example, if pixsamp is (-128.0,-128.0,...) then
353 * each axis will be sampled at 128 points between
354 * pixblc[] and pixtrc[] inclusive. Use caution when
355 * using this option on non-square images.
356 *
357 * Returned:
358 * nsamp int* The number of pixel coordinates sampled.
359 *
360 * Can be specified as a NULL pointer if not required.
361 *
362 * maxdis double[naxis]
363 * For each individual distortion function, the
364 * maximum absolute value of the distortion.
365 *
366 * Can be specified as a NULL pointer if not required.
367 *
368 * maxtot double* For the combination of all distortion functions, the
369 * maximum absolute value of the distortion.
370 *
371 * Can be specified as a NULL pointer if not required.
372 *
373 * avgdis double[naxis]
374 * For each individual distortion function, the
375 * mean value of the distortion.
376 *
377 * Can be specified as a NULL pointer if not required.
378 *
379 * avgtot double* For the combination of all distortion functions, the
380 * mean value of the distortion.
381 *
382 * Can be specified as a NULL pointer if not required.
383 *
384 * rmsdis double[naxis]
385 * For each individual distortion function, the
386 * root mean square deviation of the distortion.
387 *
388 * Can be specified as a NULL pointer if not required.
389 *
390 * rmstot double* For the combination of all distortion functions, the
391 * root mean square deviation of the distortion.
392 *
393 * Can be specified as a NULL pointer if not required.
394 *
395 * Function return value:
396 * int Status return value:
397 * 0: Success.
398 * 1: Null disprm pointer passed.
399 * 2: Memory allocation failed.
400 * 3: Invalid parameter.
401 * 4: Distort error.
402 *
403 *
404 * disprm struct - Distortion parameters
405 * -------------------------------------
406 * The disprm struct contains all of the information required to apply a set of
407 * distortion functions. It consists of certain members that must be set by
408 * the user ("given") and others that are set by the WCSLIB routines
409 * ("returned").
410 *
411 * int flag
412 * (Given and returned) This flag must be set to zero whenever any of the
413 * following members of the disprm struct are set or modified:
414 *
415 * - disprm::naxis,
416 * - disprm::dtype,
417 * - disprm::axmap,
418 * - disprm::nparm,
419 * - disprm::parms.
420 *
421 * This signals the initialization routine, disset(), to recompute the
422 * returned members of the disprm struct. disset() will reset flag to
423 * indicate that this has been done.
424 *
425 * PLEASE NOTE: flag must be set to -1 when disini() is called for the
426 * first time for a particular disprm struct in order to initialize memory
427 * management. It must ONLY be used on the first initialization otherwise
428 * memory leaks may result.
429 *
430 * int naxis
431 * (Given or returned) Number of pixel and world coordinate elements.
432 *
433 * If disini() is used to initialize the disprm struct (as would normally
434 * be the case) then it will set naxis from the value passed to it as a
435 * function argument. The user should not subsequently modify it.
436 *
437 * char (*dtype)[16]
438 * (Given) Pointer to the first element of an array of char[16] containing
439 * the name of the distortion function for each axis.
440 *
441 * int **axmap
442 * (Given) Pointer to the first element of an array of int* containing
443 * pointers to the first elements of the axis mapping arrays for each axis.
444 *
445 * An axis mapping associates the independent variables of a distortion
446 * function with the 1-relative image axis number. For example, consider
447 * an image with a spectrum on the first axis, followed by RA, Dec, and
448 * time axes. For a distortion in (RA,Dec) and no distortion on the
449 * spectral or time axes, the axis mapping arrays, axmap[j][], would be
450 *
451 = j=0: [0, 0, 0, 0] ...no distortion on spectral axis,
452 = 1: [2, 3, 0, 0] ...RA distortion depends on RA and Dec,
453 = 2: [3, 2, 0, 0] ...Dec distortion depends on Dec and RA,
454 = 3: [0, 0, 0, 0] ...no distortion on time axis,
455 *
456 * where zero indicates that there is no corresponding independent
457 * variable.
458 *
459 * double **offset
460 * (Given) Pointer to the first element of an array of double* containing
461 * an offset used to renormalize the independent variables of the
462 * distortion function for each axis.
463 *
464 * The offsets are subtracted from the independent variables before
465 * scaling.
466 *
467 * It is not necessary to reset the disprm struct (via disset()) when
468 * disprm::offset is changed.
469 *
470 * double **scale
471 * (Given) Pointer to the first element of an array of double* containing
472 * a scale used to renormalize the independent variables of the distortion
473 * function for each axis.
474 *
475 * The scale is applied to the independent variables after the offsets are
476 * subtracted.
477 *
478 * It is not necessary to reset the disprm struct (via disset()) when
479 * disprm::scale is changed.
480 *
481 * int *nparm
482 * (Given) Pointer to the first element of an array of int containing the
483 * number of distortion parameters for each axis.
484 *
485 * The number of parameters specified must satisfy the requirements of the
486 * particular distortion function. For example, the polynomial distortion
487 * associated with the TPV "projection" must have a number that corresponds
488 * to the degree of the polynomial:
489 *
490 = Degree 1: 4
491 = 2: 7
492 = 3: 12
493 = 4: 17
494 = 5: 24
495 = 6: 31
496 = 7: 40
497 *
498 * double **parms
499 * (Given) Pointer to the first element of an array of double* containing
500 * pointers to the first elements of the arrays of distortion parameters
501 * for each axis.
502 *
503 * disparms() may be used to allocate memory for these arrays.
504 *
505 * double *maxdis
506 * (Given) Pointer to the first element of an array of double specifying
507 * the maximum absolute value of the distortion for each axis computed over
508 * the whole image.
509 *
510 * It is not necessary to reset the disprm struct (via disset()) when
511 * disprm::maxdis is changed.
512 *
513 * double totdis
514 * (Given) The maximum absolute value of the combination of all distortion
515 * functions specified as an offset in pixel coordinates computed over the
516 * whole image.
517 *
518 * It is not necessary to reset the disprm struct (via disset()) when
519 * disprm::totdis is changed.
520 *
521 * int ndis
522 * (Returned) The number of distortion functions.
523 *
524 * int padding
525 * (An unused variable inserted for alignment purposes only.)
526 *
527 * struct wcserr *err
528 * (Returned) If enabled, when an error status is returned, this struct
529 * contains detailed information about the error, see wcserr_enable().
530 *
531 * int (**disp2x)(DISP2X_ARGS)
532 * (For internal use only.)
533 * int (**disx2p)(DISX2P_ARGS)
534 * (For internal use only.)
535 * double *tmpmem
536 * (For internal use only.)
537 * int **iwrk
538 * (For internal use only.)
539 * double **dwrk
540 * (For internal use only.)
541 * int m_flag
542 * (For internal use only.)
543 * int m_naxis
544 * (For internal use only.)
545 * char (*m_dtype)[16]
546 * (For internal use only.)
547 * int **m_axmap
548 * (For internal use only.)
549 * double **m_offset
550 * (For internal use only.)
551 * double **m_scale
552 * (For internal use only.)
553 * int *m_nparm
554 * (For internal use only.)
555 * double **m_parms
556 * (For internal use only.)
557 * double *m_maxdis
558 * (For internal use only.)
559 * int m_alloc
560 * (For internal use only.)
561 * int m_padding
562 * (For internal use only.)
563 *
564 *
565 * Global variable: const char *dis_errmsg[] - Status return messages
566 * ------------------------------------------------------------------
567 * Error messages to match the status value returned from each function.
568 *
569 *===========================================================================*/
570 
571 #ifndef WCSLIB_DIS
572 #define WCSLIB_DIS
573 
574 #ifdef __cplusplus
575 extern "C" {
576 #endif
577 
578 
579 extern const char *dis_errmsg[];
580 
582  DISERR_SUCCESS = 0, /* Success. */
583  DISERR_NULL_POINTER = 1, /* Null disprm pointer passed. */
584  DISERR_MEMORY = 2, /* Memory allocation failed. */
585  DISERR_BAD_PARAM = 3, /* Invalid parameter value. */
586  DISERR_DISTORT = 4, /* Distortion error. */
587  DISERR_DEDISTORT = 5 /* De-distortion error. */
588 };
589 
590 /* For use in declaring distortion function prototypes. */
591 #define DISP2X_ARGS int nparm, const double parms[], int ncrd, \
592 const double rawcrd[], double *discrd
593 
594 /* For use in declaring de-distortion function prototypes. */
595 #define DISX2P_ARGS int nparm, const double parms[], int ncrd, \
596 const double discrd[], double rawcrd[]
597 
598 
599 struct disprm {
600  /* Initialization flag (see the prologue above). */
601  /*------------------------------------------------------------------------*/
602  int flag; /* Set to zero to force initialization. */
603 
604  /* Parameters to be provided (see the prologue above). */
605  /*------------------------------------------------------------------------*/
606  int naxis; /* The number of pixel coordinate elements, */
607  /* given by NAXIS. */
608  char (*dtype)[16]; /* For each axis, the distortion type. */
609  int **axmap; /* For each axis, the axis mapping array. */
610  double **offset; /* For each axis, renormalization offset. */
611  double **scale; /* For each axis, renormalization scale. */
612  int *nparm; /* For each axis, the number of distortion */
613  /* parameters. */
614  double **parms; /* For each axis, the array of distortion */
615  /* parameters. */
616  double *maxdis; /* For each axis, the maximum distortion. */
617  double totdis; /* The maximum combined distortion. */
618 
619  /* Information derived from the parameters supplied. */
620  /*------------------------------------------------------------------------*/
621  int ndis; /* The number of distortion functions. */
622  int padding; /* (Dummy inserted for alignment purposes.) */
623 
624  /* Error handling, if enabled. */
625  /*------------------------------------------------------------------------*/
626  struct wcserr *err;
627 
628  /* Private - the remainder are for internal use. */
629  /*------------------------------------------------------------------------*/
630  int (**disp2x)(DISP2X_ARGS); /* For each axis, pointers to the */
631  int (**disx2p)(DISX2P_ARGS); /* distortion function and its inverse. */
632 
633  double *tmpmem;
634  double **iwrk;
635  double **dwrk;
636 
637  int m_flag, m_naxis; /* The remainder are for memory management. */
638  char (*m_dtype)[16];
639  int **m_axmap;
640  double **m_offset, **m_scale;
641  int *m_nparm;
642  double **m_parms;
643  double *m_maxdis;
645 };
646 
647 /* Size of the disprm struct in int units, used by the Fortran wrappers. */
648 #define DISLEN (sizeof(struct disprm)/sizeof(int))
649 
650 
651 int disini(int alloc, int naxis, struct disprm *dis);
652 
653 int disparms(struct disprm *dis);
654 
655 int discpy(int alloc, const struct disprm *dissrc, struct disprm *disdst);
656 
657 int disfree(struct disprm *dis);
658 
659 int disprt(const struct disprm *dis);
660 
661 int disset(struct disprm *dis);
662 
663 int disp2x(struct disprm *dis, const double rawcrd[], double discrd[]);
664 
665 int disx2p(struct disprm *dis, const double discrd[], double rawcrd[]);
666 
667 int diswarp(struct disprm *dis, const double pixblc[], const double pixtrc[],
668  const double pixsamp[], int *nsamp,
669  double maxdis[], double *maxtot,
670  double avgdis[], double *avgtot,
671  double rmsdis[], double *rmstot);
672 
673 
674 /* Specialist distortion functions (internal use only). */
675 int tpvset(int j, struct disprm *dis);
676 int tpv1(DISP2X_ARGS);
677 int tpv2(DISP2X_ARGS);
678 int tpv3(DISP2X_ARGS);
679 int tpv4(DISP2X_ARGS);
680 int tpv5(DISP2X_ARGS);
681 int tpv6(DISP2X_ARGS);
682 int tpv7(DISP2X_ARGS);
683 
684 #ifdef __cplusplus
685 }
686 #endif
687 
688 #endif /* WCSLIB_DIS */
int flag
Definition: dis.h:602
int discpy(int alloc, const struct disprm *dissrc, struct disprm *disdst)
Copy routine for the disprm struct.
Definition: dis.h:586
const char * dis_errmsg[]
Status return messages.
int ** axmap
Definition: dis.h:609
int disp2x(struct disprm *dis, const double rawcrd[], double discrd[])
Apply distortion function.
double ** scale
Definition: dis.h:611
int ** m_axmap
Definition: dis.h:639
double ** m_scale
Definition: dis.h:640
Error message handling.
Definition: wcserr.h:221
int disx2p(struct disprm *dis, const double discrd[], double rawcrd[])
Apply de-distortion function.
Definition: dis.h:585
int disset(struct disprm *dis)
Setup routine for the disprm struct.
int naxis
Definition: dis.h:606
double ** m_offset
Definition: dis.h:640
int tpv5(DISP2X_ARGS)
(Internal use only.)
int tpv1(DISP2X_ARGS)
(Internal use only.)
int m_flag
Definition: dis.h:637
Definition: dis.h:587
int ndis
Definition: dis.h:621
int * nparm
Definition: dis.h:612
Distortion parameters.
Definition: dis.h:599
int tpv3(DISP2X_ARGS)
(Internal use only.)
char(* dtype)[16]
Definition: dis.h:608
Definition: dis.h:583
int disfree(struct disprm *dis)
Destructor for the disprm struct.
double ** m_parms
Definition: dis.h:642
int tpv4(DISP2X_ARGS)
(Internal use only.)
dis_errmsg_enum
Definition: dis.h:581
int m_naxis
Definition: dis.h:637
int disprt(const struct disprm *dis)
Print routine for the disprm struct.
double * tmpmem
Definition: dis.h:633
int m_padding
Definition: dis.h:644
double * maxdis
Definition: dis.h:616
int m_alloc
Definition: dis.h:644
double ** dwrk
Definition: dis.h:635
double totdis
Definition: dis.h:617
int(** disx2p)(DISX2P_ARGS)
Definition: dis.h:631
Definition: dis.h:582
int tpvset(int j, struct disprm *dis)
(Internal use only.)
struct wcserr * err
Definition: dis.h:626
int disini(int alloc, int naxis, struct disprm *dis)
Default constructor for the disprm struct.
int tpv6(DISP2X_ARGS)
(Internal use only.)
double ** parms
Definition: dis.h:614
Definition: dis.h:584
int * m_nparm
Definition: dis.h:641
int tpv2(DISP2X_ARGS)
(Internal use only.)
double * m_maxdis
Definition: dis.h:643
int diswarp(struct disprm *dis, const double pixblc[], const double pixtrc[], const double pixsamp[], int *nsamp, double maxdis[], double *maxtot, double avgdis[], double *avgtot, double rmsdis[], double *rmstot)
Compute measures of distortion.
double ** offset
Definition: dis.h:610
int padding
Definition: dis.h:622
#define DISX2P_ARGS
Definition: dis.h:595
int(** disp2x)(DISP2X_ARGS)
Definition: dis.h:630
double ** iwrk
Definition: dis.h:634
char(* m_dtype)[16]
Definition: dis.h:638
int tpv7(DISP2X_ARGS)
(Internal use only.)
int disparms(struct disprm *dis)
Allocate memory for parameters in a disprm struct.
#define DISP2X_ARGS
Definition: dis.h:591