Download, extract, process, and plot gravity data. From Topex website to simple bouguer anomaly contour (even more!)
Are you a Geophysics Student, doing research using satellite gravity data? You may love this code!
I created code that could make you able to download, extract, process, and plot gravity data automatically from Topex website.
How to get started?
This code was written in python language. To run it, you need python IDE (of course) with the version 3.7 or above. You can use any IDE (my recommend : Spyder, PyCharm).
You need to install some packages that maybe you didn't have before. These packages list are :
- NumPy
- Pandas
- Matplotlib
- SciPy
- Selenium
- scikit-learn (sklearn)
To install these packages, simply write :
pip install numpy pandas matplotlib scipy selenium sklearn
on your console / python command prompt. Wait until all of these have succesfully installed, then restart your kernel (or restart your IDE).
To automatically control the browser by using Selenium package, you'll need webdriver. You can visit https://www.selenium.dev/downloads/ and scroll down to 'Platforms Supported by Selenium', then, choose your browser
Click on the 'documentation' link from one of browser you'll use. For this tutorial, I'll use Chrome.
Open https://chromedriver.chromium.org/ or documentation link from image above.
Then, click download link on 'All versions available in Downloads'
Download webdriver that match with your Chrome version. To check your Chrome version, you can see it on Control Panel --> Uninstall a program. There you can check you apps version on the rightmost column.
Now back to Chrome webdriver site and click to match version of yours.
Choose chromedriver_win32.zip if you are using Windows.
After you succesfully downloaded it, extract chromedriver.exe from .zip file and place it on C:\Windows
If you are using Spyder IDE from Anaconda, you have to set up plotting style. Go to Tools --> Preferences on the top of the bar.
Move to IPython Console and Graphics tab, then, set the Graphics Backend from Inline to Automatic.
Close and re-open your Spyder. For another IDE, please check how to set up interactive tools.
Now everything have been set up properly (hopefully). Open topex_auto.py file to your IDE. It's time to run the code with a simply pressing F5 or Run button.
Input your area coordinates
You've got your Simple Bouguer Anomaly
Picking regional and residual boundary range in the spectrum analysis
Then, we were able to separate regional and residual data
Residual data was used to get First Horizontal Derivative and Second Vertical Derivative