Class NexusScanFileManager

java.lang.Object
org.eclipse.scanning.sequencer.nexus.NexusScanFileManager

public class NexusScanFileManager extends Object
Builds and manages the NeXus file for a scan given a ScanModel.
  • Constructor Details

    • NexusScanFileManager

      public NexusScanFileManager(IScanDevice scanDevice)
  • Method Details

    • configure

      public void configure(ScanModel scanModel) throws ScanningException
      Configures this NexusScanFileManager with the given ScanModel. This determines the structure of the nexus file that will be created when createNexusFile(boolean) is called.
      Parameters:
      scanModel - the ScanModel describing the scan
      Throws:
      ScanningException
    • getEntryName

      public static String getEntryName()
    • getOuterScanShape

      protected int[] getOuterScanShape(ScanModel scanModel) throws ScanningException
      Throws:
      ScanningException
    • extractNexusDevices

      protected Map<NexusScanInfo.ScanRole,List<INexusDevice<?>>> extractNexusDevices(ScanModel model)
    • createNexusFile

      public String createNexusFile(boolean async) throws ScanningException
      Creates the nexus file. The structure of the nexus file is determined by the devices contained within the ScanModel that configure(ScanModel) was previously called with.
      Throws:
      ScanningException - if the nexus file could not be created for any reason
    • flushNexusFile

      public void flushNexusFile() throws ScanningException
      Flushes any pending data into the nexus file.
      Throws:
      ScanningException
    • scanFinished

      public void scanFinished() throws ScanningException
      Informs the manager that the scan has finished. This will cause the scanFinished dataset to be updated and the nexus file to be closed.
      Throws:
      ScanningException
    • isNexusWritingEnabled

      public boolean isNexusWritingEnabled()
      Returns whether this nexus file manager actually writes a nexus files.
      Returns:
      true if a nexus file is written, false otherwise
    • getExternalFilePaths

      public Set<String> getExternalFilePaths()
      The file paths of all the external files written to during this scan. For example, this may be used to trigger archiving.
      Returns:
      file paths of external files written to during this scan, never null