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

beginners_doc - get_rgi.sh fails if libraries are not added to PATH #18

Open
elischwat opened this issue Apr 22, 2020 · 6 comments
Open

Comments

@elischwat
Copy link
Contributor

elischwat commented Apr 22, 2020

I followed the beginners_doc, but did not add paths to the three libraries (pygeotools, demcoreg, imview) to my PATH env var.

Upon trying to run dem_align.py, I was advised to run the get_rgi.sh script.

Missing rgi glacier data source. If already downloaded, specify correct datadir. If not, run `get_rgi.sh` to download

I ran the script and, after the large download completed, a "command not found" error then an OGR error was thrown.

Merging region shp for global shp
.../demcoreg/demcoreg/get_rgi.sh: line 80: ogr_merge.sh: command not found

Clipping to site: CONUS
POLYGON ((-125 49, -104 49, -104 32, -125 32, -125 49))
+proj=aea +lat_1=36 +lat_2=49 +lat_0=43 +lon_0=-115 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
FAILURE:
Unable to open datasource `rgi60_merge.shp' with the following drivers.
  -> `PCIDSK'
  -> `netCDF'
  -> `JP2OpenJPEG'
  ......<long list of drivers>

The script is failing because it calls pygeotools' ogr_merge.sh script on line 80. If you have not added pygeotools to PATH, those files are not created, and we also get the red herring OGR error

Unable to open datasource `rgi60_merge.shp' with the following drivers.

because that file does not exist.

I resolved the issue by adding the paths to the three libraries to my PATH env var. Maybe the beginner docs could be updated to say that adding the libraries to your path is a requirement or perhaps get_rgi.sh can be modified as to not require that. No real bug here but I think walking through the beginner docs would be smoother if this was mentioned.

@meghanasharp
Copy link
Contributor

Thanks for posting your solution to this issue. I am also following the beginner's document and receiving a very similar error when i run get_rgi.sh:

Unable to open datasource '*_rgi60_*shp' with the following drivers

I have added demcoreg, pygeotools and imview to my path, but this doesn't seem to solve the issue. The first three entries in my path (echo $PATH) are:

~/src/pygeotools/pygeotools:~/src/demcoreg/demcoreg:~/src/imview/imview

Here is a screenshot of the full error. Any help would be greatly appreciated!

Screen Shot 2020-04-23 at 10 12 36 AM

@elischwat
Copy link
Contributor Author

elischwat commented Apr 23, 2020

It looks like you do not have wget installed on your mac (see the error on the 6th line of text in your screenshot). A file does not get downloaded and then you get a bunch of other errors afterwards that are misleading.
You may be able to install wget in the terminal like this

brew install wget

If that doesn't work, just google for other ways to install wget (or ways to install brew if it's not installed, and then you can run the command above).

@meghanasharp
Copy link
Contributor

meghanasharp commented Apr 23, 2020

Nice catch– that fixed it. Thanks for your help! :)

@dshean
Copy link
Owner

dshean commented Apr 24, 2020

Thanks for reporting @elischwat. Sorry it's so convoluted and that those steps were not documented. Can you help to clean up that doc, add missing steps/notes, and submit a PR?

We should probably make the RGI download optional, and move most of the download steps to a separate wrapper, as mentioned in #17

Much of this stack was developed for specific projects over the years in my own environment, often with the "I just need to get the job done" requirement. So it's good to have fresh perspective from new users, and to be reminded of all of the hurdles to get up and running. As always, I appreciate any help to simplify, fix, and/or better document setup and tools.

@dshean
Copy link
Owner

dshean commented Apr 24, 2020

Also, @meghansharp, wget is available via conda-forge these days. Follow instructions to add conda-forge channel, then:
conda install wget

@dshean
Copy link
Owner

dshean commented Apr 29, 2020

We should probably make the RGI download optional, and move most of the download steps to a separate wrapper, as mentioned in #17

FYI, I disabled RGI masking by default with bd48b4f. Should work, but I did not test, can one of you pull latest master and rerun your test case(s)?

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