WCSLIB: prjprm Struct Reference

WCSLIB 8.9

Loading...
Searching...
No Matches
Data Fields
prjprm Struct Reference

Projection parameters. More...

`#include <prj.h>`

## Data Fields
int | flag
char | code [4]
double | r0
double | pv [PVN]
double | phi0
double | theta0
int | bounds
char | name [40]
int | category
int | pvrange
int | simplezen
int | equiareal
int | conformal
int | global
int | divergent
double | x0
double | y0
struct wcserr * | err
void * | padding
double | w [10]
int | m
int | n
int(* | prjx2s )(PRJX2S_ARGS)
int(* | prjs2x )(PRJS2X_ARGS)

## Detailed Description

Projection parameters.

The prjprm struct contains all information needed to project or deproject native spherical 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 while others are for internal use only.

## Field Documentation

## ◆ flag

int prjprm::flag

(Given and returned) This flag must be set to zero (or 1, see prjset()) whenever any of the following prjprm members are set or changed:

- prjprm::code,
- prjprm::r0,
- prjprm::pv[],
- prjprm::phi0,
- prjprm::theta0.

This signals the initialization routine (prjset() or ???set()) to recompute the returned members of the prjprm struct. flag will then be reset to indicate that this has been done.

Note that flag need not be reset when prjprm::bounds is changed.

## ◆ code

char prjprm::code[4]

(Given) Three-letter projection code defined by the FITS standard.

## ◆ r0

double prjprm::r0

(Given) The radius of the generating sphere for the projection, a linear scaling parameter. If this is zero, it will be reset to its default value of (the value for FITS WCS).

## ◆ pv

double prjprm::pv[PVN]

(Given) Projection parameters. These correspond to the PVi_ma keywords in FITS, so pv[0] is PVi_0a, pv[1] is PVi_1a, etc., where i denotes the latitude-like axis. Many projections use pv[1] (PVi_1a), some also use pv[2] (PVi_2a) and SZP uses pv[3] (PVi_3a). ZPN is currently the only projection that uses any of the others.

Usage of the pv[] array as it applies to each projection is described in the prologue to each trio of projection routines in prj.c.

## ◆ phi0

double prjprm::phi0

(Given) The native longitude, [deg], and ...

## ◆ theta0

double prjprm::theta0

(Given) ... the native latitude, [deg], of the reference point, i.e. the point = (0,0). If undefined (set to a magic value by prjini()) the initialization routine will set this to a projection-specific default.

## ◆ bounds

int prjprm::bounds

(Given) Controls bounds checking. If bounds&1 then enable strict bounds checking for the spherical-to-Cartesian (s2x) transformation for the AZP, SZP, TAN, SIN, ZPN, and COP projections. If bounds&2 then enable strict bounds checking for the Cartesian-to-spherical transformation (x2s) for the HPX and XPH projections. If bounds&4 then the Cartesian- to-spherical transformations (x2s) will invoke prjbchk() to perform bounds checking on the computed native coordinates, with a tolerance set to suit each projection. bounds is set to 7 by prjini() by default which enables all checks. Zero it to disable all checking.

It is not necessary to reset the prjprm struct (via prjset() or ???set()) when prjprm::bounds is changed.

The remaining members of the prjprm struct are maintained by the setup routines and must not be modified elsewhere:

## ◆ name

char prjprm::name[40]

(Returned) Long name of the projection.

Provided for information only, not used by the projection routines.

## ◆ category

int prjprm::category

(Returned) Projection category matching the value of the relevant global variable:

- ZENITHAL,
- CYLINDRICAL,
- PSEUDOCYLINDRICAL,
- CONVENTIONAL,
- CONIC,
- POLYCONIC,
- QUADCUBE, and
- HEALPIX.

The category name may be identified via the prj_categories character array, e.g.

struct prjprm prj;
...
printf("%s\n", prj_categories[prj.category]);
prj_categories
const char prj_categories[9][32]
Projection categories.
prjprm
Projection parameters.
Definition prj.h:730

Provided for information only, not used by the projection routines.

## ◆ pvrange

int prjprm::pvrange

(Returned) Range of projection parameter indices: 100 times the first allowed index plus the number of parameters, e.g. TAN is 0 (no parameters), SZP is 103 (1 to 3), and ZPN is 30 (0 to 29).

Provided for information only, not used by the projection routines.

## ◆ simplezen

int prjprm::simplezen

(Returned) True if the projection is a radially-symmetric zenithal projection.

Provided for information only, not used by the projection routines.

## ◆ equiareal

int prjprm::equiareal

(Returned) True if the projection is equal area.

Provided for information only, not used by the projection routines.

## ◆ conformal

int prjprm::conformal

(Returned) True if the projection is conformal.

Provided for information only, not used by the projection routines.

## ◆ global

int prjprm::global

(Returned) True if the projection can represent the whole sphere in a finite, non-overlapped mapping.

Provided for information only, not used by the projection routines.

## ◆ divergent

int prjprm::divergent

(Returned) True if the projection diverges in latitude.

Provided for information only, not used by the projection routines.

## ◆ x0

double prjprm::x0

(Returned) The offset in ,and ...

## ◆ y0

double prjprm::y0

(Returned) ... the offset in used to force = (0,0) at ( , ).

## ◆ err

struct wcserr* prjprm::err

(Returned) If enabled, when an error status is returned, this struct contains detailed information about the error, see wcserr_enable().

## ◆ padding

void* prjprm::padding

(An unused variable inserted for alignment purposes only.)

## ◆ w

double prjprm::w[10]

(For internal use only.) Intermediate floating-point values derived from the projection parameters by prjset(), cached here to save recomputation.

Usage of the w[] array as it applies to each projection is described in the prologue to each trio of projection routines in prj.c.

## ◆ m

int prjprm::m

(See next ...) (For internal use only.) Intermediate integer values set by prjset() (used only for the ZPN and HPX projections).

## ◆ n

int prjprm::n

## ◆ prjx2s

int(* prjprm::prjx2s) (PRJX2S_ARGS)

(For internal use only.) Pointer to the spherical projection ...

## ◆ prjs2x

int(* prjprm::prjs2x) (PRJS2X_ARGS)

(For internal use only.) ... and deprojection routines.