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

Issue reading NEMO UnRegularGrid #231

Open
jhlasheras opened this issue Feb 9, 2024 · 2 comments
Open

Issue reading NEMO UnRegularGrid #231

jhlasheras opened this issue Feb 9, 2024 · 2 comments

Comments

@jhlasheras
Copy link

Hi @AntSimi , sorry if I may have missed some documentation or previous issue, but I am struggling to use the tool with NEMO outputs without regridding them into a regular grid, as I did in previous occasions.

I have a NEMO model output file that looks like this with ncdump:

netcdf medfs_ssh_20220501 {
dimensions:
	time = 1 ;
	y = 380 ;
	x = 1307 ;
variables:
	float SSH(time, y, x) ;
		SSH:_FillValue = NaNf ;
		SSH:standard_name = "sea_surface_height_above_geoid" ;
		SSH:long_name = "sea_surface_height_above_geoid" ;
		SSH:units = "m" ;
		SSH:online_operation = "average" ;
		SSH:interval_operation = "180 s" ;
		SSH:interval_write = "1 d" ;
		SSH:cell_methods = "time: mean (interval: 180 s)" ;
		SSH:coordinates = "nav_lat nav_lon" ;
	float nav_lat(y, x) ;
		nav_lat:_FillValue = NaNf ;
		nav_lat:standard_name = "latitude" ;
		nav_lat:long_name = "Latitude" ;
		nav_lat:units = "degrees_north" ;
	float nav_lon(y, x) ;
		nav_lon:_FillValue = NaNf ;
		nav_lon:standard_name = "longitude" ;
		nav_lon:long_name = "Longitude" ;
		nav_lon:units = "degrees_east" ;
	double time(time) ;
		time:_FillValue = NaN ;
		time:axis = "T" ;
		time:standard_name = "time" ;
		time:long_name = "Time axis" ;
		time:time_origin = "1900-01-01 00:00:00" ;
		time:bounds = "time_counter_bounds" ;
		time:units = "seconds since 1900-01-01" ;
		time:calendar = "gregorian" ;

// global attributes:
		:name = "medfs-eas8_1d_20220501_ALL_grid_T" ;
		:description = "ocean T grid variables" ;
		:title = "ocean T grid variables" ;
		:Conventions = "CF-1.6" ;
		:timeStamp = "2023-Oct-08 07:31:55 GMT" ;
		:uuid = "8ae0c4bd-ca3a-45aa-a566-21588d957881" ;
}

When I try to load the grid with h = UnRegularGridDataset(filename=file_name, x_name='nav_lon', y_name='nav_lat' ) I get NumbaTypeError: Unsupported array type: numpy.ma.MaskedArray.

I tried to use another subclass from #6 but I got the same error. I also tried to fillna values with same result.

@jhlasheras
Copy link
Author

I have been able to solve as in this comment

I now face the problem that add_uv or bessel_high_filter seem not to be implemented for UnRegularGrid.
Is there any solution available?

thanks!

@AntSimi
Copy link
Owner

AntSimi commented Feb 29, 2024

Sadly, filtering and compute current on UnRegularGrid could be tricky and different for each type of grid. So there is no code share in py eddy tracker to do that, if you have method/code to do this operation, it could be interessant to share or do a contribution on this project.

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

2 participants