4.1.1. AUG¶
4.1.1.1. AUG.Ves¶
Contains all functions specific to the AUG vessel (creating the Ves object from Inputs, loading pre-created Ves objects...)
-
tofu.plugins.AUG.Ves.
load
(Name='V1', 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
- SavePathObj (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.1.2. AUG.SXR.geom¶
-
tofu.plugins.AUG.SXR.geom.
create
(shot=0, VesName='V1', SavePathObj=None, Root='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu', forceshot=False, overwrite=False, save=True, dtime=None, dtFormat='D%Y%m%d_T%H%M%S', CalcEtend=True, CalcSpanImp=True, CalcCone=True, CalcPreComp=True, Calc=True, Verb=True, Etend_Method='quad', Etend_RelErr=0.001, Etend_dX12=[0.01, 0.01], Etend_dX12Mode='rel', Etend_Ratio=0.02, Colis=True, LOSRef='Cart', Cone_DRY=0.0025, Cone_DXTheta=0.0030679615757712823, Cone_DZ=0.0025, Cone_NPsi=20, Cone_Nk=60)[source]¶ Create, save and return all the GDetect objects relevant for the input shot, unless already created for a relevant reference shot
Create the
tofu.geom.GDetect
objects (i.e.: the cameras, which are groups of detectors) from geometry taken from CSX disgnostic for the proposed shot or earlier (looks for the oldest version of the matching geometry) and stores them in the SavePathObj.All extra arguments are fed to
Detect
Parameters: - shot (int) – Shot number for which to build the geometry
- VesName (str) – Name of the tfg.Ves object to be fed as an input to the
tofu.geom.GDetect
objects - SavePathObj (None / str) – Absolute path where the created
tofu.geom.GDetect
objects should be saved (if save=True), if None the default is used - Root (str) – If SavePathObj=None, a default value is created by appending ‘/tofu/plugins/AUG/SXR/geom/Objects/’ to Root
- forceshot (bool) – Flag indicating whether the shot number shall be downgraded to the oldest shot with the same geometry (False) or whether the provided shot number shall be enforced (True, for all camera heads)
- overwrite (bool) – Flag indicating whether new
tofu.geom.GDetect
objects shall be computed (and possibly saved) when similar ones already exist (True) - save (bool) – Flag indicating whether to save the created
tofu.geom.GDetect
objects (in SavePathObj) - dtime (None / dtm.datetime) – If provided (i.e.: not None), used as a label of the created
tofu.geom.GDetect
objects (mostly used for debugging) - dtFormat (str) – The time format to be used for labelling the created
tofu.geom.GDetect
objects (mostly used for debugging)
Returns: LGD (list) – A list of all the created tfg.GDetect objects
-
tofu.plugins.AUG.SXR.geom.
load
(Cams=None, shot=None, SavePathObj=None, Root='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu', sort=False, out='full', Test=True)[source]¶ Load and return the desired
GDetect
objects (i.e.: camera heads)Directly fecthes and loads the desired
GDetect
objects.Parameters: - Cams (str / list) – A name or a list of names of the camera heads to be loaded (available are [‘F’,’G’,’H1’,’H2’,’H3’,’I1’,’I2’,’I3’,’J1’,’J2’,’J3’,’K1’,’K2’,’L’,’M’])
- shot (int / float / np.float) – A shot number indicating which version of the geometry should be loaded (the )
- SavePathObj (None / str) – Absolute path where the created
tofu.geom.GDetect
objects should be saved (if save=True), if None the default is used - Root (str) – If SavePathObj=None, a default value is created by appending ‘/tofu/plugins/AUG/SXR/geom/Objects/’ to Root
- sort (bool) – Flag indicating whether the loaded
tofu.geom.GDetect
objects shall be returned sorted by alphabetical order of the names (True) or in the same order as asked in Cams (False) - out (str) – Flag indicating whether the object should be loaded completely (‘full’), in a light dismissing the heaviest attributes (‘light’) or whether only the Id or a list of Id should be returned (‘Id’), valid only for ‘.npz’
- Test (bool) – Flag indicating whether the inputs should be tested for conformity
- Returns –
- -------- –
- LGD (list /
tofu.geom.GDetect
) – The loadedtofu.geom.GDetect
, returned as a single object if Cams was provided as a single name, as a list otherwise
4.1.1.3. AUG.SXR.data¶
-
tofu.plugins.AUG.SXR.data.
load
(shot=None, Names=None, Mode='SSX', Dt=None, Join=True, tRef='fmin', Method='interp', NoGeom=True, Tofu=True, Verb=True, Test=True)[source]¶ Load SXR data from the AUG database and returns it either as numpy arrays or a ToFu-compatible object with appropriate methods
Part of the difficulty is that all channels do not have the same sampling frequency and time vector. Hence, there is an option to uniformize the time base.
Parameters: - shot (int) – Shot number for which the SXR data should be loaded
- Names (None / str / list) – If provided, data is loaded only for the specified channel(s)
- Mode (str) – Flag indicating whether data should be loaded from a down-sampled database (‘SSX’, , faster loading) or from the complete database ( depending on the channel)
- Dt (None / iterable) – If provided, a len()=2 iterable giving the time interval of interest (recommended to avoid very large data files)
- Join (bool) – Flag, useful when Mode=’SX’, indicating whether the different time bases of the channels shall be uniformized
- tRef (None / str / np.ndarray) –
- Flag or time vector, useful when Mode=’SX’ and Join=True, indicating which time basis should be used as a reference
- ‘fmin’: the time vector of the channel presenting the smallest sampling frequency is used as a reference
- ‘fmax’: the time vector of the channel presenting the highest sampling frequency is used as a reference
- any channel name: the time vector of the specifiec channel is used as a reference
- np.ndarray: the provided time vector is used as a reference
- Method (str) – Flag, usefule when Mode=’SX’ and Join=True, indicating how the
- NoGeom (bool) –
- Flag indicating whether the data should be stripped of its geometrical calibration factor (thus being expressed in W instead of W/m2), to allow for:
- Application of a tofu-computed etendue in case of a LOS approach
- Direct use of the signal in case of a VOS approach
- Tofu (bool) – Flag indicating whether the loaded data should be returned as (SXR, t, Names) where the first two are np.ndarrays and Names is a list or as a tofu.data.PreData object
- Verb (bool) – Flag indicating whether extra comments should be printed to give feedback on the progress of the routine
- Test (bool) – Flag indicating whether the inputs should be tested for conformity
Returns: out (tuple / tofu.data.PreData)