AusClimateService / AusClimateService/indices

icclim lat/lon subset

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6
Forks
6
PR merge metrics
No merged PRs in 30d

Description

@DamienIrving .

When running

`/g/data/xv83/dbi599/miniconda3/envs/icclim/bin/python /g/data/tp28/dev/chs548/indices/run_icclim.py --slice_mode month --verbose --start_date 1980-01-01 --end_date 2020-12-31 --input_files /g/data/xv83/bxn599/test-data/CORDEX-CMIP6/output//AUS-10i/CSIRO/ECMWF-ERA5/evaluation/r1i1p1f1/CSIRO-CCAM-2203/v1/day/tasmax/tasmax_AUS-10i_ECMWF-ERA5_evaluation_r1i1p1f1_CSIRO-CCAM-2203_v1_day_19800101-19801231.nc --variable tasmax tx out.nc`

led to,

`
Traceback (most recent call last):
File "/g/data/tp28/dev/chs548/indices/run_icclim.py", line 391, in
main(args)
File "/g/data/tp28/dev/chs548/indices/run_icclim.py", line 229, in main
ds, cf_var = read_data(
File "/g/data/tp28/dev/chs548/indices/run_icclim.py", line 167, in read_data
ds = subset_bbox(ds, start_date=start_date, end_date=end_date, lat_bnds=lat_bnds, lon_bnds=lon_bnds)
File "/g/data/xv83/dbi599/miniconda3/envs/icclim/lib/python3.10/site-packages/clisops/core/subset.py", line 270, in func_checker
return func(*args, **kwargs)
File "/g/data/xv83/dbi599/miniconda3/envs/icclim/lib/python3.10/site-packages/clisops/core/subset.py", line 1211, in subset_bbox
da = da.sel({lon: slice(*lon_bnds)})
TypeError: iteration over a 0-d array
`

Same when running on BARPA data.

Not obvious to me - possible bug in subset.py, since the icclim.py is correctly passing lat_bnds=None and lon_bnds=None to subset_bbox function.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the command in the issue, then inspect read_data in run_icclim.py around lines 167 and 229 and clisops/core/subset.py around line 1211. Compare the CORDEX-CMIP6 and BARPA cases where lat_bnds and lon_bnds are None; done means both inputs complete without the 0-D array TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.