MIT-PSFC / disruption-py

An open-source physics-based Scientific Framework for Disruption Analysis of Fusion Plasmas for AI/ML applications
https://mit-psfc.github.io/disruption-py/
MIT License
9 stars 0 forks source link

DIII-D EFIT results mismatch between EFIT01 and DIS #238

Open yumouwei opened 2 months ago

yumouwei commented 2 months ago

Description of the problem

Sample figures

For the following figures I used a 1ms sampling rate to negate any effect caused by the different time basis between different EFIT trees.

161228 (disruptive shot) Using efit_nickname_setting='disruption' refers to EFIT04 which is the runtag=DIS tree. image

166177 (non-disruptive shot) NOTE: in the MATLAB SQL DB, data of this shot were populated using EFIT05 (runtag=DIS) instead of EFIT01 despite being considered as a non-disruptive shot. For this reason running python tests/test_against_cache.py with any EFIT signal will result in failure with data (data mismatch). image

Related Issues & PRs

gtrevisan commented 2 months ago

other questions:

actual behavior of EFIT trees changed with:

yumouwei commented 2 months ago

Also, note that this mismatch between the vanilla tree vs the disruption tree only occurs on DIII-D. I did not notice any difference between analysis and efit18 during the regular discharge period on CMOD.

yumouwei commented 2 months ago

Additional affected signals

166177 (non-disruptive shot). MDSplus data retrieved using the efit05 tree instead of efit01 by default of disruption-py. Note the difference of greenwald_fraction prior to the disruption, which is likely caused by the different extrapolation methods used by MATLAB & disruption-py. Update: currently the aminor obtained from disruption-py is computed using the get_shape_parameters() function. This function checks chisq and replaces the values of time slices where chisq > 50 with nan. The greenwald_fraction calculation does perform the check chisq and use all available aminor data to do the calculation, which is why greenwald_fraction has data in the time slices where aminor has nan values.

image

Forcing get_density_parameters() method to also return aminor (bypass the chisq check) image

gtrevisan commented 1 month ago

are you able to recreate your initial plot for 161228 with time 1 s < t < 3 s ? unless I'm mistaken, it would be interesting to see the actual data points (with dot markers) without disruption-py interpolating stuff. can you use timebase = efit and then use, say, linestyle ro for the background line, and linestyle b. for the foreground line?

yumouwei commented 1 month ago

image

This one is done using the latest dev branch (9f3e485) and time_setting='disruption'. It looks like the errors are intrinsic from EFIT instead of disruption-py doing strange interpolation/extrapolation.

gtrevisan commented 1 month ago

thanks for double checking, what are actually the time steps here for the two efit trees? we'll have to ask the gurus wrt the inputs possibly being different.

yumouwei commented 1 month ago

They are both sampled at every 0.025 s during that time period. By the end of the shot the sampling rate increased to every 0.002 s.