Skip to main content

A simple Python tool for converting geographic coordinates into MODIS (Moderate-Resolution Imaging Spectroradiometer) tile numbers.

Project description

modis_sinusoidal_tile_converter

A simple Python tool for converting geographic coordinates system into MODIS (Moderate-Resolution Imaging Spectroradiometer) tile coordinates system.

Introduction

MODIS sensor, some data uses this projection method

Conventional coordinate system parameter explanation:

  1. GCS: Geographic Coordinate System, a spherical coordinate system representing the position of a point on the ground in latitude and longitude, (lat, lon), with lat representing the north-south direction and lon representing the east-west direction.

  2. PCS: Projected Coordinate System, a coordinate system representing the position of a point on the ground usually in meters, (x, y), with x representing the east-west direction and y representing the north-south direction.

Parameters of MODIS Sinusoidal Projection:

  1. ICSTile: Tile/Image Coordinates System, a tiling/image coordinate system represented by tile numbers:

    • Vertical tile number (vertical_tile), with values ranging from 0 to 17;
    • Horizontal tile number (horizontal_tile), with values ranging from 0 to 35;
    • Vertical line number (line), with values ranging from 1199.5(1km)/2399.5(500m);
    • Horizontal column number (sample), with values ranging from -0.5 to 1199.5(1km)/2399.5(500m);
  2. ICSGeo: Geographic Tile/Image Coordinate System, a tiling/image coordinate system represented by latitude and longitude:

    • Latitude (lat_tile), with values ranging from -90 to 90;
    • Longitude (lon_tile), with values ranging from -180 to 180;

Note:

  • The pixel center coordinates at the top left corner of the tile are (0.0, 0.0), and the top left corner coordinates of the pixel are (-0.5, -0.5).
  • Failure in high latitude regions.

Install

# Run in the console
pip install modis_sinusoidal_tile_converter

Usage

Open python, and some examples

Coordinates Convert:

>>> from modis_sinusoidal_tile_converter import Sinusoidal
>>> Sinusoidal.GCS2PCS(50.0, 93.34342961162473)
(6671703.118599138, 5559752.598832616)
>>> Sinusoidal.PCS2GCS(6671703.118599138, 5559752.598832616)
(50.0, 93.34342961162473)
>>> Sinusoidal.GCS2ICSTile(50.0, 93.34342961162473)
(4, 24, -0.5, -0.5)
>>> Sinusoidal.ICSTile2GCS(4, 24, -0.5, -0.5)
(50.0, 93.34342961162473)

File Format Convert:

# write to sinusoidal tiff file
>>> import numpy as np
>>> from modis_sinusoidal_tile_converter.convert import array2tiff
>>> array2tiff(np.zeros((1200, 1200), dtype=np.uint16), "h26v05.tiff", hv="h26v06", grid="1km")

Resources

MODIS_Sinusoidal_Tile_Grid_Corner_Coordinates.csv

How to get this file?

## the pattern “**” will match any files and zero or more directories, 
# subdirectories and symbolic links to directories
python scripts\get_corner_coordinates_of_modis_sinusoidal_tile.py **/*.hdf

References

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

modis_sinusoidal_tile_converter-1.0.0.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for modis_sinusoidal_tile_converter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86ed276c1b39165a60b46bad91790b3979247a823a2cc7988f9f6e93b5c7de5a
MD5 7398fb4685a3997fab8caf36521e77fc
BLAKE2b-256 d336bdfbea38dd3435d2961b397e30ceee8584ac908b5b800e49341ec0eab226

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for modis_sinusoidal_tile_converter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec46d7dfad9ece48fc2e595c725762bd217598b4dc1c3633465b9bc591ae8b95
MD5 7d70ec97d5bdcc80305ff55af47b31d2
BLAKE2b-256 5ee4213974310faad71e2a3895c848d897bc8f2c672da49196dbfe9621b20b77

See more details on using hashes here.

Provenance

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