Show exceptions

[1]:
import os
os.environ['ROOK_URL'] = 'http://rook.dkrz.de/wps'

from rooki import rooki

check that subset operator is working

[2]:
resp = rooki.subset(
    collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',
    time='1985-01-01/2014-12-30',
)
resp.ok
[2]:
True

Error: missing collection parameter

[3]:
try:
    resp = rooki.subset()
except TypeError as e:
    print(f"{e}")
subset() missing 1 required positional argument: 'collection'

Check which time range is available

[4]:
resp = rooki.subset(
    collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',
)
resp.ok
[4]:
True
[5]:
resp.download_urls()
[5]:
['https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cmip6/CMIP/IPSL/IPSL-CM6A-LR/historical/r1i1p1f1/Amon/rlds/gr/v20180803/rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_185001-201412.nc']

Error: not available time range

[6]:
resp = rooki.subset(
    collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',
    time='2100-01-01/2200-12-30',
)
resp.ok
 owslib.wps.WPSException : {'code': 'NoApplicableCode', 'locator': 'None', 'text': 'Process error: No files found in given time range for c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803'}
[6]:
False
[7]:
resp.status
[7]:
'Process error: No files found in given time range for c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803'

Error: invalid time parameter

[8]:
resp = rooki.subset(
    collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',
    time='1900-01-01',
)
resp
 owslib.wps.WPSException : {'code': 'NoApplicableCode', 'locator': 'None', 'text': 'Process error: TimeParameter should be passed in as a range separated by /'}
[8]:
Process error: TimeParameter should be passed in as a range separated by /
[9]:
resp = rooki.subset(
    collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',
    time='today',
)
resp
 owslib.wps.WPSException : {'code': 'NoApplicableCode', 'locator': 'None', 'text': 'Process error: TimeParameter should be passed in as a range separated by /'}
[9]:
Process error: TimeParameter should be passed in as a range separated by /

Error: not available collection … c3s-cmip7

[10]:
resp = rooki.subset(
    collection='c3s-cmip7.output1.MOHC.HadGEM2-ES.rcp85.mon.atmos.Amon.r1i1p1.latest.tas',
    time='2085-01-01/2120-12-30',
)
resp
 owslib.wps.WPSException : {'code': 'NoApplicableCode', 'locator': 'None', 'text': 'Process error: The project could not be identified and force was set to false'}
[10]:
Process error: The project could not be identified and force was set to false

Error: invalid collection parameter

[11]:
resp = rooki.subset(
    collection='c3s-cmip5/tas',
    time='2085-01-01/2120-12-30',
)
resp
 owslib.wps.WPSException : {'code': 'NoApplicableCode', 'locator': 'None', 'text': 'Process error: The project could not be identified and force was set to false'}
[11]:
Process error: The project could not be identified and force was set to false

Error: operation failed …0 meridian not supported

Update: this is solved!

Issue: https://github.com/roocs/clisops/issues/35

[12]:
resp = rooki.subset(
    collection='c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803',
    time='1901-01-01/1921-12-30',
    area='-20, 40, 20, 70',
)
resp
[12]:
Metalink URL: http://rook1.cloud.dkrz.de:80/outputs/rook/a7b09ae6-76b3-11eb-94aa-fa163eac7aff/input.meta4, num files: 1