Conversation
…me() and get_local_noute1e2() and fallback to self._DEFLAMB in self._checkformat_bragglamb() if nothing provided
…cing ddist, dtheta, dpsi to optimize position
…m to plot and mask, and optional dlines
…ble nphifit and nlambfit, started adding magaxis phi computation => notes
…discretize circle and select in interval of interest
…etector not tangential to Rowland circle ! needs to be fixed in _get_detect_approx()
…rystalBragg_plot_johannerror()
…bulated rocking curve
…a, with source, consider lamb-dependent tab? saved in cryst
…lotting routines and get 2d data for Quartz crystal
… a single lambda, and computation from plasma points started with calc_psidthetaphi_from_pts_lamb()
…f.utils.flatten_dict()
… ids wall, and fully recursive to_dict for .mat saving
…and tofu/imas2tofu/_core.py
Didou09
left a comment
There was a problem hiding this comment.
In addition to my comments:
- Several routines are unfinished but have no impact on unit tests and other classes
- Several routines are already quite useful (for me as a user)
- a npz file has been added, but it is temporary (useful for developping and debugging), but it will be removed before the release and merge to master
| pinhole = dgeom['D'][:, 0] + k[0]*u[:, 0] | ||
| dgeom['pinhole'] = pinhole | ||
|
|
||
| if np.any(np.isnan(dgeom['D'])): |
There was a problem hiding this comment.
This change to _core.py is just adding a safeguard (making it more robust with respect to ill-defined input from users)
| user=user, tokamak=tokamak, version=version, | ||
| ref=ref, isget=isget, get=get) | ||
|
|
||
| def add_ids_for_synthdiag(self, ids=None, occ=None, idd=None, |
There was a problem hiding this comment.
Minor changes also to make it more robust
|
|
||
| def load_from_imas(shot=None, run=None, user=None, tokamak=None, version=None, | ||
| ids=None, Name=None, out=None, tlim=None, config=None, | ||
| ids=None, Name=None, returnas=None, tlim=None, config=None, |
There was a problem hiding this comment.
out keyword replaced by returnas for clarity (will do it gradually everytime I see an opportunity)
| # ------------------- | ||
| # Prepare ids | ||
| assert ids is None or type(ids) in [list,str] | ||
| if type(ids) not in [list, str]: |
There was a problem hiding this comment.
Minor change for robustness
| dout = dout[shot[0]]['Data'][0] | ||
| elif nshot == 1 and nPla == 1: | ||
| dout = dout[shot[0]]['Plasma2D'][0] | ||
| return out |
There was a problem hiding this comment.
Was not returning the good variable...
| deep = 'dict' if deep else 'ref' | ||
| if sep is None: | ||
| sep = _SEP | ||
| if mode == 'mat': |
There was a problem hiding this comment.
If a .mat file is being saved, the separator must be '_', otherwise a '.' would corrupt the mat file (minor change for robustness)
Codecov Report
@@ Coverage Diff @@
## devel #320 +/- ##
==========================================
- Coverage 40.89% 40.22% -0.68%
==========================================
Files 79 79
Lines 23553 23998 +445
==========================================
+ Hits 9633 9653 +20
- Misses 13920 14345 +425
Continue to review full report at Codecov.
|
|
@Didou09 I'll let you see if you want to keep the branch or not. As I understood, the changes are not over |
|
I just realized this PR introduced a *.npz file in the root directory. I will erase it in a new PR... |
Intermediate PR to update devel with new features regarding 2D X-Ray spectrometer.
These new features are in tofu/geom/_core_optics.py, _comp_optics.py and _plot_optics.py.
They were added as extra files because they include a lot of new things (routines, classes) and because this way it does not affect the basic classes.
They are not unit-tested yet.
This is an update just to make available some functionalities and avoid a single huge PR at the end. But there is no user (except me) for these at this point, so it won't affect anyone.