Option to use decimated MDSplus data
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
This script
|
||||
"""
|
||||
|
||||
from MDSplus import Tree
|
||||
import argparse
|
||||
|
||||
|
||||
MDSTREENAME = 'rtappisttok'
|
||||
|
||||
def main(args):
|
||||
mdsPulseNumber = args.shot
|
||||
|
||||
try:
|
||||
if(mdsPulseNumber > 0):
|
||||
tree = Tree(MDSTREENAME)
|
||||
tree.setCurrent(mdsPulseNumber)
|
||||
#else:
|
||||
tree.close()
|
||||
|
||||
except:
|
||||
print(f'Failed opening {MDSTREENAME} for pulse number {mdsPulseNumber:d}')
|
||||
exit()
|
||||
|
||||
print(f'Last Pulse for {MDSTREENAME} is {mdsPulseNumber:d}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description = 'Script to synchronize ISTTOK shot number')
|
||||
|
||||
parser.add_argument('-s', '--shot', type=int, help='Mds+ pulse Number ([1, ...])', default=100)
|
||||
|
||||
args = parser.parse_args()
|
||||
main(args)
|
||||
# vim: set syntax=python ts=4 sw=4 sts=4 sr et
|
||||
42
Startup/pulse-ketchup.py
Executable file
42
Startup/pulse-ketchup.py
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
This script resets the MDSplus pulseNumber of Tree
|
||||
"""
|
||||
from MDSplus import Tree
|
||||
from MDSplus.mdsExceptions import TreeFOPENR
|
||||
import argparse
|
||||
|
||||
|
||||
MDSTREENAME = 'rtappisttok'
|
||||
|
||||
|
||||
def main(args):
|
||||
mdsPulseNumber = args.shot
|
||||
|
||||
try:
|
||||
if (mdsPulseNumber > 0):
|
||||
tree = Tree(MDSTREENAME)
|
||||
tree.setCurrent(mdsPulseNumber)
|
||||
# else:
|
||||
tree.close()
|
||||
|
||||
except TreeFOPENR:
|
||||
print(f'Failed opening {MDSTREENAME} for '
|
||||
f'pulse number {mdsPulseNumber:d}')
|
||||
exit()
|
||||
|
||||
print(f'Last Pulse for {MDSTREENAME} is {mdsPulseNumber:d}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Script to synchronize ISTTOK shot number')
|
||||
|
||||
parser.add_argument('-s', '--shot',
|
||||
type=int, help='Mds+ pulse Number ([1, ...])',
|
||||
default=99)
|
||||
|
||||
args = parser.parse_args()
|
||||
main(args)
|
||||
|
||||
# vim: set syntax=python ts=4 sw=4 sts=4 sr et
|
||||
Reference in New Issue
Block a user