uk.ac.starlink.ast
Class IntraMap

java.lang.Object
  extended by uk.ac.starlink.ast.AstObject
      extended by uk.ac.starlink.ast.Mapping
          extended by uk.ac.starlink.ast.IntraMap
All Implemented Interfaces:
NeedsChannelizing

public class IntraMap
extends Mapping
implements NeedsChannelizing

Java interface to the AST IntraMap class - map points using a private transformation function. The IntraMap allows you to use a custom transformation function, as implemented by a Transformer object, to perform the transformations used by a Mapping. This allows you to create Mappings that perform any conceivable coordinate transformation.

However, an IntraMap is intended for use within a given software environment, and if they are to be communicated via Channels can only be used where class libraries containing the appropriate Transformer classes are available (and only if those classes are Serializable).

Version:
$Id$
Author:
Mark Taylor (Starlink)
See Also:
AST IntraMap

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ast.Mapping
Mapping.Interpolator, Mapping.Spreader
 
Field Summary
 
Fields inherited from class uk.ac.starlink.ast.Mapping
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER
 
Fields inherited from class uk.ac.starlink.ast.AstObject
AST__BAD, AST__TUNULL, pointer
 
Constructor Summary
IntraMap(Transformer1 trans)
          Constructs a one-dimensional IntraMap from a given Transformer1 object.
IntraMap(Transformer2 trans)
          Constructs a two-dimensional IntraMap from a given Transformer2 object.
IntraMap(Transformer trans, int nin, int nout)
          Constructs an IntraMap from a given Transformer object.
 
Method Summary
 void channelize()
          This method, called by Channel's write method, attempts to serialize this IntraMap's Transformer object into the IntraFlag attribute.
 AstObject copy()
          Returns a fairly deep copy of this object.
 void finalize()
          Finalizes the object.
 void unChannelize()
          This method, called by Channel's read method, recovers the serialized Transformer object from the IntraFlag attribute of the AST object, and invokes the non-trivial parts of the IntraMap's construction.
 
Methods inherited from class uk.ac.starlink.ast.Mapping
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
 
Methods inherited from class uk.ac.starlink.ast.AstObject
annul, clear, delete, equals, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntraMap

public IntraMap(Transformer trans,
                int nin,
                int nout)
Constructs an IntraMap from a given Transformer object.

Parameters:
trans - the Transformer which will do the actual transformations
nin - the number of input coordinates for the forward transformation (or output coordinates for the inverse transformation)
nout - the number of output coordinates for the forward transformation (or input coordinates for the inverse transformation)
Throws:
AstException - if an error arose in the AST library, or if trans is not able to transform from nin to nout coordinates

IntraMap

public IntraMap(Transformer2 trans)
Constructs a two-dimensional IntraMap from a given Transformer2 object.

Parameters:
trans - the Transformer2 which will do the actual two-coordinate to two-coordinate transformations

IntraMap

public IntraMap(Transformer1 trans)
Constructs a one-dimensional IntraMap from a given Transformer1 object.

Parameters:
trans - the Transformer1 which will do the actual one-coordinate to one-coordinate transformations
Method Detail

finalize

public void finalize()
              throws Throwable
Finalizes the object. Certain resources allocated by the native code are freed, and the finalizer of the superclass is called.

Overrides:
finalize in class AstObject
Throws:
Throwable

channelize

public void channelize()
                throws IOException
This method, called by Channel's write method, attempts to serialize this IntraMap's Transformer object into the IntraFlag attribute. This will allow it to persist out of memory.

Specified by:
channelize in interface NeedsChannelizing
Throws:
NotSerializableException - if the Transformer used by this mapping cannot be serialized
IOException - if there was some error in I/O

unChannelize

public void unChannelize()
                  throws IOException
This method, called by Channel's read method, recovers the serialized Transformer object from the IntraFlag attribute of the AST object, and invokes the non-trivial parts of the IntraMap's construction.

Specified by:
unChannelize in interface NeedsChannelizing
Throws:
IOException - if there was some error in I/O

copy

public AstObject copy()
Returns a fairly deep copy of this object. The Transformer of the returned copy however is a reference to the same object as the transformer of this object.

Overrides:
copy in class AstObject
Returns:
copy


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