-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
I am confused by this error as this code was working perfectly fine until last week.
biweekly_data
is an Xarray Dataset and when I type the following:
coslat = np.cos(np.deg2rad(biweekly_data.coords['rlat'].values))
wgts = np.sqrt(coslat)[..., np.newaxis]
solver = Eof(biweekly_data, weights=wgts)
eof1 = solver.eofs()
I get this error:
TypeError: the input must be an xarray DataArray
So I tried:
coslat = np.cos(np.deg2rad(biweekly_data.coords['rlat'].values))
wgts = np.sqrt(coslat)[..., np.newaxis]
solver = Eof(biweekly_data.snowmelt, weights=wgts)
eof1 = solver.eofs()
And then get this:
TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property
So one more time I tried:
coslat = np.cos(np.deg2rad(biweekly_data.coords['rlat'].values))
wgts = np.sqrt(coslat)[..., np.newaxis]
solver = Eof(biweekly_data.snowmelt.data, weights=wgts)
eof1 = solver.eofs()
And get:
TypeError: the input must be an xarray DataArray
It just baffled me because I've used the code as shown in the very top block before to create maps like these:
Note:
The solver works if I use eofs.standard
when I use solver = Eof(biweekly_data.snowmelt.data, weights=wgts)
Metadata
Metadata
Assignees
Labels
No labels