Class NexusFile

java.lang.Object
org.nexusformat.NexusFile
All Implemented Interfaces:
NeXusFileInterface

public class NexusFile extends Object implements NeXusFileInterface
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    This is the handle to the NeXus file handle.
    protected static final int
    Maximum name length, must be VGNAMELENMAX in hlimits.h
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
    constants for compression schemes
    static final int
     
    static final int
    constants for number types.
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
    constant denoting an unlimited dimension.
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
    possible access codes, @see #NexusFile.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NexusFile(String filename, int access)
    constructs a new NexusFile Object.
  • Method Summary

    Modifier and Type
    Method
    Description
    attrdir returns the attributes of the currently open dataset or the file global attributes if no dataset is open.
    void
    close the NeXus file.
    protected void
    close(int handle)
     
    void
    closedata closes an opened dataset.
    void
    closegroup closes access to the current group and steps down one step in group hierarchy.
    void
    compmakedata(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(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
    debugstop is a debugging helper function which goes into an endless loop in the dynamic link library.
    void
    removes all NeXus file data structures and closes the file.
    void
    flushes all pending data to disk.
    getattr retrieves the data associated with the attribute * name.
    void
    getattr(String name, Object array, int[] args)
    getattr retrieves the data associated with the attribute name.
    void
    getdata(Object array)
    getdata reads the data from an previously openend dataset into array.
    getdataID gets the data necessary for linking the current dataset somewhere else.
    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.
    return the current path into the NeXus file in the form of a Unix path string.
    void
    getslab(int[] start, int[] size, Object array)
    getslab reads a subset of a large dataset into array.
    void
    getslab(long[] start, long[] size, Object array)
    getslab reads a subset of a large dataset into array.
    groupdir will retrieve the content of the currently open vGroup.
    protected int
    init(String filename, int access)
     
    protected void
    initattrdir(int handle)
     
    protected void
    initgroupdir(int handle)
     
    inquirefile inquires which file we are currently in.
    nxisexternaldataset if the named dataset is is linked externally
    isexternalgroup(String name, String nxclass)
    nxisexternalgroup test the group name, nxclass if it is linked externally
    void
    linkexternal(String name, String nxclass, String nxurl)
    linkexternal links group name, nxclass to the URL nxurl
    void
    linkexternaldataset links dataset name to the URL nxurl
    void
    makedata(String name, int type, int rank, int[] dim)
    makedata creates a new dataset with the specified characteristics in the current group.
    void
    makedata(String name, int type, int rank, long[] dim)
    makedata creates a new dataset with the specified characteristics in the current group.
    void
    makegroup(String name, 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(String name, NXlink target)
    makenamedlink links the object described by target into the current vGroup.
    protected int
    nextattr(int handle, String[] names, int[] args)
     
    protected int
    nextentry(int handle, String[] names)
     
    protected void
    nxclosedata(int handle)
     
    protected void
    nxclosegroup(int handle)
     
    protected void
    nxcompress(int handle, int compression_type)
     
    protected int
    nxflush(int handle)
     
    protected void
    nxgetattr(int handle, String name, byte[] bdata, int[] args)
     
    protected void
    nxgetattra(int handle, String name, byte[] bdata)
     
    protected void
    nxgetattrainfo(int handle, String name, int[] dim, int[] args)
     
    protected void
    nxgetdata(int handle, byte[] bdata)
     
    protected void
    nxgetdataid(int handle, NXlink link)
     
    protected void
    nxgetgroupid(int handle, NXlink link)
     
    protected void
    nxgetinfo(int handle, int[] iDim, int[] args)
     
    protected void
    nxgetinfo64(int handle, long[] iDim, int[] args)
     
    protected int
    nxgetnextattra(int handle, String[] name, int[] dim, int[] args)
     
    protected String
    nxgetpath(int handle)
     
    protected void
    nxgetslab(int handle, int[] Start, int[] size, byte[] bdata)
     
    protected void
    nxgetslab64(int handle, long[] Start, long[] size, byte[] bdata)
     
    protected void
    nxinquirefile(int handle, String[] names)
     
    protected int
    nxisexternaldataset(int handle, String name, String[] nxurl)
     
    protected int
    nxisexternalgroup(int handle, String name, String nxclass, String[] nxurl)
     
    protected void
    nxlinkexternal(int handle, String name, String nxclass, String nxurl)
     
    protected void
    nxlinkexternaldataset(int handle, String name, String nxurl)
     
    protected void
    nxmakecompdata(int handle, String name, int type, int rank, int[] dim, int iCompress, int[] iChunk)
     
    protected void
    nxmakecompdata64(int handle, String name, int type, int rank, long[] dim, int iCompress, long[] iChunk)
     
    protected void
    nxmakedata(int handle, String name, int type, int rank, int[] dim)
     
    protected void
    nxmakedata64(int handle, String name, int type, int rank, long[] dim)
     
    protected void
    nxmakegroup(int handle, String name, String nxclass)
     
    protected void
    nxmakelink(int handle, NXlink target)
     
    protected void
    nxmakenamedlink(int handle, String name, NXlink target)
     
    protected void
    nxopendata(int handle, String name)
     
    protected void
    nxopengroup(int handle, String name, String nxclass)
     
    protected void
    nxopengrouppath(int handle, String path)
     
    protected void
    nxopenpath(int handle, String path)
     
    protected void
    nxopensourcepath(int handle)
     
    protected void
    nxputattr(int handle, String name, byte[] array, int type)
     
    protected void
    nxputattra(int handle, String name, byte[] bdata, int rank, int[] dim, int iType)
     
    protected void
    nxputdata(int handle, byte[] array)
     
    protected void
    nxputslab(int handle, byte[] array, int[] start, int[] size)
     
    protected void
    nxputslab64(int handle, byte[] array, long[] start, long[] size)
     
    protected void
    nxsetnumberformat(int handle, int type, String format)
     
    void
    opendata opens an existing dataset for access.
    void
    opengroup(String name, String nxclass)
    opengroup opens the group name with class nxclass.
    void
    opengrouppath opens groups and datsets accroding to the path string given.
    void
    openpath opens groups and datsets accroding to the path string given.
    void
    opensourcepath opens the group from which the current item was linked Returns an error if the current item is not linked.
    void
    putattr(String name, Object array, int iType)
    putattr adds a named attribute to a previously opened dataset or group or a global attribute if nothing is open.
    void
    putattr(String name, Object array, int[] size, int iType)
    putattr adds a named attribute to a previously opened dataset or group or a global attribute if nothing is open.
    void
    putdata(Object array)
    putdata writes the data from array into a previously opened dataset.
    void
    putslab(Object array, int[] start, int[] size)
    putslab writes a subset of a larger dataset to a previously opened dataset.
    void
    putslab(Object array, long[] start, long[] size)
    putslab writes a subset of a larger dataset to a previously opened dataset.
    void
    setnumberformat(int type, String format)
    setnumberformat sets the number format for printing number when using the XML-NeXus format.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NexusFile

      public NexusFile(String filename, int access) throws NexusException
      constructs a new NexusFile Object.
      Parameters:
      filename - The name of the NeXus file to access.
      access - The access mode for the file. Can only be one of the predefined NeXus access code NXACC.... These are:
      NXACC_CREATE
      or creating a new file.
      NXACC_RDWR
      For opening an existing file for modification or appending data.
      NXACC_READ
      For opening a file for reading.
      NXACC_NOSTRIP
      To keep leading and trailing whitespace on strings
      Throws:
      NexusException - when the file could not be found or an HDF error occurred.
  • Method Details

    • init

      protected int init(String filename, int access)
    • close

      protected void close(int handle)
    • nxflush

      protected int nxflush(int handle)
    • flush

      public void flush() throws NexusException
      flushes all pending data to disk. Closes any open SDS's.
      Specified by:
      flush in interface NeXusFileInterface
      Throws:
      NexusException - if an error occurs.
    • close

      public void close() throws NexusException
      close the NeXus file. To make javalint and diamond happy
      Specified by:
      close in interface NeXusFileInterface
      Throws:
      NexusException
    • finalize

      public void finalize() throws Throwable
      removes all NeXus file data structures and closes the file. This function should automatically be called by the Java garbage collector whenever the NexusFile object falls into disuse. However the time when this is done is left to the garbage collector. My personal experience is that finalize might never be called. I suggest, to call finalize yourself when you are done with the NeXus file. finalize makes sure that multiple invocations will not do any harm.
      Specified by:
      finalize in interface NeXusFileInterface
      Overrides:
      finalize in class Object
      Throws:
      Throwable - because it is required by the definition of finalize.
    • nxmakegroup

      protected void nxmakegroup(int handle, String name, String nxclass)
    • nxopengroup

      protected void nxopengroup(int handle, String name, String nxclass)
    • nxopenpath

      protected void nxopenpath(int handle, String path)
    • nxopengrouppath

      protected void nxopengrouppath(int handle, String path)
    • nxclosegroup

      protected void nxclosegroup(int handle)
    • nxgetpath

      protected String nxgetpath(int handle)
    • makegroup

      public void makegroup(String name, String nxclass) throws NexusException
      Description copied from interface: NeXusFileInterface
      makegroup creates a new group below the current group within the NeXus file hierarchy.
      Specified by:
      makegroup in interface NeXusFileInterface
      Parameters:
      name - The name of the group to create.
      nxclass - The classname of the group.
      Throws:
      NexusException - if an error occurs during this operation.
    • opengroup

      public void opengroup(String name, String nxclass) throws NexusException
      Description copied from interface: NeXusFileInterface
      opengroup opens the group name with class nxclass. The group must exist, otherwise an exception is thrown. opengroup is similar to a cd name in a filesystem.
      Specified by:
      opengroup in interface NeXusFileInterface
      Parameters:
      name - the name of the group to open.
      nxclass - the classname of the group to open.
      Throws:
      NexusException - when something goes wrong.
    • openpath

      public void openpath(String path) throws NexusException
      Description copied from interface: NeXusFileInterface
      openpath opens groups and datsets accroding to the path string given. The path syntax follows unix conventions. Both absolute and relative paths are possible. All objects of the path must exist.
      Specified by:
      openpath in interface NeXusFileInterface
      Parameters:
      path - The path string
      Throws:
      NexusException - when something goes wrong.
    • opengrouppath

      public void opengrouppath(String path) throws NexusException
      Description copied from interface: NeXusFileInterface
      opengrouppath opens groups and datsets accroding to the path string given. The path syntax follows unix conventions. Both absolute and relative paths are possible. All objects of the path must exist. This function stops int the last group.
      Specified by:
      opengrouppath in interface NeXusFileInterface
      Parameters:
      path - The path string
      Throws:
      NexusException - when something goes wrong.
    • getpath

      public String getpath() throws NexusException
      Description copied from interface: NeXusFileInterface
      return the current path into the NeXus file in the form of a Unix path string.
      Specified by:
      getpath in interface NeXusFileInterface
      Returns:
      A unix path string
      Throws:
      NexusException
    • closegroup

      public void closegroup() throws NexusException
      Description copied from interface: NeXusFileInterface
      closegroup closes access to the current group and steps down one step in group hierarchy.
      Specified by:
      closegroup in interface NeXusFileInterface
      Throws:
      NexusException - when an error occurs during this operation.
    • nxmakedata

      protected void nxmakedata(int handle, String name, int type, int rank, int[] dim)
    • nxmakedata64

      protected void nxmakedata64(int handle, String name, int type, int rank, long[] dim)
    • nxmakecompdata

      protected void nxmakecompdata(int handle, String name, int type, int rank, int[] dim, int iCompress, int[] iChunk)
    • nxmakecompdata64

      protected void nxmakecompdata64(int handle, String name, int type, int rank, long[] dim, int iCompress, long[] iChunk)
    • nxopendata

      protected void nxopendata(int handle, String name)
    • nxclosedata

      protected void nxclosedata(int handle)
    • nxcompress

      protected void nxcompress(int handle, int compression_type)
    • compmakedata

      public void compmakedata(String name, int type, int rank, int[] dim, int compression_type, int[] iChunk) throws NexusException
      Description copied from interface: NeXusFileInterface
      compmakedata creates a new dataset with the specified characteristics in the current group. This data set will be compressed.
      Specified by:
      compmakedata in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when the dataset could not be created.
    • compmakedata

      public void compmakedata(String name, int type, int rank, long[] dim, int compression_type, long[] iChunk) throws NexusException
      Description copied from interface: NeXusFileInterface
      compmakedata creates a new dataset with the specified characteristics in the current group. This data set will be compressed.
      Specified by:
      compmakedata in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when the dataset could not be created.
    • makedata

      public void makedata(String name, int type, int rank, int[] dim) throws NexusException
      Description copied from interface: NeXusFileInterface
      makedata creates a new dataset with the specified characteristics in the current group.
      Specified by:
      makedata in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when the dataset could not be created.
    • makedata

      public void makedata(String name, int type, int rank, long[] dim) throws NexusException
      Description copied from interface: NeXusFileInterface
      makedata creates a new dataset with the specified characteristics in the current group.
      Specified by:
      makedata in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when the dataset could not be created.
    • opendata

      public void opendata(String name) throws NexusException
      Description copied from interface: NeXusFileInterface
      opendata opens an existing dataset for access. For instance for reading or writing.
      Specified by:
      opendata in interface NeXusFileInterface
      Parameters:
      name - The name of the dataset to open.
      Throws:
      NexusException - when the dataset does not exist or something else is wrong.
    • closedata

      public void closedata() throws NexusException
      Description copied from interface: NeXusFileInterface
      closedata closes an opened dataset. Then no further access is possible without a call to opendata.
      Specified by:
      closedata in interface NeXusFileInterface
      Throws:
      NexusException - when an error occurrs.
    • compress

      public void compress(int compression_type) throws NexusException
      Description copied from interface: NeXusFileInterface
      causes the currently open dataset to be compressed on file. This must be called after makedata and before writing to the dataset.
      Specified by:
      compress in interface NeXusFileInterface
      Parameters:
      compression_type - determines the type of compression to use.
      Throws:
      NexusException - when no dataset is open or an error occurs.
    • nxgetdata

      protected void nxgetdata(int handle, byte[] bdata)
    • nxgetslab

      protected void nxgetslab(int handle, int[] Start, int[] size, byte[] bdata)
    • nxgetslab64

      protected void nxgetslab64(int handle, long[] Start, long[] size, byte[] bdata)
    • getdata

      public void getdata(Object array) throws NexusException
      Description copied from interface: NeXusFileInterface
      getdata reads the data from an previously openend dataset into array.
      Specified by:
      getdata in interface NeXusFileInterface
      Parameters:
      array - An n-dimensional array of the appropriate number type for the dataset. Make sure to have the right type and size here.
      Throws:
      NexusException - when either an error occurs or no dataset is open or array is not of the right type to hold the data.
    • getslab

      public void getslab(int[] start, int[] size, Object array) throws NexusException
      Description copied from interface: NeXusFileInterface
      getslab reads a subset of a large dataset into array.
      Specified by:
      getslab in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when either an error occurs or no dataset is open or array is not of the right type to hold the data.
    • getslab

      public void getslab(long[] start, long[] size, Object array) throws NexusException
      Description copied from interface: NeXusFileInterface
      getslab reads a subset of a large dataset into array.
      Specified by:
      getslab in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when either an error occurs or no dataset is open or array is not of the right type to hold the data.
    • nxputdata

      protected void nxputdata(int handle, byte[] array)
    • nxputslab

      protected void nxputslab(int handle, byte[] array, int[] start, int[] size)
    • nxputslab64

      protected void nxputslab64(int handle, byte[] array, long[] start, long[] size)
    • putdata

      public void putdata(Object array) throws NexusException
      Description copied from interface: NeXusFileInterface
      putdata writes the data from array into a previously opened dataset.
      Specified by:
      putdata in interface NeXusFileInterface
      Parameters:
      array - The data to write.
      Throws:
      NexusException - when an error occurs.
    • putslab

      public void putslab(Object array, int[] start, int[] size) throws NexusException
      Description copied from interface: NeXusFileInterface
      putslab writes a subset of a larger dataset to a previously opened dataset.
      Specified by:
      putslab in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when an error occurs.
    • putslab

      public void putslab(Object array, long[] start, long[] size) throws NexusException
      Description copied from interface: NeXusFileInterface
      putslab writes a subset of a larger dataset to a previously opened dataset.
      Specified by:
      putslab in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when an error occurs.
    • nxgetattr

      protected void nxgetattr(int handle, String name, byte[] bdata, int[] args)
    • nxputattr

      protected void nxputattr(int handle, String name, byte[] array, int type)
    • nxputattra

      protected void nxputattra(int handle, String name, byte[] bdata, int rank, int[] dim, int iType)
    • nxgetnextattra

      protected int nxgetnextattra(int handle, String[] name, int[] dim, int[] args)
    • nxgetattra

      protected void nxgetattra(int handle, String name, byte[] bdata)
    • nxgetattrainfo

      protected void nxgetattrainfo(int handle, String name, int[] dim, int[] args)
    • nextattr

      protected int nextattr(int handle, String[] names, int[] args)
    • initattrdir

      protected void initattrdir(int handle)
    • initgroupdir

      protected void initgroupdir(int handle)
    • getattr

      public Object getattr(String name) throws NexusException
      Description copied from interface: NeXusFileInterface
      getattr retrieves the data associated with the attribute * name.
      Specified by:
      getattr in interface NeXusFileInterface
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute data as an array.
      Throws:
      NexusException - when either an error occurs or the attribute could not be found.
    • getattr

      public void getattr(String name, Object array, int[] args) throws NexusException
      Description copied from interface: NeXusFileInterface
      getattr retrieves the data associated with the attribute name.
      Specified by:
      getattr in interface NeXusFileInterface
      Parameters:
      name - The name of the attribute.
      array - 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.
      Throws:
      NexusException - when either an error occurs or the attribute could not be found.
    • putattr

      public void putattr(String name, Object array, int iType) throws NexusException
      Description copied from interface: NeXusFileInterface
      putattr adds a named attribute to a previously opened dataset or group or a global attribute if nothing is open.
      Specified by:
      putattr in interface NeXusFileInterface
      Parameters:
      name - The name of the attribute.
      array - The data of the attribute.
      iType - The number type of the attribute.
      Throws:
      NexusException - if an error occurs.
    • putattr

      public void putattr(String name, Object array, int[] size, int iType) throws NexusException
      Description copied from interface: NeXusFileInterface
      putattr adds a named attribute to a previously opened dataset or group or a global attribute if nothing is open.
      Specified by:
      putattr in interface NeXusFileInterface
      Parameters:
      name - The name of the attribute.
      array - The data of the attribute.
      iType - The number type of the attribute.
      Throws:
      NexusException - if an error occurs.
    • attrdir

      public Hashtable attrdir() throws NexusException
      Description copied from interface: NeXusFileInterface
      attrdir returns the attributes of the currently open dataset or the file global attributes if no dataset is open.
      Specified by:
      attrdir in interface NeXusFileInterface
      Returns:
      A Hashtable which will hold the names of the attributes as keys. For each key there is an AttributeEntry class as value.
      Throws:
      NexusException - when an error occurs.
    • nxgetinfo

      protected void nxgetinfo(int handle, int[] iDim, int[] args)
    • nxgetinfo64

      protected void nxgetinfo64(int handle, long[] iDim, int[] args)
    • nxsetnumberformat

      protected void nxsetnumberformat(int handle, int type, String format)
    • nextentry

      protected int nextentry(int handle, String[] names)
    • setnumberformat

      public void setnumberformat(int type, String format) throws NexusException
      Description copied from interface: NeXusFileInterface
      setnumberformat sets the number format for printing number when using the XML-NeXus format. For HDF4 and HDF5 this is ignored. If a dataset is open, the format for the dataset is set, if none is open the default setting for the number type is changed. The format must be a ANSII-C language format string.
      Specified by:
      setnumberformat in interface NeXusFileInterface
      Parameters:
      type - The NeXus type to set the format for.
      format - The new format to use.
      Throws:
      NexusException
    • getinfo

      public void getinfo(int[] iDim, int[] args) throws NexusException
      Description copied from interface: NeXusFileInterface
      getinfo retrieves information about a previously opened dataset.
      Specified by:
      getinfo in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when an error occurs.
    • getinfo

      public void getinfo(long[] iDim, int[] args) throws NexusException
      Description copied from interface: NeXusFileInterface
      getinfo retrieves information about a previously opened dataset.
      Specified by:
      getinfo in interface NeXusFileInterface
      Parameters:
      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.
      Throws:
      NexusException - when an error occurs.
    • groupdir

      public Hashtable groupdir() throws NexusException
      Description copied from interface: NeXusFileInterface
      groupdir will retrieve the content of the currently open vGroup. groupdir is similar to an ls in unix.
      Specified by:
      groupdir in interface NeXusFileInterface
      Returns:
      A Hashtable which will hold the names of the items in the group as keys and the NeXus classname for vGroups or the string 'SDS' for datasets as values.
      Throws:
      NexusException - if an error occurs
    • nxgetgroupid

      protected void nxgetgroupid(int handle, NXlink link)
    • nxgetdataid

      protected void nxgetdataid(int handle, NXlink link)
    • nxmakelink

      protected void nxmakelink(int handle, NXlink target)
    • nxmakenamedlink

      protected void nxmakenamedlink(int handle, String name, NXlink target)
    • nxopensourcepath

      protected void nxopensourcepath(int handle)
    • getgroupID

      public NXlink getgroupID() throws NexusException
      Description copied from interface: NeXusFileInterface
      getgroupID gets the data necessary for linking the current vGroup somewhere else.
      Specified by:
      getgroupID in interface NeXusFileInterface
      Returns:
      A NXlink object holding the link data.
      Throws:
      NexusException - if an error occurs.
    • getdataID

      public NXlink getdataID() throws NexusException
      Description copied from interface: NeXusFileInterface
      getdataID gets the data necessary for linking the current dataset somewhere else.
      Specified by:
      getdataID in interface NeXusFileInterface
      Returns:
      A NXlink object holding the link data.
      Throws:
      NexusException - if an error occurs.
    • makelink

      public void makelink(NXlink target) throws NexusException
      Description copied from interface: NeXusFileInterface
      makelink links the object described by target into the current vGroup.
      Specified by:
      makelink in interface NeXusFileInterface
      Parameters:
      target - The Object to link into the current group.
      Throws:
      NexusException - if an error occurs.
    • makenamedlink

      public void makenamedlink(String name, NXlink target) throws NexusException
      Description copied from interface: NeXusFileInterface
      makenamedlink links the object described by target into the current vGroup. The object will have a new name in the group into which it is linked
      Specified by:
      makenamedlink in interface NeXusFileInterface
      Parameters:
      name - The name of this object in the current group
      target - The Object to link into the current group.
      Throws:
      NexusException - if an error occurs.
    • opensourcepath

      public void opensourcepath() throws NexusException
      Description copied from interface: NeXusFileInterface
      opensourcepath opens the group from which the current item was linked Returns an error if the current item is not linked.
      Specified by:
      opensourcepath in interface NeXusFileInterface
      Throws:
      NexusException - if an error occurs.
    • nxinquirefile

      protected void nxinquirefile(int handle, String[] names)
    • nxlinkexternal

      protected void nxlinkexternal(int handle, String name, String nxclass, String nxurl)
    • nxlinkexternaldataset

      protected void nxlinkexternaldataset(int handle, String name, String nxurl)
    • nxisexternalgroup

      protected int nxisexternalgroup(int handle, String name, String nxclass, String[] nxurl)
    • nxisexternaldataset

      protected int nxisexternaldataset(int handle, String name, String[] nxurl)
    • inquirefile

      public String inquirefile() throws NexusException
      Description copied from interface: NeXusFileInterface
      inquirefile inquires which file we are currently in. This is a support function for external linking
      Specified by:
      inquirefile in interface NeXusFileInterface
      Returns:
      The current file
      Throws:
      NexusException - when things are wrong
    • linkexternal

      public void linkexternal(String name, String nxclass, String nxurl) throws NexusException
      Description copied from interface: NeXusFileInterface
      linkexternal links group name, nxclass to the URL nxurl
      Specified by:
      linkexternal in interface NeXusFileInterface
      Parameters:
      name - The name of the vgroup to link to
      nxclass - The class name of the linked vgroup
      nxurl - The URL to the linked external file
      Throws:
      NexusException - if things are wrong
    • linkexternaldataset

      public void linkexternaldataset(String name, String nxurl) throws NexusException
      Description copied from interface: NeXusFileInterface
      linkexternaldataset links dataset name to the URL nxurl
      Specified by:
      linkexternaldataset in interface NeXusFileInterface
      Parameters:
      name - The name of the dataset to link to
      nxurl - The URL to the linked external file
      Throws:
      NexusException - if things are wrong
    • isexternalgroup

      public String isexternalgroup(String name, String nxclass) throws NexusException
      Description copied from interface: NeXusFileInterface
      nxisexternalgroup test the group name, nxclass if it is linked externally
      Specified by:
      isexternalgroup in interface NeXusFileInterface
      Parameters:
      name - of the group to test
      nxclass - class of the group to test
      Returns:
      null when the group is not linked, else a string giving the URL of the linked resource
      Throws:
      NexusException - if things are wrong
    • isexternaldataset

      public String isexternaldataset(String name) throws NexusException
      Description copied from interface: NeXusFileInterface
      nxisexternaldataset if the named dataset is is linked externally
      Specified by:
      isexternaldataset in interface NeXusFileInterface
      Parameters:
      name - of the dataset to test
      Returns:
      null when the it is not linked, else a string giving the URL of the linked resource
      Throws:
      NexusException - if things are wrong
    • debugstop

      public void debugstop()
      debugstop is a debugging helper function which goes into an endless loop in the dynamic link library. Then a unix debugger may attach to the running java process using the pid, interrupt, set the loop variable to leave the loop, set a new breakpoint and continue debugging. This works with ladebug on DU40D. This is an developer support routine and should NEVER be called in normal code.