SCRIPTS DATA_GATHERING OMFITthomson_demoΒΆ

# -*-Python-*-
# Created by eldond at 2018 Aug 15  09:16

"""
This script demonstrates use of the OMFITthomson class for gathering, mapping,
and doing quality control on Thomson scattering data.

defaultVars parameters
----------------------
:param device: string
    Which tokamak or MDS server?
:param shot: int
:param efitid: string
    Name of EFIT tree to use for mapping measurement locations to flux-space, like 'EFIT01' or 'EFIT03'
"""


defaultVars(device='DIII-D', shots=[154749, 154754, 161558], efitid='EFIT03')

out = root['OUTPUTS']['OMFITthomson_demo'] = OMFITtree()
datasets = out['datasets'] = OMFITtree()

# Get TS data for a few shots of interest
for shot in shots:
    tf = out['ts_{}'.format(shot)] = OMFITthomson(device=device, shot=shot, efitid=efitid)
    tf()
    datasets[shot] = tf.to_dataset()
# Wow, that was pretty easy! What should we do next?


# Get TS data for a few different revisions
revision_numbers = [-1, 0, 1, 2]
revscan = out['revision_scan'] = OMFITtree()
# Save time by sharing an OMFITelm instance between OMFITthomson instances w/ same shot but different revisions.
elm = OMFITelm(device=device, shot=shots[0])
elm.detect()
for rev_num in revision_numbers:
    tf = revscan[rev_num] = OMFITthomson(device=device, shot=shots[0], efitid=efitid, revision_num=rev_num, elm_filter=elm)
    tf()