Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get _density_parameters for DIII-D #249

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

yumouwei
Copy link
Collaborator

@yumouwei yumouwei commented Aug 1, 2024

Implemented changes

  • Removed fill_value="extrapolation" in ne and dne_dt calculations which previously caused strange behaviors at the end of the shot.
  • Broke up the overreaching try-except block into two separate blocks.
  • Added conditional block to use \denv2 from d3d tree if density data isn't available.
  • Added docstring.

These changes will not resolve the XFAILs of these three parameters, as they were caused by using the different EFIT tree than the one which the SQL table was created from.

Related issues, PRs & references

@yumouwei yumouwei requested a review from gtrevisan August 1, 2024 20:09
@yumouwei yumouwei marked this pull request as draft August 1, 2024 20:34
@yumouwei yumouwei marked this pull request as ready for review August 2, 2024 14:47
@gtrevisan gtrevisan merged commit 5172112 into dev Aug 12, 2024
8 checks passed
@gtrevisan gtrevisan deleted the wei/d3d-fix-get-density-parameters branch August 12, 2024 14:35
@gtrevisan gtrevisan mentioned this pull request Aug 12, 2024
yumouwei added a commit that referenced this pull request Sep 4, 2024
* remove extrapolation in interp1 for ne & dn_dt

* Add docstring

* Update references

* !black

* Update TODO

* Completed method, reorganized try-except blocks

* minor change to trigger tests

---------

Co-authored-by: gtrevisan <gtrevisan@users.noreply.github.com>
gtrevisan added a commit that referenced this pull request Sep 4, 2024
* Add note

* Add note to SQL table column names

* Align column names with SQL table

* Fix _get_ne_te

* Minor change

* debug te & ne_pf.

* Debug, method overestimates te & ne pf

* Debug rad_pf

* Debug rad peaking

* Remove some #BUG

* Debug, TS pf methods appear to be correct

* implement ts_equispaced, doesn't resolve mismatch

* minor

* minor

* Debug, fix upper & lower channel orders

* Debug prad peakings

* Corrrect divertor bolometer chords indicing

* minor

* minor

* debug TS peaking factors

* plotting

* Switch (r, z) indices in  interpolator

* Clean up notes in TS pf calculations

* Clean up

* Debug & complete _get_p_rad

* Clean up, add docstring, resolve conflicts

* Resolve conflicts

* clean up

* Remove debug loggers

* Add 4 outputs to TEST & XFAIL. black.

* Rename to matlab_gsastd

* black

* minor

* minor

* Remove CMOD features not in SQL DB (#182)

* Remove CMOD features unavailable in SQL DB

* Remove z_error from Cmod XFAIL list

* Compare nodenames (#185)

* Add script to get original node name from alias

* Revamp script, add tqdm loader

* Remove tqdm

* Remove database, allow for stdin

* Fix linting and simplify inputs args

* Hardcode default shotlist; other small fixes

* Fix docstring

* Add expression label, reduce getRecord calls

* Fix expression logic

* Catch another exception

* Change exceptions to warnings, log results in a local json file

* Add expected expression argument

* Better expression regex

* Fix mds Tree import; black

* other pylint fixes

* isort, simpler dictionary, other small changes

* Handle multidimensional shotlist input (#178)

* Handle multidimensional shotlist input, test multidimensional shotlist input

* Handle multidim numpy; refactor test

* rename some variables

* Update and lock deps (#259)

* update minor versions

* lock deps

* temporarily add 3 failed DIII-D tests to XFAILs

* bump minor version for disruption-py

* Fix get_ohmic_parameters and get_power_parameters in the DIII-D branch (#234)

* debug

* Fixed all associated functions of math.gsastd()

* Fixed v_loop computation. p_ohm is still wrong

* minor

* Fix gsastd. p_ohm is still off by 1e6

* Completed invalid_indices computation.

* Added *1e-7 in inductance calculation.

* Added ends_type = 1 case in math.sa()

* !black

* Fix p_nbi

* Fix p_ech

* debug p_rad

* debug

* debug

* Clean up & add docstrings; incomplete

* Clean up get_ohmic_parameters() after validation

* Remove 5

* Clean up get_power_parameters

* Clean up get_ohmic_parameters

* Add matlab_ prefix to inherited matlab functions

* Final cleanup & !black

* Add signals to TEST_ & XFAIL_COLUMNS

* Fix bol_time indexing

* Modify math.matlab_power

---------

Co-authored-by: Gregorio L. Trevisan <gtrevisan@users.noreply.github.com>

* DIII-D fix get _density_parameters (#249)

* remove extrapolation in interp1 for ne & dn_dt

* Add docstring

* Update references

* !black

* Update TODO

* Completed method, reorganized try-except blocks

* minor change to trigger tests

---------

Co-authored-by: gtrevisan <gtrevisan@users.noreply.github.com>

* DIII-D fix get_rt_density_parameters methods (#251)

* Added TODOs

* Implemented changes

* Add docstring

* DIII-D fix get_kappa_area (#256)

* Fix kappa_area

* !black & complete docstring

* DIII-D fix get_n1rms_parameters (#257)

* Fix

* Add reference

* !black

* DIII-D modify get_shape_parameters (#258)

* Fix

* minor change

* Add reference

* minor

* remove some DIII-D tests for xfails

#239
#251
#257

* DIII-D fix get _rt _ip_parameters (#254)

* Correct outputs

* Add todos

* Replace np.grad with matlab_gradient_1d_vectorized

* Add docstring

* Add ref to PR

* !black

* Rewind to np.gradient

* Remove power_supply_railed output

* rerun isort

* Fix logic for running physics methods based on tokamak parameter (#252)

* Fix empty tokamak check

* Don't set tokamak to empty list

* Add test

* Remove hardcoded cmod tokamak

* Use shotlist fixture

* shebang, pylint

* Revamp test features (#262)

* Fix default nickname multiprocessing bug

* Add DoNotConnect for MDS

* More detailed retrieval settings tests

* Add dict output test

* Move output settings test to new file

* Combine sql test with other output setting tests

* Swap wrong cmod/d3d default nicknames

* move fixture above tests

* Remove series test for only_requested_columns

* Replace funcs with StaticNicknameSetting

* Remove hardcode dummy mdsplus conn; add assert to check sql data exists; rename test

* Use consistent shot order in domain test

* Fix spelling

* Swap assert order

* Output DataFrame for csv, hdf5

* Read and write data looping

* Remove efit time for compatability wit d3d

* Change fetched parameters + skip domain for D3D

* Allow writing NULL to sql; fix test for d3d

* Remove shot cleanup; remove unused test arguments

* remove stream reference in workflow; move decorator to conftest

* Add stream cleanup back in; small fixes

* skip sql writeback test on fast

* Remove unused

* Fix long lines (#270)

* CMOD implement ne & pressure peaking factors (#268)

* Add comments

* Implement ne & pressure PF

* Combine all three for-loops

* Restore compare_ts_tci to runnable state

* Add USE_TS_TCI_CALIBRATION flag

* Move calib out of try-except block

* Update docstring, black

* Clean up

* minor

* Change docstring, add line comment

* Comment

* comment

* comment

* Move TS-TCI calib functions to thomson.py

* Clean up physics.py imports

* rename TS class to include Cmod

---------

Co-authored-by: gtrevisan <gtrevisan@users.noreply.github.com>

* Remove unnecessary try-except blocks

* black

* minor

* minor

* black

---------

Co-authored-by: amdecker <amdecker9@gmail.com>
Co-authored-by: Gregorio L. Trevisan <gtrevisan@users.noreply.github.com>
@gtrevisan gtrevisan changed the title DIII-D fix get _density_parameters Fix get _density_parameters for DIII-D Sep 16, 2024
@gtrevisan gtrevisan added the machine: DIII-D Related to the DIII-D tokamak label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
machine: DIII-D Related to the DIII-D tokamak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants