Skip to main content

Convert Lambert Conformal grid to lat/lon coordinates

Project description

lccgrid

A simple Python package to convert Lambert Conformal Conic (LCC) grid coordinates to latitude and longitude.

This package provides a single utility function get_coord() which converts grid indices in LCC projection to geographic coordinates (lon/lat).


📦 Installation

Install using pip:

pip install lccgrid

🚀 Usage

from lccgrid import get_coord

# Example input: 100x100 grid with 10km spacing centered at 35N, 135E
lon, lat = get_coord(
    nx=100, ny=100,
    lat1=35.0, lon1=135.0,
    nx_orig=50, ny_orig=50,
    stdlat1=30.0, stdlat2=60.0,
    lon0=135.0,
    dx=10000, dy=10000
)

The returned lon and lat are 2D NumPy arrays of shape (ny, nx) containing longitude and latitude coordinates at each grid point.


📘 Function Documentation

get_coord(
    nx: int,
    ny: int,
    lat1: float,
    lon1: float,
    nx_orig: int,
    ny_orig: int,
    stdlat1: float,
    stdlat2: float,
    lon0: float,
    dx: float,
    dy: float
) -> Tuple[np.ndarray, np.ndarray]

Parameters:

  • nx, ny: Number of grid points in X and Y directions.
  • lat1, lon1: Latitude and longitude of the origin (center of projection).
  • nx_orig, ny_orig: Grid index at the origin (usually 1-based).
  • stdlat1, stdlat2: First and second standard parallels.
  • lon0: Central meridian of the projection.
  • dx, dy: Grid spacing in meters.

Returns:

  • (lon, lat): 2D arrays of longitude and latitude.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


🔗 Links

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

lccgrid-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lccgrid-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file lccgrid-0.1.1.tar.gz.

File metadata

  • Download URL: lccgrid-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for lccgrid-0.1.1.tar.gz
Algorithm Hash digest
SHA256 017a90f89ff728a1e692c2e8a97208335b7e3ce107679f701e99dc53d5b2ba32
MD5 f0ce9c133219492bda061f56712be7e8
BLAKE2b-256 63d24520f22376ed9ae79c483efc0ee02d80fc085cc2e6d08c17d9a53ff595ad

See more details on using hashes here.

File details

Details for the file lccgrid-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lccgrid-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for lccgrid-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77759e0c0af145e5de7d2fe4248466ef44846d5cc50e254adce0ca209c804d39
MD5 ef88c80897d07e0419e0b6c5988871fd
BLAKE2b-256 5b443e06f0a7f7aa9d6e3b5eca0d9301809a6d64c7c844da0e569e80468c76b9

See more details on using hashes here.

Supported by

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