import datetime
import h5py
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.colors import Normalize
from sys import exit
import argparse
import os
#*********Turn off devide zero error in numpy**********#
np.seterr(divide = 'ignore')
#*********parser for get filename and select plot**********#
parser = argparse.ArgumentParser(description='Data plotter for KEMPO1')
#---关键语句---#
parser.add_argument('filename', nargs='*', help='file names of data <e.g> parabolic_051.h5')
#---关键语句---#
parser.add_argument('-p', '--power', action='store_true', help="plot the temporal and spatial profile of Bw")
parser.add_argument('-d', '--dynamic-spectrum', action='store_true', help='plot dynamic spectrum at x=20, 60')
parser.add_argument('-v', '--velocity-dist', action='store_true', help='plot velocity distribution at x=20')
parser.add_argument('-r', '--resonant-current', action='store_true', help='plot -je, jb and jb/Bw')
args = parser.parse_args()
if not args.filename:
exit("Error: Filename is missing. Please specify data file.\n <e.g.> python plot_data.py parabolic_05.h5")
"""
Set plot
"""
is_power = args.power
is_dynamic = args.dynamic_spectrum
is_vdist = args.velocity_dist
is_res = args.resonant_current
#--- 将is_power is_dynamic is_vdist is_res置为true ---#
if not (is_power | is_dynamic | is_vdist | is_res):
is_power = True
is_dynamic = True
is_vdist = True
is_res = True
print(is_power)
print(is_dynamic)
print(is_vdist)
print(is_res)
print(datetime.datetime.now())
[python调试笔记] 将is_power is_dynamic is_vdist is_res置为true
猜你喜欢
转载自blog.csdn.net/qq_39154376/article/details/121312332
今日推荐
周排行