Conversation
…for loading config from imas
…rategy : vessel in vessel, PFC in limiter or mobile units if any mobile, and more descriptions written
…mobile.unit, to avoid loss of info
…ti.to_Cam() and Multi.to_Data(), hence 'names' field also added to all diag default shortcuts
…with METIS rectangular meshes
…ost done up to data
… now available for Multi.calc_signal()
Codecov Report
@@ Coverage Diff @@
## devel #325 +/- ##
==========================================
+ Coverage 40.04% 40.06% +0.02%
==========================================
Files 79 79
Lines 24108 24094 -14
==========================================
Hits 9653 9653
+ Misses 14455 14441 -14
Continue to review full report at Codecov.
|
| vphi = -np.sin(phi)*vect[0,:] + np.cos(phi)*vect[1,:] | ||
| vZ = vect[2,:] | ||
| vR = np.cos(phi)*vect[0, :] + np.sin(phi)*vect[1, :] | ||
| vPhi = -np.sin(phi)*vect[0, :] + np.cos(phi)*vect[1, :] |
There was a problem hiding this comment.
vphi was incorrect, it is vPhi
| indpts = indR*nZ + indZ | ||
| else: | ||
| indpts = indZ*nR + indR | ||
| indout = ((r < R[0]) | (r > R[-1]) |
There was a problem hiding this comment.
We make sure points outside of the rectangular grid return -1 as index
| if self._dindref[id_]['group'] == 'mesh'][0] | ||
| pts = self.dmesh[idmesh]['data']['nodes'] | ||
| pts = np.array([pts[:,0], np.zeros((pts.shape[0],)), pts[:,1]]) | ||
| if self.dmesh[idmesh]['data']['type'] == 'rect': |
There was a problem hiding this comment.
Make sure the default pts are chosen according to the mesh type (rect vs triangular)
| msg = "All Data objects do not have the same:\n" | ||
| msg += " dlabels['t'], dlabels['X'] and dlabels['data'] !" | ||
| raise Exception(msg) | ||
| warnings.warn(msg) |
There was a problem hiding this comment.
This is a non-critical error => downgraded from Exception to warning
| if Brightness is False: | ||
| if dataname is None: | ||
| dataname = r"LOS-integral x Etendue" | ||
| if E is None or np.all(np.isnan(E)): |
There was a problem hiding this comment.
Check etendue is correct before using it
| if units[ii].phi_extensions.size > 0: | ||
| pos, extent = units[ii].phi_extensions.T | ||
| # Get vessel | ||
| nlim = len(wall.limiter.unit) |
There was a problem hiding this comment.
We now consider both limiter and mobile wall types
| nmob = len(wall.mobile.unit) | ||
| onelimonly = False | ||
| try: | ||
| if len(wall.vessel.unit) != 1: |
There was a problem hiding this comment.
There should be only one vessel in the IMAS ids (corresponds to tofu call Ves : a StructIn sub-class)
|
|
||
| # Determine if mobile or not | ||
| lS = [] | ||
| if onelimonly is False: |
There was a problem hiding this comment.
If there are several PFC, we load them either from limiter or mobile
|
|
||
| return geomcls | ||
|
|
||
| def _get_indch_geomtdata(self, indch=None, indch_auto=None, |
There was a problem hiding this comment.
hidden method created to handle automated determination of indch in a modular way
| node.phi_extensions = np.array([lS[ii].pos, lS[ii].extent]).T | ||
| node.closed = True | ||
| node.name = '%s_%s'%(lS[ii].__class__.__name__, lS[ii].Id.Name) | ||
| wall = idd.wall.description_2d[description_2d] |
There was a problem hiding this comment.
We make sure that we can save to vessel / limiter / mobile froma tofu Config
|
|
||
| # Interpolate | ||
| indpts = trifind(r, z) | ||
| indok = indpts > -1 |
There was a problem hiding this comment.
Not yet, but it will be in a future version, just preparing for it
| dcom = d0._extract_common_params(d0) | ||
|
|
||
| elif isinstance(other, np.ndarray): | ||
| data = opfunc(d0.data, other) |
There was a problem hiding this comment.
I would put an "or" in the if, instead of showing two different cases with the same result
There was a problem hiding this comment.
You(re right, but I wanted to separate these becasue I may to treat these cases differently later, let's say it for readability and anticipation of future needs
| config = mod.Config(lStruct=lS, Name=Name, **kwargs) | ||
| if Name is None: | ||
| Name = wall.type.name | ||
| if Name == '': |
There was a problem hiding this comment.
is this rightly indented ?
There was a problem hiding this comment.
yes, it happens that people save empty names ('') in IMAS, because they forget to fill it in
| shapeu = np.unique(np.r_[R.shape, Z.shape]) | ||
| shapeRZ = [None, None] | ||
| if shapeRZ is None: | ||
| shapeRZ = [None, None] |
There was a problem hiding this comment.
should shapeRZ not be a tuple instead of a list (see below)
There was a problem hiding this comment.
ultmately, shapeRZ will be returned as a tuple, yes,
But at this point we have to define it as a list because we may have to modify it, and tuples are immutable.
So we define it as a list, possibly modify it, and finally convert it to a tuple
…s nan already from source in Plasma2D.interp_pts2profile() Set sig = -2*sig for polarimeter due to vect direction (laser direction) Set vect = -u in newcalc=False Double checked all METIS synthetic diagnostics: polarimeter and interferometer ok bremsstrhalung_visible and bolometer waiting for sequenceur replay for units, geometry and etendues Synthetic diag now need to be double-checked for NICE / EQUINOX
…ctions. To be double-tested for all cases, METIS and NICE
…n-zero and different in Multi.to_Config(), and limiter chosen by default (with warning) when they are equal
Main changes:
Some implementation details:
=> description_2d is kept only
Status:
To this day (2020-01-10), on WEST intra servers, the following syntthetic diagnostics are operational directly from IMAS / METIS:
The soft_x_rays ids is not operational yet because it requires atomic data, not implemented yet
Example (only on WEST intra servers):
Issues:
Fixes, in devel, issue #321