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 dataparabolic_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 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 print(is_power) print(is_dynamic) print(is_vdist) print(is_res) print(datetime.datetime.now())
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)