| 129 | == Gridding and Mapping the Data == |
| 130 | |
| 131 | Now that you have an IGM file in the required projection it is time to map the level-1 data to a regular grid. To do this you can use a GIS, some alternative mapping software or the ARSF aplmap package. This will take in the IGM file and level-1 data file and output a map of the level-1 data in the IGM projection. |
| 132 | |
| 133 | === Using aplmap === |
| 134 | |
| 135 | The aplmap software is capable of mapping a number of bands of the level-1 data to the projection system of the given IGM file, using the selected interpolation method. |
| 136 | |
| 137 | === Information on interpolation methods === |
| 138 | |
| 139 | This section briefly describes the algorithms used for the interpolation of the data within the aplmap software. |
| 140 | |
| 141 | '''Nearest Neighbour''' |
| 142 | |
| 143 | Mapping with nearest neighbour searches the neighbourhood around the grid cell and finds the closest point to this from the IGM file. The corresponding value from the level-1 file is then used for this pixel. This option is selected using -interpolation nearest on the command line. |
| 144 | |
| 145 | '''Inverse Distance Weighted''' |
| 146 | |
| 147 | The inverse distance weighted algorithm first searches for, at most, the X nearest points within the maximum allowed search distance. The number X is specified from the command line in the -interpolation option. Then when these points have been found it calculates a weight for each point and applies this to the value of the data from the level-1 file. The weight for point i is calculated as (distance^−2) / (Sum distance^−2) . This option is selected using -interpolation idw maxpoints where maxpoints is the maximum number of points you want to use. |
| 148 | |
| 149 | '''Bilinear''' |
| 150 | |
| 151 | For the bilinear interpolation algorithm, 4 neighbouring points are required. These are identified by using the level-3 position as an initial search position and finding the 4 nearest points that form a quadrilateral containing this level-3 position. The level-3 point that is being interpolated is found in terms of a proportional distance, U and V, between these 4 quadrilateral vertex points. The values of U and V are calculated using the following formulae (in level-3 space): |
| 152 | |
| 153 | P = A + U ∗ (B − A) |
| 154 | Q = D + U ∗ (C − D) |
| 155 | X = P + V ∗ (Q − P ) |
| 156 | |
| 157 | The values of U and V, which are within the range 0-1, are then used to weight the level-1 pixel values in the interpolation formula: |
| 158 | |
| 159 | f(X) = f(A) ∗ (1 − V ) ∗ (1 − U ) + f(B) ∗ (1 − V ) ∗ U + f(D) ∗ (1 − U ) ∗ V + f(C) ∗ U ∗ V |
| 160 | |
| 161 | where f(x) is the data value of cell x. |
| 162 | |
| 163 | Bilinear interpolation can be selected using -interpolation bilinear on the command line. |