forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocstrings.py
More file actions
2258 lines (1621 loc) · 59.2 KB
/
Copy pathdocstrings.py
File metadata and controls
2258 lines (1621 loc) · 59.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from __future__ import division # confidence high
del division
# We don't want the "division" symbol in the namespace, since it
# should have only docstrings
# It gets to be really tedious to type long docstrings in ANSI C
# syntax (since multi-line string literals are not valid).
# Therefore, the docstrings are written here in doc/docstrings.py,
# which are then converted by setup.py into docstrings.h, which is
# included by pywcs.c
from . import _docutil as __
a = """
``double array[a_order+1][a_order+1]`` Focal plane transformation
matrix.
The `SIP`_ ``A_i_j`` matrix used for pixel to focal plane
transformation.
Its values may be changed in place, but it may not be resized, without
creating a new `~astropy.wcs.Sip` object.
"""
a_order = """
``int`` (read-only) Order of the polynomial (``A_ORDER``).
"""
all_pix2world = """
all_pix2world(pixcrd, origin) -> ``double array[ncoord][nelem]``
Transforms pixel coordinates to world coordinates.
Does the following:
- Detector to image plane correction (optionally)
- SIP distortion correction (optionally)
- Paper IV distortion correction (optionally)
- wcslib WCS transformation
The first three (the distortion corrections) are done in parallel.
Parameters
----------
pixcrd : double array[ncoord][nelem]
Array of pixel coordinates.
{0}
Returns
-------
world : double array[ncoord][nelem]
Returns an array of world coordinates.
Raises
------
MemoryError
Memory allocation failed.
SingularMatrixError
Linear transformation matrix is singular.
InconsistentAxisTypesError
Inconsistent or unrecognized coordinate axis types.
ValueError
Invalid parameter value.
ValueError
Invalid coordinate transformation parameters.
ValueError
x- and y-coordinate arrays are not the same size.
InvalidTransformError
Invalid coordinate transformation.
InvalidTransformError
Ill-conditioned coordinate transformation parameters.
""".format(__.ORIGIN())
alt = """
``str`` Character code for alternate coordinate descriptions.
For example, the ``"a"`` in keyword names such as ``CTYPEia``. This
is a space character for the primary coordinate description, or one of
the 26 upper-case letters, A-Z.
"""
ap = """
``double array[ap_order+1][ap_order+1]`` Focal plane to pixel
transformation matrix.
The `SIP`_ ``AP_i_j`` matrix used for focal plane to pixel
transformation. Its values may be changed in place, but it may not be
resized, without creating a new `~astropy.wcs.Sip` object.
"""
ap_order = """
``int`` (read-only) Order of the polynomial (``AP_ORDER``).
"""
axis_types = """
``int array[naxis]`` An array of four-digit type codes for each axis.
- First digit (i.e. 1000s):
- 0: Non-specific coordinate type.
- 1: Stokes coordinate.
- 2: Celestial coordinate (including ``CUBEFACE``).
- 3: Spectral coordinate.
- Second digit (i.e. 100s):
- 0: Linear axis.
- 1: Quantized axis (``STOKES``, ``CUBEFACE``).
- 2: Non-linear celestial axis.
- 3: Non-linear spectral axis.
- 4: Logarithmic axis.
- 5: Tabular axis.
- Third digit (i.e. 10s):
- 0: Group number, e.g. lookup table number
- The fourth digit is used as a qualifier depending on the axis type.
- For celestial axes:
- 0: Longitude coordinate.
- 1: Latitude coordinate.
- 2: ``CUBEFACE`` number.
- For lookup tables: the axis number in a multidimensional table.
``CTYPEia`` in ``"4-3"`` form with unrecognized algorithm code will
have its type set to -1 and generate an error.
"""
b = """
``double array[b_order+1][b_order+1]`` Pixel to focal plane
transformation matrix.
The `SIP`_ ``B_i_j`` matrix used for pixel to focal plane
transformation. Its values may be changed in place, but it may not be
resized, without creating a new `~astropy.wcs.Sip` object.
"""
b_order = """
``int`` (read-only) Order of the polynomial (``B_ORDER``).
"""
bp = """
``double array[bp_order+1][bp_order+1]`` Focal plane to pixel
transformation matrix.
The `SIP`_ ``BP_i_j`` matrix used for focal plane to pixel
transformation. Its values may be changed in place, but it may not be
resized, without creating a new `~astropy.wcs.Sip` object.
"""
bp_order = """
``int`` (read-only) Order of the polynomial (``BP_ORDER``).
"""
cd = """
``double array[naxis][naxis]`` The ``CDi_ja`` linear transformation
matrix.
For historical compatibility, three alternate specifications of the
linear transforations are available in wcslib. The canonical
``PCi_ja`` with ``CDELTia``, and the deprecated ``CDi_ja`` and
``CROTAia`` keywords. Although the deprecated versions may not
formally co-exist with ``PCi_ja``, the approach here is simply to
ignore them if given in conjunction with ``PCi_ja``.
`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and
`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of
these alternatives are present in the header.
These alternate specifications of the linear transformation matrix are
translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and
are nowhere visible to the lower-level routines. In particular,
`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity
if ``CDi_ja`` is present (and no ``PCi_ja``). If no ``CROTAia`` is
associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts
to a unity ``PCi_ja`` matrix.
"""
cdelt = """
``double array[naxis]`` Coordinate increments (``CDELTia``) for each
coord axis.
If a ``CDi_ja`` linear transformation matrix is present, a warning is
raised and `~astropy.wcs.Wcsprm.cdelt` is ignored. The ``CDi_ja``
matrix may be deleted by::
del wcs.wcs.cd
An undefined value is represented by NaN.
"""
cdfix = """
cdfix()
Fix erroneously omitted ``CDi_ja`` keywords.
Sets the diagonal element of the ``CDi_ja`` matrix to unity if all
``CDi_ja`` keywords associated with a given axis were omitted.
According to Paper I, if any ``CDi_ja`` keywords at all are given in a
FITS header then those not given default to zero. This results in a
singular matrix with an intersecting row and column of zeros.
Returns
-------
success : int
Returns ``0`` for success; ``-1`` if no change required.
"""
cel_offset = """
``boolean`` Is there an offset?
If `True`, an offset will be applied to ``(x, y)`` to force ``(x, y) =
(0, 0)`` at the fiducial point, (phi_0, theta_0). Default is `False`.
"""
celfix = """
Translates AIPS-convention celestial projection types, ``-NCP`` and
``-GLS``.
Returns
-------
success : int
Returns ``0`` for success; ``-1`` if no change required.
"""
cname = """
``list of strings`` A list of the coordinate axis names, from
``CNAMEia``.
"""
colax = """
``int array[naxis]`` An array recording the column numbers for each
axis in a pixel list.
"""
colnum = """
``int`` Column of FITS binary table associated with this WCS.
Where the coordinate representation is associated with an image-array
column in a FITS binary table, this property may be used to record the
relevant column number.
It should be set to zero for an image header or pixel list.
"""
convert = """
convert(array)
Perform the unit conversion on the elements of the given *array*,
returning an array of the same shape.
"""
coord = """
``double array[K_M]...[K_2][K_1][M]`` The tabular coordinate array.
Has the dimensions::
(K_M, ... K_2, K_1, M)
(see `~astropy.wcs._astropy.wcs.Tabprm.K`) i.e. with the `M` dimension
varying fastest so that the `M` elements of a coordinate vector are
stored contiguously in memory.
"""
copy = """
Creates a deep copy of the WCS object.
"""
cpdis1 = """
`~astropy.wcs.DistortionLookupTable`
The pre-linear transformation distortion lookup table, ``CPDIS1``.
"""
cpdis2 = """
`~astropy.wcs.DistortionLookupTable`
The pre-linear transformation distortion lookup table, ``CPDIS2``.
"""
crder = """
``double array[naxis]`` The random error in each coordinate axis,
``CRDERia``.
An undefined value is represented by NaN.
"""
crota = """
``double array[naxis]`` ``CROTAia`` keyvalues for each coordinate
axis.
For historical compatibility, three alternate specifications of the
linear transforations are available in wcslib. The canonical
``PCi_ja`` with ``CDELTia``, and the deprecated ``CDi_ja`` and
``CROTAia`` keywords. Although the deprecated versions may not
formally co-exist with ``PCi_ja``, the approach here is simply to
ignore them if given in conjunction with ``PCi_ja``.
`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and
`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of
these alternatives are present in the header.
These alternate specifications of the linear transformation matrix are
translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and
are nowhere visible to the lower-level routines. In particular,
`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity
if ``CDi_ja`` is present (and no ``PCi_ja``). If no ``CROTAia`` is
associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts
to a unity ``PCi_ja`` matrix.
"""
crpix = """
``double array[naxis]`` Coordinate reference pixels (``CRPIXja``) for
each pixel axis.
"""
crval = """
``double array[naxis]`` Coordinate reference values (``CRVALia``) for
each coordinate axis.
"""
crval_tabprm = """
``double array[M]`` Index values for the reference pixel for each of
the tabular coord axes.
"""
csyer = """
``double array[naxis]`` The systematic error in the coordinate value
axes, ``CSYERia``.
An undefined value is represented by NaN.
"""
ctype = """
``list of strings[naxis]`` List of ``CTYPEia`` keyvalues.
The `~astropy.wcs.Wcsprm.ctype` keyword values must be in upper case
and there must be zero or one pair of matched celestial axis types,
and zero or one spectral axis.
"""
cubeface = """
``int`` Index into the ``pixcrd`` (pixel coordinate) array for the
``CUBEFACE`` axis.
This is used for quadcube projections where the cube faces are stored
on a separate axis.
The quadcube projections (``TSC``, ``CSC``, ``QSC``) may be
represented in FITS in either of two ways:
- The six faces may be laid out in one plane and numbered as
follows::
0
4 3 2 1 4 3 2
5
Faces 2, 3 and 4 may appear on one side or the other (or both).
The world-to-pixel routines map faces 2, 3 and 4 to the left but
the pixel-to-world routines accept them on either side.
- The ``COBE`` convention in which the six faces are stored in a
three-dimensional structure using a ``CUBEFACE`` axis indexed
from 0 to 5 as above.
These routines support both methods; `~astropy.wcs.Wcsprm.set`
determines which is being used by the presence or absence of a
``CUBEFACE`` axis in `~astropy.wcs.Wcsprm.ctype`.
`~astropy.wcs.Wcsprm.p2s` and `~astropy.wcs.Wcsprm.s2p` translate the
``CUBEFACE`` axis representation to the single plane representation
understood by the lower-level projection routines.
"""
cunit = """
``list of strings[naxis]`` List of ``CUNITia`` keyvalues.
These define the units of measurement of the ``CRVALia``, ``CDELTia``
and ``CDi_ja`` keywords.
As ``CUNITia`` is an optional header keyword,
`~astropy.wcs.Wcsprm.cunit` may be left blank but otherwise is
expected to contain a standard units specification as defined by WCS
Paper I. `~astropy.wcs.Wcsprm.unitfix` is available to translate
commonly used non-standard units specifications but this must be done
as a separate step before invoking `~astropy.wcs.Wcsprm.set`.
For celestial axes, if `~astropy.wcs.Wcsprm.cunit` is not blank,
`~astropy.wcs.Wcsprm.set` uses `wcsunits` to parse it and scale
`~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, and
`~astropy.wcs.Wcsprm.cd` to decimal degrees. It then resets
`~astropy.wcs.Wcsprm.cunit` to ``"deg"``.
For spectral axes, if `~astropy.wcs.Wcsprm.cunit` is not blank,
`~astropy.wcs.Wcsprm.set` uses `wcsunits` to parse it and scale
`~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, and
`~astropy.wcs.Wcsprm.cd` to SI units. It then resets
`~astropy.wcs.Wcsprm.cunit` accordingly.
`~astropy.wcs.Wcsprm.set` ignores `~astropy.wcs.Wcsprm.cunit` for
other coordinate types; `~astropy.wcs.Wcsprm.cunit` may be used to
label coordinate values.
"""
cylfix = """
cylfix()
Fixes WCS keyvalues for malformed cylindrical projections.
Returns
-------
success : int
Returns ``0`` for success; ``-1`` if no change required.
"""
data = """
``float array`` The array data for the
`~astropy.wcs.DistortionLookupTable`.
"""
data_wtbarr = """
``double array``
The array data for the BINTABLE.
"""
dateavg = """
``string`` Representative mid-point of the date of observation.
In ISO format, ``yyyy-mm-ddThh:mm:ss``.
See also
--------
astropy.wcs.Wcsprm.dateobs
"""
dateobs = """
``string`` Start of the date of observation.
In ISO format, ``yyyy-mm-ddThh:mm:ss``.
See also
--------
astropy.wcs.Wcsprm.dateavg
"""
datfix = """
datfix()
Translates the old ``DATE-OBS`` date format to year-2000 standard form
``(yyyy-mm-ddThh:mm:ss)`` and derives ``MJD-OBS`` from it if not
already set.
Alternatively, if `~astropy.wcs.Wcsprm.mjdobs` is set and
`~astropy.wcs.Wcsprm.dateobs` isn't, then `~astropy.wcs.Wcsprm.datfix`
derives `~astropy.wcs.Wcsprm.dateobs` from it. If both are set but
disagree by more than half a day then `ValueError` is raised.
Returns
-------
success : int
Returns ``0`` for success; ``-1`` if no change required.
"""
delta = """
``double array[M]`` (read-only) Interpolated indices into the coord
array.
Array of interpolated indices into the coordinate array such that
Upsilon_m, as defined in Paper III, is equal to
(`~astropy.wcs._astropy.wcs.Tabprm.p0` [m] + 1) + delta[m].
"""
det2im = """
Convert detector coordinates to image plane coordinates.
"""
det2im1 = """
A `~astropy.wcs.DistortionLookupTable` object for detector to image plane
correction in the *x*-axis.
"""
det2im2 = """
A `~astropy.wcs.DistortionLookupTable` object for detector to image plane
correction in the *y*-axis.
"""
dims = """
``int array[ndim]`` (read-only)
The dimensions of the tabular array
`~astropy.wcs._astropy.wcs.Wtbarr.data`.
"""
DistortionLookupTable = """
DistortionLookupTable(*table*, *crpix*, *crval*, *cdelt*)
Represents a single lookup table for a `Paper IV`_ distortion
transformation.
Parameters
----------
table : 2-dimensional array
The distortion lookup table.
crpix : 2-tuple
The distortion array reference pixel
crval : 2-tuple
The image array pixel coordinate
cdelt : 2-tuple
The grid step size
"""
equinox = """
``double`` The equinox associated with dynamical equatorial or
ecliptic coordinate systems.
``EQUINOXa`` (or ``EPOCH`` in older headers). Not applicable to ICRS
equatorial or ecliptic coordinates.
An undefined value is represented by NaN.
"""
extlev = """
``int`` (read-only)
``EXTLEV`` identifying the binary table extension.
"""
extnam = """
``str`` (read-only)
``EXTNAME`` identifying the binary table extension.
"""
extrema = """
``double array[K_M]...[K_2][2][M]`` (read-only)
An array recording the minimum and maximum value of each element of
the coordinate vector in each row of the coordinate array, with the
dimensions::
(K_M, ... K_2, 2, M)
(see `~astropy.wcs._astropy.wcs.Tabprm.K`). The minimum is recorded
in the first element of the compressed K_1 dimension, then the
maximum. This array is used by the inverse table lookup function to
speed up table searches.
"""
extver = """
``int`` (read-only)
``EXTVER`` identifying the binary table extension.
"""
find_all_wcs = """
find_all_wcs(relax=0, keysel=0)
Find all WCS transformations in the header.
Parameters
----------
header : str
The raw FITS header data.
relax : bool or int
Degree of permissiveness:
- `False`: Recognize only FITS keywords defined by the published
WCS standard.
- `True`: Admit all recognized informal extensions of the WCS
standard.
- `int`: a bit field selecting specific extensions to accept. See
:ref:`relaxread` for details.
keysel : sequence of flags
Used to restrict the keyword types considered:
- ``WCSHDR_IMGHEAD``: Image header keywords.
- ``WCSHDR_BIMGARR``: Binary table image array.
- ``WCSHDR_PIXLIST``: Pixel list keywords.
If zero, there is no restriction. If -1, `wcspih` is called,
rather than `wcstbh`.
Returns
-------
wcs_list : list of `~astropy.wcs._astropy.wcs._Wcsprm` objects
"""
fix = """
fix(translate_units='', naxis=0)
Applies all of the corrections handled separately by
`~astropy.wcs.Wcsprm.datfix`, `~astropy.wcs.Wcsprm.unitfix`,
`~astropy.wcs.Wcsprm.celfix`, `~astropy.wcs.Wcsprm.spcfix`,
`~astropy.wcs.Wcsprm.cylfix` and `~astropy.wcs.Wcsprm.cdfix`.
Parameters
----------
translate_units : str
Do potentially unsafe translations of non-standard unit strings.
Although ``"S"`` is commonly used to represent seconds, its
translation to ``"s"`` is potentially unsafe since the standard
recognizes ``"S"`` formally as Siemens, however rarely that may be
used. The same applies to ``"H"`` for hours (Henry), and ``"D"``
for days (Debye).
This string controls what to do in such cases, and is
case-insensitive.
- If the string contains ``"s"``, translate ``"S"`` to ``"s"``.
- If the string contains ``"h"``, translate ``"H"`` to ``"h"``.
- If the string contains ``"d"``, translate ``"D"`` to ``"d"``.
Thus ``''`` doesn't do any unsafe translations, whereas ``'shd'``
does all of them.
naxis : int array[naxis]
Image axis lengths. If this array is set to zero or ``None``,
then `~astropy.wcs.Wcsprm.cylfix` will not be invoked.
Returns
-------
status : dict
Returns a dictionary containing the following keys, each referring
to a status string for each of the sub-fix functions that were
called:
- `~astropy.wcs.Wcsprm.cdfix`
- `~astropy.wcs.Wcsprm.datfix`
- `~astropy.wcs.Wcsprm.unitfix`
- `~astropy.wcs.Wcsprm.celfix`
- `~astropy.wcs.Wcsprm.spcfix`
- `~astropy.wcs.Wcsprm.cylfix`
"""
get_offset = """
get_offset(x, y) -> (x, y)
Returns the offset as defined in the distortion lookup table.
Returns
-------
coordinate : coordinate pair
The offset from the distortion table for pixel point (*x*, *y*).
"""
get_cdelt = """
get_cdelt() -> double array[naxis]
Coordinate increments (``CDELTia``) for each coord axis.
Returns the ``CDELT`` offsets in read-only form. Unlike the
`~astropy.wcs.Wcsprm.cdelt` property, this works even when the header
specifies the linear transformation matrix in one of the deprecated
``CDi_ja`` or ``CROTAia`` forms. This is useful when you want access
to the linear transformation matrix, but don't care how it was
specified in the header.
"""
get_pc = """
get_pc() -> double array[naxis][naxis]
Returns the ``PC`` matrix in read-only form. Unlike the
`~astropy.wcs.Wcsprm.pc` property, this works even when the header
specifies the linear transformation matrix in one of the deprecated
``CDi_ja`` or ``CROTAia`` forms. This is useful when you want access
to the linear transformation matrix, but don't care how it was
specified in the header.
"""
get_ps = """
get_ps() -> list of tuples
Returns ``PSi_ma`` keywords for each *i* and *m*.
Returns
-------
ps : list of tuples
Returned as a list of tuples of the form (*i*, *m*, *value*):
- *i*: int. Axis number, as in ``PSi_ma``, (i.e. 1-relative)
- *m*: int. Parameter number, as in ``PSi_ma``, (i.e. 0-relative)
- *value*: string. Parameter value.
See also
--------
astropy.wcs.Wcsprm.set_ps : Set ``PSi_ma`` values
"""
get_pv = """
get_pv() -> list of tuples
Returns ``PVi_ma`` keywords for each *i* and *m*.
Returns
-------
Returned as a list of tuples of the form (*i*, *m*, *value*):
- *i*: int. Axis number, as in ``PVi_ma``, (i.e. 1-relative)
- *m*: int. Parameter number, as in ``PVi_ma``, (i.e. 0-relative)
- *value*: string. Parameter value.
See also
--------
astropy.wcs.Wcsprm.set_pv : Set ``PVi_ma`` values
Notes
-----
Note that, if they were not given, `~astropy.wcs.Wcsprm.set` resets
the entries for ``PVi_1a``, ``PVi_2a``, ``PVi_3a``, and ``PVi_4a`` for
longitude axis *i* to match (``phi_0``, ``theta_0``), the native
longitude and latitude of the reference point given by ``LONPOLEa``
and ``LATPOLEa``.
"""
has_cd = """
has_cd() -> bool
Returns `True` if ``CDi_ja`` is present.
``CDi_ja`` is an alternate specification of the linear transformation
matrix, maintained for historical compatibility.
Matrix elements in the IRAF convention are equivalent to the product
``CDi_ja = CDELTia * PCi_ja``, but the defaults differ from that of
the ``PCi_ja`` matrix. If one or more ``CDi_ja`` keywords are present
then all unspecified ``CDi_ja`` default to zero. If no ``CDi_ja`` (or
``CROTAia``) keywords are present, then the header is assumed to be in
``PCi_ja`` form whether or not any ``PCi_ja`` keywords are present
since this results in an interpretation of ``CDELTia`` consistent with
the original FITS specification.
While ``CDi_ja`` may not formally co-exist with ``PCi_ja``, it may
co-exist with ``CDELTia`` and ``CROTAia`` which are to be ignored.
See also
--------
astropy.wcs.Wcsprm.cd : Get the raw ``CDi_ja`` values.
"""
has_cdi_ja = """
has_cdi_ja() -> bool
Alias for `~astropy.wcs.Wcsprm.has_cd`. Maintained for backward
compatibility.
"""
has_crota = """
has_crota() -> bool
Returns `True` if ``CROTAia`` is present.
``CROTAia`` is an alternate specification of the linear transformation
matrix, maintained for historical compatibility.
In the AIPS convention, ``CROTAia`` may only be associated with the
latitude axis of a celestial axis pair. It specifies a rotation in
the image plane that is applied *after* the ``CDELTia``; any other
``CROTAia`` keywords are ignored.
``CROTAia`` may not formally co-exist with ``PCi_ja``. ``CROTAia`` and
``CDELTia`` may formally co-exist with ``CDi_ja`` but if so are to be
ignored.
See also
--------
astropy.wcs.Wcsprm.crota : Get the raw ``CROTAia`` values
"""
has_crotaia = """
has_crotaia() -> bool
Alias for `~astropy.wcs.Wcsprm.has_crota`. Maintained for backward
compatibility.
"""
has_pc = """
has_pc() -> bool
Returns `True` if ``PCi_ja`` is present. ``PCi_ja`` is the
recommended way to specify the linear transformation matrix.
See also
--------
astropy.wcs.Wcsprm.pc : Get the raw ``PCi_ja`` values
"""
has_pci_ja = """
has_pci_ja() -> bool
Alias for `~astropy.wcs.Wcsprm.has_pc`. Maintained for backward
compatibility.
"""
have = """
``string`` The name of the unit being converted from.
This value always uses standard unit names, even if the
`UnitConverter` was initialized with a non-standard unit name.
"""
i = """
``int`` (read-only)
Image axis number.
"""
imgpix_matrix = """
``double array[2][2]`` (read-only) Inverse of the ``CDELT`` or ``PC``
matrix.
Inverse containing the product of the ``CDELTia`` diagonal matrix and
the ``PCi_ja`` matrix.
"""
is_unity = """
is_unity() -> bool
Returns `True` if the linear transformation matrix
(`~astropy.wcs.Wcsprm.cd`) is unity.
"""
K = """
``int array[M]`` (read-only) The lengths of the axes of the coordinate
array.
An array of length `M` whose elements record the lengths of the axes of
the coordinate array and of each indexing vector.
"""
kind = """
``str`` (read-only)
Character identifying the wcstab array type:
- ``'c'``: coordinate array,
- ``'i'``: index vector.
"""
lat = """
``int`` (read-only) The index into the world coord array containing
latitude values.
"""
latpole = """
``double`` The native latitude of the celestial pole, ``LATPOLEa`` (deg).
"""
lattyp = """
``string`` (read-only) Celestial axis type for latitude.
For example, "RA", "DEC", "GLON", "GLAT", etc. extracted from "RA--",
"DEC-", "GLON", "GLAT", etc. in the first four characters of
``CTYPEia`` but with trailing dashes removed.
"""
lng = """
``int`` (read-only) The index into the world coord array containing
longitude values.
"""
lngtyp = """
``string`` (read-only) Celestial axis type for longitude.
For example, "RA", "DEC", "GLON", "GLAT", etc. extracted from "RA--",
"DEC-", "GLON", "GLAT", etc. in the first four characters of
``CTYPEia`` but with trailing dashes removed.
"""
lonpole = """
``double`` The native longitude of the celestial pole.
``LONPOLEa`` (deg).
"""
M = """
``int`` (read-only) Number of tabular coordinate axes.
"""
m = """
``int`` (read-only)
Array axis number for index vectors.
"""
map = """
``int array[M]`` Association between axes.
A vector of length `~astropy.wcs._astropy.wcs.Tabprm.M` that defines
the association between axis *m* in the *M*-dimensional coordinate
array (1 <= *m* <= *M*) and the indices of the intermediate world
coordinate and world coordinate arrays.
When the intermediate and world coordinate arrays contain the full
complement of coordinate elements in image-order, as will usually be
the case, then ``map[m-1] == i-1`` for axis *i* in the *N*-dimensional
image (1 <= *i* <= *N*). In terms of the FITS keywords::
map[PVi_3a - 1] == i - 1.
However, a different association may result if the intermediate
coordinates, for example, only contains a (relevant) subset of
intermediate world coordinate elements. For example, if *M* == 1 for
an image with *N* > 1, it is possible to fill the intermediate
coordinates with the relevant coordinate element with ``nelem`` set to
1. In this case ``map[0] = 0`` regardless of the value of *i*.
"""
mix = """
mix(mixpix, mixcel, vspan, vstep, viter, world, pixcrd, origin)
Given either the celestial longitude or latitude plus an element of
the pixel coordinate, solves for the remaining elements by iterating
on the unknown celestial coordinate element using
`~astropy.wcs.Wcsprm.s2p`.
Parameters
----------
mixpix : int
Which element on the pixel coordinate is given.
mixcel : int
Which element of the celestial coordinate is given. If *mixcel* =
``1``, celestial longitude is given in ``world[self.lng]``,
latitude returned in ``world[self.lat]``. If *mixcel* = ``2``,
celestial latitude is given in ``world[self.lat]``, longitude
returned in ``world[self.lng]``.
vspan : pair of floats
Solution interval for the celestial coordinate, in degrees. The
ordering of the two limits is irrelevant. Longitude ranges may be
specified with any convenient normalization, for example
``(-120,+120)`` is the same as ``(240,480)``, except that the
solution will be returned with the same normalization, i.e. lie
within the interval specified.
vstep : float
Step size for solution search, in degrees. If ``0``, a sensible,
although perhaps non-optimal default will be used.
viter : int
If a solution is not found then the step size will be halved and
the search recommenced. *viter* controls how many times the step
size is halved. The allowed range is 5 - 10.
world : double array[naxis]