# 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

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

int prjprm::flag

(Given and returned) This flag must be set to zero whenever any of the following prjprm struct 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.

char prjprm::code

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

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).

double prjprm::pv

(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.

double prjprm::phi0

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

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.

int prjprm::bounds

(Given) Controls strict bounds checking for the `AZP`, `SZP`, `TAN`, `SIN`, `ZPN`, and `COP` projections; set to zero to disable checking.

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

char prjprm::name

(Returned) Long name of the projection.

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

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]);

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

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.

int prjprm::simplezen

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

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

int prjprm::equiareal

(Returned) True if the projection is equal area.

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

int prjprm::conformal

(Returned) True if the projection is conformal.

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

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.

int prjprm::divergent

(Returned) True if the projection diverges in latitude.

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

double prjprm::x0

(Returned) The offset in ,and ...

double prjprm::y0

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

struct wcserr * prjprm::err`[read]`

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

void *padding (An unused variable inserted for alignment purposes only.)

void* prjprm::padding

double prjprm::w

(Returned) Intermediate floating-point values derived from the projection parameters, 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.

int prjprm::m

int prjprm::n

(Returned) Intermediate integer value (used only for the `ZPN` and `HPX` projections).

prjprm::prjx2s

(Returned) Pointer to the projection ...

prjprm::prjs2x

(Returned) ... and deprojection routines.