.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/01_readers/04_model_1_read_gravity.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_01_readers_04_model_1_read_gravity.py: Gravity Data Visualization ========================== This example illustrates how to read gravity data from the Stonepark project and visualize it. The data is converted for subsurface analysis. .. GENERATED FROM PYTHON SOURCE LINES 9-31 .. code-block:: default import numpy as np import pandas as pd import matplotlib.pyplot as plt # Import additional necessary libraries from dotenv import dotenv_values # Load environment variables and file path config = dotenv_values() path = config.get("PATH_TO_MODEL_1_BOUGUER") # Read the data into a pandas DataFrame df = pd.read_csv(path, sep=',', header=0) # Selecting the columns of interest interesting_columns = df[['X', 'Y', 'Bouguer_267_complete']] # Define the extent of the observation area omf_extent = np.array([559902.8297554839, 564955.6824703198 * 1.01, 644278.2600910577, 650608.7353560531, -1753.4, 160.3266042185512]) .. GENERATED FROM PYTHON SOURCE LINES 32-33 Plot the gravity data .. GENERATED FROM PYTHON SOURCE LINES 33-52 .. code-block:: default plt.figure(figsize=(10, 10)) plt.scatter(df['X'], df['Y'], c=df['Bouguer_267_complete'], cmap='viridis') plt.title('Gravity Data Plot for Stonepark Project') plt.xlabel('X Coordinate') plt.ylabel('Y Coordinate') plt.colorbar(label='Bouguer Anomaly') # Set the extent of the plot plt.xlim(omf_extent[0], omf_extent[1]) plt.ylim(omf_extent[2], omf_extent[3]) # Optional: Hide axis labels for a cleaner look plt.gca().axes.xaxis.set_ticklabels([]) plt.gca().axes.yaxis.set_ticklabels([]) # Display the plot plt.show() .. image-sg:: /examples/01_readers/images/sphx_glr_04_model_1_read_gravity_001.png :alt: Gravity Data Plot for Stonepark Project :srcset: /examples/01_readers/images/sphx_glr_04_model_1_read_gravity_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.071 seconds) .. _sphx_glr_download_examples_01_readers_04_model_1_read_gravity.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 04_model_1_read_gravity.py <04_model_1_read_gravity.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 04_model_1_read_gravity.ipynb <04_model_1_read_gravity.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_