-
Notifications
You must be signed in to change notification settings - Fork 0
How to use
Input data can be 1d numpy arrays (timeseries) or 3d numpy arrays with dimensions (time, lat, lon).
from granger4climate import G4C, G4CPlotting
import numpy as np
cfc = 1d_or_3d_numpy_array
sic = 1d_or_3d_numpy_array
processor = G4C(cfc, sic, 'cfc', 'sic')
Create instance
processor.run_causalitytest(maxlag=15, do_correlation=True)
Run tests
processor.save_results('/path/to/save/result/ncfile')
Saves results as netCDF4 file
plotter = G4CPlotting(processor)
OR
plotter = G4CPlotting('/path/to/save/result/ncfile/*.nc')
Plotting of 1D input data results
If /path/to/save/filename.png is passed as argument data are saved, only shown else.
plotter.plot_1d_lags()
Visualizes F-statistics and p-value for every model order
plotter.plot_1d_auxdata()
Shows raw and prepared input data timeseries
Plotting of 3D input data results
If /path/to/save/filename.png is passed as argument data are saved, only shown else.
import cartopy.crs as ccrs
Define projections for gridded plotting
proj_params = {'iproj': ccrs.PlateCarree(), 'oproj': ccrs.NorthPolarStereo(), 'extent': [-180, 180, 60, 90], 'resolution': 0.5}
Run 2D plotting.
plotter.plot_2d_maps(orders=[1, 5, 10], proj_params=proj_params)