public interface NeXusFileInterface
Modifier and Type | Method and Description |
---|---|
java.util.Hashtable |
attrdir()
attrdir returns the attributes of the currently open dataset or
the file global attributes if no dataset is open.
|
void |
close()
close the NeXus file.
|
void |
closedata()
closedata closes an opened dataset.
|
void |
closegroup()
closegroup closes access to the current group and steps down one
step in group hierarchy.
|
void |
compmakedata(java.lang.String name,
int type,
int rank,
int[] dim,
int compression_type,
int[] iChunk)
compmakedata creates a new dataset with the specified characteristics
in the current group.
|
void |
compmakedata(java.lang.String name,
int type,
int rank,
long[] dim,
int compression_type,
long[] iChunk)
compmakedata creates a new dataset with the specified characteristics
in the current group.
|
void |
compress(int compression_type)
causes the currently open dataset to be compressed on file.
|
void |
finalize()
finalize closes the file.
|
void |
flush()
flush writes all previously unsaved data to disk.
|
void |
getattr(java.lang.String name,
java.lang.Object data,
int[] args)
getattr retrieves the data associated with the attribute
name.
|
void |
getdata(java.lang.Object array)
getdata reads the data from an previously openend dataset into
array.
|
NXlink |
getdataID()
getdataID gets the data necessary for linking the current dataset
somewhere else.
|
NXlink |
getgroupID()
getgroupID gets the data necessary for linking the current vGroup
somewhere else.
|
void |
getinfo(int[] iDim,
int[] args)
getinfo retrieves information about a previously opened dataset.
|
void |
getinfo(long[] iDim,
int[] args)
getinfo retrieves information about a previously opened dataset.
|
java.lang.String |
getpath()
return the current path into the NeXus file in the
form of a Unix path string.
|
void |
getslab(int[] start,
int[] size,
java.lang.Object array)
getslab reads a subset of a large dataset into array.
|
void |
getslab(long[] start,
long[] size,
java.lang.Object array)
getslab reads a subset of a large dataset into array.
|
java.util.Hashtable |
groupdir()
groupdir will retrieve the content of the currently open vGroup.
|
java.lang.String |
inquirefile()
inquirefile inquires which file we are currently in.
|
java.lang.String |
isexternaldataset(java.lang.String name)
nxisexternaldataset if the named dataset is is linked externally
|
java.lang.String |
isexternalgroup(java.lang.String name,
java.lang.String nxclass)
nxisexternalgroup test the group name, nxclass if it is linked externally
|
void |
linkexternal(java.lang.String name,
java.lang.String nxclass,
java.lang.String nxurl)
linkexternal links group name, nxclass to the URL nxurl
|
void |
linkexternaldataset(java.lang.String name,
java.lang.String nxurl)
linkexternaldataset links dataset name to the URL nxurl
|
void |
makedata(java.lang.String name,
int type,
int rank,
int[] dim)
makedata creates a new dataset with the specified characteristics
in the current group.
|
void |
makedata(java.lang.String name,
int type,
int rank,
long[] dim)
makedata creates a new dataset with the specified characteristics
in the current group.
|
void |
makegroup(java.lang.String name,
java.lang.String nxclass)
makegroup creates a new group below the current group within
the NeXus file hierarchy.
|
void |
makelink(NXlink target)
makelink links the object described by target into the current
vGroup.
|
void |
makenamedlink(java.lang.String name,
NXlink target)
makenamedlink links the object described by target into the current
vGroup.
|
void |
opendata(java.lang.String name)
opendata opens an existing dataset for access.
|
void |
opengroup(java.lang.String name,
java.lang.String nxclass)
opengroup opens the group name with class nxclass.
|
void |
opengrouppath(java.lang.String path)
opengrouppath opens groups and datsets accroding to the path string
given.
|
void |
openpath(java.lang.String path)
openpath opens groups and datsets accroding to the path string
given.
|
void |
opensourcepath()
opensourcepath opens the group from which the current item was linked
Returns an error if the current item is not linked.
|
void |
putattr(java.lang.String name,
java.lang.Object array,
int iType)
putattr adds a named attribute to a previously opened dataset or
a global attribute if no dataset is open.
|
void |
putdata(java.lang.Object array)
putdata writes the data from array into a previously opened
dataset.
|
void |
putslab(java.lang.Object array,
int[] start,
int[] size)
putslab writes a subset of a larger dataset to a previously opened
dataset.
|
void |
putslab(java.lang.Object array,
long[] start,
long[] size)
putslab writes a subset of a larger dataset to a previously opened
dataset.
|
void |
setnumberformat(int type,
java.lang.String format)
setnumberformat sets the number format for printing number when
using the XML-NeXus format.
|
void flush() throws NexusException
NexusException
- if an HDF error occurs.void finalize() throws java.lang.Throwable
java.lang.Throwable
- because it is required by the definition of
finalize.void close() throws NexusException
NexusException
void makegroup(java.lang.String name, java.lang.String nxclass) throws NexusException
name
- The name of the group to create.nxclass
- The classname of the group.NexusException
- if an error occurs during this operation.void opengroup(java.lang.String name, java.lang.String nxclass) throws NexusException
name
- the name of the group to open.nxclass
- the classname of the group to open.NexusException
- when something goes wrong.void openpath(java.lang.String path) throws NexusException
path
- The path stringNexusException
- when something goes wrong.void opengrouppath(java.lang.String path) throws NexusException
path
- The path stringNexusException
- when something goes wrong.java.lang.String getpath() throws NexusException
NexusException
void closegroup() throws NexusException
NexusException
- when an HDF error occurs during this
operation.void makedata(java.lang.String name, int type, int rank, int[] dim) throws NexusException
name
- The name of the dataset.type
- The number type of the dataset. Usually a constant from
a selection of values.rank
- The rank or number of dimensions of the dataset.dim
- An array containing the length of each dimension. dim must
have at least rank entries. Dimension passed as -1 denote an
unlimited dimension.NexusException
- when the dataset could not be created.void makedata(java.lang.String name, int type, int rank, long[] dim) throws NexusException
name
- The name of the dataset.type
- The number type of the dataset. Usually a constant from
a selection of values.rank
- The rank or number of dimensions of the dataset.dim
- An array containing the length of each dimension. dim must
have at least rank entries. Dimension passed as -1 denote an
unlimited dimension.NexusException
- when the dataset could not be created.void compmakedata(java.lang.String name, int type, int rank, int[] dim, int compression_type, int[] iChunk) throws NexusException
name
- The name of the dataset.type
- The number type of the dataset. Usually a constant from
a selection of values.rank
- The rank or number of dimensions of the dataset.dim
- An array containing the length of each dimension. dim must
have at least rank entries. Dimension passed as -1 denote an
unlimited dimension.compression_type
- determines the compression type.iChunk
- With HDF-5, slabs can be written to compressed data
sets. The size of these slabs is specified through the chunk array.
This must have the rank values for the size of the chunk to
be written in each dimension.NexusException
- when the dataset could not be created.void compmakedata(java.lang.String name, int type, int rank, long[] dim, int compression_type, long[] iChunk) throws NexusException
name
- The name of the dataset.type
- The number type of the dataset. Usually a constant from
a selection of values.rank
- The rank or number of dimensions of the dataset.dim
- An array containing the length of each dimension. dim must
have at least rank entries. Dimension passed as -1 denote an
unlimited dimension.compression_type
- determines the compression type.iChunk
- With HDF-5, slabs can be written to compressed data
sets. The size of these slabs is specified through the chunk array.
This must have the rank values for the size of the chunk to
be written in each dimension.NexusException
- when the dataset could not be created.void opendata(java.lang.String name) throws NexusException
name
- The name of the dataset to open.NexusException
- when the dataset does not exist or
something else is wrong.void closedata() throws NexusException
NexusException
- when an HDF error occurrs.void compress(int compression_type) throws NexusException
compression_type
- determines the type of compression
to use.NexusException
- when no dataset is open or an HDF error
occurs.void getdata(java.lang.Object array) throws NexusException
array
- An n-dimensional array of the appropriate number
type for the dataset. Make sure to have the right type and size
here.NexusException
- when either an HDF error occurs or
no dataset is open or array is not of the right type to hold
the data.void getslab(int[] start, int[] size, java.lang.Object array) throws NexusException
start
- An array of dimension rank which contains the start
position in the dataset from where to start reading.size
- An array of dimension rank which contains the size
in each dimension of the data subset to read.array
- An array for holding the returned data values.NexusException
- when either an HDF error occurs or
no dataset is open or array is not of the right type to hold
the data.void getslab(long[] start, long[] size, java.lang.Object array) throws NexusException
start
- An array of dimension rank which contains the start
position in the dataset from where to start reading.size
- An array of dimension rank which contains the size
in each dimension of the data subset to read.array
- An array for holding the returned data values.NexusException
- when either an HDF error occurs or
no dataset is open or array is not of the right type to hold
the data.void getattr(java.lang.String name, java.lang.Object data, int[] args) throws NexusException
name
- The name of the attribute.data
- an array with sufficient space for holding the attribute
data.args
- An integer array holding the number of data elements
in data as args[0], and the type as args[1]. Both values will be
updated while reading.NexusException
- when either an HDF error occurs or
the attribute could not be found.void putdata(java.lang.Object array) throws NexusException
array
- The data to write.NexusException
- when an HDF error occurs.void putslab(java.lang.Object array, int[] start, int[] size) throws NexusException
array
- The data to write.start
- An integer array of dimension rank which holds the
startcoordinates of the data subset in the larger dataset.size
- An integer array of dimension rank whidh holds the
size in each dimension of the data subset to write.NexusException
- when an HDF error occurs.void putslab(java.lang.Object array, long[] start, long[] size) throws NexusException
array
- The data to write.start
- An integer array of dimension rank which holds the
startcoordinates of the data subset in the larger dataset.size
- An integer array of dimension rank whidh holds the
size in each dimension of the data subset to write.NexusException
- when an HDF error occurs.void putattr(java.lang.String name, java.lang.Object array, int iType) throws NexusException
name
- The name of the attribute.array
- The data of the attribute.iType
- The number type of the attribute.NexusException
- if an HDF error occurs.void getinfo(int[] iDim, int[] args) throws NexusException
iDim
- An array which will be filled with the size of
the dataset in each dimension.args
- An integer array which will hold more information about
the dataset after return. The fields: args[0] is the rank, args[1] is
the number type.NexusException
- when an HDF error occurs.void getinfo(long[] iDim, int[] args) throws NexusException
iDim
- An array which will be filled with the size of
the dataset in each dimension.args
- An integer array which will hold more information about
the dataset after return. The fields: args[0] is the rank, args[1] is
the number type.NexusException
- when an HDF error occurs.void setnumberformat(int type, java.lang.String format) throws NexusException
type
- The NeXus type to set the format for.format
- The new format to use.NexusException
java.util.Hashtable groupdir() throws NexusException
NexusException
- if an HDF error occursjava.util.Hashtable attrdir() throws NexusException
NexusException
- when an HDF error occurs.NXlink getgroupID() throws NexusException
NexusException
- if an HDF error occurs.NXlink getdataID() throws NexusException
NexusException
- if an HDF error occurs.void makelink(NXlink target) throws NexusException
target
- The Object to link into the current group.NexusException
- if an error occurs.void makenamedlink(java.lang.String name, NXlink target) throws NexusException
target
- The Object to link into the current group.name
- The name of this object in the current groupNexusException
- if an error occurs.void opensourcepath() throws NexusException
NexusException
- if an error occurs.java.lang.String inquirefile() throws NexusException
NexusException
- when things are wrongvoid linkexternal(java.lang.String name, java.lang.String nxclass, java.lang.String nxurl) throws NexusException
name
- The name of the vgroup to link tonxclass
- The class name of the linked vgroupnxurl
- The URL to the linked external fileNexusException
- if things are wrongvoid linkexternaldataset(java.lang.String name, java.lang.String nxurl) throws NexusException
name
- The name of the dataset to link tonxurl
- The URL to the linked external fileNexusException
- if things are wrongjava.lang.String isexternalgroup(java.lang.String name, java.lang.String nxclass) throws NexusException
name
- of the group to testnxclass
- class of the group to testNexusException
- if things are wrongjava.lang.String isexternaldataset(java.lang.String name) throws NexusException
name
- of the dataset to testNexusException
- if things are wrong