ajdawson / eofs

EOF analysis in Python
http://ajdawson.github.io/eofs/
GNU General Public License v3.0
199 stars 60 forks source link

CSV station data to use eofs #108

Closed xigrug closed 2 years ago

xigrug commented 5 years ago

I have a dataset with station observation in csv file. Output is nothing cf.head()

Height Stid ci
DATE Lat Lon
1951-01-01 32.56 117.22 206.0 58221 0.608196
32.05 118.45 618.0 58238 0.569477
30.20 120.14 77.0 58457 0.626431
30.37 117.02 263.0 58424 0.666847
28.40 121.30 95.0 58665 0.546766
from eofs.xarray import Eof
ds = cf.to_xarray()
solver = Eof(ds["ci"])
eof_ci = solver.eofsAsCorrelation(neofs=1)

here is eof_ci:

<xarray.DataArray 'eofs' (mode: 0, Lat: 154, Lon: 166)> array([], shape=(0, 154, 166), dtype=float64) Coordinates:

  • mode (mode) float64
  • Lat (Lat) float64 2.85 2.86 2.97 3.02 3.03 ... 34.27 34.29 34.5 34.51
  • Lon (Lon) float64 11.75 11.81 11.91 11.98 ... 121.6 122.1 122.1 122.3 Attributes: long_name: correlation_between_pcs_and_ci
ajdawson commented 5 years ago

There isn't enough information here to act on. What is the shape of ds["ci"] and what coordinates does it have?

ajdawson commented 2 years ago

Closing as stale, feel free to reopen with more information if you still want to follow up.