Package xal.extension.jels.model.elem
Class TransferMapLoader
java.lang.Object
xal.extension.jels.model.elem.TransferMapLoader
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>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassClass models transfer matrices for one element. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetEnergy(double s) Returns interpolated energy (eV) at position sstatic TransferMapLoadergetInstance(URI tmFile) Gets an instance for a specific filevoidloads all the matrices for TransferMap classes that were previously prepared loads the energiesstatic voidA test program, that reads the file and outputs transfer matrices.prepare(double position, double length) Prepares TransferMaps class.
-
Field Details
-
tms
-
-
Constructor Details
-
TransferMapLoader
Creates the loader for specific file- Parameters:
tmFile- the file
-
-
Method Details
-
prepare
Prepares TransferMaps class. It's not loaded yet.- Parameters:
position- Start of the elementlength- 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
Gets an instance for a specific file- Parameters:
tmFile- path to the file- Returns:
- transfer map loader
-
main
A test program, that reads the file and outputs transfer matrices.- Parameters:
args- file name
-