# Celprm¶

class astropy.wcs.Celprm

Bases: object

Class that contains information required to transform celestial coordinates. It consists of certain members that must be set by the user (given) and others that are set by the WCSLIB routines (returned). Some of the latter are supplied for informational purposes and others are for internal use only.

Attributes Summary

 euler Read-only numpy.ndarray with 5 elements. isolat bool, read-only. latpreq int, read-only. offset boolean Is there an offset? phi0 prj Read-only Celestial transformation parameters. ref numpy.ndarray with 4 elements. theta0

Methods Summary

 Sets up a celprm struct according to information supplied within it.

Attributes Documentation

euler

Read-only numpy.ndarray with 5 elements. Euler angles and associated intermediaries derived from the coordinate reference values. The first three values are the Z-, X-, and Z-Euler angles in degrees, and the remaining two are the cosine and sine of the X-Euler angle.

isolat

bool, read-only. True if the spherical rotation preserves the magnitude of the latitude, which occurs if the axes of the native and celestial coordinates are coincident. It signals an opportunity to cache intermediate calculations common to all elements in a vector computation.

latpreq

int, read-only. For informational purposes, this indicates how the LATPOLEa keyword was used:

• 0: Not required, theta_p == delta_p was determined uniquely by the

CRVALia and LONPOLEa keywords.

• 1: Required to select between two valid solutions of theta_p.

• 2: theta_p was specified solely by LATPOLEa.

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.

phi0

float, None. The native longitude, $$\phi_0$$, in degrees of the fiducial point, i.e., the point whose celestial coordinates are given in ‘’Celprm.ref[0:1]’’. If None or nan, the initialization routine, celset(), will set this to a projection-specific default.

prj

Read-only Celestial transformation parameters. Some members of Prjprm are read-write, i.e., can be set by the user. For more details, see documentation for Prjprm.

ref

numpy.ndarray with 4 elements. (Given) The first pair of values should be set to the celestial longitude and latitude of the fiducial point in degrees - typically right ascension and declination. These are given by the CRVALia keywords in FITS.

(Given and returned) The second pair of values are the native longitude, phi_p (in degrees), and latitude, theta_p (in degrees), of the celestial pole (the latter is the same as the celestial latitude of the native pole, delta_p) and these are given by the FITS keywords LONPOLEa and LATPOLEa (or by PVi_2a and PVi_3a attached to the longitude axis which take precedence if defined).

LONPOLEa defaults to phi0 if the celestial latitude of the fiducial point of the projection is greater than or equal to the native latitude, otherwise phi0 + 180 (degrees). (This is the condition for the celestial latitude to increase in the same direction as the native latitude at the fiducial point.) ref[2] may be set to None or numpy.nan or 999.0 to indicate that the correct default should be substituted.

theta_p, the native latitude of the celestial pole (or equally the celestial latitude of the native pole, delta_p) is often determined uniquely by CRVALia and LONPOLEa in which case LATPOLEa is ignored. However, in some circumstances there are two valid solutions for theta_p and LATPOLEa is used to choose between them. LATPOLEa is set in ref[3] and the solution closest to this value is used to reset ref[3]. It is therefore legitimate, for example, to set ref[3] to +90.0 to choose the more northerly solution - the default if the LATPOLEa keyword is omitted from the FITS header. For the special case where the fiducial point of the projection is at native latitude zero, its celestial latitude is zero, and LONPOLEa = +/- 90.0 then the celestial latitude of the native pole is not determined by the first three reference values and LATPOLEa specifies it completely.

The returned value, celprm.latpreq, specifies how LATPOLEa was actually used.

theta0

float, None. The native latitude, $$\theta_0$$, in degrees of the fiducial point, i.e. the point whose celestial coordinates are given in Celprm:ref[0:1]. If None or nan, the initialization routine, celset(), will set this to a projection-specific default.

Methods Documentation

set()

Sets up a celprm struct according to information supplied within it.

Note that this routine need not be called directly; it will be invoked by functions that need it.

Raises
MemoryError

Memory allocation failed.

InvalidPrjParametersError

Invalid celestial parameters.