[DEPRECATED] Magnetic data from Rio de JaneiroΒΆ

Warning

The Rio magnetic anomaly dataset is deprecated and will be removed in Verde v2.0.0 (functions verde.datasets.fetch_rio_magnetic and verde.datasets.setup_rio_magnetic_map). Please use another dataset instead.

We provide sample total-field magnetic anomaly data from an airborne survey of Rio de Janeiro, Brazil, from the 1970s. The data are made available by the Geological Survey of Brazil (CPRM) through their GEOSGB portal. See the documentation for verde.datasets.fetch_rio_magnetic for more details.

../_images/sphx_glr_rio_magnetic_001.png

Out:

/home/leo/src/verde/verde/datasets/sample_data.py:184: DeprecationWarning: The Rio magnetic anomaly dataset is deprecated and will be removed in Verde v2.0.0. Use a different dataset instead.
  DeprecationWarning,
/home/leo/miniconda3/envs/verde/lib/python3.7/site-packages/pooch/core.py:379: UserWarning: Downloading data file 'rio-magnetic.csv.xz' from remote data store 'https://github.com/fatiando/verde/raw/v1.4.0/data/rio-magnetic.csv.xz' to '/home/leo/.cache/verde/v1.4.0'.
  action_word[action], fname, self.get_url(fname), str(self.path)
   longitude   latitude  total_field_anomaly_nt  height_ell_m line_type  line_number
0 -42.590424 -22.499878                  115.41        264.26      LINE         2902
1 -42.590485 -22.498978                  121.35        265.48      LINE         2902
2 -42.590530 -22.498077                  128.29        263.96      LINE         2902
3 -42.590591 -22.497177                  133.24        258.47      LINE         2902
4 -42.590652 -22.496277                  136.18        252.07      LINE         2902
/home/leo/src/verde/verde/datasets/sample_data.py:221: DeprecationWarning: The Rio magnetic anomaly dataset is deprecated and will be removed in Verde v2.0.0. Use a different dataset instead.
  DeprecationWarning,
/home/leo/src/verde/data/examples/rio_magnetic.py:50: UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.
  plt.tight_layout()
/home/leo/src/verde/data/examples/rio_magnetic.py:51: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  plt.show()

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import numpy as np
import verde as vd

# The data are in a pandas.DataFrame
data = vd.datasets.fetch_rio_magnetic()
print(data.head())

# Make a Mercator map of the data using Cartopy
crs = ccrs.PlateCarree()
plt.figure(figsize=(7, 5))
ax = plt.axes(projection=ccrs.Mercator())
ax.set_title("Total-field Magnetic Anomaly of Rio de Janeiro")
# Since the data is diverging (going from negative to positive) we need to center our
# colorbar on 0. To do this, we calculate the maximum absolute value of the data to set
# vmin and vmax.
maxabs = vd.maxabs(data.total_field_anomaly_nt)
# Cartopy requires setting the projection of the original data through the transform
# argument. Use PlateCarree for geographic data.
plt.scatter(
    data.longitude,
    data.latitude,
    c=data.total_field_anomaly_nt,
    s=1,
    cmap="seismic",
    vmin=-maxabs,
    vmax=maxabs,
    transform=crs,
)
plt.colorbar(pad=0.01).set_label("nT")
# Set the proper ticks for a Cartopy map
vd.datasets.setup_rio_magnetic_map(ax)
plt.tight_layout()
plt.show()

Total running time of the script: ( 0 minutes 1.567 seconds)

Gallery generated by Sphinx-Gallery