Skip to content

Resampling followed by to_array().values #572

@tjvandal

Description

@tjvandal

I'm having an issue accessing data as an array after resampling. Before resampling there are no problems using to_array().values but after resampling this same method takes 10+ minutes to complete. The dataset isn't large with dimensions (shape=(1, 672, 180, 360)). I've replicated this with another dataset. I've also tried copying the dataset to another variable but that didn't work either. Does anybody have any thoughts?

cmip5_file = "/Users/tj/data/cmip5/access1-0/*.nc"

# climate model data
cmip5 = xray.open_mfdataset(cmip5_file)
cmip5.time = pandas.to_datetime(cmip5.  time.values)
print cmip5.to_array().values   ## accesses the data just fine

resampled = cmip5.resample('MS', 'time', how='mean')
print resampled.to_array().values  ## this takes 10+ minutes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions