Debian Codegraph @

doc/source/index.rst

raw
1 Python-geotiepoints
2 ===================
3
4 Python-geotiepoints is an application for the interpolation (and extrapolation if
5 needed) of geographical tiepoints into a larger/denser geographical grid. This is usefull
6 when the full resolution lon/lat grid is needed while only a lower resolution
7 grid of tiepoints is available.
8
9 Some helper functions are provided to accomodate for satellite data, but the
10 package should be generic enough to be used for any kind of data.
11
12 The source code of the module can be found on the github_ page.
13
14 .. _github: http://github.com/pytroll/python-geotiepoints
15
16 .. contents::
17
18 Installation - Pip
19 ------------------
20
21 You can install the latest version of python-geotiepoints with pip::
22
23 pip install python-geotiepoints
24
25 Alternatively, you can download the source code from github_::
26
27 git clone git://github.com/pytroll/python-geotiepoints.git
28
29 and then run::
30
31 pip install .
32
33 Alternatively, to install the package in a "development" mode when you
34 want to edit the source code and see the effects::
35
36 pip install -e .
37
38 Installation - Conda
39 --------------------
40
41 The python-geotiepoints package is also available on conda-forge. To install
42 into an existing conda environment run::
43
44 conda install -c conda-forge python-geotiepoints
45
46 Usage for longitude and latitude interpolation
47 ----------------------------------------------
48
49 A typical usage of the package.
50
51 >>> from geotiepoints.geointerpolator import GeoInterpolator
52 >>> import numpy as np
53 >>> tie_cols = np.arange(0, 11, 5)
54 >>> tie_rows = np.arange(0, 5, 2)
55 >>> fine_cols = np.arange(0, 11)
56 >>> fine_rows = np.arange(0, 5)
57 >>> tie_lons = (np.arange(3*3) + 30).reshape((3, 3))
58 >>> tie_lats = (np.arange(3*3) - 4.5).reshape((3, 3))
59 >>> interpolator = GeoInterpolator((tie_lons, tie_lats),
60 ... (tie_rows, tie_cols),
61 ... (fine_rows, fine_cols),
62 ... 2, 2)
63 >>> lons, lats = interpolator.interpolate()
64 >>> print([round(lon, 5) for lon in lons[2:4,2:4].ravel()]) # doctest: +SKIP
65 [33.40008, 33.60007, 34.89802, 35.09801]
66 >>> print([round(lat, 5) for lat in lats[2:4,2:4].ravel()]) # doctest: +SKIP
67 [-1.09998, -0.89998, 0.39951, 0.5995]
68
69
70 Example - Aqua/Terra MODIS data
71 -------------------------------
72
73 The application is currently being used in operation at SMHI to upsample the
74 thinned MODIS products received via EUMETCast. For this purpose the performance
75 is good, both in terms of achieved accuracy and processing speed.
76
77 EUMETSAT is relaying Terra and Aqua MODIS level 1 data from NOAA in real time
78 for the European User community. The data are disseminated via EUMETCast and
79 can be received with a common DVB antenna. Before uploading it EUMETSAT is
80 thinning the data to contain only a subset of MODIS channels, and also data are
81 being filtered so only data over the European area are being sent.
82
83 The radiance data (reflectances and brightness temperatures) are in 1km
84 resolution but contain geolocation only on a thinned grid - on tiepoints every
85 5th km. So in order to project and further process the data we need to upsample or
86 interpolate and exrapolate the data to the full 1km grid.
87
88 We have checked the accuracy against the full resolution geolocation
89 data. These full geolocation data were available previously in seperate files
90 on the same EUMETCast stream. But due to the significant band width occupied
91 and the relatively modets usage of the data EUMETSAT decided to stop this
92 dissemination in February 2012 and save costs and band width for other
93 products. With this tool the need for the full resolution geolocation is no
94 more as critical as before.
95
96 There is one significant issue here, however, which is that the geolocation
97 provided in the MODIS level1b products are terrain corrected. So in order to
98 restore the full 1km geolocation data from the thinned tiepoint gridded data
99 now available on EUMETCast one would need access to the exact terrain model
100 used in the MODIS processing, and also some more advanced method than what is
101 provided with this application.
102
103 But outside areas with high and rough topography the accuracy is rather good
104 using this tool. Below is an example with a 5 minute granule over Western
105 Africa and the Canary Islands from August 21st, 2011. First we show the
106 accuracy of the geolocation after interpolation. And then the image data first
107 the raw unprojected granule, and then the projected (1km Mercator) data.
108
109 Comparing interpolated lon,lat with the true ones for the granule shown below.
110
111 .. image:: images/scatter_cartesian_distances_thumb.png
112
113 We see that the method applied give deviations far less than one pixel, except
114 for a few pixels towards the edge of the swath. These larger deviations we
115 refer to the inherrent problem of interpolating terrain corrected geolocation
116 without the knowledge of the terrain model used.
117
118
119 Below is an RGB image of the granule.
120
121 .. image:: images/terra_20110821_1115_rednsow_int_thumb.png
122
123
124 And here the projected data.
125
126 .. image:: images/terra_20110821_1115_maspalomas_rednsow_int_thumb.png
127
128
129
130
131 Predefined functions for satellite data
132 ---------------------------------------
133
134 .. autofunction:: geotiepoints.metop20kmto1km
135 .. autofunction:: geotiepoints.modis5kmto1km
136 .. autofunction:: geotiepoints.modis1kmto500m
137 .. autofunction:: geotiepoints.modis1kmto250m
138
139
140
141 Indices and tables
142 ==================
143
144 * :ref:`genindex`
145 * :ref:`modindex`
146 * :ref:`search`
147