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

Unable to create glacier mask (TypeError: data type 'Bool' not understood) #29

Open
bro076 opened this issue Feb 15, 2021 · 3 comments
Open

Comments

@bro076
Copy link

bro076 commented Feb 15, 2021

Hi,
I have been trying to create a mask based on the RGI outlines. I ran "get_rgi.sh" which seems to work even if I got the message

ERROR`` 1: TopologyException: Input geom 0 is invalid: Ring Self-intersection at or near point 75.186070378000068 36.165444900000068 at 75.186070378000068 36.165444900000068`

When I run dem_mask.py --glaciers --outdir "mask" 2012_geoeye.tif I get the error message

Traceback (most recent call last): File "/mnt/c/Ben/Ben/Other/demcoreg/demcoreg/demcoreg/dem_mask.py", line 647, in <module> main() File "/mnt/c/Ben/Ben/Other/demcoreg/demcoreg/demcoreg/dem_mask.py", line 625, in main newmask = get_mask(dem_ds, mask_list, dem_fn=dem_fn, writeout=args.writeout, outdir=args.outdir, args=args) File "/mnt/c/Ben/Ben/Other/demcoreg/demcoreg/demcoreg/dem_mask.py", line 439, in get_mask icemask = get_icemask(dem_ds) File "/mnt/c/Ben/Ben/Other/demcoreg/demcoreg/demcoreg/dem_mask.py", line 107, in get_icemask icemask = geolib.shp2array(glac_shp_fn, ds) File "/mnt/c/Ben/Ben/Other/demcoreg/pygeotools/pygeotools/lib/geolib.py", line 799, in shp2array a = ~(a.astype('Bool')) TypeError: data type 'Bool' not understood

Thanks,

Ben

@bro076
Copy link
Author

bro076 commented Feb 15, 2021

Seemed to fix it, line 799 needs to be changed in geolib.py so it is "bool" and not "Bool"

@ShashankBice
Copy link
Contributor

@dshean another user reported this issue. I got the error as well with numpy version: 1.20.1. Changing to lower case as reported above fixes it. I can add a pull request upstream, but I would need to check if it breaks something backwards.

@VuOn7
Copy link

VuOn7 commented Apr 9, 2021

The 'Bool" Error got fixed. Thank you so much!! but there is this deprecation warning. What is it trying to say? Help me.

Generating Nuth and Kaab plot
/Users/sun/src/demcoreg/demcoreg/coreglib.py:337: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
bp = ax.boxplot(np.array(output)[idx][::s], positions=bin_centers[::s], widths=widths[::s], showfliers=False, \

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

3 participants