4.1.2. ITER¶
4.1.2.1. ITER.Ves¶
Contains all functions specific to the AUG vessel (creating the Ves object from Inputs, loading pre-created Ves objects...)
Created on Wed May 18 2016
@version: 0.9 @author: didiervezinet @author_email: didier.vezinet@gmail.com
-
tofu.plugins.ITER.Ves.
create
(Name='ITER_D_2N9J75 v1.7-1', Poly=['PoloidalCurvesCoordinates', 'ITER', '2N9J75', 'csv'], shot=0, SavePathInp=None, SavePathObj=None, Root='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu', save=True, skiprows=4, comments='#', units='mm', dtime=None, dtFormat='D%Y%m%d_T%H%M%S', dtimeIn=False, Test=True)[source]¶ Create and save a Ves object from givn input file or Ves object
A Ves object can be created from an input file, a np.ndarray or another
Ves
objectParameters: - Name (str) – The name to be given to the created Ves instance
- Poly (None / str /
tofu.geom.Ves
/ np.ndarray) –- The source where the polygon is to be found, either:
- str: the name of a file containing the coordinates of a polygon to be loaded with
numpy.loadtxt()
- A
tofu.geom.Ves
object: to re-use its Poly attribute and build one with different name - np.ndarray: an 2-dimensional array containing the 2D cartesian coordinates of a polygon
- str: the name of a file containing the coordinates of a polygon to be loaded with
- shot (int) – A shot number, to be used as a reference point in time, marking from when the provided geometry is valid
- SavePathInp (None / str) – If provided, forces the routine to search for the input file at SavePathInp, if not provided SavePathInp is automatically set to default (i.e. tofu/plugin/Ves/Inputs/)
- SavePathObj (None / str) – If provided, forces the routine to save the created instance at SavePathObj, if not provided SavePathObj is automatically set to default (i.e. tofu/plugin/Ves/Objects/)
- Root (str) – If SavePathObj=None, a default value is created by appending ‘/tofu/plugins/ITER/Ves/Objects/’ to Root
- save (bool) – Flag indicating whether the created Ves instance shall be saved automatically (in SavePathObj)
- skiprows (int) – Parameter fed to np.loadtxt() for reading the polygon from a txt file
- comments (str) – Parameter fed to np.loadtxt() for reading the polygon from a txt file
- units (str) – Flag indicating in which units the input polygon is provided (in [‘m’,’cm’,’mm’])
- dtime (None / dtm.datetime) – A datetime instance used for labelling the created instance (mostly used for debugging)
- dtFormat (str) – The format of the labelling (mostly used for debugging)
- dtimeIn (bool) – Flag indicating whether to include the label in the file name (mostly used for debugging)
- Test (bool) – Flag indicating whether the inpurts should be checked for conformity
Returns: Ves (
tofu.geom.Ves
) – The created tfg.Ves instance
-
tofu.plugins.ITER.Ves.
load
(Name=None, SavePathObj=None, Root='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu', Test=True)[source]¶ Load and return the selected Ves object (selected by name or file name)
Several Ves object might exist for the same experiment depending changes to the experiment in time for example This function loads the one specified by its name.
Parameters: - Name (str / list) – Name of the file to be loaded, or a subset of this name or a list of subsets, the file with a name matching all the subsets will be loaded. An error is issued in case of ambiguity (no or several matches)
- SavePathObj (None / str) – Absolute path where the objects can be found, if None sets to default
- Root (str) – If SavePathObj=None, a default value is created by appending ‘/tofu/plugins/AUG/Ves/Objects/’ to Root
- Test (bool) – Flag indicating whether the inputs should be tested for conformity
Returns: Ves (
tofu.geom.Ves
) – The loaded Ves object
4.1.2.2. ITER.Struct¶
Contains all functions specific to the ITER structural elements
-
tofu.plugins.ITER.Struct.
plot
(Elt='BPV', EltStruct='P', EltVes='P', Lax=None, Proj='Cross', shot=0, SavePathInp='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu/tofu/plugins/ITER/Struct/Inputs/', SavePathObj='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu/tofu/plugins/ITER/Struct/Objects/', Ves=None, NameVes=None, SavePathVes=None, skiprows=0, comments='#', units='mm', dtime=None, dtFormat='D%Y%m%d_T%H%M%S', dtimeIn=False, Test=True)[source]¶ Create and plot the required Struct object on the required axes
The coordinates of the polygons of the Struct objects are taken from SavePathInp
Parameters: - Elt (str) –
- Flag indicating which elements to plot, one capital letter per element
- ‘B’ : the Beams
- ‘P’ : the ports
- ‘V’ : the associated Ves object
- Lax (None / plt.Axes / list) – If provided, the axes or list of axes on which the poloidal and / or horizontal projections of the structure elements shall be plotted
- shot (int) – A shot number, to be used as a reference point in time, marking from when the provided geometry is valid
- SavePathInp (None / str) – If provided, forces the routine to search for the input file at SavePathInp, if not provided SavePathInp is automatically set to default (i.e. tofu/plugin/Ves/Inputs/)
- SavePathObj (None / str) – (optional) Absolute path where the created object will be saved
- Ves (None /
tofu.geom.Ves
) – If provided, associates the Struct objects with this Ves object, otherwise a default Ves is loaded from SavePathVes if provided - NameVes (str) – Use if Ves is not provided, fed to tofu.plugins.ITER.Ves.load() for loading a default Ves
- SavePathVes (None / str) – If provided, path from which a default Ves object can be loaded
- skiprows (int) – Parameter fed to np.loadtxt() for reading the polygon from a txt file
- comments (str) – Parameter fed to np.loadtxt() for reading the polygon from a txt file
- units (str) – Flag indicating in which units the input polygon is provided (in [‘m’,’cm’,’mm’])
- dtime (None / dtm.datetime) – A datetime instance used for labelling the created instance (mostly used for debugging)
- dtFormat (str) – The format of the labelling (mostly used for debugging)
- dtimeIn (bool) – Flag indicating whether to include the label in the file name (mostly used for debugging)
- Test (bool) – Flag indicating whether the inpurts should be checked for conformity
Returns: LS (list) – The list of all created
tofu.geom.Struct
instances- Elt (str) –
4.1.2.3. ITER.Bolo.geom¶
-
tofu.plugins.ITER.Bolo.geom.
create_Apert
(Name, Ves, Poly, shot=0, SavePathVes='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Objects_ITER/', SavePathObj='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Objects_ITER/', SavePathInp='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Inputs_ITER/', comments='#', skiprows=0, units='m', save=True)[source]¶ Create a Apert object (i.e.: aperture) with specified Name from either a file (.dat,.txt,.csv) or directly from a (2,N) or (N,2) numpy array Object is created, Saved in SavePathObj and returned If an input file is specified and the file name does not include an absolute path, the path specified in SavePathInp is used
Parameters: - Name (str) – Name of the object to be created
- Ves (str /
tofu.geom.Ves
) – Ves object to which the aperture is associated, a file name can also be used if the Ves object was previously Saved - Poly (str / np.ndarray) – Numpy array or input file name (fed to numpy.loadtxt) used to specify the polygon to be used (should be (2,N) or (N,2) for N points)
- shot (int) – Shot number from which the provided geometry is valid (useful for geometry changes bewteen campaigns)
- SavePathVes (None / str) – (optional) if Ves is a str (i.e.: file name) or a list (i.e.: list of strings contained in the file name), specifies the path at which the file is to be found
- SavePathObj (None / str) – (optional) Absolute path where the created object will be saved
- SavePathInp (None / str) – (optional) Absolute path where the input file is to be found
- comments (str) – (optional) str specifying the flag for comments in the Poly file (if Poly is a file name), fed to numpy.loadtxt
- skiprows (int) – (optional) number of rows to be skipped in the Poly file (if Poly is a file name), fed to numpy.loadtxt
- units (str) – Flag indicating in which units the input polygon is provided (in [‘m’,’cm’,’mm’])
- save (bool) – (optional) Flag indicating whether the created object should be Saved
- Test (bool) – Flag indicating whether the inputs should be tested for conformity
Returns: Apert (
tofu.geom.Apert
) – The created Apert object
-
tofu.plugins.ITER.Bolo.geom.
create_Detect
(Name, Ves, Poly, LApert, shot=0, SavePathVes='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Objects_ITER/', SavePathObj='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Objects_ITER/', SavePathInp='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Inputs_ITER/', comments='#', skiprows=0, Cone_DRY=0.0025, Cone_DXTheta=0.0030679615757712823, Cone_DZ=0.0025, Cone_NPsi=20, Cone_Nk=60, Synth_dX12=[0.005, 0.005], Synth_dX12Mode='abs', Synth_ds=0.005, Synth_dsMode='abs', Synth_Colis=True, Calc=True, CalcEtend=True, CalcSpanImp=True, CalcCone=True, CalcPreComp=True, save=True, save_SynthDiag=False)[source]¶ Create a
tofu.geom.Detect
object (i.e.: detector) with specified Name from either a file (.dat,.txt,.csv) or directly from a (2,N) or (N,2) numpy array Object is created, optionally Saved in SavePathObj and returned If an input file is specified and the file name does not include an absolute path, the path specified in SavePathInp is usedParameters: - Name (str) – Name of the object to be created
- Ves (
tofu.geom.Ves
or str) – Ves object to which the aperture is associated, a file name can also be used if the Ves object was previously Saved - Poly (str or np.ndarray) – Numpy array or input file name (fed to numpy.loadtxt) used to specify the polygon to be used (should be (2,N) or (N,2) for N points)
- LApert (list) – List of Apert objects to be associated to the detector
- SavePathVes (None / str) – (optional) if Ves is a str (i.e.: file name) or a list (i.e.: list of strings contained in the file name), specifies the path at which the file is to be found
- SavePathObj (str) – (optional) Absolute path where the created object will be Saved
- SavePathInp (str) – (optional) Absolute path where the input file is to be found
- comments (str) – (optional) str specifying the flag for comments in the Poly file (if Poly is a file name), fed to numpy.loadtxt
- skiprows (int) – (optional) number of rows to be skipped in the Poly file (if Poly is a file name), fed to numpy.loadtxt
- save (bool) – (optional) Flag indicating whether the created object should be Saved
- save_SynthDiag (bool) – (optional) Flag indicating whether the pre-computed synthetic diagnostic mesh should also be saved (larger files) or whether it should be recomputed upon loading
- compute the VOS, tofu tests all points inside a 3D grid to see if each point is visible from the detector through the apertures or not (To) –
- Cone_DR (float) – Resolution of the grid in the R direction, in meters
- Cone_DTheta (float) – Resolution of the grid in the toroidal direction, in radians
- Cone_DZ (float) – Resolution of the grid in the Z direction, in meters
- the particular case when the LOS of the detector lies entirely inside one poloidal cross-section (e.g. (In) –
- also computes the integral in the toroidal direction of the solid angle on a regular mesh (for faster computation of the geometry assuming toroidaly invariant basis functions) (tofu) –
- regular mesh is defined in 2D, by the distance between a mesh point and the detector (k) and by the poloidal angle between the LOS and the line going from the detector to the mesh point (psi) (This) –
- Cone_NPsi (20) – Number of points of the regular mesh in psi direction (angle)
- Cone_Nk (60) – Number of points of the regular mesh in k direction (distance)
- compute synthetic signal faster for any simulated emissivity, tofu can pre-compute a 3D mesh of the VOS and store it, with the associates solid angles (To) –
- 3D mesh is computed with respect to the LOS. One coordinate (s) is the distance along the LOS, the two others (1 and 2) are the distances in directions perpendicular to the LOS (This) –
- Synth_dX12 (list) – Resolution of the mesh in the two directions perpendicular to the LOS
- Synth_dX12Mode (str) – Flag indicating whether dX12 is an absolute value (‘abs’, in meters) or a fraction of the maximum local with of the VOS (‘rel’)
- Synth_ds (float) – Resolution of the mesh in the direction parallel to the LOS
- Synth_dsMode (str) – Flag indicating whether ds is an absolute value (‘abs’, in meters) or a fraction of the maximum local with of the VOS (‘rel’)
- Synth_Colis (bool) – Flag indicating whether the collision detection should be activated
Returns: Detect (TFG.Detect) – The created TFG.Detect object
-
tofu.plugins.ITER.Bolo.geom.
create_GDetect
(Name, LDetect, SavePathObj='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Objects_ITER/', save=True, save_SynthDiag=False)[source]¶ Create a
tofu.geom.GDetect
object (i.e.: group of detectors, or camera) with specified Name from a list of Detect objects Object is created, optionally Saved in SavePathObj and returnedParameters: - Name (str) – Name of the object to be created
- LDetect (list) – List of already-created Detect objects
- SavePathObj (str) – (optional) Absolute path where the created object will be Saved
- save (bool) – (optional) Flag indicating whether the created object should be Saved
- save_SynthDiag (bool) – (optional) Flag indicating whether the pre-computed synthetic diagnostic mesh should also be saved (larger files) or whether it should be recomputed upon loading
Returns: GD (
tofu.geom.GDetect
) – The created object
-
tofu.plugins.ITER.Bolo.geom.
load
(Name, Cls='GDetect', SavePathObj='/afs/ipp-garching.mpg.de/home/g/gav/ToFu_ITER/Objects_ITER/')[source]¶ Load the desired object, identified by name and saving path
Searches in SavePathObj a ToFu object of the specified class (Cls) saved under the specified name (Name). If a single match is found, the object is loaded and returned, otherwise an error is raised
Parameters: