ajdawson / eofs

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

Input Data Missing Error from Standard Solver #133

Open WHBSpeiser opened 1 year ago

WHBSpeiser commented 1 year ago

Hi! I am trying to use the standard solver on a netcdf file that has a data variable (reflectance values), a lat variable, a lon variable, and a time dimension. When I put it into the standard solver, I get an error saying all input data is missing even though I have verified there is reflectance data present... I also tried converting to an xarray and using that xarray solver but got the same warning. Could it be because there are too many masked values? Sorry if I am missing something obvious, I've been picking away at it for quite a while now- thank you for any insights you may be able to provide! Code and example .nc file below

`

filename = '/home/williamcoast/Desktop/test_csv/test.nc'
ncin = Dataset(filename, 'r')
color = ncin.variables['data'][:]
lons = ncin.variables['longitude'][:]
lats = ncin.variables['latitude'][:]
ncin.close()

coslat = np.cos(np.deg2rad(lats))
wgts = np.sqrt(coslat)[..., np.newaxis]
solver = Eof(color, weights=wgts)

` test_netcdf.zip

ajdawson commented 8 months ago

The eofs software missing value handling was designed for things like masked land areas when analysing ocean fields, where the missing values are in the same location at every time slice. If there is a missing value present in a location at any time the whole time series will be marked as missing. Perhaps your data is sampled at different locations for each time slice, resulting in no locations that have a complete time series?