HeliotronJ Package¶
HeliotronJ
Package¶
HeliotronJ acquisition module
acq
Module¶
Heliotron J acquisition module.
-
class
pyfusion.acquisition.HeliotronJ.acq.
HeliotronJAcquisition
(*args, **kwargs)[source]¶ Bases:
pyfusion.acquisition.base.BaseAcquisition
Acquisition class for HeliotronJ data system.
fetch
Module¶
Heliotron J data fetchers.
-
class
pyfusion.acquisition.HeliotronJ.fetch.
HeliotronJDataFetcher
(acq, shot, config_name=None, **kwargs)[source]¶ Bases:
pyfusion.acquisition.base.BaseDataFetcher
Fetch the HJ data.
get_basic_diagnostics
Module¶
This is the first debugged version (for HJ) still needs cleaning up!
Originally a script in example (called get_basic_params - still there get the basic plasma params for a given shot and range of times interpolation overhead only begins at 10k points, doubles time at 1Million!!
-
pyfusion.acquisition.HeliotronJ.get_basic_diagnostics.
file_info
= {'b_0': {'name': 'IBHV', 'format': 'get_static_params({shot})'}, 'MICRO01': {'name': 'MICRO01', 'format': 'HeliotronJ'}, 'IBTB': {'name': 'IBTB', 'format': 'get_static_params({shot})'}, 'IBIV': {'name': 'IBIV', 'format': 'get_static_params({shot})'}, 'DIA135': {'name': 'DIA135', 'format': 'HeliotronJ'}, 'NBIS3I': {'name': 'NBIS3I', 'format': 'HeliotronJ'}, 'IBTA': {'name': 'IBTA', 'format': 'get_static_params({shot})'}, 'NBIS4I': {'name': 'NBIS4I', 'format': 'HeliotronJ'}, 'IBHV': {'name': 'IBHV', 'format': 'get_static_params({shot})'}, 'IBAV': {'name': 'IBAV', 'format': 'get_static_params({shot})'}}¶ LHD examples file_info.update({‘<n_e19>’: {‘format’: 'fircall@{0}.dat‘,’name’:’ne_bar(3[0-9]+)’}})
- file_info.update({‘n_e19b0’:
- {‘format’: 'fircall@{0}.dat‘,’name’:’ne_bar(3[0-9]+)’,
- ‘comment’: ‘central line avg density’}})
# this one is an average of two ~ mid radius chords - simple way # to reduce dependence on major axis position. file_info.update({‘n_e19dL5’:
- {‘format’: 'fircall@{0}.dat‘,
- ‘name’:’average:nL(4029|3399)’, ‘comment’: ‘mid_radius ne_dL, not nebar’}})
file_info.update({‘i_p’: {‘format’: 'ip@{0}.dat‘,’name’:’Ip$’}}) file_info.update({‘di_pdt’: {‘format’: 'ip@{0}.dat‘,’name’:’ddt:Ip$’}}) file_info.update({‘w_p’: {‘format’: 'wp@{0}.dat‘,’name’:’Wp$’}}) file_info.update({‘dw_pdt’: {‘format’: 'wp@{0}.dat‘,’name’:’ddt:Wp$’}}) file_info.update({‘dw_pdt2’: {‘format’: 'wp@{0}.dat‘,’name’:’ddt2:Wp$’}}) file_info.update({‘beta’: {‘format’: 'wp@{0}.dat‘,’name’:’<beta-dia>’}}) # syntax is full regexp - so need .* not * file_info.update({‘NBI’: {‘format’: 'nbi@{0}.dat‘,’name’:’sum:NBI.*.Iacc.’}}) file_info.update({‘ech’: {‘format’: ‘ech@{0}.dat’,’name’:’sum:.*’}}) file_info.update({‘b_0’: {‘format’: ‘lhd_summary_data.csv’,’name’:’MagneticField’}}) file_info.update({‘R_ax’: {‘format’: ‘lhd_summary_data.csv’,’name’:’MagneticAxis’}}) file_info.update({‘Quad’: {‘format’: ‘lhd_summary_data.csv’,’name’:’Quadruple’}}) file_info.update({‘Gamma’: {‘format’: ‘lhd_summary_data.csv’,’name’:’GAMMA’}}) file_info.update({‘NBI1Pwr’: {‘format’: ‘lhd_summary_data.csv’,’name’:’NBI1Power’}}) file_info.update({‘NBI2Pwr’: {‘format’: ‘lhd_summary_data.csv’,’name’:’NBI2Power’}})
-
pyfusion.acquisition.HeliotronJ.get_basic_diagnostics.
get_basic_diagnostics
(diags=None, shot=54196, times=None, delay=None, exception=False, debug=0)[source]¶ - return a list of np.arrays of normally numeric values for the
- times given, for the given shot. Will access server if env(‘IGETFILE’) points to an exe, else accesses cache Some diagnostics are
b_0, MICRO01, IBTB, IBIV, DIA135, NBIS3I, IBTA, NBIS4I, IBHV, IBAV
-
pyfusion.acquisition.HeliotronJ.get_basic_diagnostics.
get_flat_top
(shot=54196, times=None, smooth_dt=None, maxddw=None, hold=0, debug=0)[source]¶ debug=1 gives a plot
-
pyfusion.acquisition.HeliotronJ.get_basic_diagnostics.
localigetfilepath
= '/tmp/igetfiletmp/'¶ Make a list of diagnostics, and how to obtain them, as a dictionary of dictionaries: Top level keys are the short names for the dignostics Next level keys are
format: format string to generate file name from shot. name: wild card name to find in the file headerFor the case of static parameters, the ‘format’ field is a csv file containing them all.
get_hj_modules
Module¶
make_static_param_db
Module¶
Extract the magnetic field and other static parameters of Heliotron J into a dictionary of arrays
E4300: 90 entries/second excluding time in save_h_j_data
- Uses exec of a dict - very fast!
- timeit exec(‘d=dict(‘+’‘.join(lines[5:-1]).replace(chr(0),’‘)+’)’) 144us
-
pyfusion.acquisition.HeliotronJ.make_static_param_db.
get_static_params
(shot, signal='DIA135', exe='/home/bdb112/pyfusion/working/pyfusion/pyfusion/acquisition/HeliotronJ/prl6/save_h_j_data', press_on=True)[source]¶
-
pyfusion.acquisition.HeliotronJ.make_static_param_db.
make_param_db
(max_shot=70000, file_name='HJparams.npz', shot_range=[50000, 50001, 50002, 50003, 50004, 50005, 50006, 50007, 50008, 50009], signal='DIA135', db=None, exe='/home/bdb112/pyfusion/working/pyfusion/pyfusion/acquisition/HeliotronJ/prl6/save_h_j_data')[source]¶