#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Tue Sep 24 14:20:41 EDT 2019 from datetime import datetime import os.path, sys, os import xarray as xr, numpy as np, pandas as pd import matplotlib.pyplot as plt from geoplots import mapplot if __name__ == '__main__': tformat = '%Y-%m-%d %H:%M:%S' t0 = datetime.now() print('[start]:', t0.strftime(tformat)) t1 = datetime.now() print('[end]:', t1.strftime(tformat)) print('[total time]:', f'{(t1-t0).seconds:,} seconds') figname = 'fig_map_lintrend.png' plt.figure() ifile = 'data/m6p0sol_CTL1860_tigercpu_intelmpi_18_576PE.t_surf.lintrend.0101-0110.nc' ds = xr.open_dataset(ifile) ds.slope.plot() plt.title('linear trend: 0101-0110, K/year') mapplot() plt.savefig(figname.replace('.png', '__0101-0110.png')) plt.figure() ifile = 'data/m6p0sol_CTL1860_tigercpu_intelmpi_18_576PE.t_surf.lintrend.0201-0400.nc' ds = xr.open_dataset(ifile) ds.slope.plot() plt.title('linear trend: 0201-0400') mapplot() plt.savefig(figname.replace('.png', '__0201-0400.png')) plt.figure() ifile = 'data/m6p0sol_CTL1860_tigercpu_intelmpi_18_576PE.t_surf.lintrend.0451-0550.nc' ds = xr.open_dataset(ifile) ds.slope.plot() plt.title('linear trend: 0451-0550') mapplot() plt.savefig(figname.replace('.png', '__0451-0550.png')) plt.figure() ifile = 'data/m6p0sol_CTL1860_tigercpu_intelmpi_18_576PE.t_surf.lintrend.0561-0590.nc' ds = xr.open_dataset(ifile) ds.slope.plot() plt.title('linear trend: 0561-0590') mapplot() plt.savefig(figname.replace('.png', '__0561-0590.png'))