pygmt.datasets.load_blue_marble
- pygmt.datasets.load_blue_marble(resolution='01d', region=None)[source]
Load NASA Blue Marble images in various resolutions.
Earth day/night dataset.
This function downloads the dataset from the GMT data server, caches it in a user data directory (usually
~/.gmt/server/earth/earth_day/
), and load the dataset as anxarray.DataArray
. An internet connection is required the first time around, but subsequent calls will load the dataset from the local data directory.The dataset can also be accessed by specifying a file name in any image processing function or plotting method, using the following file name format: @earth_day_res. res is the image resolution. If res is omitted (i.e.,
@earth_day
), GMT automatically selects a suitable resolution based on the current region and projection settings.Refer to https://www.generic-mapping-tools.org/remote-datasets/earth-daynight.html for more details about available datasets, including version information and references.
- Parameters:
resolution (
Literal
['01d'
,'30m'
,'20m'
,'15m'
,'10m'
,'06m'
,'05m'
,'04m'
,'03m'
,'02m'
,'01m'
,'30s'
], default:'01d'
) – The image resolution. The suffixd
,m
, ands
stand for arc-degrees, arc-minutes, and arc-seconds.region (
Sequence
[float
] |str
|None
, default:None
) – The subregion of the image to load, in the form of a sequence [xmin, xmax, ymin, ymax].
- Return type:
- Returns:
image – The NASA Blue Marble image. Coordinates are latitude and longitude in degrees.
Note
The registration and coordinate system type of the returned
xarray.DataArray
image can be accessed via the GMT accessors (i.e.,image.gmt.registration
andimage.gmt.gtype
respectively). However, these properties may be lost after specific image operations (such as slicing) and will need to be manually set before passing the image to any PyGMT data processing or plotting functions. Refer topygmt.GMTDataArrayAccessor
for detailed explanations and workarounds.Examples
>>> from pygmt.datasets import load_blue_marble >>> # Load the default image (pixel-registered 1 arc-degree image) >>> image = load_blue_marble()