Class TransferMapLoader

java.lang.Object
xal.extension.jels.model.elem.TransferMapLoader

public class TransferMapLoader extends Object
Taking care of loading and interpolating transfer matrices from a file.
  • loader = TransferMapLoader.getInstance(URI tmFile) returns an instance while the file is being loaded
  • el_tm = loader.prepare(double position, double length) prepares TransferMaps class for an element (lazily)
  • el_tm.transferMap(IProbe p, double l) on first call loads all the elements It returns interpolated transfer map for specific range
Author:
Ivo List <ivo.list@cosylab.com>
  • Field Details

  • Constructor Details

    • TransferMapLoader

      public TransferMapLoader(URI tmFile)
      Creates the loader for specific file
      Parameters:
      tmFile - the file
  • Method Details

    • prepare

      public TransferMapLoader.TransferMaps prepare(double position, double length)
      Prepares TransferMaps class. It's not loaded yet.
      Parameters:
      position - Start of the element
      length - Length of the element
      Returns:
      TransferMaps file for the element
    • getEnergy

      public double getEnergy(double s)
      Returns interpolated energy (eV) at position s
      Parameters:
      s - the position
      Returns:
      the energy
    • lazyLoader

      public void lazyLoader()
      loads all the matrices for TransferMap classes that were previously prepared loads the energies
    • getInstance

      public static TransferMapLoader getInstance(URI tmFile)
      Gets an instance for a specific file
      Parameters:
      tmFile - path to the file
      Returns:
      transfer map loader
    • main

      public static void main(String[] args)
      A test program, that reads the file and outputs transfer matrices.
      Parameters:
      args - file name