Skip to content

Improve time settings#439

Merged
gtrevisan merged 59 commits intodevfrom
wei/improve-signal-time-setting
May 7, 2025
Merged

Improve time settings#439
gtrevisan merged 59 commits intodevfrom
wei/improve-signal-time-setting

Conversation

@yumouwei
Copy link
Copy Markdown
Contributor

@yumouwei yumouwei commented Apr 9, 2025

Implemented changes

  • GLT: introduced _postprocess for deduplication and unit conversion,
  • EfitTimeSetting
    • Add d3d_times().
    • Create a generic get_efit_times method.
  • IpTimeSetting
    • Add cmod_times and east_times
    • Fix unit conversion in d3d_times
    • Add use_efit_time_range (default to False) option to remove time points outside the range of the EFIT timebase.
  • SignalTimeSetting
    • Add d3d wrapper function to allow using e.g. tree_name="ptdata", signal_path="ip"
  • Other changes
    • Fix all np.where output syntax Fix get_end_of_shot method in time_setting #443
    • Figure out how to get the dimension from MDSplus to do unit conversion without hardcoding it based on the device.
    • Set up test cases in test_retrieval_settings.py.

Figures

image

@yumouwei
Copy link
Copy Markdown
Contributor Author

yumouwei commented Apr 9, 2025

Misclicked Merge instead of Rebase

@yumouwei yumouwei added machine: DIII-D Related to the DIII-D tokamak and removed machine: DIII-D Related to the DIII-D tokamak labels Apr 9, 2025
@yumouwei yumouwei force-pushed the wei/improve-signal-time-setting branch from 87febc2 to 93a51f2 Compare April 23, 2025 19:03
@yumouwei yumouwei changed the title Improve SignalTimeSetting Improve time settings Apr 23, 2025
@yumouwei yumouwei force-pushed the wei/improve-signal-time-setting branch from a78e6b5 to 6bd670d Compare April 23, 2025 21:43
@yumouwei
Copy link
Copy Markdown
Contributor Author

yumouwei commented Apr 24, 2025

params.mds_conn.get(f"units_of(dim_of({self.signal_path})), self.tree_name).data()

returns the unit of the signal's timebase. However, this does not work for any PTDATA signal; e.g.

params.mds_conn.get("units_of(dim_of(ptdata("ip", 161228))).data()

returns a whitespace character (' ').

There is a PTDATA expression (ptunits("ip", 161228)) for getting the unit of a signal, but I can't figure out how to wrap it to get the unit of that signal's timebase.

Update

Upon checking on CMOD, I found that params.mds_conn.get(f"units_of(dim_of(\efit_aeqdsk:ali)), "_efit_tree").data() also returns a whitespace, even though both "units_of(\efit_aeqdsk:atime)" and "units_of(\efit_aeqdsk:time)" give the correct unit of second. I need to take a look at this again, but if this doesn't work then we should give up on the idea of creating a machine independent EFIT timebase method.

Copy link
Copy Markdown
Member

@gtrevisan gtrevisan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool! we should be able to talk in person and iron out the last details.

@gtrevisan gtrevisan marked this pull request as draft April 29, 2025 15:14
@gtrevisan
Copy link
Copy Markdown
Member

okay, SharedTimeSetting should be much better! LMK.

@gtrevisan gtrevisan force-pushed the wei/improve-signal-time-setting branch from d669f8c to 46654d9 Compare April 29, 2025 20:08
@yumouwei yumouwei force-pushed the wei/improve-signal-time-setting branch from de69629 to cd640d3 Compare April 30, 2025 14:36
@yumouwei yumouwei marked this pull request as ready for review April 30, 2025 14:43
@yumouwei
Copy link
Copy Markdown
Contributor Author

test_time_setting.py passed on EAST

@yumouwei yumouwei force-pushed the wei/improve-signal-time-setting branch from cfc33d2 to 354981f Compare May 5, 2025 13:52
@gtrevisan
Copy link
Copy Markdown
Member

gtrevisan commented May 5, 2025

to do:

  • refactor all time parameters into machine configs,
  • refactor common lines into new common functions,
  • ...

@yumouwei yumouwei requested a review from gtrevisan May 6, 2025 16:52
@gtrevisan gtrevisan force-pushed the wei/improve-signal-time-setting branch from 8884fb6 to 9053102 Compare May 7, 2025 13:48
@gtrevisan gtrevisan merged commit cb244c7 into dev May 7, 2025
12 checks passed
@gtrevisan gtrevisan deleted the wei/improve-signal-time-setting branch May 7, 2025 13:58
@gtrevisan gtrevisan mentioned this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants