1# Licensed under a 3-clause BSD style license - see LICENSE.rst
2
3# It gets to be really tedious to type long docstrings in ANSI C
4# syntax (since multi-line string literals are not valid).
5# Therefore, the docstrings are written here in doc/docstrings.py,
6# which are then converted by setup.py into docstrings.h, which is
7# included by pywcs.c
8
9__all__ = ['TWO_OR_MORE_ARGS', 'RETURNS', 'ORIGIN', 'RA_DEC_ORDER']
10
11
12def _fix(content, indent=0):
13    lines = content.split('\n')
14    indent = '\n' + ' ' * indent
15    return indent.join(lines)
16
17
18def TWO_OR_MORE_ARGS(naxis, indent=0):
19    return _fix(
20f"""*args
21    There are two accepted forms for the positional arguments:
22
23        - 2 arguments: An *N* x *{naxis}* array of coordinates, and an
24          *origin*.
25
26        - more than 2 arguments: An array for each axis, followed by
27          an *origin*.  These arrays must be broadcastable to one
28          another.
29
30    Here, *origin* is the coordinate in the upper left corner of the
31    image.  In FITS and Fortran standards, this is 1.  In Numpy and C
32    standards this is 0.
33""", indent)
34
35
36def RETURNS(out_type, indent=0):
37    return _fix(f"""result : array
38    Returns the {out_type}.  If the input was a single array and
39    origin, a single array is returned, otherwise a tuple of arrays is
40    returned.""", indent)
41
42
43def ORIGIN(indent=0):
44    return _fix(
45"""
46origin : int
47    Specifies the origin of pixel values.  The Fortran and FITS
48    standards use an origin of 1.  Numpy and C use array indexing with
49    origin at 0.
50""", indent)
51
52
53def RA_DEC_ORDER(indent=0):
54    return _fix(
55"""
56ra_dec_order : bool, optional
57    When `True` will ensure that world coordinates are always given
58    and returned in as (*ra*, *dec*) pairs, regardless of the order of
59    the axes specified by the in the ``CTYPE`` keywords.  Default is
60    `False`.
61""", indent)
62
63
64a = """
65``double array[a_order+1][a_order+1]`` Focal plane transformation
66matrix.
67
68The `SIP`_ ``A_i_j`` matrix used for pixel to focal plane
69transformation.
70
71Its values may be changed in place, but it may not be resized, without
72creating a new `~astropy.wcs.Sip` object.
73"""
74
75a_order = """
76``int`` (read-only) Order of the polynomial (``A_ORDER``).
77"""
78
79all_pix2world = """
80all_pix2world(pixcrd, origin) -> ``double array[ncoord][nelem]``
81
82Transforms pixel coordinates to world coordinates.
83
84Does the following:
85
86    - Detector to image plane correction (if present)
87
88    - SIP distortion correction (if present)
89
90    - FITS WCS distortion correction (if present)
91
92    - wcslib "core" WCS transformation
93
94The first three (the distortion corrections) are done in parallel.
95
96Parameters
97----------
98pixcrd : ndarray
99    Array of pixel coordinates as ``double array[ncoord][nelem]``.
100
101{}
102
103Returns
104-------
105world : ndarray
106    Returns an array of world coordinates as ``double array[ncoord][nelem]``.
107
108Raises
109------
110MemoryError
111    Memory allocation failed.
112
113SingularMatrixError
114    Linear transformation matrix is singular.
115
116InconsistentAxisTypesError
117    Inconsistent or unrecognized coordinate axis types.
118
119ValueError
120    Invalid parameter value.
121
122ValueError
123    Invalid coordinate transformation parameters.
124
125ValueError
126    x- and y-coordinate arrays are not the same size.
127
128InvalidTransformError
129    Invalid coordinate transformation.
130
131InvalidTransformError
132    Ill-conditioned coordinate transformation parameters.
133""".format(ORIGIN())
134
135alt = """
136``str`` Character code for alternate coordinate descriptions.
137
138For example, the ``"a"`` in keyword names such as ``CTYPEia``.  This
139is a space character for the primary coordinate description, or one of
140the 26 upper-case letters, A-Z.
141"""
142
143ap = """
144``double array[ap_order+1][ap_order+1]`` Focal plane to pixel
145transformation matrix.
146
147The `SIP`_ ``AP_i_j`` matrix used for focal plane to pixel
148transformation.  Its values may be changed in place, but it may not be
149resized, without creating a new `~astropy.wcs.Sip` object.
150"""
151
152ap_order = """
153``int`` (read-only) Order of the polynomial (``AP_ORDER``).
154"""
155
156aux = """
157`~astropy.wcs.Auxprm` Auxiliary coordinate system information of a specialist nature.
158"""
159
160Auxprm = """
161Class that contains auxiliary coordinate system information of a specialist
162nature.
163
164This class can not be constructed directly from Python, but instead is
165returned from `~astropy.wcs.Wcsprm.aux`.
166"""
167
168axis_types = """
169``int array[naxis]`` An array of four-digit type codes for each axis.
170
171- First digit (i.e. 1000s):
172
173  - 0: Non-specific coordinate type.
174
175  - 1: Stokes coordinate.
176
177  - 2: Celestial coordinate (including ``CUBEFACE``).
178
179  - 3: Spectral coordinate.
180
181- Second digit (i.e. 100s):
182
183  - 0: Linear axis.
184
185  - 1: Quantized axis (``STOKES``, ``CUBEFACE``).
186
187  - 2: Non-linear celestial axis.
188
189  - 3: Non-linear spectral axis.
190
191  - 4: Logarithmic axis.
192
193  - 5: Tabular axis.
194
195- Third digit (i.e. 10s):
196
197  - 0: Group number, e.g. lookup table number
198
199- The fourth digit is used as a qualifier depending on the axis type.
200
201  - For celestial axes:
202
203    - 0: Longitude coordinate.
204
205    - 1: Latitude coordinate.
206
207    - 2: ``CUBEFACE`` number.
208
209  - For lookup tables: the axis number in a multidimensional table.
210
211``CTYPEia`` in ``"4-3"`` form with unrecognized algorithm code will
212have its type set to -1 and generate an error.
213"""
214
215b = """
216``double array[b_order+1][b_order+1]`` Pixel to focal plane
217transformation matrix.
218
219The `SIP`_ ``B_i_j`` matrix used for pixel to focal plane
220transformation.  Its values may be changed in place, but it may not be
221resized, without creating a new `~astropy.wcs.Sip` object.
222"""
223
224b_order = """
225``int`` (read-only) Order of the polynomial (``B_ORDER``).
226"""
227
228bounds_check = """
229bounds_check(pix2world, world2pix)
230
231Enable/disable bounds checking.
232
233Parameters
234----------
235pix2world : bool, optional
236    When `True`, enable bounds checking for the pixel-to-world (p2x)
237    transformations.  Default is `True`.
238
239world2pix : bool, optional
240    When `True`, enable bounds checking for the world-to-pixel (s2x)
241    transformations.  Default is `True`.
242
243Notes
244-----
245Note that by default (without calling `bounds_check`) strict bounds
246checking is enabled.
247"""
248
249bp = """
250``double array[bp_order+1][bp_order+1]`` Focal plane to pixel
251transformation matrix.
252
253The `SIP`_ ``BP_i_j`` matrix used for focal plane to pixel
254transformation.  Its values may be changed in place, but it may not be
255resized, without creating a new `~astropy.wcs.Sip` object.
256"""
257
258bp_order = """
259``int`` (read-only) Order of the polynomial (``BP_ORDER``).
260"""
261
262cd = """
263``double array[naxis][naxis]`` The ``CDi_ja`` linear transformation
264matrix.
265
266For historical compatibility, three alternate specifications of the
267linear transformations are available in wcslib.  The canonical
268``PCi_ja`` with ``CDELTia``, ``CDi_ja``, and the deprecated
269``CROTAia`` keywords.  Although the latter may not formally co-exist
270with ``PCi_ja``, the approach here is simply to ignore them if given
271in conjunction with ``PCi_ja``.
272
273`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and
274`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of
275these alternatives are present in the header.
276
277These alternate specifications of the linear transformation matrix are
278translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and
279are nowhere visible to the lower-level routines.  In particular,
280`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity
281if ``CDi_ja`` is present (and no ``PCi_ja``).  If no ``CROTAia`` is
282associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts
283to a unity ``PCi_ja`` matrix.
284"""
285
286cdelt = """
287``double array[naxis]`` Coordinate increments (``CDELTia``) for each
288coord axis.
289
290If a ``CDi_ja`` linear transformation matrix is present, a warning is
291raised and `~astropy.wcs.Wcsprm.cdelt` is ignored.  The ``CDi_ja``
292matrix may be deleted by::
293
294  del wcs.wcs.cd
295
296An undefined value is represented by NaN.
297"""
298
299cdfix = """
300cdfix()
301
302Fix erroneously omitted ``CDi_ja`` keywords.
303
304Sets the diagonal element of the ``CDi_ja`` matrix to unity if all
305``CDi_ja`` keywords associated with a given axis were omitted.
306According to Paper I, if any ``CDi_ja`` keywords at all are given in a
307FITS header then those not given default to zero.  This results in a
308singular matrix with an intersecting row and column of zeros.
309
310Returns
311-------
312success : int
313    Returns ``0`` for success; ``-1`` if no change required.
314"""
315
316cel_offset = """
317``boolean`` Is there an offset?
318
319If `True`, an offset will be applied to ``(x, y)`` to force ``(x, y) =
320(0, 0)`` at the fiducial point, (phi_0, theta_0).  Default is `False`.
321"""
322
323celfix = """
324Translates AIPS-convention celestial projection types, ``-NCP`` and
325``-GLS``.
326
327Returns
328-------
329success : int
330    Returns ``0`` for success; ``-1`` if no change required.
331"""
332
333cname = """
334``list of strings`` A list of the coordinate axis names, from
335``CNAMEia``.
336"""
337
338colax = """
339``int array[naxis]`` An array recording the column numbers for each
340axis in a pixel list.
341"""
342
343colnum = """
344``int`` Column of FITS binary table associated with this WCS.
345
346Where the coordinate representation is associated with an image-array
347column in a FITS binary table, this property may be used to record the
348relevant column number.
349
350It should be set to zero for an image header or pixel list.
351"""
352
353compare = """
354compare(other, cmp=0, tolerance=0.0)
355
356Compare two Wcsprm objects for equality.
357
358Parameters
359----------
360
361other : Wcsprm
362    The other Wcsprm object to compare to.
363
364cmp : int, optional
365    A bit field controlling the strictness of the comparison.  When 0,
366    (the default), all fields must be identical.
367
368    The following constants, defined in the `astropy.wcs` module,
369    may be or'ed together to loosen the comparison.
370
371    - ``WCSCOMPARE_ANCILLARY``: Ignores ancillary keywords that don't
372      change the WCS transformation, such as ``XPOSURE`` or
373      ``EQUINOX``. Note that this also ignores ``DATE-OBS``, which does
374      change the WCS transformation in some cases.
375
376    - ``WCSCOMPARE_TILING``: Ignore integral differences in
377      ``CRPIXja``.  This is the 'tiling' condition, where two WCSes
378      cover different regions of the same map projection and align on
379      the same map grid.
380
381    - ``WCSCOMPARE_CRPIX``: Ignore any differences at all in
382      ``CRPIXja``.  The two WCSes cover different regions of the same
383      map projection but may not align on the same grid map.
384      Overrides ``WCSCOMPARE_TILING``.
385
386tolerance : float, optional
387    The amount of tolerance required.  For example, for a value of
388    1e-6, all floating-point values in the objects must be equal to
389    the first 6 decimal places.  The default value of 0.0 implies
390    exact equality.
391
392Returns
393-------
394equal : bool
395"""
396
397convert = """
398convert(array)
399
400Perform the unit conversion on the elements of the given *array*,
401returning an array of the same shape.
402"""
403
404coord = """
405``double array[K_M]...[K_2][K_1][M]`` The tabular coordinate array.
406
407Has the dimensions::
408
409    (K_M, ... K_2, K_1, M)
410
411(see `~astropy.wcs.Tabprm.K`) i.e. with the `M` dimension
412varying fastest so that the `M` elements of a coordinate vector are
413stored contiguously in memory.
414"""
415
416copy = """
417Creates a deep copy of the WCS object.
418"""
419
420cpdis1 = """
421`~astropy.wcs.DistortionLookupTable`
422
423The pre-linear transformation distortion lookup table, ``CPDIS1``.
424"""
425
426cpdis2 = """
427`~astropy.wcs.DistortionLookupTable`
428
429The pre-linear transformation distortion lookup table, ``CPDIS2``.
430"""
431
432crder = """
433``double array[naxis]`` The random error in each coordinate axis,
434``CRDERia``.
435
436An undefined value is represented by NaN.
437"""
438
439crln_obs = """
440``double`` Carrington heliographic longitude of the observer (deg). If
441undefined, this is set to `None`.
442"""
443
444crota = """
445``double array[naxis]`` ``CROTAia`` keyvalues for each coordinate
446axis.
447
448For historical compatibility, three alternate specifications of the
449linear transformations are available in wcslib.  The canonical
450``PCi_ja`` with ``CDELTia``, ``CDi_ja``, and the deprecated
451``CROTAia`` keywords.  Although the latter may not formally co-exist
452with ``PCi_ja``, the approach here is simply to ignore them if given
453in conjunction with ``PCi_ja``.
454
455`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and
456`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of
457these alternatives are present in the header.
458
459These alternate specifications of the linear transformation matrix are
460translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and
461are nowhere visible to the lower-level routines.  In particular,
462`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity
463if ``CDi_ja`` is present (and no ``PCi_ja``).  If no ``CROTAia`` is
464associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts
465to a unity ``PCi_ja`` matrix.
466"""
467
468crpix = """
469``double array[naxis]`` Coordinate reference pixels (``CRPIXja``) for
470each pixel axis.
471"""
472
473crval = """
474``double array[naxis]`` Coordinate reference values (``CRVALia``) for
475each coordinate axis.
476"""
477
478crval_tabprm = """
479``double array[M]`` Index values for the reference pixel for each of
480the tabular coord axes.
481"""
482
483csyer = """
484``double array[naxis]`` The systematic error in the coordinate value
485axes, ``CSYERia``.
486
487An undefined value is represented by NaN.
488"""
489
490ctype = """
491``list of strings[naxis]`` List of ``CTYPEia`` keyvalues.
492
493The `~astropy.wcs.Wcsprm.ctype` keyword values must be in upper case
494and there must be zero or one pair of matched celestial axis types,
495and zero or one spectral axis.
496"""
497
498cubeface = """
499``int`` Index into the ``pixcrd`` (pixel coordinate) array for the
500``CUBEFACE`` axis.
501
502This is used for quadcube projections where the cube faces are stored
503on a separate axis.
504
505The quadcube projections (``TSC``, ``CSC``, ``QSC``) may be
506represented in FITS in either of two ways:
507
508    - The six faces may be laid out in one plane and numbered as
509      follows::
510
511
512                                       0
513
514                              4  3  2  1  4  3  2
515
516                                       5
517
518      Faces 2, 3 and 4 may appear on one side or the other (or both).
519      The world-to-pixel routines map faces 2, 3 and 4 to the left but
520      the pixel-to-world routines accept them on either side.
521
522    - The ``COBE`` convention in which the six faces are stored in a
523      three-dimensional structure using a ``CUBEFACE`` axis indexed
524      from 0 to 5 as above.
525
526These routines support both methods; `~astropy.wcs.Wcsprm.set`
527determines which is being used by the presence or absence of a
528``CUBEFACE`` axis in `~astropy.wcs.Wcsprm.ctype`.
529`~astropy.wcs.Wcsprm.p2s` and `~astropy.wcs.Wcsprm.s2p` translate the
530``CUBEFACE`` axis representation to the single plane representation
531understood by the lower-level projection routines.
532"""
533
534cunit = """
535``list of astropy.UnitBase[naxis]`` List of ``CUNITia`` keyvalues as
536`astropy.units.UnitBase` instances.
537
538These define the units of measurement of the ``CRVALia``, ``CDELTia``
539and ``CDi_ja`` keywords.
540
541As ``CUNITia`` is an optional header keyword,
542`~astropy.wcs.Wcsprm.cunit` may be left blank but otherwise is
543expected to contain a standard units specification as defined by WCS
544Paper I.  `~astropy.wcs.Wcsprm.unitfix` is available to translate
545commonly used non-standard units specifications but this must be done
546as a separate step before invoking `~astropy.wcs.Wcsprm.set`.
547
548For celestial axes, if `~astropy.wcs.Wcsprm.cunit` is not blank,
549`~astropy.wcs.Wcsprm.set` uses ``wcsunits`` to parse it and scale
550`~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, and
551`~astropy.wcs.Wcsprm.cd` to decimal degrees.  It then resets
552`~astropy.wcs.Wcsprm.cunit` to ``"deg"``.
553
554For spectral axes, if `~astropy.wcs.Wcsprm.cunit` is not blank,
555`~astropy.wcs.Wcsprm.set` uses ``wcsunits`` to parse it and scale
556`~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, and
557`~astropy.wcs.Wcsprm.cd` to SI units.  It then resets
558`~astropy.wcs.Wcsprm.cunit` accordingly.
559
560`~astropy.wcs.Wcsprm.set` ignores `~astropy.wcs.Wcsprm.cunit` for
561other coordinate types; `~astropy.wcs.Wcsprm.cunit` may be used to
562label coordinate values.
563"""
564
565cylfix = """
566cylfix()
567
568Fixes WCS keyvalues for malformed cylindrical projections.
569
570Returns
571-------
572success : int
573    Returns ``0`` for success; ``-1`` if no change required.
574"""
575
576data = """
577``float array`` The array data for the
578`~astropy.wcs.DistortionLookupTable`.
579"""
580
581data_wtbarr = """
582``double array``
583
584The array data for the BINTABLE.
585"""
586
587dateavg = """
588``string`` Representative mid-point of the date of observation.
589
590In ISO format, ``yyyy-mm-ddThh:mm:ss``.
591
592See also
593--------
594astropy.wcs.Wcsprm.dateobs
595"""
596
597dateobs = """
598``string`` Start of the date of observation.
599
600In ISO format, ``yyyy-mm-ddThh:mm:ss``.
601
602See also
603--------
604astropy.wcs.Wcsprm.dateavg
605"""
606
607datfix = """
608datfix()
609
610Translates the old ``DATE-OBS`` date format to year-2000 standard form
611``(yyyy-mm-ddThh:mm:ss)`` and derives ``MJD-OBS`` from it if not
612already set.
613
614Alternatively, if `~astropy.wcs.Wcsprm.mjdobs` is set and
615`~astropy.wcs.Wcsprm.dateobs` isn't, then `~astropy.wcs.Wcsprm.datfix`
616derives `~astropy.wcs.Wcsprm.dateobs` from it.  If both are set but
617disagree by more than half a day then `ValueError` is raised.
618
619Returns
620-------
621success : int
622    Returns ``0`` for success; ``-1`` if no change required.
623"""
624
625delta = """
626``double array[M]`` (read-only) Interpolated indices into the coord
627array.
628
629Array of interpolated indices into the coordinate array such that
630Upsilon_m, as defined in Paper III, is equal to
631(`~astropy.wcs.Tabprm.p0` [m] + 1) + delta[m].
632"""
633
634det2im = """
635Convert detector coordinates to image plane coordinates.
636"""
637
638det2im1 = """
639A `~astropy.wcs.DistortionLookupTable` object for detector to image plane
640correction in the *x*-axis.
641"""
642
643det2im2 = """
644A `~astropy.wcs.DistortionLookupTable` object for detector to image plane
645correction in the *y*-axis.
646"""
647
648dims = """
649``int array[ndim]`` (read-only)
650
651The dimensions of the tabular array
652`~astropy.wcs.Wtbarr.data`.
653"""
654
655DistortionLookupTable = """
656DistortionLookupTable(*table*, *crpix*, *crval*, *cdelt*)
657
658Represents a single lookup table for a `distortion paper`_
659transformation.
660
661Parameters
662----------
663table : 2-dimensional array
664    The distortion lookup table.
665
666crpix : 2-tuple
667    The distortion array reference pixel
668
669crval : 2-tuple
670    The image array pixel coordinate
671
672cdelt : 2-tuple
673    The grid step size
674"""
675
676dsun_obs = """
677``double`` Distance between the centre of the Sun and the observer (m). If
678undefined, this is set to `None`.
679"""
680
681equinox = """
682``double`` The equinox associated with dynamical equatorial or
683ecliptic coordinate systems.
684
685``EQUINOXa`` (or ``EPOCH`` in older headers).  Not applicable to ICRS
686equatorial or ecliptic coordinates.
687
688An undefined value is represented by NaN.
689"""
690
691extlev = """
692``int`` (read-only) ``EXTLEV`` identifying the binary table extension.
693"""
694
695extnam = """
696``str`` (read-only) ``EXTNAME`` identifying the binary table extension.
697"""
698
699extrema = """
700``double array[K_M]...[K_2][2][M]`` (read-only)
701
702An array recording the minimum and maximum value of each element of
703the coordinate vector in each row of the coordinate array, with the
704dimensions::
705
706    (K_M, ... K_2, 2, M)
707
708(see `~astropy.wcs.Tabprm.K`).  The minimum is recorded
709in the first element of the compressed K_1 dimension, then the
710maximum.  This array is used by the inverse table lookup function to
711speed up table searches.
712"""
713
714extver = """
715``int`` (read-only) ``EXTVER`` identifying the binary table extension.
716"""
717
718find_all_wcs = """
719find_all_wcs(relax=0, keysel=0)
720
721Find all WCS transformations in the header.
722
723Parameters
724----------
725
726header : str
727    The raw FITS header data.
728
729relax : bool or int
730    Degree of permissiveness:
731
732    - `False`: Recognize only FITS keywords defined by the published
733      WCS standard.
734
735    - `True`: Admit all recognized informal extensions of the WCS
736      standard.
737
738    - `int`: a bit field selecting specific extensions to accept.  See
739      :ref:`astropy:relaxread` for details.
740
741keysel : sequence of flags
742    Used to restrict the keyword types considered:
743
744    - ``WCSHDR_IMGHEAD``: Image header keywords.
745
746    - ``WCSHDR_BIMGARR``: Binary table image array.
747
748    - ``WCSHDR_PIXLIST``: Pixel list keywords.
749
750    If zero, there is no restriction.  If -1, `wcspih` is called,
751    rather than `wcstbh`.
752
753Returns
754-------
755wcs_list : list of `~astropy.wcs.Wcsprm`
756"""
757
758fix = """
759fix(translate_units='', naxis=0)
760
761Applies all of the corrections handled separately by
762`~astropy.wcs.Wcsprm.datfix`, `~astropy.wcs.Wcsprm.unitfix`,
763`~astropy.wcs.Wcsprm.celfix`, `~astropy.wcs.Wcsprm.spcfix`,
764`~astropy.wcs.Wcsprm.cylfix` and `~astropy.wcs.Wcsprm.cdfix`.
765
766Parameters
767----------
768
769translate_units : str, optional
770    Specify which potentially unsafe translations of non-standard unit
771    strings to perform.  By default, performs all.
772
773    Although ``"S"`` is commonly used to represent seconds, its
774    translation to ``"s"`` is potentially unsafe since the standard
775    recognizes ``"S"`` formally as Siemens, however rarely that may be
776    used.  The same applies to ``"H"`` for hours (Henry), and ``"D"``
777    for days (Debye).
778
779    This string controls what to do in such cases, and is
780    case-insensitive.
781
782    - If the string contains ``"s"``, translate ``"S"`` to ``"s"``.
783
784    - If the string contains ``"h"``, translate ``"H"`` to ``"h"``.
785
786    - If the string contains ``"d"``, translate ``"D"`` to ``"d"``.
787
788    Thus ``''`` doesn't do any unsafe translations, whereas ``'shd'``
789    does all of them.
790
791naxis : int array, optional
792    Image axis lengths.  If this array is set to zero or ``None``,
793    then `~astropy.wcs.Wcsprm.cylfix` will not be invoked.
794
795Returns
796-------
797status : dict
798
799    Returns a dictionary containing the following keys, each referring
800    to a status string for each of the sub-fix functions that were
801    called:
802
803    - `~astropy.wcs.Wcsprm.cdfix`
804
805    - `~astropy.wcs.Wcsprm.datfix`
806
807    - `~astropy.wcs.Wcsprm.unitfix`
808
809    - `~astropy.wcs.Wcsprm.celfix`
810
811    - `~astropy.wcs.Wcsprm.spcfix`
812
813    - `~astropy.wcs.Wcsprm.cylfix`
814"""
815
816get_offset = """
817get_offset(x, y) -> (x, y)
818
819Returns the offset as defined in the distortion lookup table.
820
821Returns
822-------
823coordinate : (2,) tuple
824    The offset from the distortion table for pixel point (*x*, *y*).
825"""
826
827get_cdelt = """
828get_cdelt() -> numpy.ndarray
829
830Coordinate increments (``CDELTia``) for each coord axis as ``double array[naxis]``.
831
832Returns the ``CDELT`` offsets in read-only form.  Unlike the
833`~astropy.wcs.Wcsprm.cdelt` property, this works even when the header
834specifies the linear transformation matrix in one of the alternative
835``CDi_ja`` or ``CROTAia`` forms.  This is useful when you want access
836to the linear transformation matrix, but don't care how it was
837specified in the header.
838"""
839
840get_pc = """
841get_pc() -> numpy.ndarray
842
843Returns the ``PC`` matrix in read-only form as ``double array[naxis][naxis]``.  Unlike the
844`~astropy.wcs.Wcsprm.pc` property, this works even when the header
845specifies the linear transformation matrix in one of the alternative
846``CDi_ja`` or ``CROTAia`` forms.  This is useful when you want access
847to the linear transformation matrix, but don't care how it was
848specified in the header.
849"""
850
851get_ps = """
852get_ps() -> list
853
854Returns ``PSi_ma`` keywords for each *i* and *m* as list of tuples.
855
856Returns
857-------
858ps : list
859
860    Returned as a list of tuples of the form (*i*, *m*, *value*):
861
862    - *i*: int.  Axis number, as in ``PSi_ma``, (i.e. 1-relative)
863
864    - *m*: int.  Parameter number, as in ``PSi_ma``, (i.e. 0-relative)
865
866    - *value*: string.  Parameter value.
867
868See also
869--------
870astropy.wcs.Wcsprm.set_ps : Set ``PSi_ma`` values
871"""
872
873get_pv = """
874get_pv() -> list
875
876Returns ``PVi_ma`` keywords for each *i* and *m* as list of tuples.
877
878Returns
879-------
880sequence of tuple
881    Returned as a list of tuples of the form (*i*, *m*, *value*):
882
883    - *i*: int.  Axis number, as in ``PVi_ma``, (i.e. 1-relative)
884
885    - *m*: int.  Parameter number, as in ``PVi_ma``, (i.e. 0-relative)
886
887    - *value*: string. Parameter value.
888
889See also
890--------
891astropy.wcs.Wcsprm.set_pv : Set ``PVi_ma`` values
892
893Notes
894-----
895
896Note that, if they were not given, `~astropy.wcs.Wcsprm.set` resets
897the entries for ``PVi_1a``, ``PVi_2a``, ``PVi_3a``, and ``PVi_4a`` for
898longitude axis *i* to match (``phi_0``, ``theta_0``), the native
899longitude and latitude of the reference point given by ``LONPOLEa``
900and ``LATPOLEa``.
901"""
902
903has_cd = """
904has_cd() -> bool
905
906Returns `True` if ``CDi_ja`` is present.
907
908``CDi_ja`` is an alternate specification of the linear transformation
909matrix, maintained for historical compatibility.
910
911Matrix elements in the IRAF convention are equivalent to the product
912``CDi_ja = CDELTia * PCi_ja``, but the defaults differ from that of
913the ``PCi_ja`` matrix.  If one or more ``CDi_ja`` keywords are present
914then all unspecified ``CDi_ja`` default to zero.  If no ``CDi_ja`` (or
915``CROTAia``) keywords are present, then the header is assumed to be in
916``PCi_ja`` form whether or not any ``PCi_ja`` keywords are present
917since this results in an interpretation of ``CDELTia`` consistent with
918the original FITS specification.
919
920While ``CDi_ja`` may not formally co-exist with ``PCi_ja``, it may
921co-exist with ``CDELTia`` and ``CROTAia`` which are to be ignored.
922
923See also
924--------
925astropy.wcs.Wcsprm.cd : Get the raw ``CDi_ja`` values.
926"""
927
928has_cdi_ja = """
929has_cdi_ja() -> bool
930
931Alias for `~astropy.wcs.Wcsprm.has_cd`.  Maintained for backward
932compatibility.
933"""
934
935has_crota = """
936has_crota() -> bool
937
938Returns `True` if ``CROTAia`` is present.
939
940``CROTAia`` is an alternate specification of the linear transformation
941matrix, maintained for historical compatibility.
942
943In the AIPS convention, ``CROTAia`` may only be associated with the
944latitude axis of a celestial axis pair.  It specifies a rotation in
945the image plane that is applied *after* the ``CDELTia``; any other
946``CROTAia`` keywords are ignored.
947
948``CROTAia`` may not formally co-exist with ``PCi_ja``.  ``CROTAia`` and
949``CDELTia`` may formally co-exist with ``CDi_ja`` but if so are to be
950ignored.
951
952See also
953--------
954astropy.wcs.Wcsprm.crota : Get the raw ``CROTAia`` values
955"""
956
957has_crotaia = """
958has_crotaia() -> bool
959
960Alias for `~astropy.wcs.Wcsprm.has_crota`.  Maintained for backward
961compatibility.
962"""
963
964has_pc = """
965has_pc() -> bool
966
967Returns `True` if ``PCi_ja`` is present.  ``PCi_ja`` is the
968recommended way to specify the linear transformation matrix.
969
970See also
971--------
972astropy.wcs.Wcsprm.pc : Get the raw ``PCi_ja`` values
973"""
974
975has_pci_ja = """
976has_pci_ja() -> bool
977
978Alias for `~astropy.wcs.Wcsprm.has_pc`.  Maintained for backward
979compatibility.
980"""
981
982hgln_obs = """
983``double`` Stonyhurst heliographic longitude of the observer. If
984undefined, this is set to `None`.
985"""
986
987hglt_obs = """
988``double``  Heliographic latitude (Carrington or Stonyhurst) of the observer
989(deg). If undefined, this is set to `None`.
990"""
991
992i = """
993``int`` (read-only) Image axis number.
994"""
995
996imgpix_matrix = """
997``double array[2][2]`` (read-only) Inverse of the ``CDELT`` or ``PC``
998matrix.
999
1000Inverse containing the product of the ``CDELTia`` diagonal matrix and
1001the ``PCi_ja`` matrix.
1002"""
1003
1004is_unity = """
1005is_unity() -> bool
1006
1007Returns `True` if the linear transformation matrix
1008(`~astropy.wcs.Wcsprm.cd`) is unity.
1009"""
1010
1011K = """
1012``int array[M]`` (read-only) The lengths of the axes of the coordinate
1013array.
1014
1015An array of length `M` whose elements record the lengths of the axes of
1016the coordinate array and of each indexing vector.
1017"""
1018
1019kind = """
1020``str`` (read-only) ``wcstab`` array type.
1021
1022Character identifying the ``wcstab`` array type:
1023
1024    - ``'c'``: coordinate array,
1025    - ``'i'``: index vector.
1026"""
1027
1028lat = """
1029``int`` (read-only) The index into the world coord array containing
1030latitude values.
1031"""
1032
1033latpole = """
1034``double`` The native latitude of the celestial pole, ``LATPOLEa`` (deg).
1035"""
1036
1037lattyp = """
1038``string`` (read-only) Celestial axis type for latitude.
1039
1040For example, "RA", "DEC", "GLON", "GLAT", etc. extracted from "RA--",
1041"DEC-", "GLON", "GLAT", etc. in the first four characters of
1042``CTYPEia`` but with trailing dashes removed.
1043"""
1044
1045lng = """
1046``int`` (read-only) The index into the world coord array containing
1047longitude values.
1048"""
1049
1050lngtyp = """
1051``string`` (read-only) Celestial axis type for longitude.
1052
1053For example, "RA", "DEC", "GLON", "GLAT", etc. extracted from "RA--",
1054"DEC-", "GLON", "GLAT", etc. in the first four characters of
1055``CTYPEia`` but with trailing dashes removed.
1056"""
1057
1058lonpole = """
1059``double`` The native longitude of the celestial pole.
1060
1061``LONPOLEa`` (deg).
1062"""
1063
1064M = """
1065``int`` (read-only) Number of tabular coordinate axes.
1066"""
1067
1068m = """
1069``int`` (read-only) ``wcstab`` axis number for index vectors.
1070"""
1071
1072map = """
1073``int array[M]`` Association between axes.
1074
1075A vector of length `~astropy.wcs.Tabprm.M` that defines
1076the association between axis *m* in the *M*-dimensional coordinate
1077array (1 <= *m* <= *M*) and the indices of the intermediate world
1078coordinate and world coordinate arrays.
1079
1080When the intermediate and world coordinate arrays contain the full
1081complement of coordinate elements in image-order, as will usually be
1082the case, then ``map[m-1] == i-1`` for axis *i* in the *N*-dimensional
1083image (1 <= *i* <= *N*).  In terms of the FITS keywords::
1084
1085    map[PVi_3a - 1] == i - 1.
1086
1087However, a different association may result if the intermediate
1088coordinates, for example, only contains a (relevant) subset of
1089intermediate world coordinate elements.  For example, if *M* == 1 for
1090an image with *N* > 1, it is possible to fill the intermediate
1091coordinates with the relevant coordinate element with ``nelem`` set to
10921.  In this case ``map[0] = 0`` regardless of the value of *i*.
1093"""
1094
1095mix = """
1096mix(mixpix, mixcel, vspan, vstep, viter, world, pixcrd, origin)
1097
1098Given either the celestial longitude or latitude plus an element of
1099the pixel coordinate, solves for the remaining elements by iterating
1100on the unknown celestial coordinate element using
1101`~astropy.wcs.Wcsprm.s2p`.
1102
1103Parameters
1104----------
1105mixpix : int
1106    Which element on the pixel coordinate is given.
1107
1108mixcel : int
1109    Which element of the celestial coordinate is given. If *mixcel* =
1110    ``1``, celestial longitude is given in ``world[self.lng]``,
1111    latitude returned in ``world[self.lat]``.  If *mixcel* = ``2``,
1112    celestial latitude is given in ``world[self.lat]``, longitude
1113    returned in ``world[self.lng]``.
1114
1115vspan : (float, float)
1116    Solution interval for the celestial coordinate, in degrees.  The
1117    ordering of the two limits is irrelevant.  Longitude ranges may be
1118    specified with any convenient normalization, for example
1119    ``(-120,+120)`` is the same as ``(240,480)``, except that the
1120    solution will be returned with the same normalization, i.e. lie
1121    within the interval specified.
1122
1123vstep : float
1124    Step size for solution search, in degrees.  If ``0``, a sensible,
1125    although perhaps non-optimal default will be used.
1126
1127viter : int
1128    If a solution is not found then the step size will be halved and
1129    the search recommenced.  *viter* controls how many times the step
1130    size is halved.  The allowed range is 5 - 10.
1131
1132world : ndarray
1133    World coordinate elements as ``double array[naxis]``.  ``world[self.lng]`` and
1134    ``world[self.lat]`` are the celestial longitude and latitude, in
1135    degrees.  Which is given and which returned depends on the value
1136    of *mixcel*.  All other elements are given.  The results will be
1137    written to this array in-place.
1138
1139pixcrd : ndarray
1140    Pixel coordinates as ``double array[naxis]``.  The element indicated by *mixpix* is given and
1141    the remaining elements will be written in-place.
1142
1143{}
1144
1145Returns
1146-------
1147result : dict
1148
1149    Returns a dictionary with the following keys:
1150
1151    - *phi* (``double array[naxis]``)
1152
1153    - *theta* (``double array[naxis]``)
1154
1155        - Longitude and latitude in the native coordinate system of
1156          the projection, in degrees.
1157
1158    - *imgcrd* (``double array[naxis]``)
1159
1160        - Image coordinate elements.  ``imgcrd[self.lng]`` and
1161          ``imgcrd[self.lat]`` are the projected *x*- and
1162          *y*-coordinates, in decimal degrees.
1163
1164    - *world* (``double array[naxis]``)
1165
1166        - Another reference to the *world* argument passed in.
1167
1168Raises
1169------
1170MemoryError
1171    Memory allocation failed.
1172
1173SingularMatrixError
1174    Linear transformation matrix is singular.
1175
1176InconsistentAxisTypesError
1177    Inconsistent or unrecognized coordinate axis types.
1178
1179ValueError
1180    Invalid parameter value.
1181
1182InvalidTransformError
1183    Invalid coordinate transformation parameters.
1184
1185InvalidTransformError
1186    Ill-conditioned coordinate transformation parameters.
1187
1188InvalidCoordinateError
1189    Invalid world coordinate.
1190
1191NoSolutionError
1192    No solution found in the specified interval.
1193
1194See also
1195--------
1196astropy.wcs.Wcsprm.lat, astropy.wcs.Wcsprm.lng
1197    Get the axes numbers for latitude and longitude
1198
1199Notes
1200-----
1201
1202Initially, the specified solution interval is checked to see if it's a
1203\"crossing\" interval.  If it isn't, a search is made for a crossing
1204solution by iterating on the unknown celestial coordinate starting at
1205the upper limit of the solution interval and decrementing by the
1206specified step size.  A crossing is indicated if the trial value of
1207the pixel coordinate steps through the value specified.  If a crossing
1208interval is found then the solution is determined by a modified form
1209of \"regula falsi\" division of the crossing interval.  If no crossing
1210interval was found within the specified solution interval then a
1211search is made for a \"non-crossing\" solution as may arise from a
1212point of tangency.  The process is complicated by having to make
1213allowance for the discontinuities that occur in all map projections.
1214
1215Once one solution has been determined others may be found by
1216subsequent invocations of `~astropy.wcs.Wcsprm.mix` with suitably
1217restricted solution intervals.
1218
1219Note the circumstance that arises when the solution point lies at a
1220native pole of a projection in which the pole is represented as a
1221finite curve, for example the zenithals and conics.  In such cases two
1222or more valid solutions may exist but `~astropy.wcs.Wcsprm.mix` only
1223ever returns one.
1224
1225Because of its generality, `~astropy.wcs.Wcsprm.mix` is very
1226compute-intensive.  For compute-limited applications, more efficient
1227special-case solvers could be written for simple projections, for
1228example non-oblique cylindrical projections.
1229""".format(ORIGIN())
1230
1231mjdavg = """
1232``double`` Modified Julian Date corresponding to ``DATE-AVG``.
1233
1234``(MJD = JD - 2400000.5)``.
1235
1236An undefined value is represented by NaN.
1237
1238See also
1239--------
1240astropy.wcs.Wcsprm.mjdobs
1241"""
1242
1243mjdobs = """
1244``double`` Modified Julian Date corresponding to ``DATE-OBS``.
1245
1246``(MJD = JD - 2400000.5)``.
1247
1248An undefined value is represented by NaN.
1249
1250See also
1251--------
1252astropy.wcs.Wcsprm.mjdavg
1253"""
1254
1255name = """
1256``string`` The name given to the coordinate representation
1257``WCSNAMEa``.
1258"""
1259
1260naxis = """
1261``int`` (read-only) The number of axes (pixel and coordinate).
1262
1263Given by the ``NAXIS`` or ``WCSAXESa`` keyvalues.
1264
1265The number of coordinate axes is determined at parsing time, and can
1266not be subsequently changed.
1267
1268It is determined from the highest of the following:
1269
1270  1. ``NAXIS``
1271
1272  2. ``WCSAXESa``
1273
1274  3. The highest axis number in any parameterized WCS keyword.  The
1275     keyvalue, as well as the keyword, must be syntactically valid
1276     otherwise it will not be considered.
1277
1278If none of these keyword types is present, i.e. if the header only
1279contains auxiliary WCS keywords for a particular coordinate
1280representation, then no coordinate description is constructed for it.
1281
1282This value may differ for different coordinate representations of the
1283same image.
1284"""
1285
1286nc = """
1287``int`` (read-only) Total number of coord vectors in the coord array.
1288
1289Total number of coordinate vectors in the coordinate array being the
1290product K_1 * K_2 * ... * K_M.
1291"""
1292
1293ndim = """
1294``int`` (read-only) Expected dimensionality of the ``wcstab`` array.
1295"""
1296
1297obsgeo = """
1298``double array[3]`` Location of the observer in a standard terrestrial
1299reference frame.
1300
1301``OBSGEO-X``, ``OBSGEO-Y``, ``OBSGEO-Z`` (in meters).
1302
1303An undefined value is represented by NaN.
1304"""
1305
1306p0 = """
1307``int array[M]`` Interpolated indices into the coordinate array.
1308
1309Vector of length `~astropy.wcs.Tabprm.M` of interpolated
1310indices into the coordinate array such that Upsilon_m, as defined in
1311Paper III, is equal to ``(p0[m] + 1) + delta[m]``.
1312"""
1313
1314p2s = """
1315p2s(pixcrd, origin)
1316
1317Converts pixel to world coordinates.
1318
1319Parameters
1320----------
1321
1322pixcrd : ndarray
1323    Array of pixel coordinates as ``double array[ncoord][nelem]``.
1324
1325{}
1326
1327Returns
1328-------
1329result : dict
1330    Returns a dictionary with the following keys:
1331
1332    - *imgcrd*: ndarray
1333
1334      - Array of intermediate world coordinates as ``double array[ncoord][nelem]``.  For celestial axes,
1335        ``imgcrd[][self.lng]`` and ``imgcrd[][self.lat]`` are the
1336        projected *x*-, and *y*-coordinates, in pseudo degrees.  For
1337        spectral axes, ``imgcrd[][self.spec]`` is the intermediate
1338        spectral coordinate, in SI units.
1339
1340    - *phi*: ndarray
1341
1342      - Array as ``double array[ncoord]``.
1343
1344    - *theta*: ndarray
1345
1346      - Longitude and latitude in the native coordinate system of the
1347        projection, in degrees, as ``double array[ncoord]``.
1348
1349    - *world*: ndarray
1350
1351      - Array of world coordinates as ``double array[ncoord][nelem]``.  For celestial axes,
1352        ``world[][self.lng]`` and ``world[][self.lat]`` are the
1353        celestial longitude and latitude, in degrees.  For spectral
1354        axes, ``world[][self.spec]`` is the intermediate spectral
1355        coordinate, in SI units.
1356
1357    - *stat*: ndarray
1358
1359      - Status return value for each coordinate as ``int array[ncoord]``. ``0`` for success,
1360        ``1+`` for invalid pixel coordinate.
1361
1362Raises
1363------
1364
1365MemoryError
1366    Memory allocation failed.
1367
1368SingularMatrixError
1369    Linear transformation matrix is singular.
1370
1371InconsistentAxisTypesError
1372    Inconsistent or unrecognized coordinate axis types.
1373
1374ValueError
1375    Invalid parameter value.
1376
1377ValueError
1378    *x*- and *y*-coordinate arrays are not the same size.
1379
1380InvalidTransformError
1381    Invalid coordinate transformation parameters.
1382
1383InvalidTransformError
1384    Ill-conditioned coordinate transformation parameters.
1385
1386See also
1387--------
1388astropy.wcs.Wcsprm.lat, astropy.wcs.Wcsprm.lng
1389    Definition of the latitude and longitude axes
1390""".format(ORIGIN())
1391
1392p4_pix2foc = """
1393p4_pix2foc(*pixcrd, origin*) -> ``double array[ncoord][nelem]``
1394
1395Convert pixel coordinates to focal plane coordinates using `distortion
1396paper`_ lookup-table correction.
1397
1398Parameters
1399----------
1400pixcrd : ndarray
1401    Array of pixel coordinates as ``double array[ncoord][nelem]``.
1402
1403{}
1404
1405Returns
1406-------
1407foccrd : ndarray
1408    Returns an array of focal plane coordinates as ``double array[ncoord][nelem]``.
1409
1410Raises
1411------
1412MemoryError
1413    Memory allocation failed.
1414
1415ValueError
1416    Invalid coordinate transformation parameters.
1417""".format(ORIGIN())
1418
1419pc = """
1420``double array[naxis][naxis]`` The ``PCi_ja`` (pixel coordinate)
1421transformation matrix.
1422
1423The order is::
1424
1425  [[PC1_1, PC1_2],
1426   [PC2_1, PC2_2]]
1427
1428For historical compatibility, three alternate specifications of the
1429linear transformations are available in wcslib.  The canonical
1430``PCi_ja`` with ``CDELTia``, ``CDi_ja``, and the deprecated
1431``CROTAia`` keywords.  Although the latter may not formally co-exist
1432with ``PCi_ja``, the approach here is simply to ignore them if given
1433in conjunction with ``PCi_ja``.
1434
1435`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and
1436`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of
1437these alternatives are present in the header.
1438
1439These alternate specifications of the linear transformation matrix are
1440translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and
1441are nowhere visible to the lower-level routines.  In particular,
1442`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity
1443if ``CDi_ja`` is present (and no ``PCi_ja``).  If no ``CROTAia`` is
1444associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts
1445to a unity ``PCi_ja`` matrix.
1446"""
1447
1448phi0 = """
1449``double`` The native latitude of the fiducial point.
1450
1451The point whose celestial coordinates are given in ``ref[1:2]``.  If
1452undefined (NaN) the initialization routine, `~astropy.wcs.Wcsprm.set`,
1453will set this to a projection-specific default.
1454
1455See also
1456--------
1457astropy.wcs.Wcsprm.theta0
1458"""
1459
1460pix2foc = """
1461pix2foc(*pixcrd, origin*) -> ``double array[ncoord][nelem]``
1462
1463Perform both `SIP`_ polynomial and `distortion paper`_ lookup-table
1464correction in parallel.
1465
1466Parameters
1467----------
1468pixcrd : ndarray
1469    Array of pixel coordinates as ``double array[ncoord][nelem]``.
1470
1471{}
1472
1473Returns
1474-------
1475foccrd : ndarray
1476    Returns an array of focal plane coordinates as ``double array[ncoord][nelem]``.
1477
1478Raises
1479------
1480MemoryError
1481    Memory allocation failed.
1482
1483ValueError
1484    Invalid coordinate transformation parameters.
1485""".format(ORIGIN())
1486
1487piximg_matrix = """
1488``double array[2][2]`` (read-only) Matrix containing the product of
1489the ``CDELTia`` diagonal matrix and the ``PCi_ja`` matrix.
1490"""
1491
1492print_contents = """
1493print_contents()
1494
1495Print the contents of the `~astropy.wcs.Wcsprm` object to stdout.
1496Probably only useful for debugging purposes, and may be removed in the
1497future.
1498
1499To get a string of the contents, use `repr`.
1500"""
1501
1502print_contents_tabprm = """
1503print_contents()
1504
1505Print the contents of the `~astropy.wcs.Tabprm` object to
1506stdout.  Probably only useful for debugging purposes, and may be
1507removed in the future.
1508
1509To get a string of the contents, use `repr`.
1510"""
1511
1512print_contents_wtbarr = """
1513print_contents()
1514
1515Print the contents of the `~astropy.wcs.Wtbarr` object to
1516stdout. Probably only useful for debugging purposes, and may be
1517removed in the future.
1518
1519To get a string of the contents, use `repr`.
1520"""
1521
1522radesys = """
1523``string`` The equatorial or ecliptic coordinate system type,
1524``RADESYSa``.
1525"""
1526
1527restfrq = """
1528``double`` Rest frequency (Hz) from ``RESTFRQa``.
1529
1530An undefined value is represented by NaN.
1531"""
1532
1533restwav = """
1534``double`` Rest wavelength (m) from ``RESTWAVa``.
1535
1536An undefined value is represented by NaN.
1537"""
1538
1539row = """
1540``int`` (read-only) Table row number.
1541"""
1542
1543rsun_ref = """
1544``double`` Reference radius of the Sun used in coordinate calculations (m).
1545If undefined, this is set to `None`.
1546"""
1547
1548s2p = """
1549s2p(world, origin)
1550
1551Transforms world coordinates to pixel coordinates.
1552
1553Parameters
1554----------
1555world : ndarray
1556    Array of world coordinates, in decimal degrees, as ``double array[ncoord][nelem]``.
1557
1558{}
1559
1560Returns
1561-------
1562result : dict
1563    Returns a dictionary with the following keys:
1564
1565    - *phi*: ``double array[ncoord]``
1566
1567    - *theta*: ``double array[ncoord]``
1568
1569        - Longitude and latitude in the native coordinate system of
1570          the projection, in degrees.
1571
1572    - *imgcrd*: ``double array[ncoord][nelem]``
1573
1574       - Array of intermediate world coordinates.  For celestial axes,
1575         ``imgcrd[][self.lng]`` and ``imgcrd[][self.lat]`` are the
1576         projected *x*-, and *y*-coordinates, in pseudo \"degrees\".
1577         For quadcube projections with a ``CUBEFACE`` axis, the face
1578         number is also returned in ``imgcrd[][self.cubeface]``.  For
1579         spectral axes, ``imgcrd[][self.spec]`` is the intermediate
1580         spectral coordinate, in SI units.
1581
1582    - *pixcrd*: ``double array[ncoord][nelem]``
1583
1584        - Array of pixel coordinates.  Pixel coordinates are
1585          zero-based.
1586
1587    - *stat*: ``int array[ncoord]``
1588
1589        - Status return value for each coordinate. ``0`` for success,
1590          ``1+`` for invalid pixel coordinate.
1591
1592Raises
1593------
1594MemoryError
1595    Memory allocation failed.
1596
1597SingularMatrixError
1598    Linear transformation matrix is singular.
1599
1600InconsistentAxisTypesError
1601    Inconsistent or unrecognized coordinate axis types.
1602
1603ValueError
1604    Invalid parameter value.
1605
1606InvalidTransformError
1607   Invalid coordinate transformation parameters.
1608
1609InvalidTransformError
1610    Ill-conditioned coordinate transformation parameters.
1611
1612See also
1613--------
1614astropy.wcs.Wcsprm.lat, astropy.wcs.Wcsprm.lng
1615    Definition of the latitude and longitude axes
1616""".format(ORIGIN())
1617
1618sense = """
1619``int array[M]`` +1 if monotonically increasing, -1 if decreasing.
1620
1621A vector of length `~astropy.wcs.Tabprm.M` whose elements
1622indicate whether the corresponding indexing vector is monotonically
1623increasing (+1), or decreasing (-1).
1624"""
1625
1626set = """
1627set()
1628
1629Sets up a WCS object for use according to information supplied within
1630it.
1631
1632Note that this routine need not be called directly; it will be invoked
1633by `~astropy.wcs.Wcsprm.p2s` and `~astropy.wcs.Wcsprm.s2p` if
1634necessary.
1635
1636Some attributes that are based on other attributes (such as
1637`~astropy.wcs.Wcsprm.lattyp` on `~astropy.wcs.Wcsprm.ctype`) may not
1638be correct until after `~astropy.wcs.Wcsprm.set` is called.
1639
1640`~astropy.wcs.Wcsprm.set` strips off trailing blanks in all string
1641members.
1642
1643`~astropy.wcs.Wcsprm.set` recognizes the ``NCP`` projection and
1644converts it to the equivalent ``SIN`` projection and it also
1645recognizes ``GLS`` as a synonym for ``SFL``.  It does alias
1646translation for the AIPS spectral types (``FREQ-LSR``, ``FELO-HEL``,
1647etc.) but without changing the input header keywords.
1648
1649Raises
1650------
1651MemoryError
1652    Memory allocation failed.
1653
1654SingularMatrixError
1655    Linear transformation matrix is singular.
1656
1657InconsistentAxisTypesError
1658    Inconsistent or unrecognized coordinate axis types.
1659
1660ValueError
1661    Invalid parameter value.
1662
1663InvalidTransformError
1664    Invalid coordinate transformation parameters.
1665
1666InvalidTransformError
1667    Ill-conditioned coordinate transformation parameters.
1668"""
1669
1670set_tabprm = """
1671set()
1672
1673Allocates memory for work arrays.
1674
1675Also sets up the class according to information supplied within it.
1676
1677Note that this routine need not be called directly; it will be invoked
1678by functions that need it.
1679
1680Raises
1681------
1682MemoryError
1683    Memory allocation failed.
1684
1685InvalidTabularParametersError
1686    Invalid tabular parameters.
1687"""
1688
1689set_ps = """
1690set_ps(ps)
1691
1692Sets ``PSi_ma`` keywords for each *i* and *m*.
1693
1694Parameters
1695----------
1696ps : sequence of tuple
1697
1698    The input must be a sequence of tuples of the form (*i*, *m*,
1699    *value*):
1700
1701    - *i*: int.  Axis number, as in ``PSi_ma``, (i.e. 1-relative)
1702
1703    - *m*: int.  Parameter number, as in ``PSi_ma``, (i.e. 0-relative)
1704
1705    - *value*: string.  Parameter value.
1706
1707See also
1708--------
1709astropy.wcs.Wcsprm.get_ps
1710"""
1711
1712set_pv = """
1713set_pv(pv)
1714
1715Sets ``PVi_ma`` keywords for each *i* and *m*.
1716
1717Parameters
1718----------
1719pv : list of tuple
1720
1721    The input must be a sequence of tuples of the form (*i*, *m*,
1722    *value*):
1723
1724    - *i*: int.  Axis number, as in ``PVi_ma``, (i.e. 1-relative)
1725
1726    - *m*: int.  Parameter number, as in ``PVi_ma``, (i.e. 0-relative)
1727
1728    - *value*: float.  Parameter value.
1729
1730See also
1731--------
1732astropy.wcs.Wcsprm.get_pv
1733"""
1734
1735sip = """
1736Get/set the `~astropy.wcs.Sip` object for performing `SIP`_ distortion
1737correction.
1738"""
1739
1740Sip = """
1741Sip(*a, b, ap, bp, crpix*)
1742
1743The `~astropy.wcs.Sip` class performs polynomial distortion correction
1744using the `SIP`_ convention in both directions.
1745
1746Parameters
1747----------
1748a : ndarray
1749    The ``A_i_j`` polynomial for pixel to focal plane transformation as ``double array[m+1][m+1]``.
1750    Its size must be (*m* + 1, *m* + 1) where *m* = ``A_ORDER``.
1751
1752b : ndarray
1753    The ``B_i_j`` polynomial for pixel to focal plane transformation as ``double array[m+1][m+1]``.
1754    Its size must be (*m* + 1, *m* + 1) where *m* = ``B_ORDER``.
1755
1756ap : ndarray
1757    The ``AP_i_j`` polynomial for pixel to focal plane transformation as ``double array[m+1][m+1]``.
1758    Its size must be (*m* + 1, *m* + 1) where *m* = ``AP_ORDER``.
1759
1760bp : ndarray
1761    The ``BP_i_j`` polynomial for pixel to focal plane transformation as ``double array[m+1][m+1]``.
1762    Its size must be (*m* + 1, *m* + 1) where *m* = ``BP_ORDER``.
1763
1764crpix : ndarray
1765    The reference pixel as ``double array[2]``.
1766
1767Notes
1768-----
1769Shupe, D. L., M. Moshir, J. Li, D. Makovoz and R. Narron.  2005.
1770"The SIP Convention for Representing Distortion in FITS Image
1771Headers."  ADASS XIV.
1772"""
1773
1774sip_foc2pix = """
1775sip_foc2pix(*foccrd, origin*) -> ``double array[ncoord][nelem]``
1776
1777Convert focal plane coordinates to pixel coordinates using the `SIP`_
1778polynomial distortion convention.
1779
1780Parameters
1781----------
1782foccrd : ndarray
1783    Array of focal plane coordinates as ``double array[ncoord][nelem]``.
1784
1785{}
1786
1787Returns
1788-------
1789pixcrd : ndarray
1790    Returns an array of pixel coordinates as ``double array[ncoord][nelem]``.
1791
1792Raises
1793------
1794MemoryError
1795    Memory allocation failed.
1796
1797ValueError
1798    Invalid coordinate transformation parameters.
1799""".format(ORIGIN())
1800
1801sip_pix2foc = """
1802sip_pix2foc(*pixcrd, origin*) -> ``double array[ncoord][nelem]``
1803
1804Convert pixel coordinates to focal plane coordinates using the `SIP`_
1805polynomial distortion convention.
1806
1807Parameters
1808----------
1809pixcrd : ndarray
1810    Array of pixel coordinates as ``double array[ncoord][nelem]``.
1811
1812{}
1813
1814Returns
1815-------
1816foccrd : ndarray
1817    Returns an array of focal plane coordinates as ``double array[ncoord][nelem]``.
1818
1819Raises
1820------
1821MemoryError
1822    Memory allocation failed.
1823
1824ValueError
1825    Invalid coordinate transformation parameters.
1826""".format(ORIGIN())
1827
1828spcfix = """
1829spcfix() -> int
1830
1831Translates AIPS-convention spectral coordinate types.  {``FREQ``,
1832``VELO``, ``FELO``}-{``OBS``, ``HEL``, ``LSR``} (e.g. ``FREQ-LSR``,
1833``VELO-OBS``, ``FELO-HEL``)
1834
1835Returns
1836-------
1837success : int
1838    Returns ``0`` for success; ``-1`` if no change required.
1839"""
1840
1841spec = """
1842``int`` (read-only) The index containing the spectral axis values.
1843"""
1844
1845specsys = """
1846``string`` Spectral reference frame (standard of rest), ``SPECSYSa``.
1847
1848See also
1849--------
1850astropy.wcs.Wcsprm.ssysobs, astropy.wcs.Wcsprm.velosys
1851"""
1852
1853sptr = """
1854sptr(ctype, i=-1)
1855
1856Translates the spectral axis in a WCS object.
1857
1858For example, a ``FREQ`` axis may be translated into ``ZOPT-F2W`` and
1859vice versa.
1860
1861Parameters
1862----------
1863ctype : str
1864    Required spectral ``CTYPEia``, maximum of 8 characters.  The first
1865    four characters are required to be given and are never modified.
1866    The remaining four, the algorithm code, are completely determined
1867    by, and must be consistent with, the first four characters.
1868    Wildcarding may be used, i.e.  if the final three characters are
1869    specified as ``\"???\"``, or if just the eighth character is
1870    specified as ``\"?\"``, the correct algorithm code will be
1871    substituted and returned.
1872
1873i : int
1874    Index of the spectral axis (0-relative).  If ``i < 0`` (or not
1875    provided), it will be set to the first spectral axis identified
1876    from the ``CTYPE`` keyvalues in the FITS header.
1877
1878Raises
1879------
1880MemoryError
1881    Memory allocation failed.
1882
1883SingularMatrixError
1884    Linear transformation matrix is singular.
1885
1886InconsistentAxisTypesError
1887    Inconsistent or unrecognized coordinate axis types.
1888
1889ValueError
1890    Invalid parameter value.
1891
1892InvalidTransformError
1893    Invalid coordinate transformation parameters.
1894
1895InvalidTransformError
1896    Ill-conditioned coordinate transformation parameters.
1897
1898InvalidSubimageSpecificationError
1899    Invalid subimage specification (no spectral axis).
1900"""
1901
1902ssysobs = """
1903``string`` Spectral reference frame.
1904
1905The spectral reference frame in which there is no differential
1906variation in the spectral coordinate across the field-of-view,
1907``SSYSOBSa``.
1908
1909See also
1910--------
1911astropy.wcs.Wcsprm.specsys, astropy.wcs.Wcsprm.velosys
1912"""
1913
1914ssyssrc = """
1915``string`` Spectral reference frame for redshift.
1916
1917The spectral reference frame (standard of rest) in which the redshift
1918was measured, ``SSYSSRCa``.
1919"""
1920
1921sub = """
1922sub(axes)
1923
1924Extracts the coordinate description for a subimage from a
1925`~astropy.wcs.WCS` object.
1926
1927The world coordinate system of the subimage must be separable in the
1928sense that the world coordinates at any point in the subimage must
1929depend only on the pixel coordinates of the axes extracted.  In
1930practice, this means that the ``PCi_ja`` matrix of the original image
1931must not contain non-zero off-diagonal terms that associate any of the
1932subimage axes with any of the non-subimage axes.
1933
1934`sub` can also add axes to a wcsprm object.  The new axes will be
1935created using the defaults set by the Wcsprm constructor which produce
1936a simple, unnamed, linear axis with world coordinates equal to the
1937pixel coordinate.  These default values can be changed before
1938invoking `set`.
1939
1940Parameters
1941----------
1942axes : int or a sequence.
1943
1944    - If an int, include the first *N* axes in their original order.
1945
1946    - If a sequence, may contain a combination of image axis numbers
1947      (1-relative) or special axis identifiers (see below).  Order is
1948      significant; ``axes[0]`` is the axis number of the input image
1949      that corresponds to the first axis in the subimage, etc.  Use an
1950      axis number of 0 to create a new axis using the defaults.
1951
1952    - If ``0``, ``[]`` or ``None``, do a deep copy.
1953
1954    Coordinate axes types may be specified using either strings or
1955    special integer constants.  The available types are:
1956
1957    - ``'longitude'`` / ``WCSSUB_LONGITUDE``: Celestial longitude
1958
1959    - ``'latitude'`` / ``WCSSUB_LATITUDE``: Celestial latitude
1960
1961    - ``'cubeface'`` / ``WCSSUB_CUBEFACE``: Quadcube ``CUBEFACE`` axis
1962
1963    - ``'spectral'`` / ``WCSSUB_SPECTRAL``: Spectral axis
1964
1965    - ``'stokes'`` / ``WCSSUB_STOKES``: Stokes axis
1966
1967    - ``'celestial'`` / ``WCSSUB_CELESTIAL``: An alias for the
1968      combination of ``'longitude'``, ``'latitude'`` and ``'cubeface'``.
1969
1970Returns
1971-------
1972new_wcs : `~astropy.wcs.WCS` object
1973
1974Raises
1975------
1976MemoryError
1977    Memory allocation failed.
1978
1979InvalidSubimageSpecificationError
1980    Invalid subimage specification (no spectral axis).
1981
1982NonseparableSubimageCoordinateSystemError
1983    Non-separable subimage coordinate system.
1984
1985Notes
1986-----
1987Combinations of subimage axes of particular types may be extracted in
1988the same order as they occur in the input image by combining the
1989integer constants with the 'binary or' (``|``) operator.  For
1990example::
1991
1992    wcs.sub([WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_SPECTRAL])
1993
1994would extract the longitude, latitude, and spectral axes in the same
1995order as the input image.  If one of each were present, the resulting
1996object would have three dimensions.
1997
1998For convenience, ``WCSSUB_CELESTIAL`` is defined as the combination
1999``WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_CUBEFACE``.
2000
2001The codes may also be negated to extract all but the types specified,
2002for example::
2003
2004    wcs.sub([
2005      WCSSUB_LONGITUDE,
2006      WCSSUB_LATITUDE,
2007      WCSSUB_CUBEFACE,
2008      -(WCSSUB_SPECTRAL | WCSSUB_STOKES)])
2009
2010The last of these specifies all axis types other than spectral or
2011Stokes.  Extraction is done in the order specified by ``axes``, i.e. a
2012longitude axis (if present) would be extracted first (via ``axes[0]``)
2013and not subsequently (via ``axes[3]``).  Likewise for the latitude and
2014cubeface axes in this example.
2015
2016The number of dimensions in the returned object may be less than or
2017greater than the length of ``axes``.  However, it will never exceed the
2018number of axes in the input image.
2019"""
2020
2021tab = """
2022``list of Tabprm`` Tabular coordinate objects.
2023
2024A list of tabular coordinate objects associated with this WCS.
2025"""
2026
2027Tabprm = """
2028A class to store the information related to tabular coordinates,
2029i.e., coordinates that are defined via a lookup table.
2030
2031This class can not be constructed directly from Python, but instead is
2032returned from `~astropy.wcs.Wcsprm.tab`.
2033"""
2034
2035theta0 = """
2036``double``  The native longitude of the fiducial point.
2037
2038The point whose celestial coordinates are given in ``ref[1:2]``.  If
2039undefined (NaN) the initialization routine, `~astropy.wcs.Wcsprm.set`,
2040will set this to a projection-specific default.
2041
2042See also
2043--------
2044astropy.wcs.Wcsprm.phi0
2045"""
2046
2047to_header = """
2048to_header(relax=False)
2049
2050`to_header` translates a WCS object into a FITS header.
2051
2052The details of the header depends on context:
2053
2054    - If the `~astropy.wcs.Wcsprm.colnum` member is non-zero then a
2055      binary table image array header will be produced.
2056
2057    - Otherwise, if the `~astropy.wcs.Wcsprm.colax` member is set
2058      non-zero then a pixel list header will be produced.
2059
2060    - Otherwise, a primary image or image extension header will be
2061      produced.
2062
2063The output header will almost certainly differ from the input in a
2064number of respects:
2065
2066    1. The output header only contains WCS-related keywords.  In
2067       particular, it does not contain syntactically-required keywords
2068       such as ``SIMPLE``, ``NAXIS``, ``BITPIX``, or ``END``.
2069
2070    2. Deprecated (e.g. ``CROTAn``) or non-standard usage will be
2071       translated to standard (this is partially dependent on whether
2072       ``fix`` was applied).
2073
2074    3. Quantities will be converted to the units used internally,
2075       basically SI with the addition of degrees.
2076
2077    4. Floating-point quantities may be given to a different decimal
2078       precision.
2079
2080    5. Elements of the ``PCi_j`` matrix will be written if and only if
2081       they differ from the unit matrix.  Thus, if the matrix is unity
2082       then no elements will be written.
2083
2084    6. Additional keywords such as ``WCSAXES``, ``CUNITia``,
2085       ``LONPOLEa`` and ``LATPOLEa`` may appear.
2086
2087    7. The original keycomments will be lost, although
2088       `~astropy.wcs.Wcsprm.to_header` tries hard to write meaningful
2089       comments.
2090
2091    8. Keyword order may be changed.
2092
2093Keywords can be translated between the image array, binary table, and
2094pixel lists forms by manipulating the `~astropy.wcs.Wcsprm.colnum` or
2095`~astropy.wcs.Wcsprm.colax` members of the `~astropy.wcs.WCS`
2096object.
2097
2098Parameters
2099----------
2100
2101relax : bool or int
2102    Degree of permissiveness:
2103
2104    - `False`: Recognize only FITS keywords defined by the published
2105      WCS standard.
2106
2107    - `True`: Admit all recognized informal extensions of the WCS
2108      standard.
2109
2110    - `int`: a bit field selecting specific extensions to write.
2111      See :ref:`astropy:relaxwrite` for details.
2112
2113Returns
2114-------
2115header : str
2116    Raw FITS header as a string.
2117"""
2118
2119ttype = """
2120``str`` (read-only) ``TTYPEn`` identifying the column of the binary table that contains
2121the wcstab array.
2122"""
2123
2124unitfix = """
2125unitfix(translate_units='')
2126
2127Translates non-standard ``CUNITia`` keyvalues.
2128
2129For example, ``DEG`` -> ``deg``, also stripping off unnecessary
2130whitespace.
2131
2132Parameters
2133----------
2134translate_units : str, optional
2135    Do potentially unsafe translations of non-standard unit strings.
2136
2137    Although ``\"S\"`` is commonly used to represent seconds, its
2138    recognizes ``\"S\"`` formally as Siemens, however rarely that may
2139    be translation to ``\"s\"`` is potentially unsafe since the
2140    standard used.  The same applies to ``\"H\"`` for hours (Henry),
2141    and ``\"D\"`` for days (Debye).
2142
2143    This string controls what to do in such cases, and is
2144    case-insensitive.
2145
2146    - If the string contains ``\"s\"``, translate ``\"S\"`` to ``\"s\"``.
2147
2148    - If the string contains ``\"h\"``, translate ``\"H\"`` to ``\"h\"``.
2149
2150    - If the string contains ``\"d\"``, translate ``\"D\"`` to ``\"d\"``.
2151
2152    Thus ``''`` doesn't do any unsafe translations, whereas ``'shd'``
2153    does all of them.
2154
2155Returns
2156-------
2157success : int
2158    Returns ``0`` for success; ``-1`` if no change required.
2159"""
2160
2161velangl = """
2162``double`` Velocity angle.
2163
2164The angle in degrees that should be used to decompose an observed
2165velocity into radial and transverse components.
2166
2167An undefined value is represented by NaN.
2168"""
2169
2170velosys = """
2171``double`` Relative radial velocity.
2172
2173The relative radial velocity (m/s) between the observer and the
2174selected standard of rest in the direction of the celestial reference
2175coordinate, ``VELOSYSa``.
2176
2177An undefined value is represented by NaN.
2178
2179See also
2180--------
2181astropy.wcs.Wcsprm.specsys, astropy.wcs.Wcsprm.ssysobs
2182"""
2183
2184velref = """
2185``int`` AIPS velocity code.
2186
2187From ``VELREF`` keyword.
2188"""
2189
2190wcs = """
2191A `~astropy.wcs.Wcsprm` object to perform the basic `wcslib`_ WCS
2192transformation.
2193"""
2194
2195Wcs = """
2196Wcs(*sip, cpdis, wcsprm, det2im*)
2197
2198Wcs objects amalgamate basic WCS (as provided by `wcslib`_), with
2199`SIP`_ and `distortion paper`_ operations.
2200
2201To perform all distortion corrections and WCS transformation, use
2202``all_pix2world``.
2203
2204Parameters
2205----------
2206sip : `~astropy.wcs.Sip` object or None
2207
2208cpdis : (2,) tuple of `~astropy.wcs.DistortionLookupTable` or None
2209
2210wcsprm : `~astropy.wcs.Wcsprm`
2211
2212det2im : (2,) tuple of `~astropy.wcs.DistortionLookupTable` or None
2213"""
2214
2215Wcsprm = """
2216Wcsprm(header=None, key=' ', relax=False, naxis=2, keysel=0, colsel=None)
2217
2218`~astropy.wcs.Wcsprm` performs the core WCS transformations.
2219
2220.. note::
2221    The members of this object correspond roughly to the key/value
2222    pairs in the FITS header.  However, they are adjusted and
2223    normalized in a number of ways that make performing the WCS
2224    transformation easier.  Therefore, they can not be relied upon to
2225    get the original values in the header.  For that, use
2226    `astropy.io.fits.Header` directly.
2227
2228The FITS header parsing enforces correct FITS "keyword = value" syntax
2229with regard to the equals sign occurring in columns 9 and 10.
2230However, it does recognize free-format character (NOST 100-2.0,
2231Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values
2232(Sect. 5.2.4) for all keywords.
2233
2234
2235.. warning::
2236
2237    Many of the attributes of this class require additional processing when
2238    modifying underlying C structure.  When needed, this additional processing
2239    is implemented in attribute setters. Therefore, for mutable attributes, one
2240    should always set the attribute rather than a slice of its current value (or
2241    its individual elements) since the latter may lead the class instance to be
2242    in an invalid state.  For example, attribute ``crpix`` of a 2D WCS'
2243    ``Wcsprm`` object ``wcs`` should be set as ``wcs.crpix = [crpix1, crpix2]``
2244    instead of ``wcs.crpix[0] = crpix1; wcs.crpix[1] = crpix2]``.
2245
2246
2247Parameters
2248----------
2249header : `~astropy.io.fits.Header`, str, or None.
2250  If ``None``, the object will be initialized to default values.
2251
2252key : str, optional
2253    The key referring to a particular WCS transform in the header.
2254    This may be either ``' '`` or ``'A'``-``'Z'`` and corresponds to
2255    the ``\"a\"`` part of ``\"CTYPEia\"``.  (*key* may only be
2256    provided if *header* is also provided.)
2257
2258relax : bool or int, optional
2259
2260    Degree of permissiveness:
2261
2262    - `False`: Recognize only FITS keywords defined by the published
2263      WCS standard.
2264
2265    - `True`: Admit all recognized informal extensions of the WCS
2266      standard.
2267
2268    - `int`: a bit field selecting specific extensions to accept.  See
2269      :ref:`astropy:relaxread` for details.
2270
2271naxis : int, optional
2272    The number of world coordinates axes for the object.  (*naxis* may
2273    only be provided if *header* is `None`.)
2274
2275keysel : sequence of flag bits, optional
2276    Vector of flag bits that may be used to restrict the keyword types
2277    considered:
2278
2279        - ``WCSHDR_IMGHEAD``: Image header keywords.
2280
2281        - ``WCSHDR_BIMGARR``: Binary table image array.
2282
2283        - ``WCSHDR_PIXLIST``: Pixel list keywords.
2284
2285    If zero, there is no restriction.  If -1, the underlying wcslib
2286    function ``wcspih()`` is called, rather than ``wcstbh()``.
2287
2288colsel : sequence of int
2289    A sequence of table column numbers used to restrict the keywords
2290    considered.  `None` indicates no restriction.
2291
2292Raises
2293------
2294MemoryError
2295     Memory allocation failed.
2296
2297ValueError
2298     Invalid key.
2299
2300KeyError
2301     Key not found in FITS header.
2302"""
2303
2304wtb = """
2305``list of Wtbarr`` objects to construct coordinate lookup tables from BINTABLE.
2306
2307"""
2308
2309Wtbarr = """
2310Classes to construct coordinate lookup tables from a binary table
2311extension (BINTABLE).
2312
2313This class can not be constructed directly from Python, but instead is
2314returned from `~astropy.wcs.Wcsprm.wtb`.
2315"""
2316
2317zsource = """
2318``double`` The redshift, ``ZSOURCEa``, of the source.
2319
2320An undefined value is represented by NaN.
2321"""
2322
2323WcsError = """
2324Base class of all invalid WCS errors.
2325"""
2326
2327SingularMatrix = """
2328SingularMatrixError()
2329
2330The linear transformation matrix is singular.
2331"""
2332
2333InconsistentAxisTypes = """
2334InconsistentAxisTypesError()
2335
2336The WCS header inconsistent or unrecognized coordinate axis type(s).
2337"""
2338
2339InvalidTransform = """
2340InvalidTransformError()
2341
2342The WCS transformation is invalid, or the transformation parameters
2343are invalid.
2344"""
2345
2346InvalidCoordinate = """
2347InvalidCoordinateError()
2348
2349One or more of the world coordinates is invalid.
2350"""
2351
2352NoSolution = """
2353NoSolutionError()
2354
2355No solution can be found in the given interval.
2356"""
2357
2358InvalidSubimageSpecification = """
2359InvalidSubimageSpecificationError()
2360
2361The subimage specification is invalid.
2362"""
2363
2364NonseparableSubimageCoordinateSystem = """
2365NonseparableSubimageCoordinateSystemError()
2366
2367Non-separable subimage coordinate system.
2368"""
2369
2370NoWcsKeywordsFound = """
2371NoWcsKeywordsFoundError()
2372
2373No WCS keywords were found in the given header.
2374"""
2375
2376InvalidTabularParameters = """
2377InvalidTabularParametersError()
2378
2379The given tabular parameters are invalid.
2380"""
2381
2382mjdbeg = """
2383``double`` Modified Julian Date corresponding to ``DATE-BEG``.
2384
2385``(MJD = JD - 2400000.5)``.
2386
2387An undefined value is represented by NaN.
2388
2389See also
2390--------
2391astropy.wcs.Wcsprm.mjdbeg
2392"""
2393
2394mjdend = """
2395``double`` Modified Julian Date corresponding to ``DATE-END``.
2396
2397``(MJD = JD - 2400000.5)``.
2398
2399An undefined value is represented by NaN.
2400
2401See also
2402--------
2403astropy.wcs.Wcsprm.mjdend
2404"""
2405
2406mjdref = """
2407``double`` Modified Julian Date corresponding to ``DATE-REF``.
2408
2409``(MJD = JD - 2400000.5)``.
2410
2411An undefined value is represented by NaN.
2412
2413See also
2414--------
2415astropy.wcs.Wcsprm.dateref
2416"""
2417
2418bepoch = """
2419``double`` Equivalent to ``DATE-OBS``.
2420
2421Expressed as a Besselian epoch.
2422
2423See also
2424--------
2425astropy.wcs.Wcsprm.dateobs
2426"""
2427
2428jepoch = """
2429``double`` Equivalent to ``DATE-OBS``.
2430
2431Expressed as a Julian epoch.
2432
2433See also
2434--------
2435astropy.wcs.Wcsprm.dateobs
2436"""
2437
2438datebeg = """
2439``string`` Date at the start of the observation.
2440
2441In ISO format, ``yyyy-mm-ddThh:mm:ss``.
2442
2443See also
2444--------
2445astropy.wcs.Wcsprm.datebeg
2446"""
2447
2448dateend = """
2449``string`` Date at the end of the observation.
2450
2451In ISO format, ``yyyy-mm-ddThh:mm:ss``.
2452
2453See also
2454--------
2455astropy.wcs.Wcsprm.dateend
2456"""
2457
2458dateref = """
2459``string`` Date of a reference epoch relative to which
2460other time measurements refer.
2461
2462See also
2463--------
2464astropy.wcs.Wcsprm.dateref
2465"""
2466
2467timesys = """
2468``string`` Time scale (UTC, TAI, etc.) in which all other time-related
2469auxiliary header values are recorded. Also defines the time scale for
2470an image axis with CTYPEia set to 'TIME'.
2471
2472See also
2473--------
2474astropy.wcs.Wcsprm.timesys
2475"""
2476
2477trefpos = """
2478``string`` Location in space where the recorded time is valid.
2479
2480See also
2481--------
2482astropy.wcs.Wcsprm.trefpos
2483"""
2484
2485trefdir = """
2486``string`` Reference direction used in calculating a pathlength delay.
2487
2488See also
2489--------
2490astropy.wcs.Wcsprm.trefdir
2491"""
2492
2493timeunit = """
2494``string`` Time units in which the following header values are expressed:
2495``TSTART``, ``TSTOP``, ``TIMEOFFS``, ``TIMSYER``, ``TIMRDER``, ``TIMEDEL``.
2496
2497It also provides the default value for ``CUNITia`` for time axes.
2498
2499See also
2500--------
2501astropy.wcs.Wcsprm.trefdir
2502"""
2503
2504plephem = """
2505``string`` The Solar System ephemeris used for calculating a pathlength delay.
2506
2507See also
2508--------
2509astropy.wcs.Wcsprm.plephem
2510"""
2511
2512tstart = """
2513``double`` equivalent to DATE-BEG expressed as a time in units of TIMEUNIT relative to DATEREF+TIMEOFFS.
2514
2515See also
2516--------
2517astropy.wcs.Wcsprm.tstop
2518"""
2519
2520tstop = """
2521``double`` equivalent to DATE-END expressed as a time in units of TIMEUNIT relative to DATEREF+TIMEOFFS.
2522
2523See also
2524--------
2525astropy.wcs.Wcsprm.tstart
2526"""
2527
2528telapse = """
2529``double`` equivalent to the elapsed time between DATE-BEG and DATE-END, in units of TIMEUNIT.
2530
2531See also
2532--------
2533astropy.wcs.Wcsprm.tstart
2534"""
2535
2536timeoffs = """
2537``double`` Time offset, which may be used, for example, to provide a uniform clock correction
2538           for times referenced to DATEREF.
2539
2540See also
2541--------
2542astropy.wcs.Wcsprm.timeoffs
2543"""
2544
2545timsyer = """
2546``double`` the absolute error of the time values, in units of TIMEUNIT.
2547
2548See also
2549--------
2550astropy.wcs.Wcsprm.timrder
2551"""
2552
2553timrder = """
2554``double`` the accuracy of time stamps relative to each other, in units of TIMEUNIT.
2555
2556See also
2557--------
2558astropy.wcs.Wcsprm.timsyer
2559"""
2560
2561timedel = """
2562``double`` the resolution of the time stamps.
2563
2564See also
2565--------
2566astropy.wcs.Wcsprm.timedel
2567"""
2568
2569timepixr = """
2570``double`` relative position of the time stamps in binned time intervals, a value between 0.0 and 1.0.
2571
2572See also
2573--------
2574astropy.wcs.Wcsprm.timepixr
2575"""
2576
2577obsorbit = """
2578``string`` URI, URL, or name of an orbit ephemeris file giving spacecraft coordinates relating to TREFPOS.
2579
2580See also
2581--------
2582astropy.wcs.Wcsprm.trefpos
2583
2584"""
2585xposure = """
2586``double`` effective exposure time in units of TIMEUNIT.
2587
2588See also
2589--------
2590astropy.wcs.Wcsprm.timeunit
2591"""
2592
2593czphs = """
2594``double array[naxis]`` The time at the zero point of a phase axis, ``CSPHSia``.
2595
2596An undefined value is represented by NaN.
2597"""
2598
2599cperi = """
2600``double array[naxis]`` period of a phase axis, CPERIia.
2601
2602An undefined value is represented by NaN.
2603"""
2604