Package org.eclipse.dawnsci.nexus
Interface NXobject
- All Known Subinterfaces:
NXaberration,NXactivity,NXactuator,NXaperture,NXapm_charge_state_analysis,NXapm_event_data,NXapm_instrument,NXapm_measurement,NXapm_paraprobe_tool_common,NXapm_paraprobe_tool_parameters,NXapm_paraprobe_tool_process,NXapm_ranging,NXapm_reconstruction,NXapm_simulation,NXatom,NXattenuator,NXbeam,NXbeam_splitter,NXbeam_stop,NXbeam_transfer_matrix_table,NXbending_magnet,NXcalibration,NXcapillary,NXcg_alpha_complex,NXcg_cylinder,NXcg_ellipsoid,NXcg_face_list_data_structure,NXcg_grid,NXcg_half_edge_data_structure,NXcg_hexahedron,NXcg_parallelogram,NXcg_point,NXcg_polygon,NXcg_polyhedron,NXcg_polyline,NXcg_primitive,NXcg_roi,NXcg_tetrahedron,NXcg_triangle,NXcg_unit_normal,NXchemical_composition,NXcircuit,NXcite,NXcollection,NXcollectioncolumn,NXcollimator,NXcomponent,NXcontainer,NXcoordinate_system,NXcorrector_cs,NXcrystal,NXcs_computer,NXcs_filter_boolean_mask,NXcs_memory,NXcs_prng,NXcs_processor,NXcs_profiling,NXcs_profiling_event,NXcs_storage,NXcsg,NXcylindrical_geometry,NXdata,NXdeflector,NXdelocalization,NXdetector,NXdetector_channel,NXdetector_group,NXdetector_module,NXdisk_chopper,NXdispersion,NXdispersion_function,NXdispersion_repeated_parameter,NXdispersion_single_parameter,NXdispersion_table,NXdistortion,NXebeam_column,NXelectromagnetic_lens,NXelectron_detector,NXelectronanalyzer,NXelectrostatic_kicker,NXem_ebsd,NXem_eds,NXem_eels,NXem_event_data,NXem_img,NXem_instrument,NXem_interaction_volume,NXem_measurement,NXem_optical_system,NXem_simulation,NXenergydispersion,NXentry,NXenvironment,NXevent_data,NXfabrication,NXfermi_chopper,NXfilter,NXfit,NXfit_function,NXflipper,NXfresnel_zone_plate,NXgeometry,NXgrating,NXguide,NXhistory,NXibeam_column,NXimage,NXinsertion_device,NXinstrument,NXisocontour,NXlog,NXmagnetic_kicker,NXmanipulator,NXmatch_filter,NXmicrostructure,NXmicrostructure_feature,NXmicrostructure_ipf,NXmicrostructure_mtex_config,NXmicrostructure_odf,NXmicrostructure_pf,NXmicrostructure_slip_system,NXmirror,NXmoderator,NXmonitor,NXmonochromator,NXnote,NXoff_geometry,NXoptical_fiber,NXoptical_lens,NXoptical_polarizer,NXoptical_window,NXorientation,NXparameters,NXpdb,NXpeak,NXphase,NXpid_controller,NXpinhole,NXpolarizer,NXpositioner,NXprocess,NXprogram,NXpump,NXquadric,NXquadrupole_magnet,NXreflections,NXregion,NXregistration,NXresolution,NXroi_process,NXroot,NXrotations,NXsample,NXsample_component,NXscan_controller,NXsensor,NXseparator,NXshape,NXsimilarity_grouping,NXslit,NXsolenoid_magnet,NXsolid_geometry,NXsource,NXspatial_filter,NXspectrum,NXspin_rotator,NXspindispersion,NXsubentry,NXsubsampling_filter,NXsubstance,NXtransformations,NXtranslation,NXunit_cell,NXuser,NXvelocity_selector,NXwaveplate,NXxraylens
Base interface of all Nexus group nodes
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalLink(String name, String externalFileName, String pathToNode) Adds an external link within the given name within this node to the node with the given path within the file with the given name.booleancanAddChild(NXobject nexusObject) Returns whether the given NeXus group object can be added as a child group to this base class instance according to the NXDL definition for this base class.createDataNode(String name, org.eclipse.january.dataset.ILazyDataset dataset) Creates and adds a new datanode to this group for the given field name and with the given dataset as its value.Returns all datasets as a map keyed by field nameorg.eclipse.january.dataset.DatasetGet the value of the given attribute.getAttrBoolean(String name, String attrName) Get the value of the given attribute as aBoolean, ornullif not set.getAttrDate(String name, String attrName) Get the value of the given attribute as a date.getAttrDouble(String name, String attrName) Get the value of the given attribute as aDouble, ornullif not set...getAttrLong(String name, String attrName) Get the value of the given attribute as aLong, ornullif not set.getAttrNumber(String name, String attrName) Get the value of the given attribute as a number.getAttrString(String name, String attrName) Get the value of the given attribute as aString.getBoolean(String name) Gets the value of the given field as a boolean, ornullif not set<N extends NXobject>
NReturns the child of this node of the given type with the given name.Returns a map containing all the children of this node.getChildren(Class<N> nxClass) Returns a map containing all the children of this node of the given class.org.eclipse.january.dataset.DatasetgetDataset(String name) Gets the dataset for the field with the given name, if it exists, otherwisenull.Gets the value of the given field as a date.Gets the value of the given field as aDouble, ornullif not set.org.eclipse.january.dataset.ILazyDatasetgetLazyDataset(String name) Gets the dataset for the field with the given name, if it exists, otherwisenull.org.eclipse.january.dataset.ILazyWriteableDatasetgetLazyWritableDataset(String name) Returns theILazyWriteableDatasetfor the field within this object with the given name, ornullif no such field exists, or the dataset for this field is not aILazyWriteableDatasetGets the value of the given field as a long, ornullif not set.Enum constant fromNexusBaseClassfor this base class, e.g.Gets the value of the given field as a number, ornullif not set.JavaClassobject of the interface for this base class, e.g.Returns a set containing theNexusBaseClassconstants for the permitted child group types of this base class.Gets the value of the given field as a string.org.eclipse.january.dataset.ILazyWriteableDatasetinitializeFixedSizeLazyDataset(String name, int[] shape, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name with the given fixed shape and of the given element classorg.eclipse.january.dataset.ILazyWriteableDatasetinitializeLazyDataset(String name, int[] shape, int[] maxShape, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name, with the given initial and maximum shapes, and of the given element classorg.eclipse.january.dataset.ILazyWriteableDatasetinitializeLazyDataset(String name, int[] maxShape, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name, with the given maximum shape, and of the given element classorg.eclipse.january.dataset.ILazyWriteableDatasetinitializeLazyDataset(String name, int rank, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name, with the given rank (dimensionality) and of the given element class<N extends NXobject>
voidAdd a child node with the given name.voidsetAttribute(String name, String attrName, Object attrValue) Set the value of the given attribute.voidsetAttributeDefault(String defaultValue) ..<N extends NXobject>
voidsetChildren(Map<String, N> map) Adds the child nodes with the given names.setDataset(String name, org.eclipse.january.dataset.IDataset value) Sets the dataset for the field with the given nameSets the field with the given name to the given value.Methods inherited from interface org.eclipse.dawnsci.analysis.api.tree.GroupNode
addDataNode, addGroupNode, addNode, addNodeLink, addSymbolicNode, containsDataNode, containsGroupNode, containsNode, containsSymbolicNode, findLinkedNodeName, findNode, findNodeLink, getDataNode, getDataNodeMap, getDataNodeNames, getDataNodes, getDatasets, getGlobalPool, getGroupNode, getGroupNodeMap, getGroupNodeNames, getGroupNodes, getNames, getNode, getNodeLink, getNodeNameIterator, getNumberOfDataNodes, getNumberOfGroupNodes, getNumberOfNodelinks, getSymbolicNode, getSymbolicNodeNames, isPopulated, iterator, removeDataNode, removeDataNode, removeGroupNode, removeGroupNode, removeSymbolicNode, removeSymbolicNode, setGlobalPoolMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.eclipse.dawnsci.analysis.api.tree.Node
addAttribute, containsAttribute, getAttribute, getAttributeIterator, getAttributeNameIterator, getAttributeNames, getID, getNumberOfAttributes, isDataNode, isGroupNode, isSymbolicNode, removeAttribute, removeAttribute
-
Field Details
-
NX_ATTRIBUTE_DEFAULT
- See Also:
-
-
Method Details
-
getNXclass
- Returns:
- name of Nexus class
-
getNexusBaseClass
NexusBaseClass getNexusBaseClass()Enum constant fromNexusBaseClassfor this base class, e.g.NexusBaseClass.NX_SAMPLE.- Returns:
NexusBaseClassenum constant for this class
-
getPermittedChildGroupClasses
Set<NexusBaseClass> getPermittedChildGroupClasses()Returns a set containing theNexusBaseClassconstants for the permitted child group types of this base class.- Returns:
NexusBaseClassconstants for permitted child groups
-
canAddChild
Returns whether the given NeXus group object can be added as a child group to this base class instance according to the NXDL definition for this base class.- Parameters:
nexusObject- potential child nexus group object- Returns:
trueif the given group object can be added as a child of this base class instance,falseotherwise
-
getChild
Returns the child of this node of the given type with the given name.- Parameters:
name- of childnxClass- class of child- Returns:
- named child NXobject of given NeXus class or
nullif none
-
getChildren
Returns a map containing all the children of this node of the given class. The keys of the map are the names of the child nodes.- Parameters:
nxClass- class of children.- Returns:
- map of children, key is child node's name
-
getChildren
Returns a map containing all the children of this node. The keys of the map are the names of the child nodes within thisNXobject.- Returns:
- map of children, key is the child node's name
-
setDataset
Sets the dataset for the field with the given name- Parameters:
name-value-- Returns:
- the new data node, for convenience
-
getDataset
Gets the dataset for the field with the given name, if it exists, otherwisenull. Note that this method should only be used for small datasets, i.e. those set before the scan. To get the dataset for larger datasets (i.e. data acquired during the scan) usegetDataNode(name).getDataset()which returns anILazyDataset.- Parameters:
name- dataset name- Returns:
- the dataset for the field with the given name, or
nullif the no such dataset exists - Throws:
IllegalStateException- if the dataset is too large to load into memory
-
getLazyDataset
Gets the dataset for the field with the given name, if it exists, otherwisenull. This method will work for all kinds of dataset asILazyDatasetis the common superinterface for dataset. The type of dataset may be aDatasetfor an in-memory dataset, anILazyDatasetfor a dataset to be read from a file, or anILazyWriteableDatasetfor a dataset intended to be written to during the scan.- Parameters:
name- dataset name- Returns:
- the
ILazyDatasetfor the given name
-
initializeLazyDataset
org.eclipse.january.dataset.ILazyWriteableDataset initializeLazyDataset(String name, int rank, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name, with the given rank (dimensionality) and of the given element class- Parameters:
name- field namerank- rankclazz- dataset element class- Returns:
- new lazy writable dataset
-
initializeFixedSizeLazyDataset
org.eclipse.january.dataset.ILazyWriteableDataset initializeFixedSizeLazyDataset(String name, int[] shape, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name with the given fixed shape and of the given element class- Parameters:
name- field nameclazz- dataset element classsize- shape- Returns:
- new lazy writable dataset
-
initializeLazyDataset
org.eclipse.january.dataset.ILazyWriteableDataset initializeLazyDataset(String name, int[] maxShape, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name, with the given maximum shape, and of the given element class- Parameters:
name- field namemaxShape- maximum shapeclazz- dataset element class- Returns:
- new lazy writable dataset
-
initializeLazyDataset
org.eclipse.january.dataset.ILazyWriteableDataset initializeLazyDataset(String name, int[] shape, int[] maxShape, Class<?> clazz) Creates and adds a newILazyWriteableDatasetto this group for the given field name, with the given initial and maximum shapes, and of the given element class- Parameters:
name- field nameshape- initial shapemaxShape- maximum shapeclazz- dataset element class- Returns:
- new lazy writable dataset
-
createDataNode
Creates and adds a new datanode to this group for the given field name and with the given dataset as its value. The given dataset may be either aILazyWriteableDatasetor anIDataset.- Parameters:
name- field namedataset- dataset- Returns:
- new data node
-
addExternalLink
Adds an external link within the given name within this node to the node with the given path within the file with the given name. The external file need not exist at the time this method is invoked.- Parameters:
name- name of link within this groupexternalFileName- name of external file to link topathToNode- path of node within external file to link to
-
getLazyWritableDataset
Returns theILazyWriteableDatasetfor the field within this object with the given name, ornullif no such field exists, or the dataset for this field is not aILazyWriteableDataset- Parameters:
name- field name- Returns:
- the
ILazyWriteableDatasetfor the given field if it exists, otherwisenull
-
setField
Sets the field with the given name to the given value.- Parameters:
name- field namevalue- field value- Returns:
- the newly created
DataNode.
-
setAttribute
Set the value of the given attribute. If the first argument is notnullthen the attribute is set on the field or child group with this name- Parameters:
name- name of node (ifnullthen current group)attrName- attribute nameattrValue- attribute value
-
getDate
Gets the value of the given field as a date.- Parameters:
name- name of field- Returns:
- the value of the given field as a date,
nullif there is no field with the given name, or the value cannot be parsed as a date - Throws:
IllegalArgumentException- if the node with the given name is not aDataNode.
-
getNumber
Gets the value of the given field as a number, ornullif not set.- Parameters:
name- name of field- Returns:
- the value of the given field as a number,
nullif there is no field with the given name - Throws:
IllegalArgumentException- if the node with the given name is not aDataNode.
-
getDouble
Gets the value of the given field as aDouble, ornullif not set.- Parameters:
name- name of field- Returns:
- the value of the given field as a double,
nullif there is no field with the given name - Throws:
IllegalArgumentException- if the node with the given name is not aDataNode.
-
getLong
Gets the value of the given field as a long, ornullif not set.- Parameters:
name- name of field- Returns:
- the value of the given field as a long,
nullif there is no field with the given name - Throws:
IllegalArgumentException- if the node with the given name is not aDataNode.
-
getBoolean
Gets the value of the given field as a boolean, ornullif not set- Parameters:
name- name of field- Returns:
- the value of the given field as a boolean,
nullif there is no field with the given name - Throws:
IllegalArgumentException- if the node with the given name is not aDataNode.
-
getString
Gets the value of the given field as a string.- Parameters:
name- name of field- Returns:
- the value of the given field as a string,
nullif there is no field with the given name - Throws:
IllegalArgumentException- if the node with the given name is not aDataNode.
-
getAttrDate
Get the value of the given attribute as a date. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a date, or
nullif no such attribute or value cannot be parsed as a date
-
getAttrNumber
Get the value of the given attribute as a number. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a number
-
getAttrDouble
Get the value of the given attribute as aDouble, ornullif not set. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a double
-
getAttrLong
Get the value of the given attribute as aLong, ornullif not set. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a Long, or
nullif not set
-
getAttrBoolean
Get the value of the given attribute as aBoolean, ornullif not set. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a
Boolean, ornullif not set
-
getAttrString
Get the value of the given attribute as aString. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a long
-
getAttr
Get the value of the given attribute. If the first argument is notnullthen returns the value of attribute of the field or child group with that name.- Parameters:
name- name of node (ifnullthen current group)attrName- attribute name- Returns:
- value of attribute as a long
-
putChild
Add a child node with the given name. This method should be used with caution as it allows a child group to be added that may not be permitted by the NXDL base class definition for this base class. In preference, the relevant set method on the base class specific sub-interface of this interface should be used.- Parameters:
name- name of child groupchild- child group
-
setChildren
Adds the child nodes with the given names. This method should be used with caution as it allows a child group to be added that may not be permitted by the NXDL base class definition for this base class. In preference, the relevant set method on the base class specific sub-interface of this interface should be used.- Parameters:
map- map from names to child nodes to add
-
getAllDatasets
Returns all datasets as a map keyed by field name- Returns:
- all datasets
-
getAttributeDefault
String getAttributeDefault().. index:: find the default plottable data .. index:: plotting .. index:: default attribute value Declares which :ref:`NXdata` group contains the data to be shown by default. It is used to resolve ambiguity when one :ref:`NXdata` group exists. The value :ref:`names` a child group. If that group itself has a ``default`` attribute, continue this chain until an :ref:`NXdata` group is reached. For more information about how NeXus identifies the default plottable data, see the :ref:`Find Plottable Data, v3 invalid input: '<'Find-Plottable-Data-v3>` section. - Returns:
- the value.
-
setAttributeDefault
.. index:: find the default plottable data .. index:: plotting .. index:: default attribute value Declares which :ref:`NXdata` group contains the data to be shown by default. It is used to resolve ambiguity when one :ref:`NXdata` group exists. The value :ref:`names` a child group. If that group itself has a ``default`` attribute, continue this chain until an :ref:`NXdata` group is reached. For more information about how NeXus identifies the default plottable data, see the :ref:`Find Plottable Data, v3 invalid input: '<'Find-Plottable-Data-v3>` section. - Parameters:
defaultValue- the defaultValue
-