Skip to main content

global digit distance model

Project description

Install

Install using pip:

pip install global_ddm

Description

Python has a library called global_land_mask, which contains sea and land masks with a global resolution of 1km, using GLOBE's DEM dataset( https://www.ngdc.noaa.gov/mgg/topo/gltiles.html ). It should be made with an altitude greater than 0 indicating land and less than 0 indicating ocean. Based on his dataset, first sparsify the spatial accuracy of the dataset from 1km to 5km. Then apply this calculation method: calculate the distance to the nearest sea grid point on land, and calculate the distance to the nearest land grid point on the ocean.

Simple example

from global_ddm import globe
import numpy as np
import matplotlib.pyplot as plt

lat = np.linspace(-90,90,181)
lon = np.linspace(-180,180,361)

lat,lon = np.meshgrid(lat,lon)
ddm = globe.get_ddm(lat, lon)

plt.figure(figsize=(20,8))
plt.pcolormesh(lon, lat, ddm, cmap='bwr)
plt.colorbar()

ddm image

API Reference

from global_ddm import globe
globe.xxxx(args)

1. get_ddm

This function is used to retrieve a boolean array indicating whether the given coordinates are in the ocean.

Parameters

  • lat: ndarray or float, latitude in degrees.
  • lon: ndarray or float, longitude in degrees.

Returns

  • is_ocean_mask: ndarray or float, a boolean array denoting whether the corresponding point is in the ocean.

2. is_land

This function is used to determine whether the given coordinates are on land.

Parameters

  • lat: ndarray or float, latitude in degrees.
  • lon: ndarray or float, longitude in degrees.

Returns

  • Boolean value indicating whether the coordinates are on land.

3. is_ocean

This function is used to determine whether the given coordinates are in the ocean.

Parameters

  • lat: ndarray or float, latitude in degrees.
  • lon: ndarray or float, longitude in degrees.

Returns

  • Boolean value indicating whether the coordinates are in the ocean.

4. off_coastline

This function is used to determine whether the distance from the coastline exceeds the specified distance.

Parameters

  • lat: ndarray or float, latitude in degrees.
  • lon: ndarray or float, longitude in degrees.
  • distance: ndarray or float, distance away from the coastline in kilometers.

Returns

  • Boolean value indicating whether the distance from the coastline exceeds the specified distance.

5. on_coastline

This function is used to determine whether the distance from the coastline does not exceed the specified distance.

Parameters

  • lat: ndarray or float, latitude in degrees.
  • lon: ndarray or float, longitude in degrees.
  • distance: ndarray or float, distance away from the coastline in kilometers.

Returns

  • Boolean value indicating whether the distance from the coastline does not exceed the specified distance.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

global_ddm-1.0.0.tar.gz (16.8 MB view details)

Uploaded Source

Built Distribution

global_ddm-1.0.0-py3-none-any.whl (16.7 MB view details)

Uploaded Python 3

File details

Details for the file global_ddm-1.0.0.tar.gz.

File metadata

  • Download URL: global_ddm-1.0.0.tar.gz
  • Upload date:
  • Size: 16.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for global_ddm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4b913b9166561fe96f92ef177d3fe40c6f6782e68d20d0afd4b67d91f3c12b01
MD5 8ddf1bd83c0baad589494e2ce49ee628
BLAKE2b-256 2646967a306744cd0b9095951e7db8e234f3133d5ec9aeb72492c65980afb574

See more details on using hashes here.

File details

Details for the file global_ddm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: global_ddm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for global_ddm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae3793fe8e9bc3ff9a1b7d37deb95359067e454323ffb6e6b9f47f53b09b37be
MD5 314e600cb495d45e836be6eadf28dac7
BLAKE2b-256 0809904abc3464734735201b4ffc21295eb164cabb6c1b84de258c05d7020f33

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page