from IPython.display import Image
Image(url='https://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/jservon/CliMAF_Notebooks_html/CliMAF-logo-small.png')
The goals of CliMAF are to provide the scientists with simplified and science-oriented means for :
In this notebook we will see:
from climaf.api import *
clog('critical') # min verbosity = critical < warning < info < debug = max verbosity
# -- We use ds() to get the dataset
dat_cmip5 = ds(project='CMIP5',
model='CNRM-CM5',
variable='tos',
experiment='historical',
period='1980-1981',
frequency='monthly',
)
summary(dat_cmip5)
# -- summary() gives the list of files found by ds() and the pairs 'facets':'values' associated with the request
# -> The user can then refine the request to select only one file
# -> in this case,
dat_cmip5.explore('choices')
# -- We use ds() to get the dataset
dat_cmip5 = ds(project='CMIP5',
model='CNRM-CM5',
variable='*',
experiment='historical',
period='1980-1981',
frequency='monthly',
)
dat_cmip5.explore('choices')
dat_cmip5 = ds(project='CMIP5',
model='CNRM-CM5',
variable='*',
experiment='historical',
period='1980-1981',
frequency='monthly',
table='Amon'
)
dat_cmip5.explore('choices')
summary(dat_cmip5)
dat_cmip5 = ds(project='CMIP5',
model='CNRM-CM5',
variable='tos',
experiment='historical',
period='1980-1981',
frequency='monthly'
)
dat_cmip5.crs
dat_cmip5 = dat_cmip5.explore('resolve')
summary(dat_cmip5)
dat_cmip5.crs
https://github.com/WCRP-CMIP/CMIP6_CVs/blob/master/CMIP6_table_id.json
Basically, a table is a combination of the realm considered (A for atmosphere, O for ocean, SI for Sea Ice, etc.) and the frequency (mon for monthly, day for daily, etc.)
dat_cmip6 = ds(project='CMIP6', variable='pr', period='*', table='Amon', model='CNRM-CM6-1')
dat_cmip6.explore('choices')
ok_dat_cmip6 = dat_cmip6.explore('resolve')
summary(ok_dat_cmip6)
dat_cmip6 = ds(project='CMIP6', variable='pr', period='*', table='Amon', model='CNRM-CM6-1', realization='*')
dat_cmip6.explore('choices')
test = ds(project='CMIP5',
model='CNRM-CM5',
variable='tas',
experiment='historical',
period='1980-1981',
frequency='monthly',
domain=[20,80,-80,40] # or domain='20,80,-80,40'
)
implot(test)
req_cmip5_extent = ds(project='CMIP5_extent', variable='tas', experiment='historical',
model='IPSL-CM5A-MR', period='1990-2010', table='Amon', version='latest')
req_cmip5_extent.explore('choices')
ok_req_cmip5_extent = req_cmip5_extent.explore('resolve')
summary(ok_req_cmip5_extent)
req_cmip5_extent = ds(project='CMIP5_extent', variable='tas', experiment='historical',
model='*', period='1990-2010', table='Amon', version='latest')
ens_cmip5_extent = req_cmip5_extent.explore('ensemble')
summary(ens_cmip5_extent)
# -- ok_ens_cmip5_extent will be the checked ensemble
ok_ens_cmip5_extent = ens_cmip5_extent.copy()
for elt in ens_cmip5_extent:
print elt
if not check_time_consistency_CMIP(ens_cmip5_extent[elt]):
print 'period not covered for ',elt
ok_ens_cmip5_extent.pop(elt)
for elt in ok_ens_cmip5_extent:
print elt
if not check_time_consistency_CMIP(ok_ens_cmip5_extent[elt]):
print 'period not covered for ',elt
summary(ok_ens_cmip5_extent)
projects()
req_cordex = ds(project='CORDEX', variable='tas', frequency='daily', period='1980-2005',root='/bdd')
req_cordex.explore('choices')
# -- Example with CORDEX_extent and one RCM (model)
cordex_extent = ds(project='CORDEX_extent', period='1990-2010', variable='tas', frequency='daily',
model_version='v1', CORDEX_domain='EUR-44', model='SMHI-RCA4')
cordex_extent.explore('choices')
cordex_adjust = ds(project='CORDEX-Adjust', period='*', variable='tasmax')
cordex_adjust.explore('choices')
req_ipsl = ds(project='IGCM_OUT',
login='p86denv',
model='IPSLCM6',
simulation='CM6013-pi-01',
experiment='piControl',
DIR='OCE',
frequency='seasonal',
clim_period='*',
variable='tos')
req_ipsl.explore('choices')
ref_climato = ds(project='ref_climatos', variable='pr')
print 'explore("choices"):'
print ref_climato.explore('choices')
print ' -- '
print 'Summary:'
summary(ref_climato)
from climaf.api import *
ref_ts = ds(project='ref_ts', variable='pr', period='*')
print 'explore("choices"):'
print ref_ts.explore('choices')
print ' -- '
print 'Summary:'
summary(ref_ts)
ref_ts.explore('choices', group_periods_on='product', operation=None)
eobs = ds(project='E-OBS')
eobs.explore('choices')
summary(eobs)