Bugfix to store zeros when current data not available
Sometimes the dimension of the data for the currents in bs.bs_data does not have the same dimension as Thomson. From what I can see, the difference is just the last datapoint. I tried to armor the code against these cases, throwing a warning and updating the description. I will try to understand if this is one of the cases where 'it should fail' later, I prepared the bugfix a while ago and there is still value in not failing immediately. @osauter, if you already have an explanation of why this happens in mind I'll modify it accordingly
Merge request reports
Activity
requested review from @lsimons
- Resolved by Michele Marin
- Resolved by Michele Marin
added 1 commit
- 369440b4 - Limit the amount of warning in case of multiple missing data
- Resolved by Michele Marin
- Resolved by Michele Marin
added 62 commits
-
a3cd915c...569e08e4 - 59 commits from branch
master
- ef17f58c - Bugfix to store zeros when current data not available
- 2d25bef6 - Limit the amount of warning in case of multiple missing data
- 112c76db - Using numel instead of length and bugfix
Toggle commit list-
a3cd915c...569e08e4 - 59 commits from branch
added 1 commit
- 66ae9885 - Inter(extra)polating instead of adding zeros. Also act when the arrays are filled with Nans
added 6 commits
-
66ae9885...99257b3a - 2 commits from branch
master
- a15c504c - Bugfix to store zeros when current data not available
- 86ac4201 - Limit the amount of warning in case of multiple missing data
- 7342f646 - Using numel instead of length and bugfix
- a4c23356 - Inter(extra)polating instead of adding zeros. Also act when the arrays are filled with Nans
Toggle commit list-
66ae9885...99257b3a - 2 commits from branch
added 2 commits
I updated
tcv_get_core_profiles.m
to interpolate instead of adding zeros when there is no current or conductivity data available, warning the user of what it is doing. This should make it a bit easier to use directly with RAPTOR and toray (or other codes). This also acts when the timeslice is full of Nans now. Nans could also be filtered and interpolated on the gdat level, but it should not hurt to armor this script as well since I was interpolating anyway...Edited by Michele Marinrequested review from @lsimons and removed approval
added 1 commit
- 7e67cc90 - Fixed indenting in tcv_get_ids_core_profiles.m
Hi @mmarin, sorry for complicating things ;) but wouldn't you always want to interpolate on the full time grid to ensure that the time grids are the same? Because now we assume that the time grids are the same just one time point is missing... can we be sure that this is always the case? What if they vary also on other indeces?
In principle yes, but this should not happen in the current implementation. What we could do (but in another issue) is to just re-interpolate all the 1d variables with the same method before we put them in the IDS. Then they would all use the same function and we can use some loop over the variables to have cleaner code. @osauter what do you think?
assigned to @mmarin