Package gda.data.nexus
Class NeXusUtils
java.lang.Object
gda.data.nexus.NeXusUtils
Utility methods for dealing with NeXus files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanfindMetaItems(ArrayList<String> list) static int[]getDim(int[] dimension) Returns the dimensions array for a given width/height of data that can be used by the NeXus API to create a data section.static int[]Returns the dimensions array for a given detector that can be used by the NeXus API to create a data section.static intgetRank(int[] detectorDataDimensions) Returns the number of dimensions (rank) required for the data section in a NeXus file.static intgetRank(int width, int height) Returns the number of dimensions (rank) required for the data section in a NeXus file.static intReturns the number of dimensions (rank) required for the data section in a NeXus file.static voidwrite_NXbending_magnet(NexusFile file, GroupNode group) static voidwrite_NXinsertion_device(NexusFile file, GroupNode group) static voidwrite_NXinstrument(NexusFile file, GroupNode group) Creates an NXinstrument entry at the current position in the NeXus file.static voidwrite_NXmonochromator(NexusFile file, GroupNode group) static voidwrite_NXsample(NexusFile file, GroupNode group) static voidwrite_NXsource(NexusFile file, GroupNode group) static voidwrite_NXuser(NexusFile file, GroupNode group) Creates an NXuser(s) entry at the current position in the NeXus file.static voidRoutine for writing the elements required for Small Angle Scattering definition to a given NX_ENTRY.static voidRoutine for writing the elements required for XAS/EXAFS definition to a given NX_ENTRY.static voidwriteXESraw(NexusFile file, String entryName) Routine for writing the elements required for the XESraw definition to a given NX_ENTRY
-
Constructor Details
-
NeXusUtils
public NeXusUtils()
-
-
Method Details
-
getRank
Returns the number of dimensions (rank) required for the data section in a NeXus file. e.g. A single channel counterTimer would have a rank=1. A multi channel counterTimer would have a rank=2. A two dimensional detector (CCD) would have a rank=3.- Parameters:
detector-- Returns:
- int
- Throws:
DeviceException
-
getRank
public static int getRank(int[] detectorDataDimensions) Returns the number of dimensions (rank) required for the data section in a NeXus file. e.g. A single channel counterTimer would have a rank=1. A multi channel counterTimer would have a rank=2. A two dimensional detector (CCD) would have a rank=3.- Parameters:
detectorDataDimensions-- Returns:
- int
-
getRank
public static int getRank(int width, int height) Returns the number of dimensions (rank) required for the data section in a NeXus file. e.g. A single channel counterTimer would have a rank=1. A multi channel counterTimer would have a rank=2. A two dimensional detector (CCD) would have a rank=3.- Parameters:
width-height-- Returns:
- int
-
getDim
Returns the dimensions array for a given detector that can be used by the NeXus API to create a data section.- Parameters:
detector-- Returns:
- int[]
- Throws:
DeviceException
-
getDim
public static int[] getDim(int[] dimension) Returns the dimensions array for a given width/height of data that can be used by the NeXus API to create a data section.- Parameters:
dimension-- Returns:
- int[]
-
writeXESraw
Routine for writing the elements required for the XESraw definition to a given NX_ENTRY- Parameters:
file-entryName-- Throws:
NexusExceptionIOException
-
write_NXinstrument
Creates an NXinstrument entry at the current position in the NeXus file.- Parameters:
file- The NeXus file handlegroup-- Throws:
NexusException
-
write_NXuser
Creates an NXuser(s) entry at the current position in the NeXus file.- Parameters:
file- The NeXus file handlegroup-- Throws:
NexusException
-
write_NXsource
- Parameters:
file-- Throws:
NexusException
-
findMetaItems
- Parameters:
list-- Returns:
- true if any of the items in the list are defined in the metadata list.
- Throws:
DeviceException
-
write_NXmonochromator
- Parameters:
file-- Throws:
NexusException
-
write_NXinsertion_device
- Parameters:
file-- Throws:
NexusException
-
write_NXbending_magnet
- Parameters:
file-group-- Throws:
NexusException
-
write_NXsample
- Parameters:
file-- Throws:
NexusException
-
writeSAS
Routine for writing the elements required for Small Angle Scattering definition to a given NX_ENTRY.- Parameters:
file-entryName-
-
writeXAS
Routine for writing the elements required for XAS/EXAFS definition to a given NX_ENTRY.- Parameters:
file-entryName-
-