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

weightmap (pixel_overlaps) warnings and errors #24

Closed
kerriegeil opened this issue Nov 17, 2021 · 5 comments
Closed

weightmap (pixel_overlaps) warnings and errors #24

kerriegeil opened this issue Nov 17, 2021 · 5 comments

Comments

@kerriegeil
Copy link
Contributor

Hi, thanks for the helpful package.

On a Windows machine, I'm using the package successfully on ERA5 reanalysis data although I do get a user warning when calling pixel_overlaps. It occurs after the output "calculating overlaps between pixels and output polygons...". The warning is:

"/home/kgeil/miniconda3/envs/xagg/lib/python3.9/site-packages/xagg/core.py:308: UserWarning: keep_geom_type=True in overlay resulted in 1 dropped geometries of different geometry types than df1 has. Set keep_geom_type=False to retain all geometries overlaps = gpd.overlay(gdf_in.to_crs(epsg_set),'

When I try generating a weight map with the exact same shapefile but on AVHRR NDVI data instead I get a full error at the same-ish location:

"ValueError: GeoDataFrame does not support setting the geometry column where the column name is shared by multiple columns."

It looks like something is going wrong in get_pixel_overlaps around line 323 overlap_info...

I've tried rewriting the NDVI netcdf to be as identical as possible as the ERA5 file (same coord and dim names, etc) and both files are epsg:4326.

Any ideas how to get past this error?

@ks905383
Copy link
Owner

Hi Kerrie, thanks for the post.

First of all, I'm glad to hear that you were able to install xagg on a windows machine - that's been a problem for some users (#23 and #22 e.g.) - was there anything special you did to make the installation work?

Second of all, that's odd to hear. The first warning I've run into a few times, and though worrying, I don't think it's affected the final calculation (though it would be good if I would double check). The error is new to me, however. This may be a silly question, but does the AVHRR NDVI data happen to have a variable called 'geometry' or 'polygon' or something like that?

Could you link to the datafile you were using (or attach a subset version that still reproduces the error)?

Thanks!

@kerriegeil
Copy link
Contributor Author

So really I'm using Ubuntu WSL2 on my window's 10 machine (I enabled WSL2 subsystem linux with Ubuntu- there are various instructions on the web). I installed xagg using conda from the conda-forge channel. So nothing different from how I would install any other packages.

The AVHRR NDVI data does not have any variables named geometry or polygon. It does have a variable named crs, but I tested out rewriting the data file without the crs variable and it didn't solve the problem. The data file (~60MB) I've been troubleshooting with can be downloaded here: https://www.ncei.noaa.gov/data/avhrr-land-normalized-difference-vegetation-index/access/1981/AVHRR-Land_v005_AVH13C1_NOAA-07_19810625_c20170610042839.nc. The shp file I'm using is us_county_mex_munis.zip.

Thanks for the help!

@ks905383
Copy link
Owner

Ah, fair!

Just to double-check, you said the error was also happening in xa.pixel_overlaps()? If so, I wasn't able to reproduce it with the files you linked. Could you copy in the full error message when it happens to you?

Also, this is a good reminder too (for me) to work through a few pending performance upgrades - that takes a while with the high resolution data you're working with 😅

@ks905383
Copy link
Owner

ks905383 commented Jul 3, 2023

This should be now fixed through #39 , and the new update (only a few years late,...)

@ks905383
Copy link
Owner

ks905383 commented Jul 3, 2023

Closed by #39 , upcoming in v0.3.1

@ks905383 ks905383 closed this as completed Jul 3, 2023
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