Closed AreWeDreaming closed 1 year ago
See the "options" section in the "*.json" files to see how options can be passed to mapping functions. For example, you should be able to do:
"__options__": {
"EFIT_tree": "EFIT01",
"PROFILES_tree": "ZIPFIT01",
"analysis_type": "CERQUICK",
"default_tree": "D3D",
"fast_ece": false,
"nref": 0,
"revision": "BLESSED"
},
...
"core_profiles.profiles_1d.:.electrons.density": {
"PYTHON": "core_profiles_profile_1d(ods, {pulse}, {PROFILES_tree})"
}
which can then be passed with
with ods.open("d3d", 133221, PROFILES_tree="mytree")
plot(ods['core_profiles.profiles_1d.0.electrons.density'])
Should the ability to read ZIPFITS be retained? Are you sure there is nothing that depends on that?
@orso82 Thanks for the example. I am not suggesting to removed anything, I was just confused about what to do and wanted to have an example for what I was struggling with when asking for help. I didn't realize that I need to move the zipfit mapping out of the .json file and into my new routine. I'll add an if-clause and the tree name as an argument. The Omas viewer should be able to show whatever Omas can load from zip fits.
The last commit has several problems:
\'
, e.g. "\'ZIPFIT01\'"
in order to not loose its string nature. This is not the case for "EFIT_tree"
which is a very similar extra argument.PROFILES_tree="\'OMFIT_PROFS\'"
and PROFILES_tree="\'ZIPFIT01\'"
do not provide the same fields. This seems to confuse the .json
file that wants to have a fixed set of fields for each mapping function regardless of its input argument. TDI
function is error_of
but I am not sure how to do this for all fields without explicitly looping. I am not sure if explicitly looping over each field might cause separate MDS+ requests for each quantity. I guess I could just create a query like this:
query = {
"electrons.density.data_error_upper": "error_of(\\TOP.n_e)",
"electrons.temperature.data_error_upper": "error_of(\\TOP.T_e)",
"ion[0].density.data_error_upper": "error_of(\\TOP.n_D)",
"ion[0].temperature.data_error_upper": "error_of(\\TOP.T_i)",
"ion[0].velocity.toroidal.data_error_upper": "error_of(\\TOP.V_tor_C)",
"ion[0].density.data_error_upper": "error_of(\\TOP.n_C)"
}
charge_exchange.channel
for exampleOk, so I managed to sort out all the problems I think. It seems that there were some minor errors that then became several weird problems. Now I can switch between ZIPFIT
/OMFIT_PROFS
without issues and the tree specification works without \"
.
I also added the uncertainties.
We'll have to revisit this when the fields for *_fit
have data in MDS+. For now, I am happy with this.
Stale pull request message
@AreWeDreaming should remove the no-pr-activity
label if this PR is still valid. If it needs further testing, let's work on it. The last automatic test failed.
Stale pull request message