uk.ac.starlink.ast
Class ResampleFlags

java.lang.Object
  extended by uk.ac.starlink.ast.ResampleFlags

public class ResampleFlags
extends Object

Aggregates flags which influence how Mapping.resample* methods operate.

The flags are

noBad
Indicates that any output array elements for which no resampled value could be obtained should be left set to the value they had on entry to this function. If this flag is not supplied, such output array elements are set to the value supplied for parameter badval. Note, this flag cannot be used in conjunction with the conserveFlux flag (an error will be reported if both flags are specified).
useBad
Indicates that there may be bad pixels in the input array(s) which must be recognised by comparing with the value given for badval and propagated to the output array(s). If this flag is not set, all input values are treated literally and the badval value is only used for flagging output array values.
conserveFlux
Indicates that the output pixel values should be scaled in such a way as to preserve (approximately) the total data value in a feature on the sky. Without this flag, each output pixel value represents an instantaneous sample of the input data values at the corresponding input position. This is appropriate if the input data represents the spatial density of some quantity (e.g. surface brightness in Janskys per square arc-second) because the output pixel values will have the same normalisation and units as the input pixel values. However, if the input data values represent flux (or some other physical quantity) per pixel, then the conserveFlux flag could be used. This causes each output pixel value to be scaled by the ratio of the output pixel size to the input pixel size.
This flag can only be used if the Mapping is succesfully approximated by one or more linear transformations. Thus an error will be reported if it used when the tol parameter is set to zero (which stops the use of linear approximations), or if the Mapping is too non-linear to be approximated by a piece-wise linear transformation. The ratio of output to input pixel size is evaluated once for each panel of the piece-wise linear approximation to the Mapping, and is assumed to be constant for all output pixels in the panel. The scaling factors for adjacent panels will in general differ slightly, and so the joints between panels may be visible when viewing the output image at high contrast. If this is a problem, reduce the value of the tol parameter until the difference between adjacent panels is sufficiently small to be insignificant.
Note, this flag cannot be used in conjunction with the noBad flag (an error will be reported if both flags are specified). Flux conservation can only be approximate when using a resampling algorithm. For accurate flux conservation use the rebin method instead.

Since:
26 Feb 2009
Author:
Mark Taylor

Method Summary
 boolean getConserveFlux()
          Returns the value of the conserveFlux flag.
 int getFlagsInt()
          Returns the value of this object as an integer, suitable for supplying to one of the astResampleX() functions.
 boolean getNoBad()
          Returns the value of the noBad flag.
 boolean getUseBad()
          Returns the value of the usebad flag.
 void setConserveFlux(boolean conserveFlux)
          Sets the conserveFlux flag.
 void setNoBad(boolean noBad)
          Sets the nobad flag.
 void setUseBad(boolean useBad)
          Sets the useBad flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setNoBad

public void setNoBad(boolean noBad)
Sets the nobad flag.


getNoBad

public boolean getNoBad()
Returns the value of the noBad flag.


setUseBad

public void setUseBad(boolean useBad)
Sets the useBad flag.


getUseBad

public boolean getUseBad()
Returns the value of the usebad flag.


setConserveFlux

public void setConserveFlux(boolean conserveFlux)
Sets the conserveFlux flag.


getConserveFlux

public boolean getConserveFlux()
Returns the value of the conserveFlux flag.


getFlagsInt

public int getFlagsInt()
Returns the value of this object as an integer, suitable for supplying to one of the astResampleX() functions. If necessary, this method may be overridden to supply flags which are undefined by this java class.

Returns:
packed int representing resampling flags


Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.