astro
Class WcsProjection.PolynomialPixelProjection

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by astro.WcsProjection
                  extended by astro.WcsProjection.LinearPixelProjection
                      extended by astro.WcsProjection.PolynomialPixelProjection
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, VectorFunction
Enclosing class:
WcsProjection

public static class WcsProjection.PolynomialPixelProjection
extends WcsProjection.LinearPixelProjection

This now fits intermediate world coordinates from pixel coordinates with Legendre polynomials such that the pixel coordinates are slightly distorted before calculating the intermediate coordinates. Note that this is a bivariant fit, i.e. we fit to the tensor product of to univariant Legendre polynomials, which means that we have ten parameters to fit for a cubic correction: xi=Σ_nΣ_m P_nm*x^n*y^m, where the outer produrct P_nm reads as P_nm(x,y)=P_n(x)*P_m(y). E.g. P_21=(x^2-1)*y

This projection demands rij to be in the center of the projection, from the default head values the starting values for the polynomial are derived.


Nested Class Summary
 
Nested classes/interfaces inherited from class astro.WcsProjection.LinearPixelProjection
WcsProjection.LinearPixelProjection.Type
 
Nested classes/interfaces inherited from class astro.WcsProjection
WcsProjection.EulerRotation, WcsProjection.Gnomonic, WcsProjection.LinearGnomonicRaDe, WcsProjection.LinearPixelProjection, WcsProjection.PolynomialGnomonicRaDe, WcsProjection.PolynomialPixelProjection, WcsProjection.ReadWcs, WcsProjection.ThreeStepWcs, WcsProjection.VariableGnomonicRaDe, WcsProjection.VariablePixelProjection
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static boolean DEBUG
           
private static int DEFETAORDER
           
private static String DEFETASTART
           
private static double DEFHIGHSCALE
           
private static int DEFXIORDER
           
private static String DEFXISTART
           
private  Vector2D doff
          The constant offset we fit.
private  VectorG eta
          In eta_ij*L_m(x)*L_n(y) series, these are the non-linear eta_ij.
static String KEY_ETAORDER
           
static String KEY_ETASTART
           
static String KEY_HIGHSCALE
           
static String KEY_XIORDER
           
static String KEY_XISTART
           
static String LEGPOLYETA
          How we code the Legendre polynomials>2 in η (e.g.
static String LEGPOLYXI
          How we code the Legendre polynomials>2 in ξ (e.g.
private  boolean offset
          If true, we also fit for the constant (not recommended).
private  VectorG xi
          In a xi_ij*L_m(x)*L_n(y) series, these are the non-linear xi_ij.
 
Fields inherited from class astro.WcsProjection.LinearPixelProjection
IMROT, KEY_CRPIX1, KEY_CRPIX2, KEY_IMROTUNIT, KEY_PSCALEUNIT, PSCALE
 
Fields inherited from class astro.WcsProjection
KEY_PARAMETERSCALE
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
WcsProjection.PolynomialPixelProjection()
          We only allow full variations in the transformation matrix.
WcsProjection.PolynomialPixelProjection(Map<String,String> u2f)
          We only allow full variations in the transformation matrix.
 
Method Summary
private static void addLegendreCards(Collection<nom.tam.fits.HeaderCard> ret, int order, VectorG l, String card)
           
 VectorG estimateParameters(nom.tam.fits.Header h)
          We refer to the parental parsing methods, but sneak in on the returned parameters, adding zero for all higher-order terms.
 VectorG estimateParameterScales(VectorG start)
          We refer to the parental parsing methods, but sneak in on the returned parameters, adding different length scales for all higher-order terms.
 VectorG evaluate(VectorG pxpy)
          We evaluate the target pixel position at the first two indices and return intermediate world coordinates.
 VectorG evaluate(VectorG pxpy, VectorG print)
          We evaluate the target pixel position at the first two indices and return intermediate world coordinates.
 Collection<nom.tam.fits.HeaderCard> getCards()
          We always return a collcetion in LPU and LPV.
 VectorG getParameters()
          We query the cij from the parent and add the projection center at the end
 double getPixelArea(VectorG pxpy)
          The pixel area is the determinant of the c_ij plus non-linear terms.
private static int order(VectorG l)
           
 boolean parseHeader(nom.tam.fits.Header h)
          We parse a header first reading in the linear matrix with the parental method, then continuing to read the Legendre polynomial coefficients named LEGPOLYXI and LEGPOLYETA.
private static VectorG readLegendre(String prae, nom.tam.fits.Header h)
          We read header cards of syntax prae_ similar to LPV2_3.
 void setConstantFit(boolean nuoff)
          Set the flag, whether a constant offset should be fitted along with the polynomial.
 void setParameters(VectorG vv)
          The first four parameters are the cij, then we have the coefficients to the Legendre bivariant in x, followed by the Legender in y.
 
Methods inherited from class astro.WcsProjection.LinearPixelProjection
evaluateMatrix, getCij, getRj, setRj
 
Methods inherited from class astro.WcsProjection
argumentDimension, functionDimension, getStandardKeys
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

LEGPOLYXI

public static final String LEGPOLYXI
How we code the Legendre polynomials>2 in ξ (e.g. LPU3_0).

See Also:
Constant Field Values

LEGPOLYETA

public static final String LEGPOLYETA
How we code the Legendre polynomials>2 in η (e.g. LPU3_0).

See Also:
Constant Field Values

KEY_HIGHSCALE

public static final String KEY_HIGHSCALE
See Also:
Constant Field Values

KEY_XIORDER

public static final String KEY_XIORDER
See Also:
Constant Field Values

KEY_ETAORDER

public static final String KEY_ETAORDER
See Also:
Constant Field Values

KEY_XISTART

public static final String KEY_XISTART
See Also:
Constant Field Values

KEY_ETASTART

public static final String KEY_ETASTART
See Also:
Constant Field Values

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

DEFXIORDER

private static final int DEFXIORDER
See Also:
Constant Field Values

DEFETAORDER

private static final int DEFETAORDER
See Also:
Constant Field Values

DEFHIGHSCALE

private static final double DEFHIGHSCALE
See Also:
Constant Field Values

DEFXISTART

private static final String DEFXISTART
See Also:
Constant Field Values

DEFETASTART

private static final String DEFETASTART
See Also:
Constant Field Values

xi

private VectorG xi
In a xi_ij*L_m(x)*L_n(y) series, these are the non-linear xi_ij.


eta

private VectorG eta
In eta_ij*L_m(x)*L_n(y) series, these are the non-linear eta_ij.


offset

private boolean offset
If true, we also fit for the constant (not recommended).


doff

private Vector2D doff
The constant offset we fit.

Constructor Detail

WcsProjection.PolynomialPixelProjection

public WcsProjection.PolynomialPixelProjection()
We only allow full variations in the transformation matrix.


WcsProjection.PolynomialPixelProjection

public WcsProjection.PolynomialPixelProjection(Map<String,String> u2f)
We only allow full variations in the transformation matrix.

Method Detail

setConstantFit

public void setConstantFit(boolean nuoff)
Set the flag, whether a constant offset should be fitted along with the polynomial. Mostly intended for stand-alone and debug mode.


evaluate

public VectorG evaluate(VectorG pxpy)
We evaluate the target pixel position at the first two indices and return intermediate world coordinates. From the linear transformation we take the center of projection, which now is the center of the ccd plus the linear matrix cij. These values are then used in the coefficients to the direct Legendre product, stored in xi and eta.

Specified by:
evaluate in interface VectorFunction
Overrides:
evaluate in class WcsProjection.LinearPixelProjection

evaluate

public VectorG evaluate(VectorG pxpy,
                        VectorG print)
We evaluate the target pixel position at the first two indices and return intermediate world coordinates. From the linear transformation we take the center of projection, which now is the center of the ccd plus the linear matrix cij. These values are then used in the coefficients to the direct Legendre product, stored in xi and eta.


setParameters

public void setParameters(VectorG vv)
The first four parameters are the cij, then we have the coefficients to the Legendre bivariant in x, followed by the Legender in y. Due to the bivariant nature (L_x*L_y), the number of parameters in the Legendre is (n+1)*(n+2)/2, where n is the order (KEY_XIORDER and KEY_ETAORDER, respectively). There is no constant term, and the linear terms are already consumed in cij, thus for order of three, only 7 (10-3) parameter remain.

Overrides:
setParameters in class WcsProjection.LinearPixelProjection

getParameters

public VectorG getParameters()
We query the cij from the parent and add the projection center at the end

Overrides:
getParameters in class WcsProjection.LinearPixelProjection

estimateParameters

public VectorG estimateParameters(nom.tam.fits.Header h)
                           throws nom.tam.fits.HeaderCardException
We refer to the parental parsing methods, but sneak in on the returned parameters, adding zero for all higher-order terms. The center of projection is only allowed in the center of the CCD.

Overrides:
estimateParameters in class WcsProjection.LinearPixelProjection
Throws:
nom.tam.fits.HeaderCardException

estimateParameterScales

public VectorG estimateParameterScales(VectorG start)
We refer to the parental parsing methods, but sneak in on the returned parameters, adding different length scales for all higher-order terms. The center of projection is only allowed in the center of the CCD.

Overrides:
estimateParameterScales in class WcsProjection

parseHeader

public boolean parseHeader(nom.tam.fits.Header h)
                    throws nom.tam.fits.HeaderCardException
We parse a header first reading in the linear matrix with the parental method, then continuing to read the Legendre polynomial coefficients named LEGPOLYXI and LEGPOLYETA. A standard header key would read as LPU2_1=1.4e-4, denoting for the ξ-axis the coefficient for the direct Legendre product L_2(x)*L_1(y), where x and y are normalized CCD pixel stretching from -1 to 1. As all units in WCS-context are in degrees, this hold also for the LPU and LPVs.

Overrides:
parseHeader in class WcsProjection.LinearPixelProjection
Throws:
nom.tam.fits.HeaderCardException

getCards

public Collection<nom.tam.fits.HeaderCard> getCards()
                                             throws nom.tam.fits.HeaderCardException
We always return a collcetion in LPU and LPV.

Overrides:
getCards in class WcsProjection.LinearPixelProjection
Throws:
nom.tam.fits.HeaderCardException

addLegendreCards

private static void addLegendreCards(Collection<nom.tam.fits.HeaderCard> ret,
                                     int order,
                                     VectorG l,
                                     String card)
                              throws nom.tam.fits.HeaderCardException
Throws:
nom.tam.fits.HeaderCardException

order

private static final int order(VectorG l)

readLegendre

private static VectorG readLegendre(String prae,
                                    nom.tam.fits.Header h)
                             throws nom.tam.fits.HeaderCardException
We read header cards of syntax prae_ similar to LPV2_3. These are interpreted as direct legendre product coefficients. There is always order+1 coefficients, for order three these would be LPV3_0, LPV2_1, LPV1_2, and LPV0_3. All must be present, even if zero. The smalles order is two, linear and constant terms are already described in standard linear WCS.

Throws:
nom.tam.fits.HeaderCardException

getPixelArea

public double getPixelArea(VectorG pxpy)
The pixel area is the determinant of the c_ij plus non-linear terms.

Overrides:
getPixelArea in class WcsProjection.LinearPixelProjection