In [ ]:
    
%matplotlib inline
import pandas as pd
import numpy as np
try:
    import xarray as xray 
except: 
    import xray
import matplotlib.pyplot as plt
    
In [2]:
    
import sys
    
In [3]:
    
sys.path.insert(0, '../')
    
In [4]:
    
from paleopy import proxy 
from paleopy import analogs
from paleopy.plotting import scalar_plot
    
In [5]:
    
djsons = '../jsons/'
pjsons = '../jsons/proxies'
    
In [6]:
    
p = proxy(sitename='Rarotonga', \
          lon = -159.82, \
          lat = -21.23, \
          djsons = djsons, \
          pjsons = pjsons, \
          pfname = 'Rarotonga.json', \
          dataset = 'ersst', \
          variable ='sst', \
          measurement ='delta O18', \
          dating_convention = 'absolute', \
          calendar = 'gregorian',\
          chronology = 'historic', \
          season = 'DJF', \
          value = 0.6, \
          qualitative = 0, \
          calc_anoms = 1, \
          detrend = 1, \
        method = 'quintiles')
    
In [8]:
    
p.find_analogs()
    
In [10]:
    
p.proxy_repr(pprint=True)
    
    
In [11]:
    
p.analog_years
    
    Out[11]:
In [12]:
    
p.analogs
    
    Out[12]:
In [14]:
    
p.proxy_repr(pprint=False, outfile=True)
    
In [15]:
    
!ls -lt ../jsons/proxies/Rarotonga.json
    
    
In [16]:
    
f = p.plot_season_ts()
    
    
In [26]:
    
compos = analogs(p, 'ncep', 'hgt_1000').composite()
    
In [27]:
    
f = scalar_plot(compos, test=0.1).plot(subplots=False)
    
    
In [28]:
    
f = scalar_plot(compos, test=0.1, proj='cyl', domain=[165, 180, -50., -30], res='h').plot(subplots=False)
    
    
In [29]:
    
f = scalar_plot(compos, test=0.1, proj='cyl', domain=[165, 180, -50., -30], res='h').plot(subplots=True)
    
    
In [30]:
    
compos = analogs(p, 'vcsn', 'TMean').composite()
    
In [31]:
    
f = scalar_plot(compos, test=0.1, proj='cyl', res='h', vmin=-0.5, vmax=0.5).plot(subplots=False)
    
    
In [32]:
    
compos.dset
    
    Out[32]:
In [40]:
    
compos.save_to_file('/Users/nicolasf/Desktop/vcsn_tmean.nc')
    
In [41]:
    
!ncdump -h /Users/nicolasf/Desktop/vcsn_tmean.nc
    
    
In [42]:
    
compos = analogs(p, 'ersst', 'sst').composite()
    
In [43]:
    
f = scalar_plot(compos, test=0.1).plot(subplots=False)
    
    
In [44]:
    
f = scalar_plot(compos, test=0.1, proj='spstere').plot(subplots=False)
    
    
In [38]:
    
compos.dset
    
    Out[38]:
In [39]:
    
compos.save_to_file('/Users/nicolasf/Desktop/ersst_sst.nc')
    
In [45]:
    
!ncdump -h /Users/nicolasf/Desktop/ersst_sst.nc
    
    
In [ ]: