public class BridgeNdx extends Object implements Ndx
Ndx implementation.
This class builds an Ndx from an NdxImpl.
The static initialiser for this class is also responsible
for creating and registering the
HdxResourceType which corresponds to
Ndx. For this to happen, this BridgeNdx class must be named in a
Hdx.properties file, as described in class
HdxResourceType.
| Modifier and Type | Class and Description |
|---|---|
protected class |
BridgeNdx.BridgeNdxHdxFacade |
| Modifier and Type | Field and Description |
|---|---|
protected Document |
ndxDocumentCache |
| Constructor and Description |
|---|
BridgeNdx(NdxImpl impl)
Constructs an
Ndx implementation from an NdxImpl
object. |
| Modifier and Type | Method and Description |
|---|---|
FrameSet |
getAst()
Get the world coordinate system of the NDX as
an AST
FrameSet. |
int |
getBadBits()
Gets the value of the badBits mask.
|
Source |
getEtc()
Returns the XML containing extension information for this NDX.
|
HdxFacade |
getHdxFacade()
Obtains a HdxFacade, which enables us to examine and manipulate
the Ndx in a DOM-like way.
|
static HdxResourceType |
getHdxResourceType()
Returns the Hdx type corresponding to Ndx objects.
|
NDArray |
getImage()
Returns the image component of this NDX.
|
String |
getLabel()
Returns the label string for this Ndx.
|
NDArray |
getQuality()
Returns the quality component of this NDX.
|
String |
getTitle()
Returns the title of this Ndx.
|
String |
getUnits()
Returns the units string for this Ndx.
|
NDArray |
getVariance()
Returns the variance component of this NDX.
|
boolean |
hasEtc()
Find out if the NDX contains user-defined extension information.
|
boolean |
hasLabel()
Indicates whether there is a label component.
|
boolean |
hasQuality()
Indicates whether there is a quality component.
|
boolean |
hasTitle()
Indicates whether there is a title component.
|
boolean |
hasUnits()
Indicates whether there is a units component.
|
boolean |
hasVariance()
Indicates whether there is a variance component.
|
boolean |
hasWCS()
Find out if the NDX has World Coordinate System information.
|
boolean |
isPersistent()
Indicates whether this Ndx represents a persistent object.
|
Source |
toXML(URL base)
Deprecated.
replaced by
getHdxFacade().getSource(URLUtils.urlToUri(base)) |
protected Document ndxDocumentCache
public NDArray getImage()
Ndx
Note that this returns the raw image NDArray object,
which should not in general be used directly for reading image
data, since it has not been masked by a quality component if present.
To obtain a properly masked version of the image data for read access,
use the Ndxs.getMaskedImage(Ndx) method.
public NDArray getVariance()
Ndx
Note that this returns the raw variance
NDArray object,
which should not in general be used directly for reading variance
data, since it has not been masked by a quality component if present.
To obtain a properly masked version of the variance data for read access,
use the Ndxs.getMaskedVariance(Ndx) method.
May only be called if Ndx.hasVariance() returns true.
getVariance in interface Ndxpublic NDArray getQuality()
Ndx
May only be called if Ndx.hasQuality() returns true.
getQuality in interface Ndxpublic boolean hasVariance()
NdxhasVariance in interface NdxNdx.getVariance() may be calledpublic boolean hasQuality()
NdxhasQuality in interface NdxNdx.getQuality() may be calledpublic boolean hasTitle()
NdxhasTitle in interface NdxNdx.getTitle() may be calledpublic boolean hasLabel()
NdxhasLabel in interface NdxNdx.getLabel() may be calledpublic boolean hasUnits()
NdxhasUnits in interface NdxNdx.getUnits() may be calledpublic boolean hasEtc()
NdxhasEtc in interface NdxNdx.getEtc() may be calledpublic boolean hasWCS()
Ndx
If it exists, then the Ndx.getAst() method may be called to
access it as an AST FrameSet.
Note: in due course, when the uk.ac.starlink.wcs
package has been released a getWCS method will be
provided to access it as a WCS object.
hasWCS in interface NdxNdx.getAst() (and in due course getWCS
can be calledpublic String getTitle()
NdxNdx.hasTitle() returns true.public String getLabel()
NdxNdx.hasLabel() returns true.public String getUnits()
NdxNdx.hasUnits() returns true.public Source getEtc()
Ndx<etc> which contains an element for each extension.
May only be called if Ndx.hasEtc() returns true.getEtc in interface NdxSourceReaderpublic int getBadBits()
NdxgetBadBits in interface Ndxpublic FrameSet getAst()
NdxFrameSet.
Note: This method is intended as a temporary measure
until the uk.ac.starlink.wcs package has been released.
At that time a getWCS method will be provided, and
this one will be deprecated.
getAst in interface NdxNdx.hasWCS()public boolean isPersistent()
NdxNdx.toXML(java.net.URL) method all contain URLs referencing
genuine resources. If false, then this Ndx is in some sense
virtual, and one or more of the array elements in the the XML
generated by toXML will reference phantom resources.isPersistent in interface Ndxpublic Source toXML(URL base)
getHdxFacade().getSource(URLUtils.urlToUri(base))Source.
The XML is built using only public methods of this Ndx rather than
any private values, so that this method can safely be inherited
by subclasses.
Does not currently throw HdxException if the
XML cannot be generated, but it should.
toXML in interface Ndxbase - URL against which others are to be relativisedPluginException - (unchecked) if the XML cannot be generatedSourceReaderpublic static HdxResourceType getHdxResourceType()
public HdxFacade getHdxFacade()
NdxgetHdxFacade in interface NdxCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.