| 1 |
"""Interpolation of MODIS data using satellite zenith angle. |
| 2 |
|
| 3 |
Interpolation of geographical tiepoints using the second order interpolation |
| 4 |
scheme implemented in the CVIIRS software, as described here: |
| 5 |
Compact VIIRS SDR Product Format User Guide (V1J) |
| 6 |
https://www.eumetsat.int/media/45988 |
| 7 |
and |
| 8 |
Anders Meier Soerensen, Stephan Zinke, |
| 9 |
A tie-point zone group compaction schema for the geolocation data of S-NPP and NOAA-20 VIIRS SDRs to reduce file sizes |
| 10 |
in memory-sensitive environments, |
| 11 |
Applied Computing and Geosciences, Volume 6, 2020, 100025, ISSN 2590-1974, |
| 12 |
https://doi.org/10.1016/j.acags.2020.100025. |
| 13 |
(https://www.sciencedirect.com/science/article/pii/S2590197420300070) |
| 14 |
""" |
| 15 |
|
| 16 |
import warnings |
| 17 |
|
| 18 |
from ._modis_interpolator import interpolate |
| 19 |
|
| 20 |
|
| 21 |
def modis_1km_to_250m(lon1, lat1, satz1): |
| 22 |
"""Interpolate MODIS geolocation from 1km to 250m resolution.""" |
| 23 |
return interpolate(lon1, lat1, satz1, |
| 24 |
coarse_resolution=1000, |
| 25 |
fine_resolution=250) |
| 26 |
|
| 27 |
|
| 28 |
def modis_1km_to_500m(lon1, lat1, satz1): |
| 29 |
"""Interpolate MODIS geolocation from 1km to 500m resolution.""" |
| 30 |
return interpolate(lon1, lat1, satz1, |
| 31 |
coarse_resolution=1000, |
| 32 |
fine_resolution=500) |
| 33 |
|
| 34 |
|
| 35 |
def modis_5km_to_1km(lon1, lat1, satz1): |
| 36 |
"""Interpolate MODIS geolocation from 5km to 1km resolution.""" |
| 37 |
return interpolate(lon1, lat1, satz1, |
| 38 |
coarse_resolution=5000, |
| 39 |
fine_resolution=1000, |
| 40 |
coarse_scan_width=lon1.shape[1]) |
| 41 |
|
| 42 |
|
| 43 |
def modis_5km_to_500m(lon1, lat1, satz1): |
| 44 |
"""Interpolate MODIS geolocation from 5km to 500m resolution.""" |
| 45 |
warnings.warn( |
| 46 |
"Interpolating 5km geolocation to 500m resolution " "may result in poor quality" |
| 47 |
) |
| 48 |
return interpolate(lon1, lat1, satz1, |
| 49 |
coarse_resolution=5000, |
| 50 |
fine_resolution=500, |
| 51 |
coarse_scan_width=lon1.shape[1]) |
| 52 |
|
| 53 |
|
| 54 |
def modis_5km_to_250m(lon1, lat1, satz1): |
| 55 |
"""Interpolate MODIS geolocation from 5km to 250m resolution.""" |
| 56 |
warnings.warn( |
| 57 |
"Interpolating 5km geolocation to 250m resolution " "may result in poor quality" |
| 58 |
) |
| 59 |
return interpolate(lon1, lat1, satz1, |
| 60 |
coarse_resolution=5000, |
| 61 |
fine_resolution=250, |
| 62 |
coarse_scan_width=lon1.shape[1]) |