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 Ndx
public NDArray getQuality()
Ndx
May only be called if Ndx.hasQuality()
returns true
.
getQuality
in interface Ndx
public boolean hasVariance()
Ndx
hasVariance
in interface Ndx
Ndx.getVariance()
may be calledpublic boolean hasQuality()
Ndx
hasQuality
in interface Ndx
Ndx.getQuality()
may be calledpublic boolean hasTitle()
Ndx
hasTitle
in interface Ndx
Ndx.getTitle()
may be calledpublic boolean hasLabel()
Ndx
hasLabel
in interface Ndx
Ndx.getLabel()
may be calledpublic boolean hasUnits()
Ndx
hasUnits
in interface Ndx
Ndx.getUnits()
may be calledpublic boolean hasEtc()
Ndx
hasEtc
in interface Ndx
Ndx.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 Ndx
Ndx.getAst()
(and in due course getWCS
can be calledpublic String getTitle()
Ndx
Ndx.hasTitle()
returns true
.public String getLabel()
Ndx
Ndx.hasLabel()
returns true
.public String getUnits()
Ndx
Ndx.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 Ndx
SourceReader
public int getBadBits()
Ndx
getBadBits
in interface Ndx
public FrameSet getAst()
Ndx
FrameSet
.
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 Ndx
Ndx.hasWCS()
public boolean isPersistent()
Ndx
Ndx.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 Ndx
public 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 Ndx
base
- URL against which others are to be relativisedPluginException
- (unchecked) if the XML cannot be generatedSourceReader
public static HdxResourceType getHdxResourceType()
public HdxFacade getHdxFacade()
Ndx
getHdxFacade
in interface Ndx
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.