JuliaDataCubes / EarthDataLab.jl

Julia interface for Reading from the Earth System Datacube
http://earthsystemdatacube.net
Other
33 stars 14 forks source link

Help interpreting - LoadError: UndefKeywordError: keyword argument dims not assigned #256

Closed alex-s-gardner closed 2 years ago

alex-s-gardner commented 2 years ago

Hoping someone might be able to provide a bit of guidance to a naive user, running the following code I get an error that I don't quite understand as the array has AxisNames.

path = ["s3://its-live-data/datacubes/v02/N60W040/ITS_LIVE_vel_EPSG3413_G0120_X-150000_Y-2250000.zarr"]; ds = YAXArrays.open_dataset(path[1]) mapslices(mean, ds.v, ("mid_date"))

throws the error "LoadError: UndefKeywordError: keyword argument dims not assigned"

alex-s-gardner commented 2 years ago

Closing this issue as it appears the correct call I should have been using is:

mapslices(mean, ds.v.data, dims = [3])

The example on the ESDL docs might be incorrect: mapslices(mean, cube, ("Lon","Lat")) https://esa-esdl.github.io/ESDL.jl/latest/analysis/#Simple-Statistics-1

felixcremer commented 2 years ago

You are right the Example on the docs are incorrect. You need to use the dims keyword like so:

mapslices(mean, ds.v, dims="mid_date")

Your workaround should never be necessary, because you should not have to know the position of your axes of interest.