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.0.tar.gz (2.7 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.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lccgrid-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 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.0.tar.gz
Algorithm Hash digest
SHA256 238835f0afff20f066ebd8f1ac1bc9c50e7729d225792035122d07fc86c7a9b5
MD5 3b28023aa4667553c6a4ed4ecce9da3c
BLAKE2b-256 90449237795391d764c35043ba9055ff1603d3c685ce74ff69deb916d29dd6ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lccgrid-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4db5f55c2203a9f8ad59b4994057481986896abb516b4526c41c245acab47c54
MD5 34444d75d468a6cbec4022db8863e600
BLAKE2b-256 9f36b6330d6cf04c05ff7b87f24691c095612ccfb3d88e908ba0db77f4d9915f

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