Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why EOF transforms dims in coordinates #110

Open
oliviermarti opened this issue Apr 2, 2019 · 0 comments
Open

Why EOF transforms dims in coordinates #110

oliviermarti opened this issue Apr 2, 2019 · 0 comments

Comments

@oliviermarti
Copy link

Hi,

I have an xarray Dataset :

>>> inFile
<xarray.Dataset>
Dimensions:                               (time_counter: 6000, x: 182, y: 149)
Coordinates:
  * time_counter                          (time_counter) float64 3.02e+07 ... 1.892e+11
Dimensions without coordinates: x, y
Data variables:
     tos_yearmean                          (time_counter, y, x) float32 ...

I compute the EOFs on tos_yearmean and I get :

>>> solver.eofs()
<xarray.DataArray 'eofs' (mode: 6000, y: 149, x: 182)>
array([[[nan, nan, ..., nan, nan],
           [nan, nan, ..., nan, nan]]], dtype=float32)
Coordinates:
  * mode     (mode) int64 0 1 2 3 4 5 6 7 ... 5993 5994 5995 5996 5997 5998 5999
  * y        (y) int64 0 1 2 3 4 5 6 7 8 ... 140 141 142 143 144 145 146 147 148
  * x        (x) int64 0 1 2 3 4 5 6 7 8 ... 173 174 175 176 177 178 179 180 181
Attributes:
    long_name:  empirical_orthogonal_functions

Dimensions x and y have been transformed into coordinates, with index starting at 0. This is spurious information. When I use the input file in Ferret, Ferret assumes that x and y start at 1. When I write solver.eofs in a file and use it in Ferret, the indexing starts at 0, and there is mismatch between the two files that make Ferret to fail on some operations.

Can I prevent eofs to transform dimension in coordinates ?

Thanks,

Olivier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant