Skip to content
Snippets Groups Projects

Bugfix to store zeros when current data not available

Merged Michele Marin requested to merge bugfix/currents_overflow into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Luke Simons
  • Michele Marin added 1 commit

    added 1 commit

    • 369440b4 - Limit the amount of warning in case of multiple missing data

    Compare with previous version

  • Michele Marin added 1 commit

    added 1 commit

    • a3cd915c - Using numel instead of length and bugfix

    Compare with previous version

  • Luke Simons approved this merge request

    approved this merge request

  • Luke Simons added 62 commits

    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

    Compare with previous version

  • Michele Marin added 1 commit

    added 1 commit

    • 66ae9885 - Inter(extra)polating instead of adding zeros. Also act when the arrays are filled with Nans

    Compare with previous version

  • Michele Marin added 6 commits

    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

    Compare with previous version

  • Michele Marin added 1 commit

    added 1 commit

    Compare with previous version

  • Michele Marin added 2 commits

    added 2 commits

    • 1233e92f - single quotes instead of double quotes
    • 16246aff - printing times instead of indexes

    Compare with previous version

  • 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 Marin
  • Michele Marin requested review from @lsimons and removed approval

    requested review from @lsimons and removed approval

  • Luke Simons added 1 commit

    added 1 commit

    • 7e67cc90 - Fixed indenting in tcv_get_ids_core_profiles.m

    Compare with previous version

  • 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

  • I finished my review and tested with:

    shot=[59151];
    idss_core_profiles = gdat(shot,'ids','source','core_profiles');

    I think this is ready to be merged after open threads are resolved

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading