jddingemanse / awtiCodeDev

Development of code for and by Arba Minch University Water Technology Institute
1 stars 2 forks source link

Basemap #26

Open IsraelGebresilasieKimo opened 1 year ago

IsraelGebresilasieKimo commented 1 year ago

This is a code to generate a base map(Global and to the area of interest) so that we can visualize our data(i.e Numerical forecast product, soil data and etc.... on a map).

First, create a new environment in anaconda prompt by typing

conda create --name basemap

then type

conda activate basemap then

install the required package in a new environment type

conda install -c conda-forge basemap

conda install -c conda-forge jupyter

open jupyter notebook

import the attached script in your notebook #Basemap.py/or Base map.ipynb from awtiCodeDev/code/

pls, let me know if there is a challenge...

jddingemanse commented 1 year ago

Cool! For me it works exactly according to your instructions, and I get a lot of nice figures!

Installation of the environment and necessary packages Small addition for the people wanting to work in spyder: besides jupyter, you should also install spyder in this new environment. Also, some of the installation commands can be combined together. So, instead of ...

conda create --name basemap then type conda activate basemap then install the required package in a new environment type conda install -c conda-forge basemap conda install -c conda-forge jupyter

... you can also do the following (in Anaconda prompt of course):

conda config --add channels conda-forge
conda create -n basemap spyder jupyter basemap

After that, if you want to work with Spyder, you can open the newly installed Spyder (basemap), in which your script should fully work.

Regarding basemap If I read the page on [Introduction into Basemap]](https://matplotlib.org/basemap/users/intro.html), they say themselves that Basemap has been replaced by Cartopy. It seems they are not updating Basemap anymore. At some point, we might run into consistency issues (at some point, Basemap might simply become too old to work with in combination with other packages). I have no experience with Basemap, and also not with Cartopy; do you know or can you maybe find out whether you manage to do similar things as your code currently does, but then in Cartopy?

Another question I have: with Basemap, your code nicely draws country borders. Can we access the data for the location of these borders (for example export it as shape file, get it into Geopandas, or something like that)?

IsraelGebresilasieKimo commented 1 year ago

Dear Jan, Thank you so much, for validating my code, and thank you for your CONSTRUCTIVE COMMENTS too Next time I will work on Cartopy (The new Base map management) to benefit from the new update futures. and I will also work on other comments too. Thank you again.