Skip to content

Commit

Permalink
Update unittests
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Dybbroe <Adam.Dybbroe@smhi.se>
  • Loading branch information
adybbroe committed Nov 29, 2018
1 parent 26d3647 commit 81c22a6
Showing 1 changed file with 84 additions and 123 deletions.
207 changes: 84 additions & 123 deletions trollsched/tests/test_satpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,86 +31,61 @@
from pyorbital.orbital import Orbital


LONS1 = np.array([-122.29913729, -126.04783309, -131.54385363, -140.34457195,
-155.78803427, 177.07901485, 143.17308804, 119.09779572,
105.69172088, 97.93616567, 93.03135572, 89.68345994,
87.26010432, 85.42516118, 83.98598585, 82.82504079,
81.86683435, 81.06077901, 80.37175346, 79.77463329,
79.25097987, 78.786959, 78.37198927, 77.99783892,
77.65800714, 77.34729064, 77.06147401, 76.79710452,
76.55132567, 76.32175241, 76.10637628, 75.90349247,
75.71164307, 75.52957243, 75.35619181, 75.19055092,
75.03181505, 74.87924636, 74.73218847, 74.59005373,
74.45231256, 74.31848442, 74.18813012, 74.0608452,
73.93625404, 73.81400477, 73.69376448, 73.57521487,
73.45804805, 73.34196235, 73.22665809, 73.11183296,
72.99717693, 72.88236627, 72.76705639, 72.65087264,
72.53339842, 72.41415887, 72.29259784, 72.16804392,
72.03965796, 71.90634749, 71.76661774, 71.61828892,
71.45957469, 66.02111672, 60.62910317, 55.36663834,
50.30484964, 45.49802549, 40.98192779, 36.77486609,
32.88055429, 29.29169986, 25.99352548, 22.96676778,
20.18998791, 17.64121314, 15.29901722, 13.14317182,
11.1549917, 9.3174736, 7.61530331, 6.0347843,
4.5637236, 3.19129834, 1.90791769, -0.27010734,
-1.78807143, -3.06483263, -4.15881214, -5.116189,
-5.96754616, -6.73429808, -7.43207874, -8.07268005,
-8.66523239, -9.21696007, -9.73368473, -10.22017188,
-10.68037653, -11.11762133, -11.53472862, -11.93412013,
-12.31789334, -12.68788113, -13.04569866, -13.392781,
-13.73041348, -14.05975651, -14.38186617, -14.69771139,
-15.0081885, -15.31413371, -15.61633396, -15.91553641,
-16.21245702, -16.50778829, -16.80220647, -17.0963784,
-17.39096805, -17.68664309, -17.98408147, -18.28397825,
-18.58705276, -18.89405641, -19.2057812, -19.5230692,
-19.84682337, -20.17801994, -20.51772283, -20.86710061,
-21.22744677, -21.60020406, -21.98699405, -22.38965364,
-22.81028023, -23.25128869, -23.71548384, -24.20615392,
-24.7271931, -25.28326445, -25.88002092, -26.52441138,
-27.2251146, -27.99317242, -28.84294497, -29.79361073,
-30.87164244, -32.11515837, -33.58222589, -35.36860848,
-35.21433484, -35.1791126, -35.18076657, -35.22429227,
-35.31584841, -35.46309023, -35.67562508, -35.96564469,
-36.34881853, -36.84558066, -37.48302415, -38.29775696,
-39.3403228, -40.68224432, -42.42759794, -44.73265038,
-47.84014874, -52.14015034, -58.27495326, -67.28863935,
-80.65010901, -99.30453147], dtype='float64')

LATS1 = np.array([84.60636068, 85.92648911, 86.98555849, 87.84164277, 88.49911968,
88.88834005, 88.90233394, 88.62448747, 88.23555366, 87.82310862,
87.41630911, 87.02428912, 86.64939216, 86.29150279, 85.94959841,
85.6223543, 85.30839168, 85.00638004, 84.71507626, 84.43333547,
84.16010932, 83.89443866, 83.63544439, 83.38231774, 83.134311,
82.89072884, 82.65092035, 82.4142718, 82.18020003, 81.94814634,
81.71757085, 81.4879472, 81.25875744, 81.02948708, 80.79962022,
80.5686345, 80.33599603, 80.10115389, 79.86353437, 79.62253449,
79.37751496, 79.12779203, 78.87262831, 78.61122202, 78.3426943,
78.06607423, 77.78028072, 77.48410052, 77.1761612, 76.85489755,
76.51850934, 76.16490749, 75.7916446, 75.3958239, 74.97397798,
74.52190409, 74.03443589, 73.50511898, 72.92573674, 72.28559309,
71.57038281, 70.76032058, 69.82683886, 68.72625465, 67.40109717,
67.39527506, 67.1998889, 66.81969821, 66.26351933, 65.54326755,
64.67282502, 63.66694946, 62.54037135, 61.3071424, 59.98023066,
58.57131903, 57.09075181, 55.54757738, 53.94964584, 52.30373254,
50.6156685, 48.89046658, 47.13243744, 45.34529268, 43.53223486,
41.69603483, 39.83909758, 36.33799057, 36.81661145, 37.20036236,
37.5157317, 37.78169599, 38.01045368, 38.21030843, 38.38716181,
38.54535234, 38.68815761, 38.81811012, 38.93720418, 39.04703598,
39.14890123, 39.24386487, 39.33281184, 39.41648483, 39.49551278,
39.57043268, 39.64170648, 39.70973443, 39.77486557, 39.83740624,
39.89762686, 39.95576757, 40.01204278, 40.06664499, 40.11974793,
40.17150924, 40.22207272, 40.27157024, 40.32012336, 40.36784474,
40.41483935, 40.46120554, 40.5070359, 40.55241811, 40.59743562,
40.64216823, 40.68669262, 40.73108281, 40.77541046, 40.81974518,
40.86415471, 40.90870493, 40.95345981, 40.99848114, 41.043828,
41.08955592, 41.13571558, 41.18235086, 41.22949601, 41.27717143,
41.32537756, 41.37408581, 41.42322508, 41.47266125, 41.5221656,
41.57136466, 41.61965857, 41.66608254, 41.70906088, 41.74594256,
41.77205078, 41.7785075, 45.44971128, 47.49263795, 49.53356846,
51.57221573, 53.60824704, 55.64126787, 57.67079975, 59.69624952,
61.71686578, 63.73167578, 65.73939198, 67.73826987, 69.72588497,
71.69877148, 73.65181389, 75.57717873, 77.46235016, 79.28634129,
81.01208492, 82.57105105, 83.83562001, 84.59522958], dtype='float64')
LONS1 = np.array([-122.29913729160562, -131.54385362589042, -155.788034272281,
143.1730880418349, 105.69172088208997, 93.03135571771092,
87.26010432019743, 83.98598584966442, 81.86683434871546,
80.37175346216411, 79.2509798668123, 78.37198926578984,
77.65800714027662, 77.06147400915819, 76.55132566889495,
76.10637628220547, 75.71164306799828, 75.35619180525052,
75.03181505238287, 74.73218847041143, 74.45231256197947,
74.18813012461848, 73.9362540393912, 73.69376447765231,
73.45804804675883, 73.22665809422263, 72.99717692793544,
72.76705638792168, 72.53339841609603, 72.2925978414254,
72.03965795937306, 71.76661774368146, 71.45957469190316,
57.97687872167697, 45.49802548616658, 34.788857347919546,
25.993525469714424, 18.88846123000295, 13.14317179269443,
8.450362684274728, -0.27010733525252295, -3.0648326302431794,
-5.116189000358824, -6.73429807721795, -8.072680053386163,
-9.21696007364773, -10.220171884036919, -11.11762132513045,
-11.934120125548072, -12.687881125682765, -13.392781001351315,
-14.059756511026736, -14.69771138916782, -15.314133712696703,
-15.915536409615735, -16.507788289068856, -17.09637839792269,
-17.686643087306685, -18.283978247944123, -18.894056410060063,
-19.523069195727878, -20.17801994245519, -20.867100607022966,
-21.600204055760642, -22.389653641849733, -23.251288693929943,
-24.206153922914886, -25.283264445138713, -26.524411381004743,
-27.993172418988525, -29.79361072725673, -32.11515837055801,
-35.36860848223405, -35.38196057933595, -35.96564490844792,
-37.14469461070555, -39.34032289002443, -43.49756191648018,
-52.140150361811244, -73.32968630186114], dtype='float64')

LATS1 = np.array([84.60636067724808, 86.98555849233523, 88.49911967556697,
88.90233393880413, 88.23555365613707, 87.41630911481282,
86.64939216187459, 85.94959841469182, 85.30839167814023,
84.71507625588431, 84.16010931725756, 83.63544438659248,
83.13431099825148, 82.65092034888734, 82.18020003036649,
81.71757084925224, 81.25875743723827, 80.79962022032255,
80.33599602524967, 79.86353436733512, 79.37751495806062,
78.87262831355378, 78.3426942980262, 77.78028071690198,
77.17616119674511, 76.51850934329316, 75.79164459606967,
74.97397797613992, 74.03443588562436, 72.92573674313518,
71.57038280824118, 69.82683886377178, 67.40109717220513,
67.03242839212335, 65.54326755696877, 63.11784822611803,
59.98023069591168, 56.32647323215378, 52.30373268534935,
48.01531077177335, 36.33799056582854, 37.200362356448125,
37.78169598891329, 38.210308430109684, 38.54535234179983,
38.8181101172057, 39.0470359762339, 39.24386487280032,
39.41648482997921, 39.57043267820405, 39.70973443234515,
39.83740623634436, 39.955767569171485, 40.06664498984812,
40.17150923539549, 40.271570238680745, 40.36784473887322,
40.46120553672548, 40.55241811035527, 40.64216822927882,
40.7310828091462, 40.819745180454284, 40.90870492549053,
40.99848114410508, 41.08955592221846, 41.18235086149538,
41.27717142920562, 41.37408580927609, 41.472661254399455,
41.57136466452366, 41.66608254408796, 41.745942562974314,
41.77850750277849, 54.62516158367828, 59.69624962433962,
64.7365168572082, 69.72588498397877, 74.61859631181376,
79.2863412851444, 83.25136141880888], dtype='float64')

LONS2 = np.array([-174.41109502, 167.84584132, 148.24213696, 130.10334782,
115.7074828, 105.07369809, 97.28481583, 91.4618503,
Expand All @@ -120,52 +95,38 @@
65.79407472, 64.86682945, 63.97016605, 63.09478077,
62.23190558, 61.37287373, 60.50863405, 59.62912286,
58.72232744, 57.77268809, 56.75796498, 55.6419694,
54.36007027, 49.02060788, 41.41762911, 41.15660793,
40.9331126, 40.73252665, 40.54677784, 40.37092304,
40.20150965, 40.0358693, 39.87175642, 39.70713409,
39.54002703, 39.36840323, 39.1900621, 39.00251256,
38.80282499, 38.58743647, 38.35188019, 38.09039231,
37.79531831, 37.45618154, 37.05815986, 36.57947382,
35.98665163, 35.22533847, 34.20085643, 32.73220377,
30.42514135, 26.23397747, 16.29417395, -23.91719576,
-102.71481425, -122.5294795, -129.09284487, -157.23082856], dtype='float64')
54.36007027, 41.41762911, 41.15660793, 40.9331126,
40.73252665, 40.54677784, 40.37092304, 40.20150965,
40.0358693, 39.87175642, 39.70713409, 39.54002703,
39.36840323, 39.1900621, 39.00251256, 38.80282499,
38.58743647, 38.35188019, 38.09039231, 37.79531831,
37.45618154, 37.05815986, 36.57947382, 35.98665163,
35.22533847, 34.20085643, 32.73220377, 30.42514135,
26.23397747, 16.29417395, -23.91719576, -102.71481425,
-122.5294795, -129.09284487], dtype='float64')

LATS2 = np.array([83.23214786, 84.90973645, 85.62529048, 85.74243351, 85.52147568,
85.13874302, 84.69067959, 84.22338069, 83.75720094, 83.30023412,
82.85480916, 82.42053485, 81.9957309, 81.57810129, 81.16504231,
80.75376801, 80.34133891, 79.92463458, 79.50028749, 79.0645828,
78.61332046, 78.14162813, 77.64370408, 77.11245516, 76.5389713,
75.91173559, 75.21538754, 74.42869094, 73.52099029, 72.44554294,
71.12561977, 69.42093758, 67.03973793, 67.32482671, 67.40770791,
69.8341456, 71.57844446, 72.93459921, 74.04414258, 74.98457279,
75.80317362, 76.53102217, 77.1897121, 77.79492994, 78.3585095,
78.88968633, 79.39590402, 79.88335693, 80.35737249, 80.8226939,
81.28370137, 81.74459732, 82.20957417, 82.68298027, 83.16949849,
83.67435372, 84.20356848, 84.76429067, 85.36521771, 86.01711637,
86.73327122, 87.5286869, 88.40887156, 89.21959299, 88.71884272,
87.09172665, 84.6670132, 84.33222435], dtype='float64')

LONS3 = np.array([-8.90844155, -6.41788507, 15.9722481, 25.41135812, 33.82664554,
48.40057578, 49.68649967, 49.67357678, 49.660659, 49.64774633,
49.63483878, 49.62193632, 49.60903897, 49.59614672, 49.58325957,
49.57037752, 49.55750056, 49.54462869, 49.53176192, 49.51890023,
49.50604363, 49.49319211, 49.48034567, 45.3479991, 44.06777983,
30.05979749, 22.33029612, 13.8829146, -5.77610172, -7.97353711,
-8.8574793, -8.86063533, -8.86379522, -8.86695898, -8.8701266,
-8.8732981, -8.87647348, -8.87965274, -8.88283588, -8.88602292,
-8.88921386, -8.89240869, -8.89560744, -8.89881009, -8.90201665,
-8.90522714], dtype='float64')

LATS3 = np.array([66.93178962, 67.06891155, 66.53360116, 65.27837503, 63.4969562,
58.28365842, 57.64571471, 57.63885271, 57.63198927, 57.62512438,
57.61825804, 57.61139026, 57.60452105, 57.59765039, 57.59077829,
57.58390475, 57.57702977, 57.57015336, 57.56327551, 57.55639622,
57.5495155, 57.54263335, 57.53574976, 55.08857632, 55.67467008,
60.40416556, 61.99561206, 63.11651715, 63.66434851, 63.55726406,
66.78221588, 66.79156549, 66.80091493, 66.8102642, 66.81961331,
66.82896226, 66.83831103, 66.84765964, 66.85700809, 66.86635637,
66.87570448, 66.88505242, 66.89440019, 66.9037478, 66.91309524,
66.92244251], dtype='float64')
71.12561977, 69.42093758, 67.03973793, 67.40770791, 69.8341456,
71.57844446, 72.93459921, 74.04414258, 74.98457279, 75.80317362,
76.53102217, 77.1897121, 77.79492994, 78.3585095, 78.88968633,
79.39590402, 79.88335693, 80.35737249, 80.8226939, 81.28370137,
81.74459732, 82.20957417, 82.68298027, 83.16949849, 83.67435372,
84.20356848, 84.76429067, 85.36521771, 86.01711637, 86.73327122,
87.5286869, 88.40887156, 89.21959299, 88.71884272, 87.09172665,
84.6670132], dtype='float64')

LONS3 = np.array([-8.66259458, -6.20984986, 15.99813586, 25.41134052, 33.80598414,
48.28641356, 49.55596283, 45.21769275, 43.95449327, 30.04053601,
22.33028017, 13.90584249, -5.59290326, -7.75625031], dtype='float64')

LATS3 = np.array([66.94713585, 67.07854554, 66.53108388, 65.27837805, 63.50223596,
58.33858588, 57.71210872, 55.14964148, 55.72506407, 60.40889798,
61.99561474, 63.11425455, 63.67173255, 63.56939058], dtype='float64')


def assertNumpyArraysEqual(self, other):
Expand Down Expand Up @@ -268,22 +229,22 @@ def test_swath_coverage(self):
overp = Pass('NOAA-19', tstart, tend, orb=self.n19orb, instrument='avhrr')

cov = overp.area_coverage(self.euron1)
self.assertAlmostEqual(cov, 0.103960, 5)
self.assertAlmostEqual(cov, 0.103526, 5)

overp = Pass('NOAA-19', tstart, tend, orb=self.n19orb, instrument='avhrr', frequency=100)

cov = overp.area_coverage(self.euron1)
self.assertAlmostEqual(cov, 0.103960, 5)
self.assertAlmostEqual(cov, 0.103526, 5)

overp = Pass('NOAA-19', tstart, tend, orb=self.n19orb, instrument='avhrr', frequency=133)

cov = overp.area_coverage(self.euron1)
self.assertAlmostEqual(cov, 0.103960, 5)
self.assertAlmostEqual(cov, 0.103526, 5)

overp = Pass('NOAA-19', tstart, tend, orb=self.n19orb, instrument='avhrr', frequency=300)

cov = overp.area_coverage(self.euron1)
self.assertAlmostEqual(cov, 0.103960, 5)
self.assertAlmostEqual(cov, 0.103526, 5)

def tearDown(self):
"""Clean up"""
Expand Down

0 comments on commit 81c22a6

Please sign in to comment.