-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavigatorPolarStereographic.java
97 lines (78 loc) · 1.87 KB
/
NavigatorPolarStereographic.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import java.io.DataInputStream;
import java.io.IOException;
import java.lang.String;
import edu.wisc.ssec.mcidas.AncillaryData;
import edu.wisc.ssec.mcidas.PSnav;
/**
* NavigatorPolarStereographic provides the ability to navigate
* imagery in the Polar Stereographic projection. This class
* is essentially a math copy of the McIDAS source module
* nvxps.dlm.
*
* @version 1.3 6 Aug 1999
* @author Tommy Jasmin, SSEC
*/
class NavigatorPolarStereographic implements Navigator {
private PSnav ng = null;
private float centralLat;
private float centralLon;
/**
*
* constructor
*
* @param ad AncillaryData object
* @param navBlock navigation parameters array
*
*/
public NavigatorPolarStereographic (
AncillaryData ad,
int [] navBlock
)
throws IOException, NavigatorPSException
{
ng = new PSnav(navBlock);
ng.setRes(ad.getLineRes(), ad.getElemRes());
ng.setImageStart(ad.getStartLine(), ad.getStartElem());
ng.setStart(1,1);
// store central lat and lon
centralLat = ((float) navBlock[3])/10000.f;
centralLon = ((float) navBlock[5])/10000.f;
centralLon = -centralLon;
}
/**
*
* return central latitude
*
*/
public float getCentralLat () {
return (centralLat);
}
/**
*
* return central longitude
*
*/
public float getCentralLon () {
return (centralLon);
}
/**
*
* given a set of lat/lon, return the corresponding line/element
*
* @param latLon an array of latitudes and longitudes
*
*/
public double [][] toLinEle ( double [][] latLon) {
return ng.toLinEle(latLon);
}
/**
*
* given a set of lines/elements, return the corresponding lats/lons.
*
* @param linEle an array of lines and elements
*
*/
public double [][] toLatLon ( double [][] linEle) {
return ng.toLatLon(linEle);
}
}