MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
239 stars 319 forks source link

Gtm/interactive postprocessing #1158

Closed guilhermeltm closed 6 months ago

guilhermeltm commented 6 months ago

Module for interactively plotting time series from MPAS raw output files at particular points. Usage example from Python shell:

######################################################################## import matplotlib.pyplot as plt; from interactive_ts import ts, plot_ts

dir='/path/to/data'; stream='history'; t0='2021-01-01 00:00:00'; tf='2021-01-02 18:00:00'; dt='10800'; var='swdnb'; lat='-52'; lon='-2'; vertlevel='0'

t1,y1,label1=ts(dir=dir,stream=stream,t0=t0,tf=tf,dt=dt,var=var,lat=lat, lon=lon,vertlevel=vertlevel)

var='swupb'

t2,y2,label2=ts(dir=dir,stream=stream,t0=t0,tf=tf,dt=dt,var=var,lat=lat, lon=lon,vertlevel=vertlevel)

y3=y1+y2 label3='total'

plot_ts(t1,y1,label1,ofile='y1.png') plot_ts(t2,y2,label2,ofile='y1_y2.png') plot_ts(t2,y3,label3,ofile='y1_y2_y3.png') ########################################################################