##// END OF EJS Templates
Task #716: ABS Views, plot beams patterns with OverJRO and overJroShow scripts...
Fiorella Quino -
r178:6920059c9c16
parent child
Show More
@@ -0,0 +1,25
1 {% load static %}
2 {% load bootstrap3 %}
3 {% load main_tags %}
4
5 {% block content %}
6 <style>
7 </style>
8
9 <div id="PictureOverJRODown" style="float: right">
10 <img id="imgMainDown" src="{% url 'url_plot_down_beam' beam.abs_conf.id beam.id %}" alt="Error in Parameters" style="width:360px;height:270px;">
11 <img id="imgLoaderDown" src="{% static 'images/loading_loading.gif' %}" alt="Error in Parameters" width="50" height="50" align="left">
12
13 </div>
14
15 <script>
16
17 $('#imgMainDown').hide();
18 $('#imgLoaderDown').show();
19 $('#imgMainDown').load(function(){
20 $('#imgLoaderDown').hide();
21 $('#imgMainDown').show();
22 });
23 //window.onload = function () { alert("It's loaded!") }
24 </script>
25 {% endblock %}
@@ -0,0 +1,25
1 {% load static %}
2 {% load bootstrap3 %}
3 {% load main_tags %}
4
5 {% block content %}
6 <style>
7 </style>
8
9 <div id="PictureOverJROUp" style="float: right">
10 <img id="imgMain" src="{% url 'url_plot_up_beam' beam.abs_conf.id beam.id %}" alt="Error in Parameters" style="width:360px;height:270px;">
11 <img id="imgLoader" src="{% static 'images/loading_loading.gif' %}" alt="Error in Parameters" width="50" height="50">
12
13 </div>
14
15 <script>
16
17 $('#imgMain').hide();
18 $('#imgLoader').show();
19 $('#imgMain').load(function(){
20 $('#imgLoader').hide();
21 $('#imgMain').show();
22 });
23
24 </script>
25 {% endblock %}
This diff has been collapsed as it changes many lines, (1419 lines changed) Show them Hide them
@@ -0,0 +1,1419
1 """
2 The module ASTRO_COORDS.py gathers classes and functions for coordinates transformation. Additiona-
3 lly a class EquatorialCorrections and celestial bodies are defined. The first of these is to correct
4 any error in the location of the body and the second to know the location of certain celestial bo-
5 dies in the sky.
6
7 MODULES CALLED:
8 OS, NUMPY, NUMERIC, SCIPY, TIME_CONVERSIONS
9
10 MODIFICATION HISTORY:
11 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ Sep 20, 2009.
12 """
13
14 import numpy
15 #import Numeric
16 import scipy.interpolate
17 import os
18 import sys
19 import TimeTools
20 import Misc_Routines
21
22 class EquatorialCorrections():
23 def __init__(self):
24 """
25 EquatorialCorrections class creates an object to call methods to correct the loca-
26 tion of the celestial bodies.
27
28 Modification History
29 --------------------
30 Converted to Object-oriented Programming by Freddy Galindo, ROJ, 27 September 2009.
31 """
32
33 pass
34
35 def co_nutate(self,jd,ra,dec):
36 """
37 co_nutate calculates changes in RA and Dec due to nutation of the Earth's rotation
38 Additionally it returns the obliquity of the ecliptic (eps), nutation in the longi-
39 tude of the ecliptic (d_psi) and nutation in the pbliquity of the ecliptic (d_eps).
40
41 Parameters
42 ----------
43 jd = Julian Date (Scalar or array).
44 RA = A scalar o array giving the Right Ascention of interest.
45 Dec = A scalar o array giving the Right Ascention of interest.
46
47 Return
48 ------
49 d_ra = Correction to ra due to nutation.
50 d_dec = Correction to dec due to nutation.
51
52 Examples
53 --------
54 >> Julian = 2462088.7
55 >> Ra = 41.547213
56 >> Dec = 49.348483
57 >> [d_ra,d_dec,eps,d_psi,d_eps] = co_nutate(julian,Ra,Dec)
58 >> print d_ra, d_dec, eps, d_psi, d_eps
59 [ 15.84276651] [ 6.21641029] [ 0.4090404] [ 14.85990198] [ 2.70408658]
60
61 Modification history
62 --------------------
63 Written by Chris O'Dell, 2002.
64 Converted to Python by Freddy R. Galindo, ROJ, 26 September 2009.
65 """
66
67 jd = numpy.atleast_1d(jd)
68 ra = numpy.atleast_1d(ra)
69 dec = numpy.atleast_1d(dec)
70
71 # Useful transformation constants
72 d2as = numpy.pi/(180.*3600.)
73
74 # Julian centuries from J2000 of jd
75 T = (jd - 2451545.0)/36525.0
76
77 # Must calculate obliquity of ecliptic
78 [d_psi, d_eps] = self.nutate(jd)
79 d_psi = numpy.atleast_1d(d_psi)
80 d_eps = numpy.atleast_1d(d_eps)
81
82 eps0 = (23.4392911*3600.) - (46.8150*T) - (0.00059*T**2) + (0.001813*T**3)
83 # True obliquity of the ecliptic in radians
84 eps = (eps0 + d_eps)/3600.*Misc_Routines.CoFactors.d2r
85
86 # Useful numbers
87 ce = numpy.cos(eps)
88 se = numpy.sin(eps)
89
90 # Convert Ra-Dec to equatorial rectangular coordinates
91 x = numpy.cos(ra*Misc_Routines.CoFactors.d2r)*numpy.cos(dec*Misc_Routines.CoFactors.d2r)
92 y = numpy.sin(ra*Misc_Routines.CoFactors.d2r)*numpy.cos(dec*Misc_Routines.CoFactors.d2r)
93 z = numpy.sin(dec*Misc_Routines.CoFactors.d2r)
94
95 # Apply corrections to each rectangular coordinate
96 x2 = x - (y*ce + z*se)*d_psi*Misc_Routines.CoFactors.s2r
97 y2 = y + (x*ce*d_psi - z*d_eps)*Misc_Routines.CoFactors.s2r
98 z2 = z + (x*se*d_psi + y*d_eps)*Misc_Routines.CoFactors.s2r
99
100 # Convert bask to equatorial spherical coordinates
101 r = numpy.sqrt(x2**2. + y2**2. + z2**2.)
102 xyproj =numpy.sqrt(x2**2. + y2**2.)
103
104 ra2 = x2*0.0
105 dec2 = x2*0.0
106
107 xyproj = numpy.atleast_1d(xyproj)
108 z = numpy.atleast_1d(z)
109 r = numpy.atleast_1d(r)
110 x2 = numpy.atleast_1d(x2)
111 y2 = numpy.atleast_1d(y2)
112 z2 = numpy.atleast_1d(z2)
113 ra2 = numpy.atleast_1d(ra2)
114 dec2 = numpy.atleast_1d(dec2)
115
116 w1 = numpy.where((xyproj==0) & (z!=0))
117 w2 = numpy.where(xyproj!=0)
118
119 # Calculate Ra and Dec in radians (later convert to degrees)
120 if w1[0].size>0:
121 # Places where xyproj=0 (point at NCP or SCP)
122 dec2[w1] = numpy.arcsin(z2[w1]/r[w1])
123 ra2[w1] = 0
124
125 if w2[0].size>0:
126 # Places other than NCP or SCP
127 ra2[w2] = numpy.arctan2(y2[w2],x2[w2])
128 dec2[w2] = numpy.arcsin(z2[w2]/r[w2])
129
130 # Converting to degree
131 ra2 = ra2/Misc_Routines.CoFactors.d2r
132 dec2 = dec2/Misc_Routines.CoFactors.d2r
133
134 w = numpy.where(ra2<0.)
135 if w[0].size>0:
136 ra2[w] = ra2[w] + 360.
137
138 # Return changes in Ra and Dec in arcseconds
139 d_ra = (ra2 -ra)*3600.
140 d_dec = (dec2 - dec)*3600.
141
142 return d_ra, d_dec, eps, d_psi, d_eps
143
144 def nutate(self,jd):
145 """
146 nutate returns the nutation in longitude and obliquity for a given Julian date.
147
148 Parameters
149 ----------
150 jd = Julian ephemeris date, scalar or vector.
151
152 Return
153 ------
154 nut_long = The nutation in longitude.
155 nut_obliq = The nutation in latitude.
156
157 Example
158 -------
159 >> julian = 2446895.5
160 >> [nut_long,nut_obliq] = nutate(julian)
161 >> print nut_long, nut_obliq
162 -3.78793107711 9.44252069864
163
164 >> julians = 2415020.5 + numpy.arange(50)
165 >> [nut_long,nut_obliq] = nutate(julians)
166
167 Modification History
168 --------------------
169 Written by W.Landsman (Goddard/HSTX), June 1996.
170 Converted to Python by Freddy R. Galindo, ROJ, 26 September 2009.
171 """
172
173 jd = numpy.atleast_1d(jd)
174
175 # Form time in Julian centuries from 1900
176 t = (jd - 2451545.0)/36525.0
177
178 # Mean elongation of the moon
179 coeff1 = numpy.array([1/189474.0,-0.0019142,445267.111480,297.85036])
180 d = numpy.poly1d(coeff1)
181 d = d(t)*Misc_Routines.CoFactors.d2r
182 d = self.cirrange(d,rad=1)
183
184 # Sun's mean elongation
185 coeff2 = numpy.array([-1./3e5,-0.0001603,35999.050340,357.52772])
186 m = numpy.poly1d(coeff2)
187 m = m(t)*Misc_Routines.CoFactors.d2r
188 m = self.cirrange(m,rad=1)
189
190 # Moon's mean elongation
191 coeff3 = numpy.array([1.0/5.625e4,0.0086972,477198.867398,134.96298])
192 mprime = numpy.poly1d(coeff3)
193 mprime = mprime(t)*Misc_Routines.CoFactors.d2r
194 mprime = self.cirrange(mprime,rad=1)
195
196 # Moon's argument of latitude
197 coeff4 = numpy.array([-1.0/3.27270e5,-0.0036825,483202.017538,93.27191])
198 f = numpy.poly1d(coeff4)
199 f = f(t)*Misc_Routines.CoFactors.d2r
200 f = self.cirrange(f,rad=1)
201
202 # Longitude fo the ascending node of the Moon's mean orbit on the ecliptic, measu-
203 # red from the mean equinox of the date.
204 coeff5 = numpy.array([1.0/4.5e5,0.0020708,-1934.136261,125.04452])
205 omega = numpy.poly1d(coeff5)
206 omega = omega(t)*Misc_Routines.CoFactors.d2r
207 omega = self.cirrange(omega,rad=1)
208
209 d_lng = numpy.array([0,-2,0,0,0,0,-2,0,0,-2,-2,-2,0,2,0,2,0,0,-2,0,2,0,0,-2,0,-2,0,0,\
210 2,-2,0,-2,0,0,2,2,0,-2,0,2,2,-2,-2,2,2,0,-2,-2,0,-2,-2,0,-1,-2,1,0,0,-1,0,\
211 0,2,0,2])
212
213 m_lng = numpy.array([0,0,0,0,1,0,1,0,0,-1])
214 m_lng = numpy.append(m_lng,numpy.zeros(17))
215 m_lng = numpy.append(m_lng,numpy.array([2,0,2,1,0,-1,0,0,0,1,1,-1,0,0,0,0,0,0,-1,-1,0,0,\
216 0,1,0,0,1,0,0,0,-1,1,-1,-1,0,-1]))
217
218 mp_lng = numpy.array([0,0,0,0,0,1,0,0,1,0,1,0,-1,0,1,-1,-1,1,2,-2,0,2,2,1,0,0, -1, 0,\
219 -1,0,0,1,0,2,-1,1,0,1,0,0,1,2,1,-2,0,1,0,0,2,2,0,1,1,0,0,1,-2,1,1,1,-1,3,0])
220
221 f_lng = numpy.array([0,2,2,0,0,0,2,2,2,2,0,2,2,0,0,2,0,2,0,2,2,2,0,2,2,2,2,0,0,2,0,0,\
222 0,-2,2,2,2,0,2,2,0,2,2,0,0,0,2,0,2,0,2,-2,0,0,0,2,2,0,0,2,2,2,2])
223
224 om_lng = numpy.array([1,2,2,2,0,0,2,1,2,2,0,1,2,0,1,2,1,1,0,1,2,2,0,2,0,0,1,0,1,2,1, \
225 1,1,0,1,2,2,0,2,1,0,2,1,1,1,0,1,1,1,1,1,0,0,0,0,0,2,0,0,2,2,2,2])
226
227 sin_lng = numpy.array([-171996,-13187,-2274,2062,1426,712,-517,-386,-301, 217, -158, \
228 129,123,63,63,-59,-58,-51,48,46,-38,-31,29,29,26,-22,21,17,16,-16,-15,-13,\
229 -12,11,-10,-8,7,-7,-7,-7,6,6,6,-6,-6,5,-5,-5,-5,4,4,4,-4,-4,-4,3,-3,-3,-3,\
230 -3,-3,-3,-3])
231
232 sdelt = numpy.array([-174.2,-1.6,-0.2,0.2,-3.4,0.1,1.2,-0.4,0,-0.5,0, 0.1, 0, 0, 0.1,\
233 0,-0.1])
234 sdelt = numpy.append(sdelt,numpy.zeros(10))
235 sdelt = numpy.append(sdelt,numpy.array([-0.1, 0, 0.1]))
236 sdelt = numpy.append(sdelt,numpy.zeros(33))
237
238 cos_lng = numpy.array([92025,5736,977,-895,54,-7,224,200,129,-95,0,-70,-53,0,-33,26, \
239 32,27,0,-24,16,13,0,-12,0,0,-10,0,-8,7,9,7,6,0,5,3,-3,0,3,3,0,-3,-3,3,3,0,\
240 3,3,3])
241 cos_lng = numpy.append(cos_lng,numpy.zeros(14))
242
243 cdelt = numpy.array([8.9,-3.1,-0.5,0.5,-0.1,0.0,-0.6,0.0,-0.1,0.3])
244 cdelt = numpy.append(cdelt,numpy.zeros(53))
245
246 # Sum the periodic terms.
247 n = numpy.size(jd)
248 nut_long = numpy.zeros(n)
249 nut_obliq = numpy.zeros(n)
250
251 d_lng = d_lng.reshape(numpy.size(d_lng),1)
252 d = d.reshape(numpy.size(d),1)
253 matrix_d_lng = numpy.dot(d_lng,d.transpose())
254
255 m_lng = m_lng.reshape(numpy.size(m_lng),1)
256 m = m.reshape(numpy.size(m),1)
257 matrix_m_lng = numpy.dot(m_lng,m.transpose())
258
259 mp_lng = mp_lng.reshape(numpy.size(mp_lng),1)
260 mprime = mprime.reshape(numpy.size(mprime),1)
261 matrix_mp_lng = numpy.dot(mp_lng,mprime.transpose())
262
263 f_lng = f_lng.reshape(numpy.size(f_lng),1)
264 f = f.reshape(numpy.size(f),1)
265 matrix_f_lng = numpy.dot(f_lng,f.transpose())
266
267 om_lng = om_lng.reshape(numpy.size(om_lng),1)
268 omega = omega.reshape(numpy.size(omega),1)
269 matrix_om_lng = numpy.dot(om_lng,omega.transpose())
270
271 arg = matrix_d_lng + matrix_m_lng + matrix_mp_lng + matrix_f_lng + matrix_om_lng
272
273 sarg = numpy.sin(arg)
274 carg = numpy.cos(arg)
275
276 for ii in numpy.arange(n):
277 nut_long[ii] = 0.0001*numpy.sum((sdelt*t[ii] + sin_lng)*sarg[:,ii])
278 nut_obliq[ii] = 0.0001*numpy.sum((cdelt*t[ii] + cos_lng)*carg[:,ii])
279
280 if numpy.size(jd)==1:
281 nut_long = nut_long[0]
282 nut_obliq = nut_obliq[0]
283
284 return nut_long, nut_obliq
285
286 def co_aberration(self,jd,ra,dec):
287 """
288 co_aberration calculates changes to Ra and Dec due to "the effect of aberration".
289
290 Parameters
291 ----------
292 jd = Julian Date (Scalar or vector).
293 ra = A scalar o vector giving the Right Ascention of interest.
294 dec = A scalar o vector giving the Declination of interest.
295
296 Return
297 ------
298 d_ra = The correction to right ascension due to aberration (must be added to ra to
299 get the correct value).
300 d_dec = The correction to declination due to aberration (must be added to the dec
301 to get the correct value).
302 eps = True obliquity of the ecliptic (in radians).
303
304 Examples
305 --------
306 >> Julian = 2462088.7
307 >> Ra = 41.547213
308 >> Dec = 49.348483
309 >> [d_ra,d_dec,eps] = co_aberration(julian,Ra,Dec)
310 >> print d_ra, d_dec, eps
311 [ 30.04441796] [ 6.69837858] [ 0.40904059]
312
313 Modification history
314 --------------------
315 Written by Chris O'Dell , Univ. of Wisconsin, June 2002.
316 Converted to Python by Freddy R. Galindo, ROJ, 27 September 2009.
317 """
318
319 # Julian centuries from J2000 of jd.
320 T = (jd - 2451545.0)/36525.0
321
322 # Getting obliquity of ecliptic
323 njd = numpy.size(jd)
324 jd = numpy.atleast_1d(jd)
325 ra = numpy.atleast_1d(ra)
326 dec = numpy.atleast_1d(dec)
327
328 d_psi = numpy.zeros(njd)
329 d_epsilon = d_psi
330 for ii in numpy.arange(njd):
331 [dp,de] = self.nutate(jd[ii])
332 d_psi[ii] = dp
333 d_epsilon[ii] = de
334
335 coeff = 23 + 26/60. + 21.488/3600.
336 eps0 = coeff*3600. - 46.8150*T - 0.00059*T**2. + 0.001813*T**3.
337 # True obliquity of the ecliptic in radians
338 eps = (eps0 + d_epsilon)/3600*Misc_Routines.CoFactors.d2r
339
340 celestialbodies = CelestialBodies()
341 [sunra,sundec,sunlon,sunobliq] = celestialbodies.sunpos(jd)
342
343 # Earth's orbital eccentricity
344 e = 0.016708634 - 0.000042037*T - 0.0000001267*T**2.
345
346 # longitude of perihelion, in degrees
347 pi = 102.93735 + 1.71946*T + 0.00046*T**2
348
349 # Constant of aberration, in arcseconds
350 k = 20.49552
351
352 cd = numpy.cos(dec*Misc_Routines.CoFactors.d2r) ; sd = numpy.sin(dec*Misc_Routines.CoFactors.d2r)
353 ce = numpy.cos(eps) ; te = numpy.tan(eps)
354 cp = numpy.cos(pi*Misc_Routines.CoFactors.d2r) ; sp = numpy.sin(pi*Misc_Routines.CoFactors.d2r)
355 cs = numpy.cos(sunlon*Misc_Routines.CoFactors.d2r) ; ss = numpy.sin(sunlon*Misc_Routines.CoFactors.d2r)
356 ca = numpy.cos(ra*Misc_Routines.CoFactors.d2r) ; sa = numpy.sin(ra*Misc_Routines.CoFactors.d2r)
357
358 term1 = (ca*cs*ce + sa*ss)/cd
359 term2 = (ca*cp*ce + sa*sp)/cd
360 term3 = (cs*ce*(te*cd - sa*sd) + ca*sd*ss)
361 term4 = (cp*ce*(te*cd - sa*sd) + ca*sd*sp)
362
363 d_ra = -k*term1 + e*k*term2
364 d_dec = -k*term3 + e*k*term4
365
366 return d_ra, d_dec, eps
367
368 def precess(self,ra,dec,equinox1=None,equinox2=None,FK4=0,rad=0):
369 """
370 precess coordinates from EQUINOX1 to EQUINOX2
371
372 Parameters
373 -----------
374 ra = A scalar o vector giving the Right Ascention of interest.
375 dec = A scalar o vector giving the Declination of interest.
376 equinox1 = Original equinox of coordinates, numeric scalar. If omitted, the __Pre-
377 cess will query for equinox1 and equinox2.
378 equinox2 = Original equinox of coordinates.
379 FK4 = If this keyword is set and non-zero, the FK4 (B1950) system will be used
380 otherwise FK5 (J2000) will be used instead.
381 rad = If this keyword is set and non-zero, then the input and output RAD and DEC
382 vectors are in radian rather than degree.
383
384 Return
385 ------
386 ra = Right ascension after precession (scalar or vector) in degrees, unless the rad
387 keyword is set.
388 dec = Declination after precession (scalar or vector) in degrees, unless the rad
389 keyword is set.
390
391 Examples
392 --------
393 >> Ra = 329.88772
394 >> Dec = -56.992515
395 >> [p_ra,p_dec] = precess(Ra,Dec,1950,1975,FK4=1)
396 >> print p_ra, p_dec
397 [ 330.31442971] [-56.87186154]
398
399 Modification history
400 --------------------
401 Written by Wayne Landsman, STI Corporation, August 1986.
402 Converted to Python by Freddy R. Galindo, ROJ, 27 September 2009.
403 """
404
405 npts = numpy.size(ra)
406 ra = numpy.atleast_1d(ra)
407 dec = numpy.atleast_1d(dec)
408
409 if rad==0:
410 ra_rad = ra*Misc_Routines.CoFactors.d2r
411 dec_rad = dec*Misc_Routines.CoFactors.d2r
412 else:
413 ra_rad = ra
414 dec_rad = dec
415
416 x = numpy.zeros((npts,3))
417 x[:,0] = numpy.cos(dec_rad)*numpy.cos(ra_rad)
418 x[:,1] = numpy.cos(dec_rad)*numpy.sin(ra_rad)
419 x[:,2] = numpy.sin(dec_rad)
420
421 # Use premat function to get precession matrix from equinox1 to equinox2
422 r = self.premat(equinox1,equinox2,FK4)
423
424 x2 = numpy.dot(r,x.transpose())
425
426 ra_rad = numpy.arctan2(x2[1,:],x2[0,:])
427 dec_rad = numpy.arcsin(x2[2,:])
428
429 if rad==0:
430 ra = ra_rad/Misc_Routines.CoFactors.d2r
431 ra = ra + (ra<0)*360.
432 dec = dec_rad/Misc_Routines.CoFactors.d2r
433 else:
434 ra = ra_rad
435 ra = ra + (ra<0)*numpy.pi*2.
436 dec = dec_rad
437
438 return ra, dec
439
440 def premat(self,equinox1,equinox2,FK4=0):
441 """
442 premat returns the precession matrix needed to go from EQUINOX1 to EQUINOX2.
443
444 Parameters
445 ----------
446 equinox1 = Original equinox of coordinates, numeric scalar.
447 equinox2 = Equinox of precessed coordinates.
448 FK4 = If this keyword is set and non-zero, the FK4 (B1950) system precession angles
449 are used to compute the precession matrix. The default is to use FK5 (J2000) pre-
450 cession angles.
451
452 Return
453 ------
454 r = Precession matrix, used to precess equatorial rectangular coordinates.
455
456 Examples
457 --------
458 >> matrix = premat(1950.0,1975.0,FK4=1)
459 >> print matrix
460 [[ 9.99981438e-01 -5.58774959e-03 -2.42908517e-03]
461 [ 5.58774959e-03 9.99984388e-01 -6.78691471e-06]
462 [ 2.42908517e-03 -6.78633095e-06 9.99997050e-01]]
463
464 Modification history
465 --------------------
466 Written by Wayne Landsman, HSTX Corporation, June 1994.
467 Converted to Python by Freddy R. Galindo, ROJ, 27 September 2009.
468 """
469
470 t = 0.001*(equinox2 - equinox1)
471
472 if FK4==0:
473 st=0.001*(equinox1 - 2000.)
474 # Computing 3 rotation angles.
475 A=Misc_Routines.CoFactors.s2r*t*(23062.181+st*(139.656+0.0139*st)+t*(30.188-0.344*st+17.998*t))
476 B=Misc_Routines.CoFactors.s2r*t*t*(79.280+0.410*st+0.205*t)+A
477 C=Misc_Routines.CoFactors.s2r*t*(20043.109-st*(85.33+0.217*st)+ t*(-42.665-0.217*st-41.833*t))
478 else:
479 st=0.001*(equinox1 - 1900)
480 # Computing 3 rotation angles
481 A=Misc_Routines.CoFactors.s2r*t*(23042.53+st*(139.75+0.06*st)+t*(30.23-0.27*st+18.0*t))
482 B=Misc_Routines.CoFactors.s2r*t*t*(79.27+0.66*st+0.32*t)+A
483 C=Misc_Routines.CoFactors.s2r*t*(20046.85-st*(85.33+0.37*st)+t*(-42.67-0.37*st-41.8*t))
484
485 sina = numpy.sin(A); sinb = numpy.sin(B); sinc = numpy.sin(C)
486 cosa = numpy.cos(A); cosb = numpy.cos(B); cosc = numpy.cos(C)
487
488 r = numpy.zeros((3,3))
489 r[:,0] = numpy.array([cosa*cosb*cosc-sina*sinb,sina*cosb+cosa*sinb*cosc,cosa*sinc])
490 r[:,1] = numpy.array([-cosa*sinb-sina*cosb*cosc,cosa*cosb-sina*sinb*cosc,-sina*sinc])
491 r[:,2] = numpy.array([-cosb*sinc,-sinb*sinc,cosc])
492
493 return r
494
495 def cirrange(self,angle,rad=0):
496 """
497 cirrange forces an angle into the range 0<= angle < 360.
498
499 Parameters
500 ----------
501 angle = The angle to modify, in degrees. Can be scalar or vector.
502 rad = Set to 1 if the angle is specified in radians rather than degrees. It is for-
503 ced into the range 0 <= angle < 2 PI
504
505 Return
506 ------
507 angle = The angle after the modification.
508
509 Example
510 -------
511 >> angle = cirrange(numpy.array([420,400,361]))
512 >> print angle
513 >> [60, 40, 1]
514
515 Modification History
516 --------------------
517 Written by Michael R. Greason, Hughes STX, 10 February 1994.
518 Converted to Python by Freddy R. Galindo, ROJ, 26 September 2009.
519 """
520
521 angle = numpy.atleast_1d(angle)
522
523 if rad==1:
524 cnst = numpy.pi*2.
525 elif rad==0:
526 cnst = 360.
527
528 # Deal with the lower limit.
529 angle = angle % cnst
530
531 # Deal with negative values, if way
532 neg = numpy.where(angle<0.0)
533 if neg[0].size>0: angle[neg] = angle[neg] + cnst
534
535 return angle
536
537
538 class CelestialBodies(EquatorialCorrections):
539 def __init__(self):
540 """
541 CelestialBodies class creates a object to call methods of celestial bodies location.
542
543 Modification History
544 --------------------
545 Converted to Object-oriented Programming by Freddy Galindo, ROJ, 27 September 2009.
546 """
547
548 EquatorialCorrections.__init__(self)
549
550 def sunpos(self,jd,rad=0):
551 """
552 sunpos method computes the RA and Dec of the Sun at a given date.
553
554 Parameters
555 ----------
556 jd = The julian date of the day (and time), scalar or vector.
557 rad = If this keyword is set and non-zero, then the input and output RAD and DEC
558 vectors are in radian rather than degree.
559
560 Return
561 ------
562 ra = The right ascension of the sun at that date in degrees.
563 dec = The declination of the sun at that date in degrees.
564 elong = Ecliptic longitude of the sun at that date in degrees.
565 obliquity = The declination of the sun at that date in degrees.
566
567 Examples
568 --------
569 >> jd = 2466880
570 >> [ra,dec,elong,obliquity] = sunpos(jd)
571 >> print ra, dec, elong, obliquity
572 [ 275.53499556] [-23.33840558] [ 275.08917968] [ 23.43596165]
573
574 >> [ra,dec,elong,obliquity] = sunpos(jd,rad=1)
575 >> print ra, dec, elong, obliquity
576 [ 4.80899288] [-0.40733202] [ 4.80121192] [ 0.40903469]
577
578 >> jd = 2450449.5 + numpy.arange(365)
579 >> [ra,dec,elong,obliquity] = sunpos(jd)
580
581 Modification history
582 --------------------
583 Written by Micheal R. Greason, STX Corporation, 28 October 1988.
584 Converted to Python by Freddy R. Galindo, ROJ, 27 September 2009.
585 """
586
587 jd = numpy.atleast_1d(jd)
588
589 # Form time in Julian centuries from 1900.
590 t = (jd -2415020.0)/36525.0
591
592 # Form sun's mean longitude
593 l = (279.696678+((36000.768925*t) % 360.0))*3600.0
594
595 # Allow for ellipticity of the orbit (equation of centre) using the Earth's mean
596 # anomoly ME
597 me = 358.475844 + ((35999.049750*t) % 360.0)
598 ellcor = (6910.1 - 17.2*t)*numpy.sin(me*Misc_Routines.CoFactors.d2r) + 72.3*numpy.sin(2.0*me*Misc_Routines.CoFactors.d2r)
599 l = l + ellcor
600
601 # Allow for the Venus perturbations using the mean anomaly of Venus MV
602 mv = 212.603219 + ((58517.803875*t) % 360.0)
603 vencorr = 4.8*numpy.cos((299.1017 + mv - me)*Misc_Routines.CoFactors.d2r) + \
604 5.5*numpy.cos((148.3133 + 2.0*mv - 2.0*me )*Misc_Routines.CoFactors.d2r) + \
605 2.5*numpy.cos((315.9433 + 2.0*mv - 3.0*me )*Misc_Routines.CoFactors.d2r) + \
606 1.6*numpy.cos((345.2533 + 3.0*mv - 4.0*me )*Misc_Routines.CoFactors.d2r) + \
607 1.0*numpy.cos((318.15 + 3.0*mv - 5.0*me )*Misc_Routines.CoFactors.d2r)
608 l = l + vencorr
609
610 # Allow for the Mars perturbations using the mean anomaly of Mars MM
611 mm = 319.529425 + ((19139.858500*t) % 360.0)
612 marscorr = 2.0*numpy.cos((343.8883 - 2.0*mm + 2.0*me)*Misc_Routines.CoFactors.d2r ) + \
613 1.8*numpy.cos((200.4017 - 2.0*mm + me)*Misc_Routines.CoFactors.d2r)
614 l = l + marscorr
615
616 # Allow for the Jupiter perturbations using the mean anomaly of Jupiter MJ
617 mj = 225.328328 + ((3034.6920239*t) % 360.0)
618 jupcorr = 7.2*numpy.cos((179.5317 - mj + me )*Misc_Routines.CoFactors.d2r) + \
619 2.6*numpy.cos((263.2167 - mj)*Misc_Routines.CoFactors.d2r) + \
620 2.7*numpy.cos((87.1450 - 2.0*mj + 2.0*me)*Misc_Routines.CoFactors.d2r) + \
621 1.6*numpy.cos((109.4933 - 2.0*mj + me)*Misc_Routines.CoFactors.d2r)
622 l = l + jupcorr
623
624 # Allow for Moons perturbations using mean elongation of the Moon from the Sun D
625 d = 350.7376814 + ((445267.11422*t) % 360.0)
626 mooncorr = 6.5*numpy.sin(d*Misc_Routines.CoFactors.d2r)
627 l = l + mooncorr
628
629 # Allow for long period terms
630 longterm = + 6.4*numpy.sin((231.19 + 20.20*t)*Misc_Routines.CoFactors.d2r)
631 l = l + longterm
632 l = (l + 2592000.0) % 1296000.0
633 longmed = l/3600.0
634
635 # Allow for Aberration
636 l = l - 20.5
637
638 # Allow for Nutation using the longitude of the Moons mean node OMEGA
639 omega = 259.183275 - ((1934.142008*t) % 360.0)
640 l = l - 17.2*numpy.sin(omega*Misc_Routines.CoFactors.d2r)
641
642 # Form the True Obliquity
643 oblt = 23.452294 - 0.0130125*t + (9.2*numpy.cos(omega*Misc_Routines.CoFactors.d2r))/3600.0
644
645 # Form Right Ascension and Declination
646 l = l/3600.0
647 ra = numpy.arctan2((numpy.sin(l*Misc_Routines.CoFactors.d2r)*numpy.cos(oblt*Misc_Routines.CoFactors.d2r)),numpy.cos(l*Misc_Routines.CoFactors.d2r))
648
649 neg = numpy.where(ra < 0.0)
650 if neg[0].size > 0: ra[neg] = ra[neg] + 2.0*numpy.pi
651
652 dec = numpy.arcsin(numpy.sin(l*Misc_Routines.CoFactors.d2r)*numpy.sin(oblt*Misc_Routines.CoFactors.d2r))
653
654 if rad==1:
655 oblt = oblt*Misc_Routines.CoFactors.d2r
656 longmed = longmed*Misc_Routines.CoFactors.d2r
657 else:
658 ra = ra/Misc_Routines.CoFactors.d2r
659 dec = dec/Misc_Routines.CoFactors.d2r
660
661 return ra, dec, longmed, oblt
662
663 def moonpos(self,jd,rad=0):
664 """
665 moonpos method computes the RA and Dec of the Moon at specified Julian date(s).
666
667 Parameters
668 ----------
669 jd = The julian date of the day (and time), scalar or vector.
670 rad = If this keyword is set and non-zero, then the input and output RAD and DEC
671 vectors are in radian rather than degree.
672
673 Return
674 ------
675 ra = The right ascension of the sun at that date in degrees.
676 dec = The declination of the sun at that date in degrees.
677 dist = The Earth-moon distance in kilometers (between the center of the Earth and
678 the center of the moon).
679 geolon = Apparent longitude of the moon in degrees, referred to the ecliptic of the
680 specified date(s).
681 geolat = Apparent latitude the moon in degrees, referred to the ecliptic of the
682 specified date(s).
683
684 Examples
685 --------
686 >> jd = 2448724.5
687 >> [ra,dec,dist,geolon,geolat] = sunpos(jd)
688 >> print ra, dec, dist, geolon, geolat
689 [ 134.68846855] [ 13.76836663] [ 368409.68481613] [ 133.16726428] [-3.22912642]
690
691 >> [ra,dec,dist,geolon, geolat] = sunpos(jd,rad=1)
692 >> print ra, dec, dist, geolon, geolat
693 [ 2.35075724] [ 0.24030333] [ 368409.68481613] [ 2.32420722] [-0.05635889]
694
695 >> jd = 2450449.5 + numpy.arange(365)
696 >> [ra,dec,dist,geolon, geolat] = sunpos(jd)
697
698 Modification history
699 --------------------
700 Written by Micheal R. Greason, STX Corporation, 31 October 1988.
701 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
702 """
703
704 jd = numpy.atleast_1d(jd)
705
706 # Form time in Julian centuries from 1900.
707 t = (jd - 2451545.0)/36525.0
708
709 d_lng = numpy.array([0,2,2,0,0,0,2,2,2,2,0,1,0,2,0,0,4,0,4,2,2,1,1,2,2,4,2,0,2,2,1,2,\
710 0,0,2,2,2,4,0,3,2,4,0,2,2,2,4,0,4,1,2,0,1,3,4,2,0,1,2,2])
711
712 m_lng = numpy.array([0,0,0,0,1,0,0,-1,0,-1,1,0,1,0,0,0,0,0,0,1,1,0,1,-1,0,0,0,1,0,-1,\
713 0,-2,1,2,-2,0,0,-1,0,0,1,-1,2,2,1,-1,0,0,-1,0,1,0,1,0,0,-1,2,1,0,0])
714
715 mp_lng = numpy.array([1,-1,0,2,0,0,-2,-1,1,0,-1,0,1,0,1,1,-1,3,-2,-1,0,-1,0,1,2,0,-3,\
716 -2,-1,-2,1,0,2,0,-1,1,0,-1,2,-1,1,-2,-1,-1,-2,0,1,4,0,-2,0,2,1,-2,-3,2,1,-1,3,-1])
717
718 f_lng = numpy.array([0,0,0,0,0,2,0,0,0,0,0,0,0,-2,2,-2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,\
719 0,0,0,0,-2,2,0,2,0,0,0,0,0,0,-2,0,0,0,0,-2,-2,0,0,0,0,0,0,0,-2])
720
721 sin_lng = numpy.array([6288774,1274027,658314,213618,-185116,-114332,58793,57066,\
722 53322,45758,-40923,-34720,-30383,15327,-12528,10980,10675,10034,8548,-7888,\
723 -6766,-5163,4987,4036,3994,3861,3665,-2689,-2602,2390,-2348,2236,-2120,-2069,\
724 2048,-1773,-1595,1215,-1110,-892,-810,759,-713,-700,691,596,549,537,520,-487,\
725 -399,-381,351,-340,330,327,-323,299,294,0.0])
726
727 cos_lng = numpy.array([-20905355,-3699111,-2955968,-569925,48888,-3149,246158,-152138,\
728 -170733,-204586,-129620,108743,104755,10321,0,79661,-34782,-23210,-21636,24208,\
729 30824,-8379,-16675,-12831,-10445,-11650,14403,-7003,0,10056,6322, -9884,5751,0,\
730 -4950,4130,0,-3958,0,3258,2616,-1897,-2117,2354,0,0,-1423,-1117,-1571,-1739,0, \
731 -4421,0,0,0,0,1165,0,0,8752.0])
732
733 d_lat = numpy.array([0,0,0,2,2,2,2,0,2,0,2,2,2,2,2,2,2,0,4,0,0,0,1,0,0,0,1,0,4,4,0,4,\
734 2,2,2,2,0,2,2,2,2,4,2,2,0,2,1,1,0,2,1,2,0,4,4,1,4,1,4,2])
735
736 m_lat = numpy.array([0,0,0,0,0,0,0,0,0,0,-1,0,0,1,-1,-1,-1,1,0,1,0,1,0,1,1,1,0,0,0,0,\
737 0,0,0,0,-1,0,0,0,0,1,1,0,-1,-2,0,1,1,1,1,1,0,-1,1,0,-1,0,0,0,-1,-2])
738
739 mp_lat = numpy.array([0,1,1,0,-1,-1,0,2,1,2,0,-2,1,0,-1,0,-1,-1,-1,0,0,-1,0,1,1,0,0,\
740 3,0,-1,1,-2,0,2,1,-2,3,2,-3,-1,0,0,1,0,1,1,0,0,-2,-1,1,-2,2,-2,-1,1,1,-1,0,0])
741
742 f_lat = numpy.array([1,1,-1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,-1,-1,1,3,1,1,1,-1,\
743 -1,-1,1,-1,1,-3,1,-3,-1,-1,1,-1,1,-1,1,1,1,1,-1,3,-1,-1,1,-1,-1,1,-1,1,-1,-1, \
744 -1,-1,-1,-1,1])
745
746 sin_lat = numpy.array([5128122,280602,277693,173237,55413,46271, 32573, 17198, 9266, \
747 8822,8216,4324,4200,-3359,2463,2211,2065,-1870,1828,-1794, -1749, -1565, -1491, \
748 -1475,-1410,-1344,-1335,1107,1021,833,777,671,607,596,491,-451,439,422,421,-366,\
749 -351,331,315,302,-283,-229,223,223,-220,-220,-185,181,-177,176, 166, -164, 132, \
750 -119,115,107.0])
751
752 # Mean longitude of the moon refered to mean equinox of the date.
753 coeff0 = numpy.array([-1./6.5194e7,1./538841.,-0.0015786,481267.88123421,218.3164477])
754 lprimed = numpy.poly1d(coeff0)
755 lprimed = lprimed(t)
756 lprimed = self.cirrange(lprimed,rad=0)
757 lprime = lprimed*Misc_Routines.CoFactors.d2r
758
759 # Mean elongation of the moon
760 coeff1 = numpy.array([-1./1.13065e8,1./545868.,-0.0018819,445267.1114034,297.8501921])
761 d = numpy.poly1d(coeff1)
762 d = d(t)*Misc_Routines.CoFactors.d2r
763 d = self.cirrange(d,rad=1)
764
765 # Sun's mean anomaly
766 coeff2 = numpy.array([1.0/2.449e7,-0.0001536,35999.0502909,357.5291092])
767 M = numpy.poly1d(coeff2)
768 M = M(t)*Misc_Routines.CoFactors.d2r
769 M = self.cirrange(M,rad=1)
770
771 # Moon's mean anomaly
772 coeff3 = numpy.array([-1.0/1.4712e7,1.0/6.9699e4,0.0087414,477198.8675055,134.9633964])
773 Mprime = numpy.poly1d(coeff3)
774 Mprime = Mprime(t)*Misc_Routines.CoFactors.d2r
775 Mprime = self.cirrange(Mprime,rad=1)
776
777 # Moon's argument of latitude
778 coeff4 = numpy.array([1.0/8.6331e8,-1.0/3.526e7,-0.0036539,483202.0175233,93.2720950])
779 F = numpy.poly1d(coeff4)
780 F = F(t)*Misc_Routines.CoFactors.d2r
781 F = self.cirrange(F,rad=1)
782
783 # Eccentricity of Earth's orbit around the sun
784 e = 1 - 0.002516*t - 7.4e-6*(t**2.)
785 e2 = e**2.
786
787 ecorr1 = numpy.where((numpy.abs(m_lng))==1)
788 ecorr2 = numpy.where((numpy.abs(m_lat))==1)
789 ecorr3 = numpy.where((numpy.abs(m_lng))==2)
790 ecorr4 = numpy.where((numpy.abs(m_lat))==2)
791
792 # Additional arguments.
793 A1 = (119.75 + 131.849*t)*Misc_Routines.CoFactors.d2r
794 A2 = (53.09 + 479264.290*t)*Misc_Routines.CoFactors.d2r
795 A3 = (313.45 + 481266.484*t)*Misc_Routines.CoFactors.d2r
796 suml_add = 3958.*numpy.sin(A1) + 1962.*numpy.sin(lprime - F) + 318*numpy.sin(A2)
797 sumb_add = -2235.*numpy.sin(lprime) + 382.*numpy.sin(A3) + 175.*numpy.sin(A1-F) + \
798 175.*numpy.sin(A1 + F) + 127.*numpy.sin(lprime - Mprime) - 115.*numpy.sin(lprime + Mprime)
799
800 # Sum the periodic terms
801 geolon = numpy.zeros(jd.size)
802 geolat = numpy.zeros(jd.size)
803 dist = numpy.zeros(jd.size)
804
805 for i in numpy.arange(jd.size):
806 sinlng = sin_lng
807 coslng = cos_lng
808 sinlat = sin_lat
809
810 sinlng[ecorr1] = e[i]*sinlng[ecorr1]
811 coslng[ecorr1] = e[i]*coslng[ecorr1]
812 sinlat[ecorr2] = e[i]*sinlat[ecorr2]
813 sinlng[ecorr3] = e2[i]*sinlng[ecorr3]
814 coslng[ecorr3] = e2[i]*coslng[ecorr3]
815 sinlat[ecorr4] = e2[i]*sinlat[ecorr4]
816
817 arg = d_lng*d[i] + m_lng*M[i] + mp_lng*Mprime[i] + f_lng*F[i]
818 geolon[i] = lprimed[i] + (numpy.sum(sinlng*numpy.sin(arg)) + suml_add[i] )/1.e6
819 dist[i] = 385000.56 + numpy.sum(coslng*numpy.cos(arg))/1.e3
820 arg = d_lat*d[i] + m_lat*M[i] + mp_lat*Mprime[i] + f_lat*F[i]
821 geolat[i] = (numpy.sum(sinlat*numpy.sin(arg)) + sumb_add[i])/1.e6
822
823 [nlon, elon] = self.nutate(jd)
824 geolon = geolon + nlon/3.6e3
825 geolon = self.cirrange(geolon,rad=0)
826 lamb = geolon*Misc_Routines.CoFactors.d2r
827 beta = geolat*Misc_Routines.CoFactors.d2r
828
829 # Find mean obliquity and convert lamb, beta to RA, Dec
830 c = numpy.array([2.45,5.79,27.87,7.12,-39.05,-249.67,-51.38,1999.25,-1.55,-4680.93, \
831 21.448])
832 junk = numpy.poly1d(c);
833 epsilon = 23. + (26./60.) + (junk(t/1.e2)/3600.)
834 # True obliquity in radians
835 eps = (epsilon + elon/3600. )*Misc_Routines.CoFactors.d2r
836
837 ra = numpy.arctan2(numpy.sin(lamb)*numpy.cos(eps)-numpy.tan(beta)*numpy.sin(eps),numpy.cos(lamb))
838 ra = self.cirrange(ra,rad=1)
839
840 dec = numpy.arcsin(numpy.sin(beta)*numpy.cos(eps) + numpy.cos(beta)*numpy.sin(eps)*numpy.sin(lamb))
841
842 if rad==1:
843 geolon = lamb
844 geolat = beta
845 else:
846 ra = ra/Misc_Routines.CoFactors.d2r
847 dec = dec/Misc_Routines.CoFactors.d2r
848
849 return ra, dec, dist, geolon, geolat
850
851 def hydrapos(self):
852 """
853 hydrapos method returns RA and Dec provided by Bill Coles (Oct 2003).
854
855 Parameters
856 ----------
857 None
858
859 Return
860 ------
861 ra = The right ascension of the sun at that date in degrees.
862 dec = The declination of the sun at that date in degrees.
863 Examples
864 --------
865 >> [ra,dec] = hydrapos()
866 >> print ra, dec
867 139.45 -12.0833333333
868
869 Modification history
870 --------------------
871 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
872 """
873
874 ra = (9. + 17.8/60.)*15.
875 dec = -(12. + 5./60.)
876
877 return ra, dec
878
879
880 def skynoise_jro(self,dec_cut=-11.95,filename='skynoise_jro.dat',filepath=None):
881 """
882 hydrapos returns RA and Dec provided by Bill Coles (Oct 2003).
883
884 Parameters
885 ----------
886 dec_cut = A scalar giving the declination to get a cut of the skynoise over Jica-
887 marca. The default value is -11.95.
888 filename = A string to specify name the skynoise file. The default value is skynoi-
889 se_jro.dat
890
891 Return
892 ------
893 maxra = The maximum right ascension to the declination used to get a cut.
894 ra = The right ascension.
895 Examples
896 --------
897 >> [maxra,ra] = skynoise_jro()
898 >> print maxra, ra
899 139.45 -12.0833333333
900
901 Modification history
902 --------------------
903 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
904 """
905
906 if filepath==None:filepath = './resource'
907
908 f = open(os.path.join(filepath,filename),'rb')
909
910 # Reading SkyNoise Power (lineal scale)
911 ha_sky = numpy.fromfile(f,numpy.dtype([('var','<f4')]),480*20)
912 ha_sky = ha_sky['var'].reshape(20,480).transpose()
913
914 dec_sky = numpy.fromfile(f,numpy.dtype([('var','<f4')]),480*20)
915 dec_sky = dec_sky['var'].reshape((20,480)).transpose()
916
917 tmp_sky = numpy.fromfile(f,numpy.dtype([('var','<f4')]),480*20)
918 tmp_sky = tmp_sky['var'].reshape((20,480)).transpose()
919
920 f.close()
921
922 nha = 480
923 tmp_cut = numpy.zeros(nha)
924 for iha in numpy.arange(nha):
925 tck = scipy.interpolate.splrep(dec_sky[iha,:],tmp_sky[iha,:],s=0)
926 tmp_cut[iha] = scipy.interpolate.splev(dec_cut,tck,der=0)
927
928 ptr = numpy.nanargmax(tmp_cut)
929
930 maxra = ha_sky[ptr,0]
931 ra = ha_sky[:,0]
932
933 return maxra, ra
934
935 def skyNoise(self,jd,ut=-5.0,longitude=-76.87,filename='galaxy.txt',filepath=None):
936 """
937 hydrapos returns RA and Dec provided by Bill Coles (Oct 2003).
938
939 Parameters
940 ----------
941 jd = The julian date of the day (and time), scalar or vector.
942
943 dec_cut = A scalar giving the declination to get a cut of the skynoise over Jica-
944 marca. The default value is -11.95.
945 filename = A string to specify name the skynoise file. The default value is skynoi-
946 se_jro.dat
947
948 Return
949 ------
950 maxra = The maximum right ascension to the declination used to get a cut.
951 ra = The right ascension.
952
953 Examples
954 --------
955 >> [maxra,ra] = skynoise_jro()
956 >> print maxra, ra
957 139.45 -12.0833333333
958
959 Modification history
960 --------------------
961 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
962 """
963
964 # Defining date to compute SkyNoise.
965 [year, month, dom, hour, mis, secs] = TimeTools.Julian(jd).change2time()
966 is_dom = (month==9) & (dom==21)
967 if is_dom:
968 tmp = jd
969 jd = TimeTools.Time(year,9,22).change2julian()
970 dom = 22
971
972 # Reading SkyNoise
973 if filepath==None:filepath='./resource'
974 f = open(os.path.join(filepath,filename))
975
976 lines = f.read()
977 f.close()
978
979 nlines = 99
980 lines = lines.split('\n')
981 data = numpy.zeros((2,nlines))*numpy.float32(0.)
982 for ii in numpy.arange(nlines):
983 line = numpy.array([lines[ii][0:6],lines[ii][6:]])
984 data[:,ii] = numpy.float32(line)
985
986 # Getting SkyNoise to the date desired.
987 otime = data[0,:]*60.0
988 opowr = data[1,:]
989
990 hour = numpy.array([0,23]);
991 mins = numpy.array([0,59]);
992 secs = numpy.array([0,59]);
993 LTrange = TimeTools.Time(year,month,dom,hour,mins,secs).change2julday()
994 LTtime = LTrange[0] + numpy.arange(1440)*((LTrange[1] - LTrange[0])/(1440.-1))
995 lst = TimeTools.Julian(LTtime + (-3600.*ut/86400.)).change2lst()
996
997 ipowr = lst*0.0
998 # Interpolating using scipy (inside max and min "x")
999 otime = otime/3600.
1000 val = numpy.where((lst>numpy.min(otime)) & (lst<numpy.max(otime))); val = val[0]
1001 tck = scipy.interpolate.interp1d(otime,opowr)
1002 ipowr[val] = tck(lst[val])
1003
1004 # Extrapolating above maximum time data (23.75).
1005 uval = numpy.where(lst>numpy.max(otime))
1006 if uval[0].size>0:
1007 ii = numpy.min(uval[0])
1008 m = (ipowr[ii-1] - ipowr[ii-2])/(lst[ii-1] - lst[ii-2])
1009 b = ipowr[ii-1] - m*lst[ii-1]
1010 ipowr[uval] = m*lst[uval] + b
1011
1012 if is_dom:
1013 lst = numpy.roll(lst,4)
1014 ipowr = numpy.roll(ipowr,4)
1015
1016 new_lst = numpy.int32(lst*3600.)
1017 new_pow = ipowr
1018
1019 return ipowr, LTtime, lst
1020
1021
1022 class AltAz(EquatorialCorrections):
1023 def __init__(self,alt,az,jd,lat=-11.95,lon=-76.8667,WS=0,altitude=500,nutate_=0,precess_=0,\
1024 aberration_=0,B1950=0):
1025 """
1026 The AltAz class creates an object which represents the target position in horizontal
1027 coordinates (alt-az) and allows to convert (using the methods) from this coordinate
1028 system to others (e.g. Equatorial).
1029
1030 Parameters
1031 ----------
1032 alt = Altitude in degrees. Scalar or vector.
1033 az = Azimuth angle in degrees (measured EAST from NORTH, but see keyword WS). Sca-
1034 lar or vector.
1035 jd = Julian date. Scalar or vector.
1036 lat = North geodetic latitude of location in degrees. The default value is -11.95.
1037 lon = East longitude of location in degrees. The default value is -76.8667.
1038 WS = Set this to 1 to get the azimuth measured westward from south.
1039 altitude = The altitude of the observing location, in meters. The default 500.
1040 nutate_ = Set this to 1 to force nutation, 0 for no nutation.
1041 precess_ = Set this to 1 to force precession, 0 for no precession.
1042 aberration_ = Set this to 1 to force aberration correction, 0 for no correction.
1043 B1950 = Set this if your RA and DEC are specified in B1950, FK4 coordinates (ins-
1044 tead of J2000, FK5)
1045
1046 Modification History
1047 --------------------
1048 Converted to Object-oriented Programming by Freddy Galindo, ROJ, 26 September 2009.
1049 """
1050
1051 EquatorialCorrections.__init__(self)
1052
1053 self.alt = numpy.atleast_1d(alt)
1054 self.az = numpy.atleast_1d(az)
1055 self.jd = numpy.atleast_1d(jd)
1056 self.lat = lat
1057 self.lon = lon
1058 self.WS = WS
1059 self.altitude = altitude
1060
1061 self.nutate_ = nutate_
1062 self.aberration_ = aberration_
1063 self.precess_ = precess_
1064 self.B1950 = B1950
1065
1066 def change2equatorial(self):
1067 """
1068 change2equatorial method converts horizon (Alt-Az) coordinates to equatorial coordi-
1069 nates (ra-dec).
1070
1071 Return
1072 ------
1073 ra = Right ascension of object (J2000) in degrees (FK5). Scalar or vector.
1074 dec = Declination of object (J2000), in degrees (FK5). Scalar or vector.
1075 ha = Hour angle in degrees.
1076
1077 Example
1078 -------
1079 >> alt = 88.5401
1080 >> az = -128.990
1081 >> jd = 2452640.5
1082 >> ObjAltAz = AltAz(alt,az,jd)
1083 >> [ra, dec, ha] = ObjAltAz.change2equatorial()
1084 >> print ra, dec, ha
1085 [ 22.20280632] [-12.86610025] [ 1.1638927]
1086
1087 Modification History
1088 --------------------
1089 Written Chris O'Dell Univ. of Wisconsin-Madison, May 2002.
1090 Converted to Python by Freddy R. Galindo, ROJ, 26 September 2009.
1091 """
1092
1093 az = self.az
1094 alt = self.alt
1095 if self.WS>0:az = az -180.
1096 ra_tmp = numpy.zeros(numpy.size(self.jd)) + 45.
1097 dec_tmp = numpy.zeros(numpy.size(self.jd)) + 45.
1098 [dra1,ddec1,eps,d_psi,d_eps] = self.co_nutate(self.jd,ra_tmp, dec_tmp)
1099
1100 # Getting local mean sidereal time (lmst)
1101 lmst = TimeTools.Julian(self.jd[0]).change2lst()
1102 lmst = lmst*Misc_Routines.CoFactors.h2d
1103 # Getting local apparent sidereal time (last)
1104 last = lmst + d_psi*numpy.cos(eps)/3600.
1105
1106 # Now do the spherical trig to get APPARENT hour angle and declination (Degrees).
1107 [ha, dec] = self.change2HaDec()
1108
1109 # Finding Right Ascension (in degrees, from 0 to 360.)
1110 ra = (last - ha + 360.) % 360.
1111
1112 # Calculate NUTATION and ABERRATION Correction to Ra-Dec
1113 [dra1, ddec1,eps,d_psi,d_eps] = self.co_nutate(self.jd,ra,dec)
1114 [dra2,ddec2,eps] = self.co_aberration(self.jd,ra,dec)
1115
1116 # Make Nutation and Aberration correction (if wanted)
1117 ra = ra - (dra1*self.nutate_ + dra2*self.aberration_)/3600.
1118 dec = dec - (ddec1*self.nutate_ + ddec2*self.aberration_)/3600.
1119
1120 # Computing current equinox
1121 j_now = (self.jd - 2451545.)/365.25 + 2000
1122
1123 # Precess coordinates to current date
1124 if self.precess_==1:
1125 njd = numpy.size(self.jd)
1126 for ii in numpy.arange(njd):
1127 ra_i = ra[ii]
1128 dec_i = dec[ii]
1129 now = j_now[ii]
1130
1131 if self.B1950==1:
1132 [ra_i,dec_i] = self.precess(ra_i,dec_i,now,1950.,FK4=1)
1133 elif self.B1950==0:
1134 [ra_i,dec_i] = self.precess(ra_i,dec_i,now,2000.,FK4=0)
1135
1136 ra[ii] = ra_i
1137 dec[ii] = dec_i
1138
1139 return ra, dec, ha
1140
1141 def change2HaDec(self):
1142 """
1143 change2HaDec method converts from horizon (Alt-Az) coordinates to hour angle and de-
1144 clination.
1145
1146 Return
1147 ------
1148 ha = The local apparent hour angle, in degrees. The hour angle is the time that ri-
1149 ght ascension of 0 hours crosses the local meridian. It is unambiguisoly defined.
1150 dec = The local apparent declination, in degrees.
1151
1152 Example
1153 -------
1154 >> alt = 88.5401
1155 >> az = -128.990
1156 >> jd = 2452640.5
1157 >> ObjAltAz = AltAz(alt,az,jd)
1158 >> [ha, dec] = ObjAltAz.change2HaDec()
1159 >> print ha, dec
1160 [ 1.1638927] [-12.86610025]
1161
1162 Modification History
1163 --------------------
1164 Written Chris O'Dell Univ. of Wisconsin-Madison, May 2002.
1165 Converted to Python by Freddy R. Galindo, ROJ, 26 September 2009.
1166 """
1167
1168 alt_r = numpy.atleast_1d(self.alt*Misc_Routines.CoFactors.d2r)
1169 az_r = numpy.atleast_1d(self.az*Misc_Routines.CoFactors.d2r)
1170 lat_r = numpy.atleast_1d(self.lat*Misc_Routines.CoFactors.d2r)
1171
1172 # Find local hour angle (in degrees, from 0 to 360.)
1173 y_ha = -1*numpy.sin(az_r)*numpy.cos(alt_r)
1174 x_ha = -1*numpy.cos(az_r)*numpy.sin(lat_r)*numpy.cos(alt_r) + numpy.sin(alt_r)*numpy.cos(lat_r)
1175
1176 ha = numpy.arctan2(y_ha,x_ha)
1177 ha = ha/Misc_Routines.CoFactors.d2r
1178
1179 w = numpy.where(ha<0.)
1180 if w[0].size>0:ha[w] = ha[w] + 360.
1181 ha = ha % 360.
1182
1183 # Find declination (positive if north of celestial equatorial, negative if south)
1184 sindec = numpy.sin(lat_r)*numpy.sin(alt_r) + numpy.cos(lat_r)*numpy.cos(alt_r)*numpy.cos(az_r)
1185 dec = numpy.arcsin(sindec)/Misc_Routines.CoFactors.d2r
1186
1187 return ha, dec
1188
1189
1190 class Equatorial(EquatorialCorrections):
1191 def __init__(self,ra,dec,jd,lat=-11.95,lon=-76.8667,WS=0,altitude=500,nutate_=0,precess_=0,\
1192 aberration_=0,B1950=0):
1193 """
1194 The Equatorial class creates an object which represents the target position in equa-
1195 torial coordinates (ha-dec) and allows to convert (using the class methods) from
1196 this coordinate system to others (e.g. AltAz).
1197
1198 Parameters
1199 ----------
1200 ra = Right ascension of object (J2000) in degrees (FK5). Scalar or vector.
1201 dec = Declination of object (J2000), in degrees (FK5). Scalar or vector.
1202 jd = Julian date. Scalar or vector.
1203 lat = North geodetic latitude of location in degrees. The default value is -11.95.
1204 lon = East longitude of location in degrees. The default value is -76.8667.
1205 WS = Set this to 1 to get the azimuth measured westward from south.
1206 altitude = The altitude of the observing location, in meters. The default 500.
1207 nutate = Set this to 1 to force nutation, 0 for no nutation.
1208 precess = Set this to 1 to force precession, 0 for no precession.
1209 aberration = Set this to 1 to force aberration correction, 0 for no correction.
1210 B1950 = Set this if your RA and DEC are specified in B1950, FK4 coordinates (ins-
1211 tead of J2000, FK5)
1212
1213 Modification History
1214 --------------------
1215 Converted to Object-oriented Programming by Freddy Galindo, ROJ, 29 September 2009.
1216 """
1217
1218 EquatorialCorrections.__init__(self)
1219
1220 self.ra = numpy.atleast_1d(ra)
1221 self.dec = numpy.atleast_1d(dec)
1222 self.jd = numpy.atleast_1d(jd)
1223 self.lat = lat
1224 self.lon = lon
1225 self.WS = WS
1226 self.altitude = altitude
1227
1228 self.nutate_ = nutate_
1229 self.aberration_ = aberration_
1230 self.precess_ = precess_
1231 self.B1950 = B1950
1232
1233 def change2AltAz(self):
1234 """
1235 change2AltAz method converts from equatorial coordinates (ha-dec) to horizon coordi-
1236 nates (alt-az).
1237
1238 Return
1239 ------
1240 alt = Altitude in degrees. Scalar or vector.
1241 az = Azimuth angle in degrees (measured EAST from NORTH, but see keyword WS). Sca-
1242 lar or vector.
1243 ha = Hour angle in degrees.
1244
1245 Example
1246 -------
1247 >> ra = 43.370609
1248 >> dec = -28.0000
1249 >> jd = 2452640.5
1250 >> ObjEq = Equatorial(ra,dec,jd)
1251 >> [alt, az, ha] = ObjEq.change2AltAz()
1252 >> print alt, az, ha
1253 [ 65.3546497] [ 133.58753124] [ 339.99609002]
1254
1255 Modification History
1256 --------------------
1257 Written Chris O'Dell Univ. of Wisconsin-Madison. May 2002
1258 Converted to Python by Freddy R. Galindo, ROJ, 29 September 2009.
1259 """
1260
1261 ra = self.ra
1262 dec = self.dec
1263
1264 # Computing current equinox
1265 j_now = (self.jd - 2451545.)/365.25 + 2000
1266
1267 # Precess coordinates to current date
1268 if self.precess_==1:
1269 njd = numpy.size(self.jd)
1270 for ii in numpy.arange(njd):
1271 ra_i = ra[ii]
1272 dec_i = dec[ii]
1273 now = j_now[ii]
1274
1275 if self.B1950==1:
1276 [ra_i,dec_i] = self.precess(ra_i,dec_i,now,1950.,FK4=1)
1277 elif self.B1950==0:
1278 [ra_i,dec_i] = self.precess(ra_i,dec_i,now,2000.,FK4=0)
1279
1280 ra[ii] = ra_i
1281 dec[ii] = dec_i
1282
1283 # Calculate NUTATION and ABERRATION Correction to Ra-Dec
1284 [dra1, ddec1,eps,d_psi,d_eps] = self.co_nutate(self.jd,ra,dec)
1285 [dra2,ddec2,eps] = self.co_aberration(self.jd,ra,dec)
1286
1287 # Make Nutation and Aberration correction (if wanted)
1288 ra = ra + (dra1*self.nutate_ + dra2*self.aberration_)/3600.
1289 dec = dec + (ddec1*self.nutate_ + ddec2*self.aberration_)/3600.
1290
1291 # Getting local mean sidereal time (lmst)
1292 lmst = TimeTools.Julian(self.jd).change2lst()
1293
1294 lmst = lmst*Misc_Routines.CoFactors.h2d
1295 # Getting local apparent sidereal time (last)
1296 last = lmst + d_psi*numpy.cos(eps)/3600.
1297
1298 # Finding Hour Angle (in degrees, from 0 to 360.)
1299 ha = last - ra
1300 w = numpy.where(ha<0.)
1301 if w[0].size>0:ha[w] = ha[w] + 360.
1302 ha = ha % 360.
1303
1304 # Now do the spherical trig to get APPARENT hour angle and declination (Degrees).
1305 [alt, az] = self.HaDec2AltAz(ha,dec)
1306
1307 return alt, az, ha
1308
1309 def HaDec2AltAz(self,ha,dec):
1310 """
1311 HaDec2AltAz convert hour angle and declination (ha-dec) to horizon coords (alt-az).
1312
1313 Parameters
1314 ----------
1315 ha = The local apparent hour angle, in DEGREES, scalar or vector.
1316 dec = The local apparent declination, in DEGREES, scalar or vector.
1317
1318 Return
1319 ------
1320 alt = Altitude in degrees. Scalar or vector.
1321 az = Azimuth angle in degrees (measured EAST from NORTH, but see keyword WS). Sca-
1322 lar or vector.
1323
1324 Modification History
1325 --------------------
1326 Written Chris O'Dell Univ. of Wisconsin-Madison, May 2002.
1327 Converted to Python by Freddy R. Galindo, ROJ, 26 September 2009.
1328 """
1329
1330 sh = numpy.sin(ha*Misc_Routines.CoFactors.d2r) ; ch = numpy.cos(ha*Misc_Routines.CoFactors.d2r)
1331 sd = numpy.sin(dec*Misc_Routines.CoFactors.d2r) ; cd = numpy.cos(dec*Misc_Routines.CoFactors.d2r)
1332 sl = numpy.sin(self.lat*Misc_Routines.CoFactors.d2r) ; cl = numpy.cos(self.lat*Misc_Routines.CoFactors.d2r)
1333
1334 x = -1*ch*cd*sl + sd*cl
1335 y = -1*sh*cd
1336 z = ch*cd*cl + sd*sl
1337 r = numpy.sqrt(x**2. + y**2.)
1338
1339 az = numpy.arctan2(y,x)/Misc_Routines.CoFactors.d2r
1340 alt = numpy.arctan2(z,r)/Misc_Routines.CoFactors.d2r
1341
1342 # correct for negative az.
1343 w = numpy.where(az<0.)
1344 if w[0].size>0:az[w] = az[w] + 360.
1345
1346 # Convert az to West from South, if desired
1347 if self.WS==1: az = (az + 180.) % 360.
1348
1349 return alt, az
1350
1351
1352 class Geodetic():
1353 def __init__(self,lat=-11.95,alt=0):
1354 """
1355 The Geodetic class creates an object which represents the real position on earth of
1356 a target (Geodetic Coordinates: lat-alt) and allows to convert (using the class me-
1357 thods) from this coordinate system to others (e.g. geocentric).
1358
1359 Parameters
1360 ----------
1361 lat = Geodetic latitude of location in degrees. The default value is -11.95.
1362
1363 alt = Geodetic altitude (km). The default value is 0.
1364
1365 Modification History
1366 --------------------
1367 Converted to Object-oriented Programming by Freddy R. Galindo, ROJ, 02 October 2009.
1368 """
1369
1370 self.lat = numpy.atleast_1d(lat)
1371 self.alt = numpy.atleast_1d(alt)
1372
1373 self.a = 6378.16
1374 self.ab2 = 1.0067397
1375 self.ep2 = 0.0067397
1376
1377 def change2geocentric(self):
1378 """
1379 change2geocentric method converts from Geodetic to Geocentric coordinates. The re-
1380 ference geoid is that adopted by the IAU in 1964.
1381
1382 Return
1383 ------
1384 gclat = Geocentric latitude (in degrees), scalar or vector.
1385 gcalt = Geocentric radial distance (km), scalar or vector.
1386
1387 Example
1388 -------
1389 >> ObjGeoid = Geodetic(lat=-11.95,alt=0)
1390 >> [gclat, gcalt] = ObjGeoid.change2geocentric()
1391 >> print gclat, gcalt
1392 [-11.87227742] [ 6377.25048195]
1393
1394 Modification History
1395 --------------------
1396 Converted to Python by Freddy R. Galindo, ROJ, 02 October 2009.
1397 """
1398
1399 gdl = self.lat*Misc_Routines.CoFactors.d2r
1400 slat = numpy.sin(gdl)
1401 clat = numpy.cos(gdl)
1402 slat2 = slat**2.
1403 clat2 = (self.ab2*clat)**2.
1404
1405 sbet = slat/numpy.sqrt(slat2 + clat2)
1406 sbet2 = (sbet**2.) # < 1
1407 noval = numpy.where(sbet2>1)
1408 if noval[0].size>0:sbet2[noval] = 1
1409 cbet = numpy.sqrt(1. - sbet2)
1410
1411 rgeoid = self.a/numpy.sqrt(1. + self.ep2*sbet2)
1412
1413 x = rgeoid*cbet + self.alt*clat
1414 y = rgeoid*sbet + self.alt*slat
1415
1416 gcalt = numpy.sqrt(x**2. + y**2.)
1417 gclat = numpy.arctan2(y,x)/Misc_Routines.CoFactors.d2r
1418
1419 return gclat, gcalt
@@ -0,0 +1,18
1 '''
2 Created on Jun 19, 2013
3
4 @author: Jose Antonio Sal y Rosas Celi
5 @contact: jose.salyrosas@jro.igp.gob.pe
6 '''
7
8 from datetime import datetime
9
10 class Files(object):
11
12 def setFilename(self):
13 return datetime.today().strftime("%Y%m%d%H%M%S%f")
14
15 def save(self, filename, contentFile):
16 f = open(filename, 'a+')
17 f.write(contentFile)
18 f.close()
@@ -0,0 +1,51
1 """
2 The GRAPHICS_MISC.py module gathers classes and/or functions useful for generation of plots.
3
4 MODULES CALLED:
5 NUMPY, OS
6
7 MODIFICATION HISTORY:
8 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ, 13 August 2009.
9 """
10
11 import os
12 import numpy
13 import sys
14
15
16 class ColorTable:
17 def __init__(self,table=1,filepath=None):
18 self.table = table
19 #set to path for data folder, file: col_koki.dat
20 if filepath==None:
21 filepath= './data/'
22 self.filepath = filepath
23
24 def readTable(self):
25 if self.table>0:
26 if self.table==1:
27 f = open(os.path.join(self.filepath,'col_koki.dat'),'rb')
28
29 #f = open('./col_koki.dat','rb')
30
31 # Reading SkyNoise Power (lineal scale)
32 blue = numpy.fromfile(f,numpy.dtype([('var','b')]),256)
33 blue = numpy.int32(blue['var'])
34 val = numpy.where(blue<0)
35 if val[0].size:blue[val] = blue[val] + numpy.int32(256)
36
37 green = numpy.fromfile(f,numpy.dtype([('var','b')]),256)
38 green = numpy.int32(green['var'])
39 val = numpy.where(green<0)
40 if val[0].size:green[val] = green[val] + numpy.int32(256)
41
42 red = numpy.fromfile(f,numpy.dtype([('var','b')]),256)
43 red = numpy.int32(red['var'])
44 val = numpy.where(red<0)
45 if val[0].size:red[val] = red[val] + numpy.int32(256)
46
47 f.close()
48
49 colortable = numpy.array([red/255.,green/255.,blue/255.])
50
51 return colortable
This diff has been collapsed as it changes many lines, (563 lines changed) Show them Hide them
@@ -0,0 +1,563
1 """
2 The module GRAPHICS_OVERJRO.py gathers classes or/and functions to create graphics from OVER-JRO
3 project (e.g. antenna patterns, skynoise, ...).
4
5 MODULES CALLED:
6 TIME, NUMPY, MATPLOTLIB, TIMETOOLS
7
8 MODIFICATION HISTORY:
9 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ Oct 18, 2009.
10 """
11
12 import time
13 import numpy
14 import sys
15 import os
16
17 # set HOME environment variable to a directory the httpd server can write to
18 #os.environ[ 'HOME' ] = '/usr/local/www/htdocs/overJro/tempReports'
19 #os.environ[ 'HOME' ] = '/home/dsuarez/Pictures'
20 #os.environ[ 'HOME' ] = '/tmp/'
21 import matplotlib
22 #if ide==1:
23 # matplotlib.use('Qt4Agg')
24 #elif ide==2:
25 # matplotlib.use("Agg")
26 #else:
27 # matplotlib.use('TKAgg')
28 #matplotlib.use("Agg")
29 #matplotlib.interactive(1)
30 import matplotlib.pyplot
31 #import Numeric
32 #import scipy
33 import scipy.interpolate
34
35 import Astro_Coords
36 import TimeTools
37 import Graphics_Miscens
38
39 import Misc_Routines
40
41 class AntPatternPlot:
42 def __init__(self):
43 """
44 AntPatternPlot creates an object to call methods to plot the antenna pattern.
45
46 Modification History
47 --------------------
48 Created by Freddy Galindo, ROJ, 06 October 2009.
49 """
50 self.figure = None
51 pass
52
53 def contPattern(self,iplot=0,gpath='',filename='',mesg='',amp=None ,x=None ,y=None ,getCut=None,title=''):
54 """
55 contPattern plots a contour map of the antenna pattern.
56
57 Parameters
58 ----------
59 iplot = A integer to specify if the plot is the first, second, ... The default va-
60 lue is 0.
61
62 Examples
63 --------
64 >> Over_Jro.JroPattern(pattern=2).contPattern()
65
66 Modification history
67 --------------------
68 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
69 """
70
71 if getCut == 1:
72 return
73
74 xmax = numpy.max(x)
75 xmin = numpy.min(x)
76 ymax = numpy.max(y)
77 ymin = numpy.min(y)
78
79 levels = numpy.array([1e-3,1e-2,1e-1,0.5,1.0])
80 tmp = numpy.round(10*numpy.log10(levels),decimals=1)
81 labels = range(5)
82 for i in numpy.arange(5):labels[i] = str(numpy.int(tmp[i]))
83
84 if iplot==0:
85 xsize = 8.0
86 if matplotlib.get_backend()=='QT4Agg':xsize = 6.0
87 ysize = 8.0
88 self.figure = matplotlib.pyplot.figure(num=2,figsize=(xsize,ysize))
89 matplotlib.pyplot.clf()
90
91 colors = ((0,0,1.),(0,170/255.,0),(127/255.,1.,0),(1.,109/255.,0),(128/255.,0,0))
92 CS = matplotlib.pyplot.contour(x,y,amp.transpose(),levels,colors=colors)
93 fmt = {}
94 for l,s in zip(CS.levels,labels):fmt[l] = s
95
96 matplotlib.pyplot.annotate('Ng',xy=(-0.05,1.04),xytext=(0.01,0.962),xycoords='axes fraction',arrowprops=dict(facecolor='black', width=1.,shrink=0.2),fontsize=15.)
97 matplotlib.pyplot.annotate(mesg,xy=(0,0),xytext=(0.01,0.01),xycoords='figure fraction')
98 matplotlib.pyplot.clabel(CS,CS.levels,inline=True,fmt=fmt,fontsize=10)
99 matplotlib.pyplot.xlim(xmin,xmax)
100 matplotlib.pyplot.ylim(ymin,ymax)
101 matplotlib.pyplot.title("Total Pattern" + title)
102 matplotlib.pyplot.xlabel("West to South")
103 matplotlib.pyplot.ylabel("West to North")
104 matplotlib.pyplot.grid(True)
105 print "SAVE_FIG"
106 print gpath
107 print filename
108 save_fig = os.path.join(gpath,filename)
109 matplotlib.pyplot.savefig(save_fig,format='png')
110
111 def plotRaDec(self,gpath=None,filename=None,jd=2452640.5,ra_obs=None,xg=None,yg=None,x=None,y=None):
112 """
113 plotRaDec draws right ascension and declination lines on a JRO plane. This function
114 must call after conPattern.
115
116 Parameters
117 ----------
118 jd = A scalar giving the Julian date.
119 ra_obs = Scalar giving the right ascension of the observatory.
120 xg = A 3-element array to specify ..
121 yg = A 3-element array to specify ..
122
123 Examples
124 --------
125 >> Over_Jro.JroPattern(pattern=2).contPattern()
126 >> Over_Jro.JroPattern(pattern=2).plotRaDec(jd=jd,ra_obs=ra_obs,xg=xg,yg=yg)
127
128 Modification history
129 --------------------
130 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
131 """
132
133 # Finding RA of observatory for a specific date
134 if ra_obs==None:ra_obs = numpy.array([23.37060849])
135 if xg==None:xg = numpy.array([0.62918474,-0.77725579,0.])
136 if yg==None:yg = numpy.array([0.77700346,0.62898048,0.02547905])
137
138 # Getting HA and DEC axes
139 mindec = -28; maxdec = 4; incdec = 2.
140 ndec = numpy.int((maxdec - mindec)/incdec) + 1
141
142 minha = -20; maxha = 20; incha = 2.
143 nha = numpy.int((maxha - minha)/incha) + 1
144
145 mcosx = numpy.zeros((nha,ndec))
146 mcosy = numpy.zeros((nha,ndec))
147
148 ha_axes = numpy.reshape(numpy.arange(nha)*incha + minha,(nha,1))
149 ones_dec = numpy.reshape(numpy.zeros(ndec) + 1,(ndec,1))
150 ha_axes = numpy.dot(ha_axes,ones_dec.transpose())
151 ha_axes2 = numpy.array(ra_obs - ha_axes)
152
153 dec_axes = numpy.reshape(numpy.arange(ndec)*incdec + mindec,(ndec,1))
154 ones_ra = numpy.reshape(numpy.zeros(nha) + 1,(nha,1))
155 dec_axes = numpy.dot(ones_ra,dec_axes.transpose())
156 dec_axes2 = numpy.array(dec_axes)
157
158 ObjHor = Astro_Coords.Equatorial(ha_axes2,dec_axes2,jd)
159 [alt,az,ha] = ObjHor.change2AltAz()
160
161 z = numpy.transpose(alt)*Misc_Routines.CoFactors.d2r ; z = z.flatten()
162 az = numpy.transpose(az)*Misc_Routines.CoFactors.d2r ; az = az.flatten()
163
164 vect = numpy.array([numpy.cos(z)*numpy.sin(az),numpy.cos(z)*numpy.cos(az),numpy.sin(z)])
165
166 xg = numpy.atleast_2d(xg)
167 dcosx = numpy.array(numpy.dot(xg,vect))
168 yg = numpy.atleast_2d(yg)
169 dcosy = numpy.array(numpy.dot(yg,vect))
170
171 mcosx = dcosx.reshape(ndec,nha)
172 mcosy = dcosy.reshape(ndec,nha)
173
174 # Defining NAN for points outof limits.
175 xmax = numpy.max(x)
176 xmin = numpy.min(x)
177 ymax = numpy.max(y)
178 ymin = numpy.min(y)
179
180 factor = 1.3
181 noval = numpy.where((mcosx>(xmax*factor)) | (mcosx<(xmin*factor)))
182 if noval[0].size>0:mcosx[noval] = numpy.nan
183 noval = numpy.where((mcosy>(ymax*factor)) | (mcosy<(ymin*factor)))
184 if noval[0].size>0:mcosy[noval] = numpy.nan
185
186 # Plotting HA and declination grid.
187 iha0 = numpy.int((0 - minha)/incha)
188 idec0 = numpy.int((-14 - mindec)/incdec)
189
190 colorgrid = (1.,109/255.,0)
191 matplotlib.pyplot.plot(mcosx.transpose(),mcosy.transpose(),color=colorgrid,linestyle='--')
192 for idec in numpy.arange(ndec):
193 if idec != idec0:
194 valx = (mcosx[idec,iha0]<=xmax) & (mcosx[idec,iha0]>=xmin)
195 valy = (mcosy[idec,iha0]<=ymax) & (mcosy[idec,iha0]>=ymin)
196 if valx & valy:
197 text = str(numpy.int(mindec + incdec*idec))+'$^o$'
198 matplotlib.pyplot.text(mcosx[idec,iha0],mcosy[idec,iha0],text)
199
200 matplotlib.pyplot.plot(mcosx,mcosy,color=colorgrid,linestyle='--')
201 for iha in numpy.arange(nha):
202 if iha != iha0:
203 valx = (mcosx[idec0,iha]<=xmax) & (mcosx[idec0,iha]>=xmin)
204 valy = (mcosy[idec0,iha]<=ymax) & (mcosy[idec0,iha]>=ymin)
205 if valx & valy:
206 text = str(4*numpy.int(minha + incha*iha))+"'"
207 matplotlib.pyplot.text(mcosx[idec0,iha],mcosy[idec0,iha],text)
208
209 matplotlib.pyplot.xlim(xmin,xmax)
210 matplotlib.pyplot.ylim(ymin,ymax)
211
212 save_fig = os.path.join(gpath,filename)
213 matplotlib.pyplot.savefig(save_fig,format='png')
214
215
216 class BFieldPlot:
217 def __init__(self):
218 """
219 BFieldPlot creates an object for drawing magnetic Field lines over Jicamarca.
220
221 Modification History
222 --------------------
223 Created by Freddy Galindo, ROJ, 07 October 2009.
224 """
225
226 self.alpha_location = 1
227 # pass
228
229 def plotBField(self,gpath,filename,dcos,alpha, nlon, nlat, dcosxrange, dcosyrange, heights, alpha_i):
230 """
231 plotBField draws the magnetic field in a directional cosines plot.
232
233 Parameters
234 ----------
235 dcos = An 4-dimensional array giving the directional cosines of the magnetic field
236 over the desired place.
237 alpha = An 3-dimensional array giving the angle of the magnetic field over the desi-
238 red place.
239 nlon = An integer to specify the number of elements per longitude.
240 nlat = An integer to specify the number of elements per latitude.
241 dcosxrange = A 2-element array giving the range of the directional cosines in the
242 "x" axis.
243 dcosyrange = A 2-element array giving the range of the directional cosines in the
244 "y" axis.
245 heights = An array giving the heights (km) where the magnetic field will be modeled By default the magnetic field will be computed at 100, 500 and 1000km.
246 alpha_i = Angle to interpolate the magnetic field.
247 Modification History
248 --------------------
249 Converted to Python by Freddy R. Galindo, ROJ, 07 October 2009.
250 """
251
252 handles = []
253 objects = []
254 colors = ['k','m','c','b','g','r','y']
255 marker = ['-+','-*','-D','-x','-s','->','-o','-^']
256
257 alpha_location = numpy.zeros((nlon,2,heights.size))
258
259 for ih in numpy.arange(heights.size):
260 alpha_location[:,0,ih] = dcos[:,0,ih,0]
261 for ilon in numpy.arange(nlon):
262 myx = (alpha[ilon,:,ih])[::-1]
263 myy = (dcos[ilon,:,ih,0])[::-1]
264 tck = scipy.interpolate.splrep(myx,myy,s=0)
265 mydcosx = scipy.interpolate.splev(alpha_i,tck,der=0)
266
267 myx = (alpha[ilon,:,ih])[::-1]
268 myy = (dcos[ilon,:,ih,1])[::-1]
269 tck = scipy.interpolate.splrep(myx,myy,s=0)
270 mydcosy = scipy.interpolate.splev(alpha_i,tck,der=0)
271 alpha_location[ilon,:,ih] = numpy.array([mydcosx, mydcosy])
272
273
274 ObjFig, = matplotlib.pyplot.plot(alpha_location[:,0,ih],alpha_location[:,1,ih], \
275 marker[ih % 8],color=colors[numpy.int(ih/8)],ms=4.5,lw=0.5)
276 handles.append(ObjFig)
277 objects.append(numpy.str(heights[ih]) + ' km')
278
279 matplotlib.pyplot.xlim(dcosxrange[0],dcosxrange[1])
280 matplotlib.pyplot.ylim(dcosyrange[0],dcosyrange[1])
281
282 try:
283 ObjlegB = matplotlib.pyplot.legend(handles,objects,loc="lower right", numpoints=1, handlelength=0.3, \
284 handletextpad=0.02, borderpad=0.3, labelspacing=0.1)
285 except:
286 ObjlegB = matplotlib.pyplot.legend(handles,objects,loc=[0.01,0.75], numpoints=1, handlelength=0, \
287 pad=0.015, handletextsep=0.02,labelsep=0.01)
288
289 matplotlib.pyplot.setp(ObjlegB.get_texts(),fontsize='small')
290 matplotlib.pyplot.gca().add_artist(ObjlegB)
291
292 save_fig = os.path.join(gpath,filename)
293 matplotlib.pyplot.savefig(save_fig,format='png')
294 self.alpha_location = alpha_location
295
296
297 class CelestialObjectsPlot:
298 def __init__(self,jd,dec,tod,maxha_min,show_object=None):
299
300 self.jd = jd
301 self.dec = dec
302 self.tod = tod
303 self.maxha_min = maxha_min
304
305 if show_object==None:show_object=numpy.zeros(4)+2
306 self.show_object = show_object
307
308 self.dcosx_sun = 1
309 self.dcosy_sun = 1
310 self.ha_sun = 1
311 self.time_sun = 1
312
313 self.dcosx_moon = 1
314 self.dcosy_moon = 1
315 self.ha_moon = 1
316 self.time_moon = 1
317
318 self.dcosx_hydra = 1
319 self.dcosy_hydra = 1
320 self.ha_hydra = 1
321 self.time_hydra = 1
322
323 self.dcosx_galaxy = 1
324 self.dcosy_galaxy = 1
325 self.ha_galaxy = 1
326 self.time_galaxy = 1
327
328 def drawObject(self,glat,glon,xg,yg,dcosxrange,dcosyrange,gpath='',filename=''):
329
330 jd = self.jd
331 main_dec = self.dec
332 tod = self.tod
333 maxha_min = self.maxha_min
334
335 mesg = "Drawing celestial objects over Observatory"
336 # print mesg
337 # if textid!=None:textid.append(mesg)
338
339 maxlev = 24; minlev = 0; maxcol = 39; mincol = 10
340 handles = []
341 objects = ['$Sun$','$Moon$','$Hydra$','$Galaxy$']
342 marker = ['--^','--s','--*','--o']
343
344 # Getting RGB table to plot celestial object over Jicamarca
345 colortable = Graphics_Miscens.ColorTable(table=1).readTable()
346
347 for io in (numpy.arange(4)+1):
348 if self.show_object[io]!=0:
349 ObjBodies = Astro_Coords.CelestialBodies()
350 if io==1:
351 [ra,dec,sunlon,sunobliq] = ObjBodies.sunpos(jd)
352 elif io==2:
353 [ra,dec,dist,moonlon,moonlat] = ObjBodies.moonpos(jd)
354 elif io==3:
355 [ra,dec] = ObjBodies.hydrapos()
356 elif io==4:
357 [maxra,ra] = ObjBodies.skynoise_jro(dec_cut=main_dec)
358 ra = maxra*15.
359 dec = main_dec
360
361 ObjEq = Astro_Coords.Equatorial(ra,dec,jd,lat=glat,lon=glon)
362 [alt, az, ha] = ObjEq.change2AltAz()
363 vect = numpy.array([az,alt]).transpose()
364 vect = Misc_Routines.Vector(vect,direction=0).Polar2Rect()
365
366 dcosx = numpy.array(numpy.dot(vect,xg))
367 dcosy = numpy.array(numpy.dot(vect,yg))
368 wrap = numpy.where(ha>=180.)
369 if wrap[0].size>0:ha[wrap] = ha[wrap] - 360.
370
371 val = numpy.where((numpy.abs(ha))<=(maxha_min*0.25))
372 if val[0].size>2:
373 tod_1 = tod*1.
374 shift_1 = numpy.where(tod>12.)
375 tod_1[shift_1] = tod_1[shift_1] - 24.
376 tod_2 = tod*1.
377 shift_2 = numpy.where(tod<12.)
378 tod_2[shift_2] = tod_2[shift_2] + 24.
379
380 diff0 = numpy.nanmax(tod[val]) - numpy.nanmin(tod[val])
381 diff1 = numpy.nanmax(tod_1[val]) - numpy.nanmin(tod_1[val])
382 diff2 = numpy.nanmax(tod_2[val]) - numpy.nanmin(tod_2[val])
383
384 if ((diff0<=diff1) & (diff0<=diff2)):
385 tod_0 = tod
386 elif ((diff1<diff0) & (diff1<diff2)):
387 tod_0 = tod_1
388 else:
389 tod_0 = tod_2
390
391 if io==1:
392 self.dcosx_sun = dcosx[val]
393 self.dcosy_sun = dcosy[val]
394 self.ha_sun = ha[val]
395 self.time_sun = numpy.median(tod_0[val])
396 elif io==2:
397 self.dcosx_moon = dcosx[val]
398 self.dcosy_moon = dcosy[val]
399 self.ha_moon = ha[val]
400 self.time_moon = numpy.median(tod_0[val])
401 elif io==3:
402 self.dcosx_hydra = dcosx[val]
403 self.dcosy_hydra = dcosy[val]
404 self.ha_hydra = ha[val]
405 self.time_hydra = numpy.mean(tod_0[val])
406 elif io==4:
407 self.dcosx_galaxy = dcosx[val]
408 self.dcosy_galaxy = dcosy[val]
409 self.ha_galaxy = ha[val]
410 self.time_galaxy = numpy.mean(tod_0[val])
411
412 index = numpy.mean(tod_0[val]) - minlev
413 index = (index*(maxcol - mincol)/(maxlev - minlev)) + mincol
414 index = numpy.int(index)
415 figobjects, = matplotlib.pyplot.plot(dcosx[val],dcosy[val],marker[io-1],\
416 lw=1,ms=7,mew=0,color=tuple(colortable[:,index]))
417 handles.append(figobjects)
418
419 xmax = numpy.max(dcosxrange[1])
420 xmin = numpy.min(dcosxrange[0])
421 ymax = numpy.max(dcosyrange[1])
422 ymin = numpy.min(dcosyrange[0])
423 matplotlib.pyplot.xlim(xmin,xmax)
424 matplotlib.pyplot.ylim(ymin,ymax)
425
426 val = numpy.where(self.show_object[1:]>0)
427 objects = numpy.array(objects)
428 objects = list(objects[val])
429 try:
430 ObjlegC = matplotlib.pyplot.legend(handles,objects,loc="lower left", numpoints=1, handlelength=0.3, \
431 borderpad=0.3, handletextpad=0.02,labelspacing=0.1)
432 except:
433 ObjlegC = matplotlib.pyplot.legend(handles,objects,loc=[0.01,0.75], numpoints=1, handlelength=0, \
434 pad=0.015, handletextsep=0.02,labelsep=0.01)
435
436 matplotlib.pyplot.setp(ObjlegC.get_texts(),fontsize='small')
437 ObjlegC.isaxes = False
438 save_fig = os.path.join(gpath,filename)
439 matplotlib.pyplot.savefig(save_fig,format='png')
440
441
442 class PatternCutPlot:
443 def __init__(self,nsubplots):
444 self.nsubplots = nsubplots
445
446 self.fig = None
447
448 self.__plot_width = 8
449
450 if self.nsubplots == 5:
451 self.__plot_height = 11
452
453 if self.nsubplots == 4:
454 self.__plot_height = 9
455
456 if self.nsubplots == 3:
457 self.__plot_height = 7
458
459 if self.nsubplots == 2:
460 self.__plot_height = 5
461
462 if self.nsubplots == 1:
463 self.__plot_height = 3
464
465 self.fig = matplotlib.pyplot.figure(num = 4,figsize = (self.__plot_width, self.__plot_height))
466
467 if self.nsubplots < 5:
468 self.__height_inch = 1.1 #altura de los subplots (pulgadas)
469 top_inch = 1.5/2.7 #espacio entre el primer subplot y el limite superior del plot
470 self.__vspace_plot_inch = 1.0#1.5/2 # espacio vertical entre subplots
471 self.__left = 0.1
472 else:
473 self.__height_inch = 1.1 #altura de los subplots (pulgadas)
474 top_inch = 1.5/2.7 #espacio entre el primer subplot y el limite superior del plot
475 self.__vspace_plot_inch = 1.0 # espacio vertical entre subplots
476 self.__left = 0.1
477
478 self.__bottom_inch = self.__plot_height - (self.__height_inch + top_inch)
479 self.__height = self.__height_inch/self.__plot_height
480
481 self.__width = 0.8
482
483
484 def drawCut(self,io,patterns,npatterns,ha,otitle,subtitle,ptitle):
485
486 t_cuts = ['B','Sun','Moon','Hydra','Galaxy']
487 self.__bottom = self.__bottom_inch/self.__plot_height
488
489
490 subp = self.fig.add_axes([self.__left,self.__bottom,self.__width,self.__height])
491
492 on_axis_angle = -4.65562
493 for icut in numpy.arange(npatterns):
494 # Getting Antenna cut.
495 pattern = patterns[icut]
496 power = numpy.abs(pattern/numpy.nanmax(pattern))
497 max_power_db = numpy.round(10.*numpy.log10(numpy.nanmax(pattern)),2)
498
499 bval = numpy.where(power[:,0]==numpy.nanmax(power))
500 beta = -0.25*(ha[bval[0]] + on_axis_angle)
501 # print 'Angle (deg): '+"%f"%(beta)
502
503 subp.plot(ha,power)
504
505
506 xmax = numpy.max(numpy.nanmin(ha))
507 xmin = numpy.min(numpy.nanmax(ha))
508 ymax = numpy.max(1)
509 ymin = numpy.min(0)
510
511
512 subp.set_xlim(xmin, xmax)
513
514 subp.set_ylim(ymin, ymax)
515
516 subp.set_title(otitle + ' ' + ptitle,size="medium")
517
518 subp.text(0.5, 1.26,subtitle[0],
519 horizontalalignment='center',
520 verticalalignment='center',
521 transform = subp.transAxes)
522
523 xlabels = subp.get_xticks()
524
525 subp.set_xticklabels(xlabels,size="small")
526
527 ylabels = subp.get_yticks()
528
529 subp.set_yticklabels(ylabels,size="small")
530
531 subp.set_xlabel('Hour angle (min) (+ve to West)',size="small")
532
533 subp.set_ylabel("Power [Max: " + str(max_power_db) + ' dB]',size="small")
534
535 subp.grid()
536
537
538 self.__bottom_inch = self.__bottom_inch - (self.__height_inch + self.__vspace_plot_inch)
539
540
541 class SkyNoisePlot:
542 def __init__(self,date,powr,time,time_lst):
543 """
544 SkyNoisePlot class creates an object which represents the SkyNoise Object to genera-
545 te a SkyNoise map.
546
547 Parameters
548 ----------
549 date = A List of 3 elements to define the desired date ([year, month, day]).
550 powr = An array giving the SkyNoise power for the desired time.
551 time = An array giving the number of seconds since 1970 to the desired time.
552 time_lst = Set this input to an array to define the Local Sidereal Time of the desi-
553 red time.
554
555 Modification History
556 --------------------
557 Created by Freddy Galindo, ROJ, 18 October 2009.
558 """
559
560 self.date = date
561 self.powr = powr
562 self.time = time
563 self.time_lst = time_lst
This diff has been collapsed as it changes many lines, (1035 lines changed) Show them Hide them
@@ -0,0 +1,1035
1 '''
2 The module JroAntSetup contains the pre-defined parameters for beam modelling of the Jicamarca ante-
3 nna. Any new configuration must be added in this module (if the user decides that) using a specific
4 ID (pattern value) or it would be read from a file using pattern=None.
5
6 MODULES CALLED:
7 OS, NUMPY
8
9 MODIFICATION HISTORY:
10 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ Sep 20, 2009.
11 '''
12
13 import os
14 import numpy
15
16 def ReturnSetup(path=None,filename=None,pattern=0):
17 """
18 ReturnSetup is a pre-defined list of Jicamarca antenna configurations which returns a dic-
19 tionary giving the configuration parameters (e.g. transmitted phases). To choose one, the
20 user must define the input "pattern" (See valid values below).
21
22 Parameters:
23 -----------
24
25 pattern = A integer (>=0) to specify the setup to choose. The default value is zero. If the
26 antenna configuration is user-defined pattern must be None.
27
28 path = Set this input a string to specifiy the folder path where the user-defined configu-
29 ration file is placed. If this value is not defined ReturnSetup will return None.
30
31 file = Set this input a string to specifiy the name of the user-defined configuration file
32 (*.txt). if this value is not defined ReturnSEtup will return None.
33
34 Examples:
35 ---------
36
37 Choosing a pre-defined antenna configuration
38 setup = ReturnSetup(pattern=1)
39
40 Reading a user-defined antenna configuration
41 setup = ReturnSetup(path="/users/users/Progs/Patterns/",file="ExpSep232009.txt")
42 """
43
44
45 if pattern == 0:
46 title = "for module (rx)"
47
48 ues = numpy.array([1.,2.,2.,1.])
49 phase = numpy.zeros([8,8])
50 phase[0:4,:] = 4
51 phase[4:8,:] = 5
52
53 gaintx = numpy.zeros([8,8])
54 gaintx[0,0] = 1
55
56 gainrx = numpy.zeros([8,8])
57 gainrx[0,0] = 1
58
59 justrx = 1
60
61 elif pattern==1:
62 # Configuration 1/16 on-axis (rx)
63 title = " for 1/16 on-axis (rx)"
64
65 ues = numpy.array([1.,2.,2.,1.])
66 phase = numpy.zeros([8,8])
67 phase[0:4,:] = 4
68 phase[4:8,:] = 5
69
70 gaintx = numpy.zeros([8,8])
71 gaintx[0:2,0:2] = 1
72
73 gainrx = numpy.zeros([8,8])
74 gainrx[0:2,0:2] = 1
75
76 justrx = 1
77
78 elif pattern == 2:
79 # Configuration for On-Axis
80 title = " for 1/4 on-axis (rx)"
81
82 ues = numpy.array([1.,2.,2.,1.])
83 phase = numpy.zeros([8,8])
84 phase[0:4,:] = 4
85 phase[4:8,:] = 5
86
87 gaintx = numpy.zeros([8,8])
88 gaintx[0:4,0:4] = 1
89
90 gainrx = numpy.zeros([8,8])
91 gainrx[0:4,0:4] = 1
92
93 justrx = 1
94
95 elif pattern == 3:
96 # Configuration for On-Axis
97 title = " for all on-axis (rx)"
98
99 ues = numpy.array([1.,2.,2.,1.])
100 phase = numpy.zeros([8,8])
101 phase[0:4,:] = 4
102 phase[4:8,:] = 5
103
104 gaintx = numpy.zeros([8,8])
105 gaintx[:,:] = 1
106
107 gainrx = numpy.zeros([8,8])
108 gainrx[:,:] = 1
109
110 justrx = 0
111
112 elif pattern == 4:
113 # Configuration for oblique ISR On-Axis
114 title = " for Oblique ISR On-axis"
115
116 ues = numpy.array([1.,2.,2.,1.])
117 phase = numpy.zeros([8,8])
118 phase[0:4,:] = 4
119 phase[4:8,:] = 5
120
121 gaintx = numpy.zeros([8,8])
122 gaintx[:,:] = 1
123
124 gainrx = numpy.zeros([8,8])
125 gainrx[:,:] = 1
126
127 justrx = 0
128
129 elif pattern == 5:
130 # Configuration for oblique ISR "4.5"
131 title = " for Oblique ISR '4.5'"
132
133 ues = numpy.array([1.,2.,2.,1.])
134 phase = numpy.array([[4,4,5,5,2,2,3,3],
135 [4,5,5,2,2,3,3,4],
136 [5,5,2,2,3,3,4,4],
137 [5,2,2,3,3,4,4,5],
138 [3,3,4,4,5,5,2,2],
139 [3,4,4,5,5,2,2,3],
140 [4,4,5,5,2,2,3,3],
141 [4,5,5,2,2,3,3,4]],dtype=float)
142
143 gaintx = numpy.zeros([8,8])
144 gaintx[:,:] = 1
145
146 gainrx = numpy.zeros([8,8])
147 gainrx[:,:] = 1
148
149 justrx = 0
150
151 elif pattern == 6:
152 # Configuration for oblique ISR "6.0S"
153 title = " for Oblique ISR '6.0S'"
154
155 ues = numpy.array([1.,2.,2.,1.])
156 phase = numpy.array([[4,5,2,3,4,5,2,3],
157 [5,2,3,4,5,2,3,4],
158 [2,3,4,5,2,3,4,5],
159 [3,4,5,2,3,4,5,2],
160 [5,2,3,4,5,2,3,4],
161 [2,3,4,5,2,3,4,5],
162 [3,4,5,2,3,4,5,2],
163 [4,5,2,3,4,5,2,3]],dtype=float)
164
165 gaintx = numpy.zeros([8,8])
166 gaintx[:,:] = 1
167
168 gainrx = numpy.zeros([8,8])
169 gainrx[:,:] = 1
170
171 justrx = 0
172
173 elif pattern == 7:
174 # Configuration for oblique ISR "3.0N"
175 title = " for Oblique ISR '3.0N'"
176
177 ues = numpy.array([1.,2.,2.,1.])
178 phase = numpy.array([[4,3,2,5,4,3,2,5],
179 [3,2,5,4,3,2,5,4],
180 [2,5,4,3,2,5,4,3],
181 [5,4,3,2,5,4,3,2],
182 [5,4,3,2,5,4,3,2],
183 [4,3,2,5,4,3,2,5],
184 [3,2,5,4,3,2,5,4],
185 [2,5,4,3,2,5,4,3]],dtype=float)
186
187 gaintx = numpy.zeros([8,8])
188 gaintx[:,:] = 1
189
190 gainrx = numpy.zeros([8,8])
191 gainrx[:,:] = 1
192
193 justrx = 0
194
195 elif pattern == 8:
196 # Configuration for North Fritts"
197 title = " for North (Fritts)"
198
199 ues = numpy.array([2.513, 1.0, 3.0, 0.413])
200 phase = numpy.array([[4.29, 3.55, 2.82, 2.08, 4.20, 3.47, 2.73, 2.00],
201 [2.94, 2.20, 5.44, 4.70, 4.32, 3.59, 2.85, 2.12],
202 [5.56, 4.82, 4.09, 3.35, 4.44, 3.71, 2.97, 2.24],
203 [4.20, 3.47, 2.73, 2.00, 4.56, 3.82, 3.09, 2.35],
204 [4.20, 3.47, 2.73, 2.00, 4.56, 3.82, 3.09, 2.35],
205 [4.32, 3.59, 2.85, 2.12, 2.94, 2.20, 5.44, 4.70],
206 [4.44, 3.71, 2.97, 2.24, 5.56, 4.82, 4.09, 3.35],
207 [4.56, 3.82, 3.09, 2.35, 4.20, 3.47, 2.73, 2.00]],dtype=float)
208
209 gaintx = numpy.zeros([8,8])
210 gaintx[0:4,0:4] = 1
211 gaintx[4:8,4:8] = 1
212
213 gainrx = numpy.zeros([8,8])
214 gainrx[0:4,0:4] = 1
215 gainrx[4:8,4:8] = 1
216
217 justrx = 0
218
219 elif pattern == 9:
220 # Configuration for West Fritts"
221 title = " for West (Fritts)"
222
223 ues = numpy.array([2.513, 1.0, 3.0, 0.413])
224 phase = numpy.array([[4.29, 3.55, 2.82, 2.08, 4.20, 3.47, 2.73, 2.00],
225 [2.94, 2.20, 5.44, 4.70, 4.32, 3.59, 2.85, 2.12],
226 [5.56, 4.82, 4.09, 3.35, 4.44, 3.71, 2.97, 2.24],
227 [4.20, 3.47, 2.73, 2.00, 4.56, 3.82, 3.09, 2.35],
228 [4.20, 3.47, 2.73, 2.00, 4.56, 3.82, 3.09, 2.35],
229 [4.32, 3.59, 2.85, 2.12, 2.94, 2.20, 5.44, 4.70],
230 [4.44, 3.71, 2.97, 2.24, 5.56, 4.82, 4.09, 3.35],
231 [4.56, 3.82, 3.09, 2.35, 4.20, 3.47, 2.73, 2.00]],dtype=float)
232
233 gaintx = numpy.zeros([8,8])
234 gaintx[4:8,0:4] = 1
235 gaintx[4:8,0:4] = 1
236
237 gainrx = numpy.zeros([8,8])
238 gainrx[4:8,0:4] = 1
239 gainrx[4:8,0:4] = 1
240
241 justrx = 0
242
243 elif pattern == 10:
244 # Configuration for South Fritts"
245 title = " for South (Fritts)"
246
247 ues = numpy.array([0.413, 2.0, 1.0, 1.513])
248 phase = numpy.array([[2.0 , 2.73, 3.47, 4.2 , 2.08, 2.82, 3.55, 4.29],
249 [2.12, 2.85, 3.59, 4.32, 4.7 , 5.44, 2.20, 2.94],
250 [2.24, 2.97, 3.71, 4.44, 3.35, 4.09, 4.82, 5.56],
251 [2.35, 3.09, 3.82, 4.56, 2.0 , 2.73, 3.47, 4.20],
252 [2.08, 2.82, 3.55, 4.29, 2.0 , 2.73, 3.47, 4.20],
253 [4.70, 5.44, 2.20, 2.94, 2.12, 2.85, 3.59, 4.32],
254 [3.35, 4.09, 4.82, 5.56, 2.24, 2.97, 3.71, 4.44],
255 [2.00, 2.73, 3.47, 4.20, 2.35, 3.09, 3.82, 4.56]],dtype=float)
256
257 gaintx = numpy.zeros([8,8])
258 gaintx[0:4,0:4] = 1
259 gaintx[4:8,4:8] = 1
260
261 gainrx = numpy.zeros([8,8])
262 gainrx[0:4,0:4] = 1
263 gainrx[4:8,4:8] = 1
264
265 justrx = 0
266
267 elif pattern == 11:
268 # Configuration for East Fritts"
269 title = " for East (Fritts)"
270
271 ues = numpy.array([0.413, 2.0, 1.0, 1.513])
272 phase = numpy.array([[2.0 , 2.73, 3.47, 4.2 , 2.08, 2.82, 3.55, 4.29],
273 [2.12, 2.85, 3.59, 4.32, 4.7 , 5.44, 2.20, 2.94],
274 [2.24, 2.97, 3.71, 4.44, 3.35, 4.09, 4.82, 5.56],
275 [2.35, 3.09, 3.82, 4.56, 2.0 , 2.73, 3.47, 4.20],
276 [2.08, 2.82, 3.55, 4.29, 2.0 , 2.73, 3.47, 4.20],
277 [4.70, 5.44, 2.20, 2.94, 2.12, 2.85, 3.59, 4.32],
278 [3.35, 4.09, 4.82, 5.56, 2.24, 2.97, 3.71, 4.44],
279 [2.00, 2.73, 3.47, 4.20, 2.35, 3.09, 3.82, 4.56]],dtype=float)
280
281 gaintx = numpy.zeros([8,8])
282 gaintx[4:8,0:4] = 1
283 gaintx[4:8,0:4] = 1
284
285 gainrx = numpy.zeros([8,8])
286 gainrx[4:8,0:4] = 1
287 gainrx[4:8,0:4] = 1
288
289 justrx = 0
290
291 elif pattern == 12:
292 # Configuration for DEWD position (2009)
293 title = " for DEWD position (2009) East Beam"
294
295 ues = numpy.array([0.,0.,0.75,0.75])
296 phase = numpy.array([[2,3,3,3,3,4,4,4],
297 [5,2,2,2,2,3,3,3],
298 [3,4,4,4,4,5,5,5],
299 [2,3,3,3,3,4,4,4],
300 [4,5,5,5,5,2,2,2],
301 [3,4,4,4,4,5,5,5],
302 [5,2,2,2,2,3,3,3],
303 [4,5,5,5,5,2,2,2]],dtype=float)
304
305 gaintx = numpy.zeros([8,8])
306 gaintx[:,:] = 1
307
308 gainrx = numpy.zeros([8,8])
309 gainrx[:,0:4] = 1
310
311 justrx = 0
312
313 elif pattern == 13:
314 # Configuration for DEWD position (2009)
315 title = " for DEWD position (2009) West Beam"
316
317 ues = numpy.array([1.0,0.5,1.5,2.0])
318 phase = numpy.array([[5,4,2,5,3,2,4,3],
319 [2,5,3,2,4,3,5,4],
320 [2,5,3,2,4,3,5,4],
321 [3,2,4,3,5,4,2,5],
322 [3,2,4,3,5,4,2,5],
323 [4,3,5,4,2,5,3,2],
324 [4,3,5,4,2,5,3,2],
325 [5,4,2,5,3,2,4,3]],dtype=float)
326
327 gaintx = numpy.zeros([8,8])
328 gaintx[:,:] = 1
329
330 gainrx = numpy.zeros([8,8])
331 gainrx[4:8,:] = 1
332
333 justrx = 0
334
335 elif pattern == 14:
336 # Configuration for DVD position (2009)
337 title = " for DVD position (2009)"
338
339 ues = numpy.array([1.0,2.0,2.0,1.25])
340 phase = numpy.array([[2,2,5,5,4,4,3,3],
341 [2,5,5,4,4,3,3,2],
342 [5,5,4,4,3,3,2,2],
343 [5,4,4,3,3,2,2,5],
344 [5,5,4,4,3,3,2,2],
345 [5,4,4,3,3,2,2,5],
346 [4,4,3,3,2,2,5,5],
347 [4,3,3,2,2,5,5,4]],dtype=float)
348
349 gaintx = numpy.zeros([8,8])
350 gaintx[:,:] = 1
351
352 gainrx = numpy.zeros([8,8])
353 gainrx[0:4,0:4] = 1
354
355 justrx = 0
356
357 elif pattern == 15:
358 # Configuration for Julia CP2
359 title = " for Julia CP2 Ew"
360
361 ues = numpy.array([0.0,1.0,1.0,0.0])
362 phase = numpy.array([[2,2,5,4,3,3,2,5],
363 [2,5,4,4,3,2,5,5],
364 [5,4,3,3,2,5,4,4],
365 [4,4,3,2,5,5,4,3],
366 [4,4,3,2,5,5,4,3],
367 [4,3,2,2,5,4,3,3],
368 [3,2,5,5,4,3,2,2],
369 [2,2,5,4,3,3,2,5]],dtype=float)
370
371 gaintx = numpy.zeros([8,8])
372 gaintx[0:4,4:8] = 1
373 gaintx[4:8,0:4] = 1
374
375 gainrx = numpy.zeros([8,8])
376 gainrx[0,0] = 1
377
378 justrx = 0
379
380 elif pattern == 16:
381 # Configuration for Julia CP2
382 title = " for Julia CP2 NS"
383
384 ues = numpy.array([1.0,2.0,2.0,1.0])
385 phase = numpy.array([[4,4,3,2,5,5,4,3],
386 [4,3,2,2,5,4,3,3],
387 [3,2,5,5,4,3,2,2],
388 [2,2,5,4,3,3,2,5],
389 [2,2,5,4,3,3,2,5],
390 [2,5,4,4,3,2,5,5],
391 [5,4,3,3,2,5,4,4],
392 [4,4,3,2,5,5,4,3]],dtype=float)
393
394 gaintx = numpy.zeros([8,8])
395 gaintx[0:4,0:4] = 1
396 gaintx[4:8,4:8] = 1
397
398 gainrx = numpy.zeros([8,8])
399 gainrx[0:4,0:4] = 1
400
401 justrx = 0
402
403 elif pattern == 17:
404 # Configuration for Julia CP3
405 title = " for Julia CP3 NS"
406
407 ues = numpy.array([1.0,1.0,1.0,1.0])
408 phase = numpy.array([[4,4,3,2,5,5,4,3],
409 [4,3,2,2,5,4,3,3],
410 [3,2,5,5,4,3,2,2],
411 [2,2,5,4,3,3,2,5],
412 [2,2,5,4,3,3,2,5],
413 [2,5,4,4,3,2,5,5],
414 [5,4,3,3,2,5,4,4],
415 [4,4,3,2,5,5,4,3]],dtype=float)
416
417 gaintx = numpy.zeros([8,8])
418 gaintx[0:4,0:4] = 1
419 gaintx[4:8,4:8] = 1
420
421 gainrx = numpy.zeros([8,8])
422 gainrx[0:4,0:4] = 1
423
424 justrx = 0
425
426 elif pattern == 18:
427 # Configuration for Julia V
428 title = " for Julia V"
429
430 ues = (2/3.)*numpy.array([1.5,3.0+0.75,3.0,1.5-0.75])
431 phase = numpy.array([[4,4,3,3,2,2,5,5],
432 [4,3,3,2,2,5,5,4],
433 [3,3,2,2,5,5,4,4],
434 [3,2,2,5,5,4,4,3],
435 [3,3,2,2,5,5,4,4],
436 [3,2,2,5,5,4,4,3],
437 [2,2,5,5,4,4,3,3],
438 [2,5,5,4,4,3,3,2]],dtype=float)
439
440 gaintx = numpy.zeros([8,8])
441 gaintx[0:4,0:4] = 1
442 gaintx[4:8,4:8] = 1
443
444 gainrx = numpy.zeros([8,8])
445 gainrx[0:4,0:4] = 1
446
447 justrx = 0
448
449 elif pattern == 19:
450 # Configuration for Julia V
451 title = " for Julia EW 2006-2007 (W)"
452
453 ues = numpy.array([1.0+0.66,2.0+0.66,2.0,1.0])
454 phase = numpy.array([[4,3,2,5,4,3,2,5],
455 [4,3,2,5,4,3,2,5],
456 [4,3,2,5,4,3,2,5],
457 [4,3,2,5,4,3,2,5],
458 [5,4,3,2,5,4,3,2],
459 [5,4,3,2,5,4,3,2],
460 [5,4,3,2,5,4,3,2],
461 [5,4,3,2,5,4,3,2]],dtype=float)
462
463 gaintx = numpy.zeros([8,8])
464 gaintx[:,:] = 1
465
466 gainrx = numpy.zeros([8,8])
467 gainrx[:,:] = 1
468
469 justrx = 0
470
471 elif pattern == 20:
472 # Configuration for Julia V
473 title = " for Julia EW 2006-2007 (E)"
474
475 ues = numpy.array([1.0,1.0,1.0,1.0])
476 phase = numpy.array([[4,4,4,4,5,5,5,5],
477 [3,3,3,3,4,4,4,4],
478 [5,5,5,5,2,2,2,2],
479 [4,4,4,4,5,5,5,5],
480 [2,2,2,2,3,3,3,3],
481 [5,5,5,5,2,2,2,2],
482 [3,3,3,3,4,4,4,4],
483 [2,2,2,2,3,3,3,3]],dtype=float)
484
485 gaintx = numpy.zeros([8,8])
486 gaintx[:,:] = 1
487
488 gainrx = numpy.zeros([8,8])
489 gainrx[0:4,0:4] = 1
490 gainrx[4:8,4:8] = 1
491
492 justrx = 0
493
494 elif pattern == 21:
495 # Configuration for EW Imaging 1996
496 title = " for EW Imaging 1996"
497
498 ues = numpy.array([1.0,2.0,2.0,1.0])
499 phase = numpy.array([[4,4,3,2,5,5,4,3],
500 [4,3,2,2,5,4,3,3],
501 [3,2,5,5,4,3,2,2],
502 [2,2,5,4,3,3,2,5],
503 [2,2,5,4,3,3,2,5],
504 [2,5,4,4,3,2,5,5],
505 [5,4,3,3,2,5,4,4],
506 [4,4,3,2,5,5,4,3]],dtype=float)
507
508 gaintx = numpy.zeros([8,8])
509 gaintx[0:4,0:4] = 1
510 gaintx[4:8,4:8] = 1
511
512 gainrx = numpy.zeros([8,8])
513 gainrx[0,0] = 1
514
515 justrx = 0
516
517 elif pattern == 22:
518 # Configuration for EW Imaging 2003
519 title = " for EW Imaging 2003"
520
521 ues = numpy.array([1.0,1.0,1.0,1.0])
522 phase = numpy.array([[4,4,3,2,0,0,0,0],
523 [2,3,2,2,0,0,0,0],
524 [5,0,2,5,0,0,0,0],
525 [2,4,3,4,0,0,0,0],
526 [0,0,0,0,3,3,2,5],
527 [0,0,0,0,2,2,5,5],
528 [0,0,0,0,4,3,5,4],
529 [0,0,0,0,5,3,2,3]],dtype=float)
530
531 gaintx = numpy.zeros([8,8])
532 gaintx[0:4,0:4] = 1
533 gaintx[4:8,4:8] = 1
534
535 gainrx = numpy.zeros([8,8])
536 gainrx[0,0] = 1
537
538 justrx = 0
539
540 elif pattern == 23:
541 # Configuration for EW Imaging 2003
542 title = " for EW Imaging 2006-2008"
543
544 ues = numpy.array([1.0,1.0,1.0,2.0])
545 phase = numpy.array([[4,4,3,2,0,0,0,0],
546 [2,3,2,2,0,0,0,0],
547 [5,0,2,5,0,0,0,0],
548 [2,4,3,4,0,0,0,0],
549 [0,0,0,0,3,3,2,5],
550 [0,0,0,0,2,2,5,5],
551 [0,0,0,0,4,3,5,4],
552 [0,0,0,0,5,3,2,3]],dtype=float)
553
554 gaintx = numpy.zeros([8,8])
555 gaintx[0:4,0:4] = 1
556 gaintx[4:8,4:8] = 1
557
558 gainrx = numpy.zeros([8,8])
559 gainrx[0,0] = 1
560
561 justrx = 0
562
563 elif pattern == 50:
564 # Configuration for vertical drift 1996
565 title = " for Vertical drift 1996"
566
567 ues = (2/3.)*numpy.array([0.,1.5,1.5,0.])
568 phase = numpy.array([[4,4,3,2,5,5,4,3],
569 [4,3,2,2,5,4,3,3],
570 [3,2,5,5,4,3,2,2],
571 [2,2,5,4,3,3,2,5],
572 [2,2,5,4,3,3,2,5],
573 [2,5,4,4,3,2,5,5],
574 [5,4,3,3,2,5,4,4],
575 [4,4,3,2,5,5,4,3]],dtype=float)
576
577 gaintx = numpy.zeros([8,8])
578 gaintx[:,:] = 1
579
580 gainrx = numpy.zeros([8,8])
581 gainrx[:,:] = 1
582
583 justrx = 0
584
585 elif pattern == 51:
586 # Configuration for vertical drift 1996
587 title = " for East-West Drifts 1996 (W beam)"
588
589 ues = numpy.array([0.0,1.0,2.0,1.0])
590 phase = numpy.array([[4,3,5,4,2,5,3,2],
591 [4,3,5,4,2,5,3,2],
592 [4,3,5,4,2,5,3,2],
593 [4,3,5,4,2,5,3,2],
594 [5,4,2,5,3,2,4,3],
595 [5,4,2,5,3,2,4,3],
596 [5,4,2,5,3,2,4,3],
597 [5,4,2,5,3,2,4,3]],dtype=float)
598
599 gaintx = numpy.zeros([8,8])
600 gaintx[:,:] = 1
601
602 gainrx = numpy.zeros([8,8])
603 gainrx[4:8,:] = 1
604
605 justrx = 0
606
607 elif pattern == 52:
608 # Configuration for vertical drift 1996
609 title = " for East-West Drifts 1996 (E Beam)"
610
611 ues = numpy.array([1.0,1.0,0.0,0.0])
612 phase = numpy.array([[4,4,4,4,5,5,5,5],
613 [3,3,3,3,4,4,4,4],
614 [5,5,5,5,2,2,2,2],
615 [4,4,4,4,5,5,5,5],
616 [2,2,2,2,3,3,3,3],
617 [5,5,5,5,2,2,2,2],
618 [3,3,3,3,4,4,4,4],
619 [2,2,2,2,3,3,3,3]],dtype=float)
620
621 gaintx = numpy.zeros([8,8])
622 gaintx[:,:] = 1
623
624 gainrx = numpy.zeros([8,8])
625 gainrx[:,0:4] = 1
626
627 justrx = 0
628
629 elif pattern == 53:
630 # Configuration for vertical drift 1996
631 title = " for DVD position 3 (2006-2008)"
632
633 ues = numpy.array([1.,2,2,1])
634 phase = numpy.array([[4,4,3,3,2,2,5,5],
635 [4,3,3,2,2,5,5,4],
636 [3,3,2,2,5,5,4,4],
637 [3,2,2,5,5,4,4,3],
638 [3,3,2,2,5,5,4,4],
639 [3,2,2,5,5,4,4,3],
640 [2,2,5,5,4,4,3,3],
641 [2,5,5,4,4,3,3,2]],dtype=float)
642
643 gaintx = numpy.zeros([8,8])
644 gaintx[:,:] = 1
645
646 gainrx = numpy.zeros([8,8])
647 gainrx[0:4,4:8] = 1
648
649 justrx = 0
650
651 elif pattern == 54:
652 # Configuration for vertical drift 1996
653 title = " for DEWD (Mar 2005)"
654
655 ues = numpy.array([0.,1.,1/3.,1])
656 phase = numpy.array([[4,3,2,5,3,3,3,3],
657 [4,3,2,5,2,2,2,2],
658 [4,3,2,4,5,5,5,5],
659 [4,3,2,4,4,4,3,3],
660 [5,4,3,2,2,2,2,2],
661 [5,4,3,2,5,5,5,5],
662 [5,4,3,5,4,4,4,4],
663 [5,4,3,5,3,3,2,2]],dtype=float)
664
665 gaintx = numpy.zeros([8,8])
666 gaintx[:,:] = 1
667
668 gainrx = numpy.zeros([8,8])
669 gainrx[:,0:4] = 1
670
671 justrx = 0
672
673 elif pattern == 55:
674 # Configuration for vertical drift 1996
675 title = " for DEWD (Mar 2005)"
676
677 ues = numpy.array([0.,1.,1/3.,1])
678 phase = numpy.array([[4,3,2,5,3,3,3,3],
679 [4,3,2,5,2,2,2,2],
680 [4,3,2,4,5,5,5,5],
681 [4,3,2,4,4,4,3,3],
682 [5,4,3,2,2,2,2,2],
683 [5,4,3,2,5,5,5,5],
684 [5,4,3,5,4,4,4,4],
685 [5,4,3,5,3,3,2,2]],dtype=float)
686
687 gaintx = numpy.zeros([8,8])
688 gaintx[:,:] = 1
689
690 gainrx = numpy.zeros([8,8])
691 gainrx[0:4:,4:8] = 1
692
693 justrx = 0
694
695 elif pattern ==56:
696 # Configuration using antenna compression
697 title = " for antenna compression AA*"
698
699 ues = numpy.array([0.0,0.0,0.0,0.0])
700 phase = numpy.array([[4,4,4,2,4,4,2,4],
701 [4,4,4,2,4,4,2,4],
702 [2,2,2,4,2,2,4,2],
703 [4,4,4,2,4,4,2,4],
704 [2,2,2,4,2,2,4,2],
705 [2,2,2,4,2,2,4,2],
706 [4,4,4,2,4,4,2,4],
707 [2,2,2,4,2,2,4,2]],dtype=float)
708
709 gaintx = numpy.zeros([8,8])
710 gaintx[:,:] = 1
711
712 gainrx = numpy.zeros([8,8])
713 gainrx[0:4,0:4] = 1
714
715 justrx = 0
716
717 elif pattern ==57:
718 # Configuration using antenna compression
719 title = " for antenna compression AB*"
720
721 ues = numpy.array([0.0,0.0,0.0,0.0])
722 phase = numpy.array([[4,4,2,4,2,2,4,2],
723 [4,4,2,4,2,2,4,2],
724 [2,2,4,2,4,4,2,4],
725 [4,4,2,4,2,2,4,2],
726 [2,2,4,2,4,4,2,4],
727 [2,2,4,2,4,4,2,4],
728 [4,4,2,4,2,2,4,2],
729 [2,2,4,2,4,4,2,4]],dtype=float)
730
731 gaintx = numpy.zeros([8,8])
732 gaintx[:,:] = 1
733
734 gainrx = numpy.zeros([8,8])
735 gainrx[0:4,0:4] = 1
736
737 justrx = 0
738
739 elif pattern ==58:
740 # Configuration using in Oblique ISR 4.5
741 title = " for Oblique ISR 4.5"
742
743 ues = numpy.array([1.0,2.0,2.0,1.0])
744 phase = numpy.array([[4,4,5,5,2,2,3,3],
745 [4,5,5,2,2,3,3,4],
746 [5,5,2,2,3,3,4,4],
747 [5,2,2,3,3,4,4,5],
748 [3,3,4,4,5,5,2,2],
749 [3,4,4,5,5,2,2,3],
750 [4,4,5,5,2,2,3,3],
751 [4,5,5,2,2,3,3,4]],dtype=float)
752
753 gaintx = numpy.zeros([8,8])
754 gaintx[:,:] = 1
755
756 gainrx = numpy.zeros([8,8])
757 gainrx[:,:] = 1
758
759 justrx = 1
760
761 elif pattern == 60:
762 title=" for Differential phase 2000"
763 ues = (2/3.)*numpy.array([0.,1.5-0.5,1.5,0.+0.5])
764
765 phase = numpy.array([[4,4,3,2,5,5,4,3],
766 [4,3,2,2,5,4,3,3],
767 [3,2,5,5,4,3,2,2],
768 [2,2,5,4,3,3,2,5],
769 [2,2,5,4,3,3,2,5],
770 [2,5,4,4,3,2,5,5],
771 [5,4,3,3,2,5,4,4],
772 [4,4,3,2,5,5,4,3]],dtype=float)
773
774 gaintx = numpy.zeros([8,8])
775 gaintx[:,:] = 1
776
777 gainrx = numpy.zeros([8,8])
778 gainrx[0:4,0:4] = 1
779
780 justrx = 0
781
782 elif pattern == 61:
783 #for East-West 2003 W
784 title=" for East-West 2003"
785
786 ues = numpy.array([1.+0.66,2.+0.66,2.,1.])
787
788 phase = numpy.array([[4,3,2,5,4,3,2,5],
789 [4,3,2,5,4,3,2,5],
790 [4,3,2,5,4,3,2,5],
791 [4,3,2,5,4,3,2,5],
792 [5,4,3,2,5,4,3,2],
793 [5,4,3,2,5,4,3,2],
794 [5,4,3,2,5,4,3,2],
795 [5,4,3,2,5,4,3,2]],dtype=float)
796
797 gaintx = numpy.zeros([8,8])
798 gaintx[:,:] = 1
799
800 gainrx = numpy.zeros([8,8])
801 gainrx[4:8,:] = 1
802
803 justrx = 0
804
805 elif pattern == 62:
806 #for East-West 2003 E
807 title=" for East-West 2003"
808
809 ues = numpy.array([1.,1.,0.+1.0,0.+1.0])
810
811 phase = numpy.array([[4,4,4,4,5,5,5,5],
812 [3,3,3,3,4,4,4,4],
813 [5,5,5,5,2,2,2,2],
814 [4,4,4,4,5,5,5,5],
815 [2,2,2,2,3,3,3,3],
816 [5,5,5,5,2,2,2,2],
817 [3,3,3,3,4,4,4,4],
818 [2,2,2,2,3,3,3,3]],dtype=float)
819
820 gaintx = numpy.zeros([8,8])
821 gaintx[:,:] = 1
822
823 gainrx = numpy.zeros([8,8])
824 gainrx[:,0:4] = 1
825
826 justrx = 0
827
828 elif pattern == 63:
829
830 title=" for Differential phase 2004 High Alt."
831
832 ues = (2/3.)*numpy.array([0.,1.5-1.0,1.5,0.+1.0])
833
834 phase = numpy.array([[4,4,3,2,5,5,4,3],
835 [4,3,2,2,5,4,3,3],
836 [3,2,5,5,4,3,2,2],
837 [2,2,5,4,3,3,2,5],
838 [2,2,5,4,3,3,2,5],
839 [2,5,4,4,3,2,5,5],
840 [5,4,3,3,2,5,4,4],
841 [4,4,3,2,5,5,4,3]],dtype=float)
842
843 gaintx = numpy.zeros([8,8])
844 gaintx[:,:] = 1
845
846 gainrx = numpy.zeros([8,8])
847 gainrx[:,:] = 1
848
849 justrx = 0
850
851 elif pattern == 64:
852
853 title=" for Differential Phase Perp to B 2005-2006"
854
855 ues = (2/3.)*numpy.array([1.5,3.0+0.75,3.0,1.5-0.75])
856
857 phase = numpy.array([[4,4,3,3,2,2,5,5],
858 [4,3,3,2,2,5,5,4],
859 [3,3,2,2,5,5,4,4],
860 [3,2,2,5,5,4,4,3],
861 [3,3,2,2,5,5,4,4],
862 [3,2,2,5,5,4,4,3],
863 [2,2,5,5,4,4,3,3],
864 [2,5,5,4,4,3,3,2]],dtype=float)
865
866 gaintx = numpy.zeros([8,8])
867 gaintx[:,:] = 1
868
869 gainrx = numpy.zeros([8,8])
870 gainrx[0:4,4:8] = 1
871
872 justrx = 0
873
874 elif pattern == 65:
875 #for JULIA EW 2003 W
876 title=" for JULIA EW 2003"
877
878 ues = numpy.array([1+0.66,2+0.66,2.,1.])
879
880 phase = numpy.array([[4,3,2,5,4,3,2,5],
881 [4,3,2,5,4,3,2,5],
882 [4,3,2,5,4,3,2,5],
883 [4,3,2,5,4,3,2,5],
884 [5,4,3,2,5,4,3,2],
885 [5,4,3,2,5,4,3,2],
886 [5,4,3,2,5,4,3,2],
887 [5,4,3,2,5,4,3,2]],dtype=float)
888
889 gaintx = numpy.zeros([8,8])
890 gaintx[:,:] = 1
891
892 gainrx = numpy.zeros([8,8])
893 gainrx[4:8,:] = 1
894
895 justrx = 0
896
897 elif pattern == 66:
898 #for JULIA EW 2003 E
899 title=" for JULIA EW 2003"
900
901 ues = numpy.array([1.,1.,0.,0.])
902
903 phase = numpy.array([[4,4,4,4,5,5,5,5],
904 [3,3,3,3,4,4,4,4],
905 [5,5,5,5,2,2,2,2],
906 [4,4,4,4,5,5,5,5],
907 [2,2,2,2,3,3,3,3],
908 [5,5,5,5,2,2,2,2],
909 [3,3,3,3,4,4,4,4],
910 [2,2,2,2,3,3,3,3]],dtype=float)
911
912 gaintx = numpy.zeros([8,8])
913 gaintx[:,:] = 1
914
915 gainrx = numpy.zeros([8,8])
916 gainrx[:,0:4] = 1
917
918 justrx = 0
919
920 elif pattern == 67:
921
922 title=" for Vertical (Yellow Cables)"
923
924 ues = numpy.array([0.25, 0.25, 0.25, 0.25])
925
926 phase = numpy.array([[3.41, 3.41, 3.41, 3.41, 3.41, 3.41, 3.41, 3.41],
927 [2.78, 2.78, 2.78, 2.78, 2.78, 2.78, 2.78, 2.78],
928 [2.15, 2.15, 2.15, 2.15, 2.15, 2.15, 2.15, 2.15],
929 [5.52, 5.52, 5.52, 5.52, 5.52, 5.52, 5.52, 5.52],
930 [4.89, 4.89, 4.89, 4.89, 4.89, 4.89, 4.89, 4.89],
931 [4.26, 4.26, 4.26, 4.26, 4.26, 4.26, 4.26, 4.26],
932 [3.63, 3.63, 3.63, 3.63, 3.63, 3.63, 3.63, 3.63],
933 [3.00, 3.00, 3.00, 3.00, 3.00, 3.00, 3.00, 3.00]],dtype=float)
934
935 gaintx = numpy.zeros([8,8])
936 gaintx[:,:] = 1
937
938 gainrx = numpy.zeros([8,8])
939 gainrx[:,:] = 1
940
941 justrx = 0
942
943 elif pattern == 100:
944
945 title=" for High Altitude Drift"
946
947 ues = numpy.array([ 2.0,0.8,1.0,2.2])
948
949 phase = numpy.array([[5,5,4,4, 4,4,3,3],
950 [5,4,4,4, 4,3,3,3],
951 [4,4,4,4, 3,3,3,3],
952 [4,4,4,3, 3,3,3,2],
953 [3,3,2,2, 2,2,5,5],
954 [3,2,2,2, 2,5,5,5],
955 [2,2,2,2, 5,5,5,5],
956 [2,2,2,5, 5,5,5,4]],dtype=float)
957
958 gaintx = numpy.zeros([8,8])
959 gaintx[:,:] = 1
960
961 gainrx = numpy.zeros([8,8])
962 gainrx[:,:] = 1
963
964 justrx = 0
965
966
967 elif pattern==None:
968
969 inputs = numpy.array(["title","ues_tx","phase_tx","gain_tx","gain_rx","just_rx"])
970
971 # Reading user-defined configuration.
972 if path==None:path = os.getcwd() + os.sep + "patterns" + os.sep
973 if filename==None:filename = "jropattern.txt"
974
975 ff = open(os.path.join(path,filename),'r')
976
977 while 1:
978 # Checking EOF.
979 init = ff.tell()
980 if not ff.readline():break
981 else:ff.seek(init)
982
983 line = ff.readline().lstrip()
984 if line.__len__()!=0:
985 if line[0]!='#':
986 keys = line.split("=")
987 key = keys[0].lstrip().rstrip().lower()
988 vv = numpy.where(inputs==key)
989 if vv[0][0]==0:
990 title = keys[1].lstrip().rstrip()
991 elif vv[0][0]==1:
992 ues = (keys[1].lstrip().rstrip())
993 ues = numpy.float32(ues[1:-1].split(","))
994 elif vv[0][0]==2:
995 phase = numpy.zeros([8,8])
996 tx = (keys[1].lstrip().rstrip())
997 tx = numpy.float32(tx[2:-3].split(","))
998 phase[0,:] = tx
999 for ii in numpy.arange(7):
1000 tx = ff.readline().lstrip().rstrip()
1001 tx = numpy.float32(tx[1:-3+(ii==6)].split(","))
1002 phase[ii+1,:] = tx
1003 elif vv[0][0]==3:
1004 gaintx = numpy.zeros([8,8])
1005 gg = (keys[1].lstrip().rstrip())
1006 gg = numpy.float32(gg[2:-3].split(","))
1007 gaintx[0,:] = gg
1008 for ii in numpy.arange(7):
1009 gg = ff.readline().lstrip().rstrip()
1010 gg = numpy.float32(gg[1:-3+(ii==6)].split(","))
1011 gaintx[ii+1,:] = gg
1012 elif vv[0][0]==4:
1013 gainrx = numpy.zeros([8,8])
1014 gg = (keys[1].lstrip().rstrip())
1015 gg = numpy.float32(gg[2:-3].split(","))
1016 gainrx[0,:] = gg
1017 for ii in numpy.arange(7):
1018 gg = ff.readline().lstrip().rstrip()
1019 gg = numpy.float32(gg[1:-3+(ii==6)].split(","))
1020 gainrx[ii+1,:] = gg
1021 elif vv[0][0]==5:
1022 justrx = numpy.float(keys[1].lstrip().rstrip())
1023
1024 ff.close()
1025
1026
1027
1028 setup = {"ues":ues, "phase":phase, "gaintx":gaintx, "gainrx":gainrx, "justrx":justrx, \
1029 "title":title}
1030
1031 return setup
1032
1033
1034
1035 No newline at end of file
@@ -0,0 +1,81
1 """
2 The module MISC_ROUTINES gathers classes and functions which are useful for daily processing. As an
3 example we have conversion factor or universal constants.
4
5 MODULES CALLED:
6 NUMPY, SYS
7
8 MODIFICATION HISTORY:
9 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ, 21 October 2009.
10 """
11
12 import numpy
13 import sys
14
15 class CoFactors():
16 """
17 CoFactor class used to call pre-defined conversion factor (e.g. degree to radian). The cu-
18 The current available factor are:
19
20 d2r = degree to radian.
21 s2r = seconds to radian?, degree to arcsecond.?
22 h2r = hour to radian.
23 h2d = hour to degree
24 """
25
26 d2r = numpy.pi/180.
27 s2r = numpy.pi/(180.*3600.)
28 h2r = numpy.pi/12.
29 h2d = 15.
30
31 class Redirect:
32 def __init__(self,stdout):
33 self.stdout = stdout
34
35 def write(self,message):
36 self.stdout.insertPlainText(message)
37
38 class WidgetPrint:
39 """
40 WidgetPrint class allows to define the standard output.
41 """
42 def __init__(self,textid=None):
43 self.__stdout = sys.stdout
44 self.textid = textid
45 self.wPrint()
46
47 def wPrint(self):
48 if self.textid == None: sys.stdout = self.__stdout
49 if self.textid != None: sys.stdout = Redirect(self.textid)
50 print ("")
51
52 class Vector:
53 """
54 direction = 0 Polar to rectangular; direction=1 rectangular to polar
55 """
56 def __init__(self,vect,direction=0):
57 nsize = numpy.size(vect)
58 if nsize <= 3:
59 vect = vect.reshape(1,nsize)
60
61 self.vect = vect
62 self.dirc = direction
63
64
65
66 def Polar2Rect(self):
67 if self.dirc == 0:
68 jvect = self.vect*numpy.pi/180.
69 mmx = numpy.cos(jvect[:,1])*numpy.sin(jvect[:,0])
70 mmy = numpy.cos(jvect[:,1])*numpy.cos(jvect[:,0])
71 mmz = numpy.sin(jvect[:,1])
72 mm = numpy.array([mmx,mmy,mmz]).transpose()
73
74 elif self.dirc == 1:
75 mm = [numpy.arctan2(self.vect[:,0],self.vect[:,1]),numpy.arcsin(self.vect[:,2])]
76 mm = numpy.array(mm)*180./numpy.pi
77
78 return mm
79
80
81
@@ -0,0 +1,97
1 '''
2 Created on May 8, 2013
3
4 @author: Jose Antonio Sal y Rosas Celi
5 @contact: jose.salyrosas@jro.igp.gob.pe
6 '''
7
8 import os
9 from Files import Files
10
11 class OverJRO(Files):
12
13 __scriptName = "OverJRO.py"
14
15 def __init__(self):
16 pass
17
18 def setParameters(self, path, exp_name, phase_tx, gain_tx, gain_rx, ues_tx, just_rx):
19 self.path = path
20 self.exp_name = exp_name
21 self.phase_tx = phase_tx
22 self.gain_tx = gain_tx
23 self.gain_rx = gain_rx
24 self.ues_tx = ues_tx
25 self.just_rx = just_rx
26
27 def saveFile(self, contentFile):
28 filename = self.setFilename()
29 finalpath = os.path.join(self.path, self.setFileExtension(filename))
30 print "HAHAH"
31 finalpath = "apps/abs/static/data/"+finalpath
32 self.save(finalpath, contentFile)
33 return finalpath
34
35 def setTextContent(self):
36 title = "title ='%s'" % self.exp_name
37 ues_tx = "ues_tx = %s" % self.ues_tx
38 phase_tx = "phase_tx = %s" % (self.convertValue(self.phase_tx))
39 gain_tx = "gain_tx = %s" % (self.convertValue(self.gain_tx))
40 gain_rx = "gain_rx = %s" % (self.convertValue(self.gain_rx))
41 just_rx = "just_rx = %d" % self.just_rx
42 content = " %s\r\n\n %s\r\n\n %s\r\n %s\r\n %s\r\n %s\r\n" % (title, ues_tx, phase_tx, gain_tx, gain_rx, just_rx)
43 return content
44
45 def setFileExtension(self, filename):
46 txtFile = filename + ".txt"
47
48 return txtFile
49
50 def convertValue(self, strAntenna):
51 value = ""
52 strAntenna = strAntenna.replace("],[","]+[")
53 lsAntenna = strAntenna.split("+")
54 for i,element in enumerate(lsAntenna):
55 if i == 0:
56 value += "%s,$\n" % element
57 elif i == 7:
58 value += " %s\n" % element
59 else:
60 value += " %s,$\n" % element
61
62 return value
63
64
65 if __name__ == '__main__':
66 path = "/home/fquino/workspace/radarsys/webapp/apps/abs/static/data"
67 exp_name = "MST-ISR 2009 (NS-Up)"
68 phase_tx = "[[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
69 "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \
70 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
71 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
72 "[1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5]," \
73 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \
74 "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \
75 "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]]"
76 gain_tx = "[[1,1,1,1,1,1,1,1]," \
77 "[1,1,1,1,1,1,1,1]," \
78 "[1,1,1,1,1,1,1,1]," \
79 "[1,1,1,1,1,1,1,1]," \
80 "[1,1,1,1,1,1,1,1]," \
81 "[1,1,1,1,1,1,1,1]," \
82 "[1,1,1,1,1,1,1,1]," \
83 "[1,1,1,1,1,1,1,1]]"
84 gain_rx = "[[1,1,1,1,0,0,0,0]," \
85 "[1,1,1,1,0,0,0,0]," \
86 "[1,1,1,1,0,0,0,0]," \
87 "[1,1,1,1,0,0,0,0]," \
88 "[0,0,0,0,1,1,1,1]," \
89 "[0,0,0,0,1,1,1,1]," \
90 "[0,0,0,0,1,1,1,1]," \
91 "[0,0,0,0,1,1,1,1]]"
92 ues_tx = "[0.533333,0.00000,1.06667,0.00000]"
93 just_rx = 0
94 data = OverJRO()
95 data.setParameters(path, exp_name, phase_tx, gain_tx, gain_rx, ues_tx, just_rx)
96 contentFile = data.setTextContent()
97 data.saveFile(contentFile)
@@ -0,0 +1,427
1 """
2 The TIME_CONVERSIONS.py module gathers classes and functions for time system transformations
3 (e.g. between seconds from 1970 to datetime format).
4
5 MODULES CALLED:
6 NUMPY, TIME, DATETIME, CALENDAR
7
8 MODIFICATION HISTORY:
9 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ Aug 13, 2009.
10 """
11
12 import numpy
13 import time
14 #import datetime as dt
15 import calendar
16
17 class Time:
18 """
19 time(year,month,dom,hour,min,secs)
20
21 An object represents a date and time of certain event..
22
23 Parameters
24 ----------
25 YEAR = Number of the desired year. Year must be valid values from the civil calendar.
26 Years B.C.E must be represented as negative integers. Years in the common era are repre-
27 sented as positive integers. In particular, note that there is no year 0 in the civil
28 calendar. 1 B.C.E. (-1) is followed by 1 C.E. (1).
29
30 MONTH = Number of desired month (1=Jan, ..., 12=December).
31
32 DOM = Number of day of the month.
33
34 HOUR = Number of the hour of the day. By default hour=0
35
36 MINS = Number of the minute of the hour. By default min=0
37
38 SECS = Number of the second of the minute. By default secs=0.
39
40 Examples
41 --------
42 time_info = time(2008,9,30,12,30,00)
43
44 time_info = time(2008,9,30)
45 """
46
47 def __init__(self,year=None,month=None,dom=None,hour=0,mins=0,secs=0):
48 # If one the first three inputs are not defined, it takes the current date.
49 date = time.localtime()
50 if year==None:year=date[0]
51 if month==None:month=date[1]
52 if dom==None:dom=date[2]
53
54 # Converting to arrays
55 year = numpy.array([year]); month = numpy.array([month]); dom = numpy.array([dom])
56 hour = numpy.array([hour]); mins = numpy.array([mins]); secs = numpy.array([secs])
57
58 # Defining time information object.
59 self.year = numpy.atleast_1d(year)
60 self.month = numpy.atleast_1d(month)
61 self.dom = numpy.atleast_1d(dom)
62 self.hour = numpy.atleast_1d(hour)
63 self.mins = numpy.atleast_1d(mins)
64 self.secs = numpy.atleast_1d(secs)
65
66 def change2julday(self):
67 """
68 Converts a datetime to Julian days.
69 """
70
71 # Defining constants
72 greg = 2299171 # incorrect Julian day for Oct, 25, 1582.
73 min_calendar = -4716
74 max_calendar = 5000000
75
76 min_year = numpy.nanmin(self.year)
77 max_year = numpy.nanmax(self.year)
78 if (min_year<min_calendar) or (max_year>max_calendar):
79 print ("Value of Julian date is out of allowed range")
80 return -1
81
82 noyear = numpy.sum(self.year==0)
83 if noyear>0:
84 print ("There is no year zero in the civil calendar")
85 return -1
86
87 # Knowing if the year is less than 0.
88 bc = self.year<0
89
90 # Knowing if the month is less than March.
91 inJanFeb = self.month<=2
92
93 jy = self.year + bc - inJanFeb
94 jm = self.month + (1 + 12*inJanFeb)
95
96 # Computing Julian days.
97 jul= numpy.floor(365.25*jy) + numpy.floor(30.6001*jm) + (self.dom+1720995.0)
98
99 # Test whether to change to Gregorian Calendar
100 if numpy.min(jul) >= greg:
101 ja = numpy.int32(0.01*jy)
102 jul = jul + 2 - ja + numpy.int32(0.25*ja)
103 else:
104 gregchange = numpy.where(jul >= greg)
105 if gregchange[0].size>0:
106 ja = numpy.int32(0.01 + jy[gregchange])
107 jy[gregchange] = jy[gregchange] + 2 - ja + numpy.int32(0.25*ja)
108
109 # Determining machine-specific parameters affecting floating-point.
110 eps = 0.0 # Replace this line for a function to get precision.
111 eps = abs(jul)*0.0 > eps
112
113 jul = jul + (self.hour/24. -0.5) + (self.mins/1440.) + (self.secs/86400.) + eps
114
115 return jul[0]
116
117 def change2secs(self):
118 """
119 Converts datetime to number of seconds respect to 1970.
120 """
121
122 year = self.year
123 if year.size>1: year = year[0]
124
125 month = self.month
126 if month.size>1: month = month[0]
127
128 dom = self.dom
129 if dom.size>1: dom = dom[0]
130
131 # Resizing hour, mins and secs if it was necessary.
132 hour = self.hour
133 if hour.size>1:hour = hour[0]
134 if hour.size==1:hour = numpy.resize(hour,year.size)
135
136 mins = self.mins
137 if mins.size>1:mins = mins[0]
138 if mins.size==1:mins = numpy.resize(mins,year.size)
139
140 secs = self.secs
141 if secs.size>1:secs = secs[0]
142 if secs.size==1:secs = numpy.resize(secs,year.size)
143
144 # Using time.mktime to compute seconds respect to 1970.
145 secs1970 = numpy.zeros(year.size)
146 for ii in numpy.arange(year.size):
147 secs1970[ii] = time.mktime((int(year[ii]),int(month[ii]),int(dom[ii]),\
148 int(hour[ii]),int(mins[ii]),int(secs[ii]),0,0,0))
149
150 secs1970 = numpy.int32(secs1970 - time.timezone)
151
152 return secs1970
153
154 def change2strdate(self,mode=1):
155 """
156 change2strdate method converts a date and time of certain event to date string. The
157 string format is like localtime (e.g. Fri Oct 9 15:00:19 2009).
158
159 Parameters
160 ----------
161 None.
162
163 Return
164 ------
165
166 Modification History
167 --------------------
168 Created by Freddy R. Galindo, ROJ, 09 October 2009.
169
170 """
171
172 secs = numpy.atleast_1d(self.change2secs())
173 strdate = []
174 for ii in numpy.arange(numpy.size(secs)):
175 secs_tmp = time.localtime(secs[ii] + time.timezone)
176 if mode==1:
177 strdate.append(time.strftime("%d-%b-%Y (%j) %H:%M:%S",secs_tmp))
178 elif mode==2:
179 strdate.append(time.strftime("%d-%b-%Y (%j)",secs_tmp))
180
181 strdate = numpy.array(strdate)
182
183 return strdate
184
185
186 class Secs:
187 """
188 secs(secs):
189
190 An object represents the number of seconds respect to 1970.
191
192 Parameters
193 ----------
194
195 SECS = A scalar or array giving the number of seconds respect to 1970.
196
197 Example:
198 --------
199 secs_info = secs(1251241373)
200
201 secs_info = secs([1251241373,1251241383,1251241393])
202 """
203 def __init__(self,secs):
204 self.secs = secs
205
206 def change2julday(self):
207 """
208 Convert seconds from 1970 to Julian days.
209 """
210
211 secs_1970 = time(1970,1,1,0,0,0).change2julday()
212
213 julian = self.secs/86400.0 + secs_1970
214
215 return julian
216
217 def change2time(self):
218 """
219 Converts seconds from 1970 to datetime.
220 """
221
222 secs1970 = numpy.atleast_1d(self.secs)
223
224 datetime = numpy.zeros((9,secs1970.size))
225 for ii in numpy.arange(secs1970.size):
226 tuple = time.gmtime(secs1970[ii])
227 datetime[0,ii] = tuple[0]
228 datetime[1,ii] = tuple[1]
229 datetime[2,ii] = tuple[2]
230 datetime[3,ii] = tuple[3]
231 datetime[4,ii] = tuple[4]
232 datetime[5,ii] = tuple[5]
233 datetime[6,ii] = tuple[6]
234 datetime[7,ii] = tuple[7]
235 datetime[8,ii] = tuple[8]
236
237 datetime = numpy.int32(datetime)
238
239 return datetime
240
241
242 class Julian:
243 """
244 julian(julian):
245
246 An object represents julian days.
247
248 Parameters
249 ----------
250
251 JULIAN = A scalar or array giving the julina days.
252
253 Example:
254 --------
255 julian_info = julian(2454740)
256
257 julian_info = julian([2454740,2454760,2454780])
258 """
259 def __init__(self,julian):
260 self.julian = numpy.atleast_1d(julian)
261
262 def change2time(self):
263 """
264 change2time method converts from julian day to calendar date and time.
265
266 Return
267 ------
268 year = An array giving the year of the desired julian day.
269 month = An array giving the month of the desired julian day.
270 dom = An array giving the day of the desired julian day.
271 hour = An array giving the hour of the desired julian day.
272 mins = An array giving the minute of the desired julian day.
273 secs = An array giving the second of the desired julian day.
274
275 Examples
276 --------
277 >> jd = 2455119.0
278 >> [yy,mo,dd,hh,mi,ss] = TimeTools.julian(jd).change2time()
279 >> print ([yy,mo,dd,hh,mi,ss])
280 [2009] [10] [ 14.] [ 12.] [ 0.] [ 0.]
281
282 Modification history
283 --------------------
284 Translated from "Numerical Recipies in C", by William H. Press, Brian P. Flannery,
285 Saul A. Teukolsky, and William T. Vetterling. Cambridge University Press, 1988.
286 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
287 """
288
289 min_julian = -1095
290 max_julian = 1827933925
291 if (numpy.min(self.julian) < min_julian) or (numpy.max(self.julian) > max_julian):
292 print ('Value of Julian date is out of allowed range.')
293 return None
294
295 # Beginning of Gregorian calendar
296 igreg = 2299161
297 julLong = numpy.floor(self.julian + 0.5)
298 minJul = numpy.min(julLong)
299
300 if (minJul >= igreg):
301 # All are Gregorian
302 jalpha = numpy.int32(((julLong - 1867216) - 0.25)/36524.25)
303 ja = julLong + 1 + jalpha - numpy.int32(0.25*jalpha)
304 else:
305 ja = julLong
306 gregChange = numpy.where(julLong >= igreg)
307 if gregChange[0].size>0:
308 jalpha = numpy.int32(((julLong[gregChange]-1867216) - 0.25)/36524.25)
309 ja[gregChange] = julLong[gregChange]+1+jalpha-numpy.int32(0.25*jalpha)
310
311 # clear memory.
312 jalpha = -1
313
314 jb = ja + 1524
315 jc = numpy.int32(6680. + ((jb-2439870)-122.1)/365.25)
316 jd = numpy.int32(365.*jc + (0.25*jc))
317 je = numpy.int32((jb - jd)/30.6001)
318
319 dom = jb - jd - numpy.int32(30.6001*je)
320 month = je - 1
321 month = ((month - 1) % 12) + 1
322 month = numpy.atleast_1d(month)
323 year = jc - 4715
324 year = year - (month > 2)*1
325 year = year - (year <= 0)*1
326 year = numpy.atleast_1d(year)
327
328 # Getting hours, minutes, seconds
329 fraction = self.julian + 0.5 - julLong
330 eps_0 = dom*0.0 + 1.0e-12
331 eps_1 = 1.0e-12*numpy.abs(julLong)
332 eps = (eps_0>eps_1)*eps_0 + (eps_0<=eps_1)*eps_1
333
334 hour_0 = dom*0 + 23
335 hour_2 = dom*0 + 0
336 hour_1 = numpy.floor(fraction*24.0 + eps)
337 hour = ((hour_1>hour_0)*23) + ((hour_1<=hour_0)*hour_1)
338 hour = ((hour_1<hour_2)*0) + ((hour_1>=hour_2)*hour_1)
339
340 fraction = fraction - (hour/24.0)
341 mins_0 = dom*0 + 59
342 mins_2 = dom*0 + 0
343 mins_1 = numpy.floor(fraction*1440.0 + eps)
344 mins = ((mins_1>mins_0)*59) + ((mins_1<=mins_0)*mins_1)
345 mins = ((mins_1<mins_2)*0) + ((mins_1>=mins_2)*mins_1)
346
347 secs_2 = dom*0 + 0
348 secs_1 = (fraction - mins/1440.0)*86400.0
349 secs = ((secs_1<secs_2)*0) + ((secs_1>=secs_2)*secs_1)
350
351 return year,month,dom,hour,mins,secs
352
353 def change2secs(self):
354 """
355 Converts from Julian days to seconds from 1970.
356 """
357
358 jul_1970 = Time(1970,1,1,0,0,0).change2julday()
359
360 secs = numpy.int32((self.julian - jul_1970)*86400)
361
362 return secs
363
364 def change2lst(self,longitude=-76.8667):
365 """
366 CT2LST converts from local civil time to local mean sideral time
367
368 longitude = The longitude in degrees (east of Greenwich) of the place for which
369 the local sideral time is desired, scalar. The Greenwich mean sideral time (GMST)
370 can be found by setting longitude=0.
371 """
372
373 # Useful constants, see Meus, p. 84
374 c = numpy.array([280.46061837, 360.98564736629, 0.000387933, 38710000.0])
375 jd2000 = 2451545.0
376 t0 = self.julian - jd2000
377 t = t0/36525.
378
379 # Computing GST in seconds
380 theta = c[0] + (c[1]*t0) + (t**2)*(c[2]-t/c[3])
381
382 # Computing LST in hours
383 lst = (theta + longitude)/15.0
384 neg = numpy.where(lst < 0.0)
385 if neg[0].size>0:lst[neg] = 24.0 + (lst[neg] % 24)
386 lst = lst % 24.0
387
388 return lst
389
390
391 class date2doy:
392 def __init__(self,year,month,day):
393 self.year = year
394 self.month = month
395 self.day = day
396
397 def change2doy(self):
398 if calendar.isleap(self.year) == True:
399 tfactor = 1
400 else:
401 tfactor = 2
402
403 day = self.day
404 month = self.month
405
406 doy = numpy.floor((275*month)/9.0) - (tfactor*numpy.floor((month+9)/12.0)) + day - 30
407
408 return numpy.int32(doy)
409
410
411 class Doy2Date:
412 def __init__(self,year,doy):
413 self.year = year
414 self.doy = doy
415
416 def change2date(self):
417 months = numpy.arange(12) + 1
418
419 first_dem = date2doy(self.year,months,1)
420 first_dem = first_dem.change2doy()
421
422 imm = numpy.where((self.doy - first_dem) > 0)
423
424 month = imm[0].size
425 dom = self.doy -first_dem[month - 1] + 1
426
427 return month, dom
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
1 NO CONTENT: new file 100755, binary diff hidden
NO CONTENT: new file 100755, binary diff hidden
@@ -0,0 +1,1
1 Edwin Christian Yllanes Cucho
1 NO CONTENT: new file 100755, binary diff hidden
NO CONTENT: new file 100755, binary diff hidden
@@ -0,0 +1,34
1 from numpy import *
2 from scipy import optimize
3
4 def gaussian(height, center_x, center_y, width_x, width_y):
5 """Returns a gaussian function with the given parameters"""
6 width_x = float(width_x)
7 width_y = float(width_y)
8 return lambda x,y: height*exp(
9 -(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2)
10
11 def moments(data):
12 """Returns (height, x, y, width_x, width_y)
13 the gaussian parameters of a 2D distribution by calculating its
14 moments """
15 total = data.sum()
16 X, Y = indices(data.shape)
17 x = (X*data).sum()/total
18 y = (Y*data).sum()/total
19 col = data[:, int(y)]
20 width_x = sqrt(abs((arange(col.size)-y)**2*col).sum()/col.sum())
21 row = data[int(x), :]
22 width_y = sqrt(abs((arange(row.size)-x)**2*row).sum()/row.sum())
23 height = data.max()
24 return height, x, y, width_x, width_y
25
26 def fitgaussian(data):
27 """Returns (height, x, y, width_x, width_y)
28 the gaussian parameters of a 2D distribution found by a fit"""
29 params = moments(data)
30 errorfunction = lambda p: ravel(gaussian(*p)(*indices(data.shape)) -
31 data)
32 p, success = optimize.leastsq(errorfunction, params)
33 return p
34
@@ -0,0 +1,10
1 #!/usr/bin/env python
2 import os
3 import sys
4
5 if __name__ == "__main__":
6 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "radarsys.settings")
7
8 from django.core.management import execute_from_command_line
9
10 execute_from_command_line(sys.argv)
This diff has been collapsed as it changes many lines, (1632 lines changed) Show them Hide them
@@ -0,0 +1,1632
1 #!/usr/bin/python
2
3
4 import sys, os, os.path
5 import traceback
6 import cgi, Cookie
7 import time, datetime
8 import types
9 import numpy
10 import numpy.fft
11 import scipy.linalg
12 import scipy.special
13 #import Numeric
14
15 import Misc_Routines
16 import TimeTools
17 import JroAntSetup
18 import Graphics_OverJro
19 import Astro_Coords
20
21 class JroPattern():
22 def __init__(self,pattern=0,path=None,filename=None,nptsx=101,nptsy=101,maxphi=5,fftopt=0, \
23 getcut=0,dcosx=None,dcosy=None,eomwl=6,airwl=4):
24 """
25 JroPattern class creates an object to represent the useful parameters for beam mode-
26 lling of the Jicamarca VHF radar.
27
28 Parameters
29 ----------
30 pattern = An integer (See JroAntSetup to know the available values) to load a prede-
31 fined configuration. The default value is 0. To use a user-defined configuration
32 pattern must be None.
33 path = A string giving the directory that contains the user-configuration file. PATH
34 will work if pattern is None.
35 filename = A string giving the name of the user-configuration file. FILENAME will
36 work if pattern is None.
37 nptsx = A scalar to specify the number of points used to define the angular resolu-
38 tion in the "x" axis. The default value is 101.
39 nptsy = A scalar to specify the number of points used to define the angular resolu-
40 tion in the "x" axis. The default value is 101.
41 maxphi = A scalar giving the maximum (absolute) angle (in degree) to model the ante-
42 nna pattern. The default value is 5 degrees.
43 fftopt = Set this input to 1 to model the beam using FFT. To model using antenna
44 theory set to 0 (default value).
45 getcut = Set to 1 to show an antenna cut instead of a contour plot of itself (set to
46 0). The defautl value is 0.
47 dcosx = An array giving the directional cosines for the x-axis. DCOSX will work if
48 getcut is actived.
49 dcosy = An array giving the directional cosines for the y-axis. DCOSY will work if
50 getcut is actived.
51 eomwl = A scalar giving the radar wavelength. The default value is 6m (50 MHZ).
52 airwl = Set this input to float (or intger) to specify the wavelength (in meters) of
53 the transmitted EOM wave in the air. The default value is 4m.
54
55 Modification History
56 --------------------
57 Converted to Object-oriented Programming by Freddy Galindo, ROJ, 20 September 2009.
58 """
59
60
61
62 # Getting antenna configuration.
63 setup = JroAntSetup.ReturnSetup(path=path,filename=filename,pattern=pattern)
64
65 ues = setup["ues"]
66 phase = setup["phase"]
67 gaintx = setup["gaintx"]
68 gainrx = setup["gainrx"]
69 justrx = setup["justrx"]
70
71 # Defining attributes for JroPattern class.
72 # Antenna configuration
73 self.uestx = ues
74 self.phasetx = phase
75 self.gaintx = gaintx
76 self.uesrx = ues
77 self.phaserx = phase
78 self.gainrx = gainrx
79 self.justrx = justrx
80
81 # Pattern resolution & method to model
82 self.maxphi = maxphi
83 self.nptsx = nptsx
84 self.nptsy = nptsy
85 self.fftopt = fftopt
86
87 # To get a cut of the pattern.
88 self.getcut = getcut
89
90 maxdcos = numpy.sin(maxphi*Misc_Routines.CoFactors.d2r)
91 if dcosx==None:dcosx = ((numpy.arange(nptsx,dtype=float)/(nptsx-1))-0.5)*2*maxdcos
92 if dcosy==None:dcosy = ((numpy.arange(nptsy,dtype=float)/(nptsy-1))-0.5)*2*maxdcos
93 self.dcosx = dcosx
94 self.dcosy = dcosy
95 self.nx = dcosx.size
96 self.ny = dcosy.size*(getcut==0) + (getcut==1)
97
98 self.eomwl = eomwl
99 self.airwl = airwl
100
101 self.kk = 2.*numpy.pi/eomwl
102
103 self.pattern = None
104 self.meanpos = None
105 self.norpattern = None
106 self.maxpattern = None
107
108 self.title = setup["title"]
109
110 self.getPattern()
111
112 def getPattern(self):
113 """
114 getpattern method returns the modelled total antenna pattern and its mean position.
115
116 Return
117 ------
118 pattern = An array giving the Modelled antenna pattern.
119 mean_pos = A 2-elements array giving the mean position of the main beam.
120
121 Examples
122 --------
123 >> [pattern, mean_pos] = JroPattern(pattern=2).getPattern()
124 >> print meanpos
125 [ 8.08728085e-14 -4.78193873e-14]
126
127 Modification history
128 --------------------
129 Developed by Jorge L. Chau.
130 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
131 """
132
133 if (self.fftopt>0) and (self.getcut>0):
134 #print "Conflict bewteen fftopt and getcut"
135 #print "To get a cut of the antenna pattern uses ffopt=0"
136 return None, None
137
138 if (self.fftopt==0):
139 # Getting antenna pattern using the array method
140 self.pattern = self.__usingArray(rx=1)
141 if (self.justrx==0):self.pattern = self.pattern*self.__usingArray(rx=0)
142
143 elif (self.fftopt>0):
144 # Getting antenna pattern using FFT method
145 self.pattern = self.__usingFFT(rx=1)
146 if (self.justrx==0):self.pattern = self.pattern*self.__usingFFT(rx=0)
147
148 self.maxpattern = numpy.nanmax(self.pattern)
149 self.norpattern = self.pattern/self.maxpattern
150 if self.getcut==0:self.__getBeamPars()
151
152 def __usingArray(self,rx):
153 """
154 __usingArray method returns the Jicamarca antenna pattern computed using array model
155
156 pattern = dipolepattern x modulepattern
157
158 Parameters
159 ----------
160 rx = Set to 1 to use the Rx information. Otherwise set to 0 for Tx.
161
162 Return
163 ------
164 pattern = An array giving the modelled antenna pattern using the array model.
165
166 Modification history
167 --------------------
168 Developed by Jorge L. Chau.
169 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
170 """
171
172 if rx==1:
173 ues = self.uesrx
174 phase = self.phaserx
175 gain = self.gainrx
176 elif rx==0:
177 ues = self.uestx
178 phase = self.phasetx
179 gain = self.gaintx
180
181 ues = ues*360./self.airwl
182 phase = phase*360./self.airwl
183
184 for ii in range(4):
185 if ii==0:dim = numpy.array([4,0,8,4]) # WEST
186 elif ii==1:dim = numpy.array([0,0,4,4]) # NORTH
187 elif ii==2:dim = numpy.array([0,4,4,8]) # EAST
188 elif ii==3:dim = numpy.array([4,4,8,8]) # SOUTH
189 xi = dim[0]; xf = dim[2]; yi = dim[1]; yf = dim[3]
190 phase[xi:xf,yi:yf] = phase[xi:xf,yi:yf] + ues[ii]
191
192 phase = -phase
193
194 ar = self.eomwl*numpy.array([[0.5,6., 24.5],[0.5,6.,24.5]])
195 nr = numpy.array([[12.,4.,2.],[12.,4.,2.]])
196 lr = 0.25*self.eomwl*numpy.array([[0,0.,0],[0.,0,0]])
197
198 # Computing module and dipole patterns.
199 pattern = (numpy.abs(self.__dipPattern(ar,nr,lr)*self.__modPattern(phase,gain)))**2
200
201 return pattern
202
203 def __usingFFT(self,rx):
204 """
205 __usingFFT method returns the Jicamarca antenna pattern computed using The Fast Fou-
206 rier Transform.
207
208 pattern = iFFT(FFT(gain*EXP(j*phase)))
209
210 Parameters
211 ----------
212 rx = Set to 1 to use the Rx information. Otherwise set to 0 for Tx.
213
214 Return
215 ------
216 pattern = An array giving the modelled antenna pattern using the array model.
217
218 Modification history
219 --------------------
220 Developed by Jorge L. Chau.
221 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
222 """
223
224 if rx==1:
225 ues = self.uesrx
226 phase = self.phaserx
227 gain = self.gainrx
228 elif rx==0:
229 ues = self.uestx
230 phase = self.phasetx
231 gain = self.gaintx
232
233 ues = ues*360./self.airwl
234 phase = phase*360./self.airwl
235
236 for ii in range(4):
237 if ii==0:dim = numpy.array([4,0,8,4]) # WEST
238 elif ii==1:dim = numpy.array([0,0,4,4]) # NORTH
239 elif ii==2:dim = numpy.array([0,4,4,8]) # EAST
240 elif ii==3:dim = numpy.array([4,4,8,8]) # SOUTH
241 xi = dim[0]; xf = dim[2]; yi = dim[1]; yf = dim[3]
242 phase[xi:xf,yi:yf] = phase[xi:xf,yi:yf] + ues[ii]
243
244 phase = -phase
245
246 delta_x = self.eomwl/2.
247 delta_y = self.eomwl/2.
248
249 nxfft = 2048
250 nyfft = 2048
251 dcosx = (numpy.arange(nxfft) - (0.5*nxfft))/(nxfft*delta_x)*self.eomwl
252 dcosy = (numpy.arange(nyfft) - (0.5*nyfft))/(nyfft*delta_y)*self.eomwl
253
254 fft_gain = numpy.zeros((nxfft,nyfft))
255 fft_phase = numpy.zeros((nxfft,nyfft))
256
257 nx = 8
258 ny = 8
259 ndx =12
260 ndy =12
261 for iy in numpy.arange(ny):
262 for ix in numpy.arange(nx):
263 ix1 = nxfft/2-self.nx/2*ndx+ix*ndx
264 if ix<(nx/2):ix1 = ix1 - 1
265 if ix>=(nx/2):ix1 = ix1 + 1
266
267 iy1 = nyfft/2-ny/2*ndx+iy*ndy
268 if iy<(ny/2):iy1 = iy1 - 1
269 if iy>=(ny/2):iy1 = iy1 + 1
270
271 fft_gain[ix1:ix1+ndx-1,iy1:iy1+ndy-1] = gain[ix,ny-1-iy]
272 fft_phase[ix1:ix1+ndx-1,iy1:iy1+ndy-1] = phase[ix,ny-1-iy]
273
274
275 fft_phase = fft_phase*Misc_Routines.CoFactors.d2r
276
277 pattern = numpy.abs(numpy.fft.fft2(fft_gain*numpy.exp(numpy.complex(0,1)*fft_phase)))**2
278 pattern = numpy.fft.fftshift(pattern)
279
280 xvals = numpy.where((dcosx>=(numpy.min(self.dcosx))) & (dcosx<=(numpy.max(self.dcosx))))
281 yvals = numpy.where((dcosy>=(numpy.min(self.dcosy))) & (dcosy<=(numpy.max(self.dcosy))))
282
283 pattern = pattern[xvals[0][0]:xvals[0][-1],yvals[0][0]:yvals[0][-1]]
284
285 return pattern
286
287 def __readAttenuation(self):
288 """
289 _readAttenuation reads the attenuations' file and returns an array giving these va-
290 lues (dB). The ext file must be in the directory "resource".
291
292 Return
293 ------
294 attenuation = An array giving attenuation values read from the text file.
295
296 Modification history
297 --------------------
298 Developed by Jorge L. Chau.
299 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
300 """
301
302 attenuation = None
303 # foldr = sys.path[-1] + os.sep + "resource" + os.sep
304 base_path = os.path.dirname(os.path.abspath(__file__))
305 #foldr = './resource'
306 #filen = "attenuation.txt"
307 attenuationFile = os.path.join(base_path,"resource","attenuation.txt")
308 #ff = open(os.path.join(foldr,filen),'r')
309 ff = open(attenuationFile,'r')
310 exec(ff.read())
311 ff.close()
312
313 return attenuation
314
315 def __dipPattern(self,ar,nr,lr):
316 """
317 _dipPattern function computes the dipole's pattern to the Jicamarca radar. The next
318 equation defines the pattern as a function of the mainlobe direction:
319
320 sincx = SIN(k/2*n0x*(a0x*SIN(phi)*COS(alpha)))/SIN(k/2*(a0x*SIN(phi)*COS(alpha)))
321 sincy = SIN(k/2*n0y*(a0y*SIN(phi)*SIN(alpha)))/SIN(k/2*(a0y*SIN(phi)*SIN(alpha)))
322 A0(phi,alpha) = sincx*sincy
323 Parameters
324 ----------
325 ar = ?
326 nr = ?
327 lr = ?
328
329 Return
330 ------
331 dipole = An array giving antenna pattern from the dipole point of view..
332
333 Modification history
334 --------------------
335 Developed by Jorge L. Chau.
336 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
337 """
338
339 dipole = numpy.zeros((self.nx,self.ny),dtype=complex)
340 for iy in range(self.ny):
341 for ix in range(self.nx):
342 yindex = iy*(self.getcut==0) + ix*(self.getcut==1)
343
344 argx = ar[0,0]*self.dcosx[ix] - lr[0,0]
345 junkx = numpy.sin(0.5*self.kk*nr[0,0]*argx)/numpy.sin(0.5*self.kk*argx)
346 if argx == 0.0: junkx = nr[0,0]
347
348 argy = ar[1,0]*self.dcosy[yindex] - lr[1,0]
349 junky = numpy.sin(0.5*self.kk*nr[1,0]*argy)/numpy.sin(0.5*self.kk*argy)
350 if argy == 0.0: junky = nr[1,0]
351
352 dipole[ix,iy] = junkx*junky
353
354 return dipole
355
356 def __modPattern(self,phase,gain):
357 """
358 ModPattern computes the module's pattern to the Jicamarca radar. The next equation
359 defines the pattern as a function mainlobe direction:
360
361 phasex = pos(x)*SIN(phi)*COS(alpha)
362 phasey = pos(y)*SIN(phi)*SIN(alpha)
363
364 A1(phi,alpha) = TOTAL(gain*EXP(COMPLEX(0,k*(phasex+phasey)+phase)))
365
366 Parameters
367 ----------
368 phase = Bidimensional array (8x8) giving the phase (in meters) of each module.
369 gain = Bidimensional array (8x8) giving to define modules will be active (ones)
370 and which will not (zeros).
371
372 Return
373 ------
374 module = An array giving antenna pattern from the module point of view..
375
376 Modification history
377 --------------------
378 Developed by Jorge L. Chau.
379 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
380 """
381
382 pos = self.eomwl*self.__readAttenuation()
383 posx = pos[0,:,:]
384 posy = pos[1,:,:]
385
386 phase = phase*Misc_Routines.CoFactors.d2r
387 module = numpy.zeros((self.nx,self.ny),dtype=complex)
388 for iy in range(self.ny):
389 for ix in range(self.nx):
390 yindex = iy*(self.getcut==0) + ix*(self.getcut==1)
391 phasex = posx*self.dcosx[ix]
392 phasey = posy*self.dcosy[yindex]
393 tmp = gain*numpy.exp(numpy.complex(0,1.)*(self.kk*(phasex+phasey)+phase))
394 module[ix,iy] = tmp.sum()
395
396 return module
397
398 def __getBeamPars(self):
399 """
400 _getBeamPars computes the main-beam parameters of the antenna.
401
402 Modification history
403 --------------------
404 Developed by Jorge L. Chau.
405 Converted to Python by Freddy R. Galindo, ROJ, 20 September 2009.
406 """
407
408 dx = self.dcosx[1] - self.dcosx[0]
409 dy = self.dcosy[1] - self.dcosy[0]
410
411 amp = self.norpattern
412
413 xx = numpy.resize(self.dcosx,(self.nx,self.nx)).transpose()
414 yy = numpy.resize(self.dcosy,(self.ny,self.ny))
415
416 mm0 = amp[numpy.where(amp > 0.5)]
417 xx0 = xx[numpy.where(amp > 0.5)]
418 yy0 = yy[numpy.where(amp > 0.5)]
419
420 xc = numpy.sum(mm0*xx0)/numpy.sum(mm0)
421 yc = numpy.sum(mm0*yy0)/numpy.sum(mm0)
422 rc = numpy.sqrt(mm0.size*dx*dy/numpy.pi)
423
424 nnx = numpy.where(numpy.abs(self.dcosx - xc) < rc)
425 nny = numpy.where(numpy.abs(self.dcosy - yc) < rc)
426
427 mm1 = amp[numpy.min(nnx):numpy.max(nnx)+1,numpy.min(nny):numpy.max(nny)+1]
428 xx1 = self.dcosx[numpy.min(nnx):numpy.max(nnx)+1]
429 yy1 = self.dcosy[numpy.min(nny):numpy.max(nny)+1]
430
431 # fitting data into the main beam.
432 import gaussfit
433 params = gaussfit.fitgaussian(mm1)
434
435 # Tranforming from indexes to axis' values
436 xcenter = xx1[0] + (((xx1[xx1.size-1] - xx1[0])/(xx1.size -1))*(params[1]))
437 ycenter = yy1[0] + (((yy1[yy1.size-1] - yy1[0])/(yy1.size -1))*(params[2]))
438 xwidth = ((xx1[xx1.size-1] - xx1[0])/(xx1.size-1))*(params[3])*(1/Misc_Routines.CoFactors.d2r)
439 ywidth = ((yy1[yy1.size-1] - yy1[0])/(yy1.size-1))*(params[4])*(1/Misc_Routines.CoFactors.d2r)
440 meanwx = (xwidth*ywidth)
441 meanpos = numpy.array([xcenter,ycenter])
442
443 #print 'Position: %f %f' %(xcenter,ycenter)
444 #print 'Widths: %f %f' %(xwidth, ywidth)
445 #print 'BWHP: %f' %(2*numpy.sqrt(2*meanwx)*numpy.sqrt(-numpy.log(0.5)))
446
447 self.meanpos = meanpos
448
449
450 class BField():
451 def __init__(self,year=None,doy=None,site=1,heights=None,alpha_i=90):
452 """
453 BField class creates an object to get the Magnetic field for a specific date and
454 height(s).
455
456 Parameters
457 ----------
458 year = A scalar giving the desired year. If the value is None (default value) then
459 the current year will be used.
460 doy = A scalar giving the desired day of the year. If the value is None (default va-
461 lue) then the current doy will be used.
462 site = An integer to choose the geographic coordinates of the place where the magne-
463 tic field will be computed. The default value is over Jicamarca (site=1)
464 heights = An array giving the heights (km) where the magnetic field will be modeled By default the magnetic field will be computed at 100, 500 and 1000km.
465 alpha_i = Angle to interpolate the magnetic field.
466
467 Modification History
468 --------------------
469 Converted to Object-oriented Programming by Freddy Galindo, ROJ, 07 October 2009.
470 """
471
472 tmp = time.localtime()
473 if year==None: year = tmp[0]
474 if doy==None: doy = tmp[7]
475 self.year = year
476 self.doy = doy
477 self.site = site
478 if heights==None:heights = numpy.array([100,500,1000])
479 self.heights = heights
480 self.alpha_i = alpha_i
481
482 def getBField(self,maglimits=numpy.array([-7,-7,7,7])):
483 """
484 getBField models the magnetic field for a different heights in a specific date.
485
486 Parameters
487 ----------
488 maglimits = An 4-elements array giving ..... The default value is [-7,-7,7,7].
489
490 Return
491 ------
492 dcos = An 4-dimensional array giving the directional cosines of the magnetic field
493 over the desired place.
494 alpha = An 3-dimensional array giving the angle of the magnetic field over the desi-
495 red place.
496
497 Modification History
498 --------------------
499 Converted to Python by Freddy R. Galindo, ROJ, 07 October 2009.
500 """
501
502 x_ant = numpy.array([1,0,0])
503 y_ant = numpy.array([0,1,0])
504 z_ant = numpy.array([0,0,1])
505
506 if self.site==0:
507 title_site = "Magnetic equator"
508 coord_site = numpy.array([-76+52./60.,-11+57/60.,0.5])
509 elif self.site==1:
510 title_site = 'Jicamarca'
511 coord_site = [-76-52./60.,-11-57/60.,0.5]
512 theta = (45+5.35)*numpy.pi/180. # (50.35 and 1.46 from Fleish Thesis)
513 delta = -1.46*numpy.pi/180
514
515 x_ant1 = numpy.roll(self.rotvector(self.rotvector(x_ant,1,delta),3,theta),1)
516 y_ant1 = numpy.roll(self.rotvector(self.rotvector(y_ant,1,delta),3,theta),1)
517 z_ant1 = numpy.roll(self.rotvector(self.rotvector(z_ant,1,delta),3,theta),1)
518
519 ang0 = -1*coord_site[0]*numpy.pi/180.
520 ang1 = coord_site[1]*numpy.pi/180.
521 x_ant = self.rotvector(self.rotvector(x_ant1,2,ang1),3,ang0)
522 y_ant = self.rotvector(self.rotvector(y_ant1,2,ang1),3,ang0)
523 z_ant = self.rotvector(self.rotvector(z_ant1,2,ang1),3,ang0)
524 else:
525 # print "No defined Site. Skip..."
526 return None
527
528 nhei = self.heights.size
529 pt_intercep = numpy.zeros((nhei,2))
530 nfields = 1
531
532 grid_res = 0.5
533 nlon = numpy.int(maglimits[2] - maglimits[0])/grid_res + 1
534 nlat = numpy.int(maglimits[3] - maglimits[1])/grid_res + 1
535
536 location = numpy.zeros((nlon,nlat,2))
537 mlon = numpy.atleast_2d(numpy.arange(nlon)*grid_res + maglimits[0])
538 mrep = numpy.atleast_2d(numpy.zeros(nlat) + 1)
539 location0 = numpy.dot(mlon.transpose(),mrep)
540
541 mlat = numpy.atleast_2d(numpy.arange(nlat)*grid_res + maglimits[1])
542 mrep = numpy.atleast_2d(numpy.zeros(nlon) + 1)
543 location1 = numpy.dot(mrep.transpose(),mlat)
544
545 location[:,:,0] = location0
546 location[:,:,1] = location1
547
548 alpha = numpy.zeros((nlon,nlat,nhei))
549 rr = numpy.zeros((nlon,nlat,nhei,3))
550 dcos = numpy.zeros((nlon,nlat,nhei,2))
551
552 global first_time
553
554 first_time = None
555 for ilon in numpy.arange(nlon):
556 for ilat in numpy.arange(nlat):
557 outs = self.__bdotk(self.heights,
558 self.year + self.doy/366.,
559 coord_site[1],
560 coord_site[0],
561 coord_site[2],
562 coord_site[1]+location[ilon,ilat,1],
563 location[ilon,ilat,0]*720./180.)
564
565 alpha[ilon, ilat,:] = outs[1]
566 rr[ilon, ilat,:,:] = outs[3]
567
568 mrep = numpy.atleast_2d((numpy.zeros(nhei)+1)).transpose()
569 tmp = outs[3]*numpy.dot(mrep,numpy.atleast_2d(x_ant))
570 tmp = tmp.sum(axis=1)
571 dcos[ilon,ilat,:,0] = tmp/numpy.sqrt((outs[3]**2).sum(axis=1))
572
573 mrep = numpy.atleast_2d((numpy.zeros(nhei)+1)).transpose()
574 tmp = outs[3]*numpy.dot(mrep,numpy.atleast_2d(y_ant))
575 tmp = tmp.sum(axis=1)
576 dcos[ilon,ilat,:,1] = tmp/numpy.sqrt((outs[3]**2).sum(axis=1))
577
578 return dcos, alpha, nlon, nlat
579
580
581 def __bdotk(self,heights,tm,gdlat=-11.95,gdlon=-76.8667,gdalt=0.0,decd=-12.88, ham=-4.61666667):
582
583 global first_time
584 # Mean Earth radius in Km WGS 84
585 a_igrf = 6371.2
586
587 bk = numpy.zeros(heights.size)
588 alpha = numpy.zeros(heights.size)
589 bfm = numpy.zeros(heights.size)
590 rr = numpy.zeros((heights.size,3))
591 rgc = numpy.zeros((heights.size,3))
592
593 ObjGeodetic = Astro_Coords.Geodetic(gdlat,gdalt)
594 [gclat,gcalt] = ObjGeodetic.change2geocentric()
595
596 gclat = gclat*numpy.pi/180.
597 gclon = gdlon*numpy.pi/180.
598
599 # Antenna position from center of Earth
600 ca_vector = [numpy.cos(gclat)*numpy.cos(gclon),numpy.cos(gclat)*numpy.sin(gclon),numpy.sin(gclat)]
601 ca_vector = gcalt*numpy.array(ca_vector)
602
603 dec = decd*numpy.pi/180.
604
605 # K vector respect to the center of earth.
606 klon = gclon + ham*numpy.pi/720.
607 k_vector = [numpy.cos(dec)*numpy.cos(klon),numpy.cos(dec)*numpy.sin(klon),numpy.sin(dec)]
608 k_vector = numpy.array(k_vector)
609
610 for ih in numpy.arange(heights.size):
611 # Vector from Earth's center to volume of interest
612 rr[ih,:] = k_vector*heights[ih]
613 cv_vector = numpy.squeeze(ca_vector) + rr[ih,:]
614
615 cv_gcalt = numpy.sqrt(numpy.sum(cv_vector**2.))
616 cvxy = numpy.sqrt(numpy.sum(cv_vector[0:2]**2.))
617
618 radial = cv_vector/cv_gcalt
619 east = numpy.array([-1*cv_vector[1],cv_vector[0],0])/cvxy
620 comp1 = east[1]*radial[2] - radial[1]*east[2]
621 comp2 = east[2]*radial[0] - radial[2]*east[0]
622 comp3 = east[0]*radial[1] - radial[0]*east[1]
623 north = -1*numpy.array([comp1, comp2, comp3])
624
625 rr_k = cv_vector - numpy.squeeze(ca_vector)
626 u_rr = rr_k/numpy.sqrt(numpy.sum(rr_k**2.))
627
628 cv_gclat = numpy.arctan2(cv_vector[2],cvxy)
629 cv_gclon = numpy.arctan2(cv_vector[1],cv_vector[0])
630
631 bhei = cv_gcalt-a_igrf
632 blat = cv_gclat*180./numpy.pi
633 blon = cv_gclon*180./numpy.pi
634 bfield = self.__igrfkudeki(bhei,tm,blat,blon)
635
636 B = (bfield[0]*north + bfield[1]*east - bfield[2]*radial)*1.0e-5
637
638 bfm[ih] = numpy.sqrt(numpy.sum(B**2.)) #module
639 bk[ih] = numpy.sum(u_rr*B)
640 alpha[ih] = numpy.arccos(bk[ih]/bfm[ih])*180/numpy.pi
641 rgc[ih,:] = numpy.array([cv_gclon, cv_gclat, cv_gcalt])
642
643 return bk, alpha, bfm, rr, rgc
644
645
646 def __igrfkudeki(self,heights,time,latitude,longitude,ae=6371.2):
647 """
648 __igrfkudeki calculates the International Geomagnetic Reference Field for given in-
649 put conditions based on IGRF2005 coefficients.
650
651 Parameters
652 ----------
653 heights = Scalar or vector giving the height above the Earth of the point in ques-
654 tion in kilometers.
655 time = Scalar or vector giving the decimal year of time in question (e.g. 1991.2).
656 latitude = Latitude of point in question in decimal degrees. Scalar or vector.
657 longitude = Longitude of point in question in decimal degrees. Scalar or vector.
658 ae =
659 first_time =
660
661 Return
662 ------
663 bn =
664 be =
665 bd =
666 bmod =
667 balpha =
668 first_time =
669
670 Modification History
671 --------------------
672 Converted to Python by Freddy R. Galindo, ROJ, 03 October 2009.
673 """
674
675 global first_time
676 global gs, hs, nvec, mvec, maxcoef
677
678 heights = numpy.atleast_1d(heights)
679 time = numpy.atleast_1d(time)
680 latitude = numpy.atleast_1d(latitude)
681 longitude = numpy.atleast_1d(longitude)
682
683 if numpy.max(latitude)==90:
684 # print "Field calculations are not supported at geographic poles"
685 pass
686
687 # output arrays
688 bn = numpy.zeros(heights.size)
689 be = numpy.zeros(heights.size)
690 bd = numpy.zeros(heights.size)
691
692 if first_time==None:first_time=0
693
694 time0 = time[0]
695 if time!=first_time:
696 #print "Getting coefficients for", time0
697 [periods,g,h ] = self.__readIGRFcoeff()
698 top_year = numpy.max(periods)
699 nperiod = (top_year - 1900)/5 + 1
700
701 maxcoef = 10
702 if time0>=2000:maxcoef = 12
703
704
705 # Normalization array for Schmidt fucntions
706 multer = numpy.zeros((2+maxcoef,1+maxcoef)) + 1
707 for cn in (numpy.arange(maxcoef)+1):
708 for rm in (numpy.arange(cn)+1):
709 tmp = numpy.arange(2*rm) + cn - rm + 1.
710 multer[rm+1,cn] = ((-1.)**rm)*numpy.sqrt(2./tmp.prod())
711
712 schmidt = multer[1:,1:].transpose()
713
714 # n and m arrays
715 nvec = numpy.atleast_2d(numpy.arange(maxcoef)+2)
716 mvec = numpy.atleast_2d(numpy.arange(maxcoef+1)).transpose()
717
718 # Time adjusted igrf g and h with Schmidt normalization
719 # IGRF coefficient arrays: g0(n,m), n=1, maxcoeff,m=0, maxcoeff, ...
720 if time0<top_year:
721 dtime = (time0 - 1900) % 5
722 ntime = (time0 - 1900 - dtime)/5
723 else:
724 # Estimating coefficients for times > top_year
725 dtime = (time0 - top_year) + 5
726 ntime = g[:,0,0].size - 2
727
728 g0 = g[ntime,1:maxcoef+1,:maxcoef+1]
729 h0 = h[ntime,1:maxcoef+1,:maxcoef+1]
730 gdot = g[ntime+1,1:maxcoef+1,:maxcoef+1]-g[ntime,1:maxcoef+1,:maxcoef+1]
731 hdot = h[ntime+1,1:maxcoef+1,:maxcoef+1]-h[ntime,1:maxcoef+1,:maxcoef+1]
732 gs = (g0 + dtime*(gdot/5.))*schmidt[:maxcoef,0:maxcoef+1]
733 hs = (h0 + dtime*(hdot/5.))*schmidt[:maxcoef,0:maxcoef+1]
734
735 first_time = time0
736
737 for ii in numpy.arange(heights.size):
738 # Height dependence array rad = (ae/(ae+height))**(n+3)
739 rad = numpy.atleast_2d((ae/(ae + heights[ii]))**(nvec+1))
740
741 # Sin and Cos of m times longitude phi arrays
742 mphi = mvec*longitude[ii]*numpy.pi/180.
743 cosmphi = numpy.atleast_2d(numpy.cos(mphi))
744 sinmphi = numpy.atleast_2d(numpy.sin(mphi))
745
746 # Cos of colatitude theta
747 c = numpy.cos((90 - latitude[ii])*numpy.pi/180.)
748
749 # Legendre functions p(n,m|c)
750 [p,dp]= scipy.special.lpmn(maxcoef+1,maxcoef+1,c)
751 p = p[:,:-1].transpose()
752 s = numpy.sqrt((1. - c)*(1 + c))
753
754 # Generate derivative array dpdtheta = -s*dpdc
755 dpdtheta = c*p/s
756 for m in numpy.arange(maxcoef+2): dpdtheta[:,m] = m*dpdtheta[:,m]
757 dpdtheta = dpdtheta + numpy.roll(p,-1,axis=1)
758
759 # Extracting arrays required for field calculations
760 p = p[1:maxcoef+1,:maxcoef+1]
761 dpdtheta = dpdtheta[1:maxcoef+1,:maxcoef+1]
762
763 # Weigh p and dpdtheta with gs and hs coefficients.
764 gp = gs*p
765 hp = hs*p
766 gdpdtheta = gs*dpdtheta
767 hdpdtheta = hs*dpdtheta
768 # Calcultate field components
769 matrix0 = numpy.dot(gdpdtheta,cosmphi)
770 matrix1 = numpy.dot(hdpdtheta,sinmphi)
771 bn[ii] = numpy.dot(rad,(matrix0 + matrix1))
772 matrix0 = numpy.dot(hp,(mvec*cosmphi))
773 matrix1 = numpy.dot(gp,(mvec*sinmphi))
774 be[ii] = numpy.dot((-1*rad),((matrix0 - matrix1)/s))
775 matrix0 = numpy.dot(gp,cosmphi)
776 matrix1 = numpy.dot(hp,sinmphi)
777 bd[ii] = numpy.dot((-1*nvec*rad),(matrix0 + matrix1))
778
779 bmod = numpy.sqrt(bn**2. + be**2. + bd**2.)
780 btheta = numpy.arctan(bd/numpy.sqrt(be**2. + bn**2.))*180/numpy.pi
781 balpha = numpy.arctan(be/bn)*180./numpy.pi
782
783 #bn : north
784 #be : east
785 #bn : radial
786 #bmod : module
787
788
789 return bn, be, bd, bmod, btheta, balpha
790
791 def str2num(self, datum):
792 try:
793 return int(datum)
794 except:
795 try:
796 return float(datum)
797 except:
798 return datum
799
800 def __readIGRFfile(self, filename):
801 list_years=[]
802 for i in range(1,24):
803 list_years.append(1895.0 + i*5)
804
805 epochs=list_years
806 epochs.append(epochs[-1]+5)
807 nepochs = numpy.shape(epochs)
808
809 gg = numpy.zeros((13,14,nepochs[0]),dtype=float)
810 hh = numpy.zeros((13,14,nepochs[0]),dtype=float)
811
812 coeffs_file=open(filename)
813 lines=coeffs_file.readlines()
814
815 coeffs_file.close()
816
817 for line in lines:
818 items = line.split()
819 g_h = items[0]
820 n = self.str2num(items[1])
821 m = self.str2num(items[2])
822
823 coeffs = items[3:]
824
825 for i in range(len(coeffs)-1):
826 coeffs[i] = self.str2num(coeffs[i])
827
828 #coeffs = numpy.array(coeffs)
829 ncoeffs = numpy.shape(coeffs)[0]
830
831 if g_h == 'g':
832 # print n," g ",m
833 gg[n-1,m,:]=coeffs
834 elif g_h=='h':
835 # print n," h ",m
836 hh[n-1,m,:]=coeffs
837 # else :
838 # continue
839
840 # Ultimo Reordenamiento para almacenar .
841 gg[:,:,nepochs[0]-1] = gg[:,:,nepochs[0]-2] + 5*gg[:,:,nepochs[0]-1]
842 hh[:,:,nepochs[0]-1] = hh[:,:,nepochs[0]-2] + 5*hh[:,:,nepochs[0]-1]
843
844 # return numpy.array([gg,hh])
845 periods = numpy.array(epochs)
846 g = gg
847 h = hh
848 return periods, g, h
849
850
851 def __readIGRFcoeff(self,filename="igrf10coeffs.dat"):
852 """
853 __readIGRFcoeff reads the coefficients from a binary file which is located in the
854 folder "resource."
855
856 Parameter
857 ---------
858 filename = A string to specify the name of the file which contains thec coeffs. The
859 default value is "igrf10coeffs.dat"
860
861 Return
862 ------
863 periods = A lineal array giving...
864 g1 =
865 h1 =
866
867 Modification History
868 --------------------
869 Converted to Python by Freddy R. Galindo, ROJ, 03 October 2009.
870 """
871
872 # # igrfile = sys.path[-1] + os.sep + "resource" + os.sep + filename
873 # igrfile = os.path.join('./resource',filename)
874 # f = open(igrfile,'rb')
875 # #f = open(os.getcwd() + os.sep + "resource" + os.sep + filename,'rb')
876 #
877 # # Reading SkyNoise Power (lineal scale)
878 # periods = numpy.fromfile(f,numpy.dtype([('var','<f4')]),23)
879 # periods = periods['var']
880 #
881 # g = numpy.fromfile(f,numpy.dtype([('var','<f8')]),23*14*14)
882 # g = g['var'].reshape((14,14,23)).transpose()
883 #
884 # h = numpy.fromfile(f,numpy.dtype([('var','<f8')]),23*14*14)
885 # h = h['var'].reshape((14,14,23)).transpose()
886 #
887 # f.close()
888 base_path = os.path.dirname(os.path.abspath(__file__))
889 filename = os.path.join(base_path,"resource","igrf11coeffs.txt")
890
891 period_v, g_v, h_v = self.__readIGRFfile(filename)
892 g2 = numpy.zeros((14,14,24))
893 h2 = numpy.zeros((14,14,24))
894 g2[1:14,:,:] = g_v
895 h2[1:14,:,:] = h_v
896
897 g = numpy.transpose(g2, (2,0,1))
898 h = numpy.transpose(h2, (2,0,1))
899 periods = period_v.copy()
900
901 return periods, g, h
902
903 def rotvector(self,vector,axis=1,ang=0):
904 """
905 rotvector function returns the new vector generated rotating the rectagular coords.
906
907 Parameters
908 ----------
909 vector = A lineal 3-elements array (x,y,z).
910 axis = A integer to specify the axis used to rotate the coord systems. The default
911 value is 1.
912 axis = 1 -> Around "x"
913 axis = 2 -> Around "y"
914 axis = 3 -> Around "z"
915 ang = Angle of rotation (in radians). The default value is zero.
916
917 Return
918 ------
919 rotvector = A lineal array of 3 elements giving the new coordinates.
920
921 Modification History
922 --------------------
923 Converted to Python by Freddy R. Galindo, ROJ, 01 October 2009.
924 """
925
926 if axis==1:
927 t = [[1,0,0],[0,numpy.cos(ang),numpy.sin(ang)],[0,-numpy.sin(ang),numpy.cos(ang)]]
928 elif axis==2:
929 t = [[numpy.cos(ang),0,-numpy.sin(ang)],[0,1,0],[numpy.sin(ang),0,numpy.cos(ang)]]
930 elif axis==3:
931 t = [[numpy.cos(ang),numpy.sin(ang),0],[-numpy.sin(ang),numpy.cos(ang),0],[0,0,1]]
932
933 rotvector = numpy.array(numpy.dot(numpy.array(t),numpy.array(vector)))
934
935 return rotvector
936
937
938 class overJroShow:
939
940 # __serverdocspath = '/usr/local/www/htdocs'
941 # __tmpDir = 'overJro/tempReports'
942 # __serverdocspath = '/Users/dsuarez/Pictures'
943 # __tmpDir = 'overjro'
944 __serverdocspath = None
945 __tmpDir = None
946
947 def __init__(self):
948 self.year = None
949 self.month = None
950 self.dom = None
951 self.pattern = None
952 self.maxphi = None
953 self.heights = None
954 self.filename = None
955 self.showType = None
956 self.path = None
957 self.objects = None
958 self.nptsx = 101
959 self.nptsy = 101
960 self.fftopt = 0
961 self.site = 1
962 self.dcosx = 1
963 self.dcosy = 1
964 self.dcosxrange = None
965 self.dcosyrange = None
966 self.maxha_min= 0.
967 self.show_object = None
968 self.dcosx_mag = None
969 self.dcosy_mag = None
970 self.ha_mag = None
971 self.time_mag = None
972 self.main_dec = None
973 self.ObjC = None
974 self.ptitle = ''
975 self.path4plotname = None
976 self.plotname0 = None
977 self.plotname1 = None
978 self.plotname2 = None
979 self.scriptHeaders = 0
980 # self.outputHead('Show Plot')
981 # self.printBody()
982
983 def setScriptState(self):
984 self.madForm = cgi.FieldStorage()
985
986 if self.madForm.has_key('serverdocspath'):
987 self.__serverdocspath = self.madForm.getvalue('serverdocspath')#'/usr/local/www/htdocs'
988
989 if self.madForm.has_key('tmpdir'):
990 self.__tmpDir = self.madForm.getvalue('tmpdir')#'overJro/tempReports'
991
992 if self.madForm.has_key('showType'):
993 self.showType = int(self.madForm.getvalue('showType'))
994
995 if self.showType == 0 or self.showType == 1:
996
997 # if self.madForm.has_key('year') and \
998 # self.madForm.has_key('month') and \
999 # self.madForm.has_key('dom') and \
1000 # self.madForm.has_key('pattern') and \
1001 # self.madForm.has_key('maxphi') and \
1002 # self.madForm.has_key('objects') and \
1003 # self.madForm.has_key('heights'):
1004
1005 if self.madForm.has_key('year') and \
1006 self.madForm.has_key('month') and \
1007 self.madForm.has_key('dom') and \
1008 self.madForm.has_key('maxphi') and \
1009 self.madForm.has_key('objects') and \
1010 self.madForm.has_key('heights'):
1011
1012 self.year = int(self.madForm.getvalue('year'))
1013 self.month = int(self.madForm.getvalue('month'))
1014 self.dom = int(self.madForm.getvalue('dom'))
1015 self.maxphi = float(self.madForm.getvalue('maxphi'))
1016
1017 if self.madForm.has_key('pattern'):
1018
1019 tmp_pattern = self.madForm.getvalue('pattern') #pattern es predifinido en listado o definido por el usuario
1020 self.pattern=[]
1021 if tmp_pattern[0] == '[':
1022 tmp_pattern=tmp_pattern[1:]
1023
1024 if tmp_pattern[-1] == ']':
1025 tmp_pattern=tmp_pattern[0:len(tmp_pattern)-1]
1026
1027 for s in tmp_pattern.split(','):
1028 self.pattern.append(float(s))
1029 elif self.madForm.has_key('filename'):
1030 if self.madForm.has_key('filename'):
1031 self.filename = self.madForm.getvalue('filename') # nombre de archivo: patron de radiacion definido por el usuario
1032
1033 if self.madForm.has_key('path'):
1034 self.path = self.madForm.getvalue('path') #path donde se encuentra el archivo: patron de radiacion del usuario
1035
1036 else:
1037 print "Content-Type: text/html\n"
1038 print '<h3> This cgi plot script was called without the proper arguments.</h3>'
1039 print '<p> This is a script used to plot Antenna Cuts over Jicamarca Antenna</p>'
1040 print '<p> Required arguments:</p>'
1041 print '<p> pattern - chekbox indicating objects over jicamarca antenna</p>'
1042 print '<p> or'
1043 print '<p> filename - The pattern defined by users is a file text'
1044 print '<p> path - folder with pattern files'
1045 sys.exit(0)
1046
1047
1048 tmp_heights = self.madForm.getvalue('heights')
1049 self.heights=[]
1050 if tmp_heights[0] == '[':
1051 tmp_heights=tmp_heights[1:]
1052
1053 if tmp_heights[-1] == ']':
1054 tmp_heights=tmp_heights[0:len(tmp_heights)-1]
1055
1056 for s in tmp_heights.split(','):
1057 self.heights.append(float(s))
1058 self.heights = numpy.array(self.heights)
1059
1060 tmp_objects = self.madForm.getvalue('objects') #lista con los objetos a graficar en el patron de radiacion
1061 self.objects=[]
1062 if tmp_objects[0] == '[':
1063 tmp_objects=tmp_objects[1:]
1064
1065 if tmp_objects[-1] == ']':
1066 tmp_objects=tmp_objects[0:len(tmp_objects)-1]
1067
1068 for s in tmp_objects.split(','):
1069 self.objects.append(int(s))
1070
1071 if self.showType == 1:
1072 if numpy.sum(self.objects) == 0:
1073 if self.scriptHeaders == 0:
1074 print "Content-Type: text/html\n"
1075 print '<h3> This cgi plot script was called without the proper arguments.</h3>'
1076 print '<p> This is a script used to plot Antenna Cuts over Jicamarca Antenna</p>'
1077 print '<p> Required arguments:</p>'
1078 print '<p> objects - chekbox indicating objects over jicamarca antenna</p>'
1079 print '<p> Please, options in "Select Object" must be checked'
1080 sys.exit(0)
1081
1082 #considerar para futura implementacion
1083 if self.madForm.has_key('filename'):
1084 self.filename = self.madForm.getvalue('filename') # nombre de archivo: patron de radiacion definido por el usuario
1085
1086 if self.madForm.has_key('path'):
1087 self.path = self.madForm.getvalue('path') #path donde se encuentra el archivo: patron de radiacion del usuario
1088
1089
1090 else:
1091 if self.scriptHeaders == 0:
1092 print "Content-Type: text/html\n"
1093
1094 print '<h3> This cgi plot script was called without the proper arguments.</h3>'
1095 print '<p> This is a script used to plot Pattern Field and Celestial Objects over Jicamarca Antenna</p>'
1096 print '<p> Required arguments:</p>'
1097 print '<p> year - year of event</p>'
1098 print '<p> month - month of event</p>'
1099 print '<p> dom - day of month</p>'
1100 print '<p> pattern - pattern is defined by "Select an Experiment" list box</p>'
1101 print '<p> maxphi - maxphi is defined by "Max Angle" text box</p>'
1102 print '<p> objects - objects is a list defined by checkbox in "Select Object"</p>'
1103 print '<p> heights - heights is defined by "Heights" text box, for default heights=[100,500,1000]</p>'
1104 print '<p> showType - showType is a hidden element for show plot of Pattern&Object or Antenna Cuts or Sky Noise</p>'
1105
1106 sys.exit(0)
1107
1108 if self.showType == 2:
1109 if self.madForm.has_key('year') and \
1110 self.madForm.has_key('month') and \
1111 self.madForm.has_key('dom'):
1112
1113 self.year = int(self.madForm.getvalue('year'))
1114 self.month = int(self.madForm.getvalue('month'))
1115 self.dom = int(self.madForm.getvalue('dom'))
1116
1117 else:
1118 if self.scriptHeaders == 0:
1119 print "Content-Type: text/html\n"
1120 print '<h3> This cgi plot script was called without the proper arguments.</h3>'
1121 print '<p> This is a script used to plot Sky Noise over Jicamarca Antenna</p>'
1122 print '<p> Required arguments:</p>'
1123 print '<p> year - year of event</p>'
1124 print '<p> month - month of event</p>'
1125 print '<p> dom - day of month</p>'
1126
1127 sys.exit(0)
1128
1129
1130 def initParameters1(self):
1131
1132 gui=1
1133 if self.pattern==None:
1134 if gui==1: self.filename = self.filename.split(',')
1135
1136 pattern = numpy.atleast_1d(self.pattern)
1137 filename = numpy.atleast_1d(self.filename)
1138
1139 npatterns = numpy.max(numpy.array([pattern.size,filename.size]))
1140
1141 self.pattern = numpy.resize(pattern,npatterns)
1142 self.filename = numpy.resize(filename,npatterns)
1143
1144 self.doy = datetime.datetime(self.year,self.month,self.dom).timetuple().tm_yday
1145
1146
1147 if self.objects==None:
1148 self.objects=numpy.zeros(5)
1149 else:
1150 tmp = numpy.atleast_1d(self.objects)
1151 self.objects = numpy.zeros(5)
1152 self.objects[0:tmp.size] = tmp
1153
1154 self.show_object = self.objects
1155
1156 self.maxha_min = 4*self.maxphi*numpy.sqrt(2)*1.25
1157
1158
1159 if self.heights==None:
1160 self.heights = numpy.array([100.,500.,1000.])
1161
1162
1163
1164 #ROJ geographic coordinates and time zone
1165 self.glat = -11.95
1166 self.glon = -76.8667
1167 self.UT = 5 #timezone
1168
1169 self.glat = -11.951481
1170 self.glon = -76.874383
1171
1172
1173 self.junkjd = TimeTools.Time(self.year,self.month,self.dom).change2julday()
1174 self.junklst = TimeTools.Julian(self.junkjd).change2lst(longitude=self.glon)
1175
1176 # Finding RA of observatory for a specific date
1177 self.ra_obs = self.junklst*Misc_Routines.CoFactors.h2d
1178
1179 def initParameters(self):
1180
1181 # Defining plot filenames
1182 self.path4plotname = os.path.join(self.__serverdocspath,self.__tmpDir)
1183 print "PATH4"
1184 print os.path.join(self.__serverdocspath,self.__tmpDir)
1185 self.plotname0 = 'over_jro_0_%i.png'% (time.time()) #plot pattern & objects
1186 self.plotname1 = 'over_jro_1_%i.png'% (time.time()) #plot antenna cuts
1187 self.plotname2 = 'over_jro_2_%i.png'% (time.time()) #plot sky noise
1188
1189 # Defining antenna axes respect to geographic coordinates (See Ochs report).
1190 # alfa = 1.46*Misc_Routines.CoFactors.d2r
1191 # theta = 51.01*Misc_Routines.CoFactors.d2r
1192
1193 alfa = 1.488312*Misc_Routines.CoFactors.d2r
1194 th = 6.166710 + 45.0
1195 theta = th*Misc_Routines.CoFactors.d2r
1196
1197 sina = numpy.sin(alfa)
1198 cosa = numpy.cos(alfa)
1199 MT1 = numpy.array([[1,0,0],[0,cosa,-sina],[0,sina,cosa]])
1200 sinb = numpy.sin(theta)
1201 cosb = numpy.cos(theta)
1202 MT2 = numpy.array([[cosb,sinb,0],[-sinb,cosb,0],[0,0,1]])
1203 self.MT3 = numpy.array(numpy.dot(MT2, MT1)).transpose()
1204
1205 self.xg = numpy.dot(self.MT3.transpose(),numpy.array([1,0,0]))
1206 self.yg = numpy.dot(self.MT3.transpose(),numpy.array([0,1,0]))
1207 self.zg = numpy.dot(self.MT3.transpose(),numpy.array([0,0,1]))
1208
1209 def plotPattern(self):
1210 # Plotting Antenna patterns.
1211 npatterns = numpy.size(self.pattern)
1212
1213 if npatterns==1:
1214 if self.pattern[0] == None: npatterns = self.filename.__len__()
1215
1216 date = TimeTools.Time(self.year,self.month,self.dom).change2strdate(mode=2)
1217
1218 mesg = 'Over Jicamarca: ' + date[0]
1219
1220 title = ''
1221
1222 for ii in numpy.arange(npatterns):
1223 ObjAnt = JroPattern(pattern=self.pattern[ii],
1224 filename=self.filename[ii],
1225 path=self.path,
1226 nptsx=self.nptsx,
1227 nptsy=self.nptsy,
1228 maxphi=self.maxphi,
1229 fftopt=self.fftopt)
1230
1231 title += ObjAnt.title
1232 # Plotting Contour Map
1233 print "Antes de la creacion"
1234 self.path4plotname = '/home/fquino/workspace/radarsys/webapp/apps/abs/static/images'
1235 print self.path4plotname
1236 print self.plotname0
1237 dum = Graphics_OverJro.AntPatternPlot()
1238 dum.contPattern(iplot=ii,
1239 gpath=self.path4plotname,
1240 filename=self.plotname0,
1241 mesg=mesg,
1242 amp=ObjAnt.norpattern,
1243 x=ObjAnt.dcosx,
1244 y=ObjAnt.dcosy,
1245 getCut=ObjAnt.getcut,
1246 title=title)
1247 # title=ObjAnt.title)
1248 # self.ptitle = ObjAnt.title
1249 if ii==0:
1250 self.figure = dum.figure
1251
1252 if ii != (npatterns-1):
1253 title += '+'
1254
1255
1256 vect_ant = numpy.array([ObjAnt.meanpos[0],ObjAnt.meanpos[1],numpy.sqrt(1-numpy.sum(ObjAnt.meanpos**2.))])
1257
1258 vect_geo = numpy.dot(scipy.linalg.inv(self.MT3),vect_ant)
1259
1260 vect_polar = Misc_Routines.Vector(numpy.array(vect_geo),direction=1).Polar2Rect()
1261
1262 [ra,dec,ha] = Astro_Coords.AltAz(vect_polar[1],vect_polar[0],self.junkjd).change2equatorial()
1263
1264 print'Main beam position (HA(min), DEC(degrees)): %f %f'%(ha*4.,dec)
1265
1266 self.main_dec = dec
1267
1268 self.ptitle = title
1269
1270 Graphics_OverJro.AntPatternPlot().plotRaDec(gpath=self.path4plotname,filename=self.plotname0,jd=self.junkjd, ra_obs=self.ra_obs, xg=self.xg, yg=self.yg, x=ObjAnt.dcosx, y=ObjAnt.dcosy)
1271
1272 self.dcosx = ObjAnt.dcosx
1273
1274 self.dcosy = ObjAnt.dcosy
1275
1276 self.dcosxrange = [numpy.min(self.dcosx),numpy.max(self.dcosx)]
1277
1278 self.dcosyrange = [numpy.min(self.dcosy),numpy.max(self.dcosy)]
1279
1280 def plotBfield(self):
1281
1282 if self.show_object[0]>0:
1283 # Getting B field
1284 ObjB = BField(self.year,self.doy,self.site,self.heights)
1285
1286
1287 [dcos, alpha, nlon, nlat] = ObjB.getBField()
1288
1289 # Plotting B field.
1290 # print "Drawing magnetic field over Observatory"
1291
1292 Obj = Graphics_OverJro.BFieldPlot()
1293
1294 Obj.plotBField(self.path4plotname,self.plotname0,dcos,alpha,nlon,nlat,self.dcosxrange,self.dcosyrange,ObjB.heights,ObjB.alpha_i)
1295
1296 if self.show_object[0]>1:
1297
1298 Bhei = 0
1299
1300 dcosx = Obj.alpha_location[:,0,Bhei]
1301
1302 dcosy = Obj.alpha_location[:,1,Bhei]
1303
1304 vect_ant = [dcosx,dcosy,numpy.sqrt(1.-(dcosx**2. + dcosy**2.))]
1305
1306 vect_ant = numpy.array(vect_ant)
1307
1308 vect_geo = numpy.dot(scipy.linalg.inv(self.MT3),vect_ant)
1309
1310 vect_geo = numpy.array(vect_geo).transpose()
1311
1312 vect_polar = Misc_Routines.Vector(vect_geo,direction=1).Polar2Rect()
1313
1314 [ra,dec,ha] = Astro_Coords.AltAz(vect_polar[1,:],vect_polar[0,:],self.junkjd).change2equatorial()
1315
1316 val = numpy.where(ha>=180)
1317
1318 if val[0].size>0:ha[val] = ha[val] -360.
1319
1320 val = numpy.where(numpy.abs(ha)<=self.maxphi)
1321
1322 if val[0].size>2:
1323
1324 self.dcosx_mag = dcosx[val]
1325
1326 self.dcosy_mag = dcosy[val]
1327
1328 self.ha_mag = ha[val]
1329
1330 self.time_mag = 0
1331
1332 def plotCelestial(self):
1333
1334 ntod = 24.*16.
1335
1336 tod = numpy.arange(ntod)/ntod*24.
1337
1338 [month,dom] = TimeTools.Doy2Date(self.year,self.doy).change2date()
1339
1340 jd = TimeTools.Time(self.year,month,dom,tod+self.UT).change2julday()
1341
1342 if numpy.sum(self.show_object[1:]>0)!=0:
1343
1344 self.ObjC = Graphics_OverJro.CelestialObjectsPlot(jd,self.main_dec,tod,self.maxha_min,self.show_object)
1345
1346 self.ObjC.drawObject(self.glat,
1347 self.glon,
1348 self.xg,
1349 self.yg,
1350 self.dcosxrange,
1351 self.dcosyrange,
1352 self.path4plotname,
1353 self.plotname0)
1354
1355 def plotAntennaCuts(self):
1356 # print "Drawing antenna cuts"
1357
1358 incha = 0.05 # min
1359 nha = numpy.int32(2*self.maxha_min/incha) + 1.
1360 newha = numpy.arange(nha)/nha*2.*self.maxha_min - self.maxha_min
1361 nha_star = numpy.int32(200./incha)
1362 star_ha = (numpy.arange(nha_star) - (nha_star/2))*nha_star
1363
1364 #Init ObjCut for PatternCutPlot()
1365 view_objects = numpy.where(self.show_object>0)
1366 subplots = len(view_objects[0])
1367 ObjCut = Graphics_OverJro.PatternCutPlot(subplots)
1368
1369 for io in (numpy.arange(5)):
1370 if self.show_object[io]==2:
1371 if io==0:
1372 if self.dcosx_mag.size!=0:
1373 dcosx = self.dcosx_mag
1374 dcosy = self.dcosy_mag
1375 dcosz = 1 - numpy.sqrt(dcosx**2. + dcosy**2.)
1376
1377 # Finding rotation of B respec to antenna coords.
1378 [mm,bb] = scipy.polyfit(dcosx,dcosy,1)
1379 alfa = 0.0
1380 theta = -1.*numpy.arctan(mm)
1381 sina = numpy.sin(alfa); cosa = numpy.cos(alfa)
1382 MT1 = [[1,0,0],[0,cosa,-sina],[0,sina,cosa]]
1383 MT1 = numpy.array(MT1)
1384 sinb = numpy.sin(theta); cosb = numpy.cos(theta)
1385 MT2 = [[cosb,sinb,0],[-sinb,cosb,0],[0,0,1]]
1386 MT2 = numpy.array(MT2)
1387 MT3_mag = numpy.dot(MT2, MT1)
1388 MT3_mag = numpy.array(MT3_mag).transpose()
1389 # Getting dcos respec to B coords
1390 vector = numpy.array([dcosx,dcosy,dcosz])
1391 nvector = numpy.dot(MT3_mag,vector)
1392 nvector = numpy.array(nvector).transpose()
1393
1394 ## print 'Rotation (deg) %f'%(theta/Misc_Routines.CoFactors.d2r)
1395
1396 yoffset = numpy.sum(nvector[:,1])/nvector[:,1].size
1397 # print 'Dcosyoffset %f'%(yoffset)
1398
1399 ha = self.ha_mag*4.
1400 time = self.time_mag
1401 width_star = 0.1 # half width in minutes
1402 otitle = 'B Perp. cut'
1403 # else:
1404 # print "No B perp. over Observatory"
1405 #
1406 #
1407 elif io==1:
1408 if self.ObjC.dcosx_sun.size!=0:
1409 dcosx = self.ObjC.dcosx_sun
1410 dcosy = self.ObjC.dcosy_sun
1411 ha = self.ObjC.ha_sun*4.0
1412 time = self.ObjC.time_sun
1413 width_star = 2. # half width in minutes
1414 otitle = 'Sun cut'
1415 # else:
1416 # print "Sun is not passing over Observatory"
1417
1418 elif io==2:
1419 if self.ObjC.dcosx_moon.size!=0:
1420 dcosx = self.ObjC.dcosx_moon
1421 dcosy = self.ObjC.dcosy_moon
1422 ha = self.ObjC.ha_moon*4
1423 time = self.ObjC.time_moon
1424 m_distance = 404114.6 # distance to the Earth in km
1425 m_diameter = 1734.4 # diameter in km.
1426 width_star = numpy.arctan(m_distance/m_diameter)
1427 width_star = width_star/2./Misc_Routines.CoFactors.d2r*4.
1428 otitle = 'Moon cut'
1429 # else:
1430 # print "Moon is not passing over Observatory"
1431
1432 elif io==3:
1433 if self.ObjC.dcosx_hydra.size!=0:
1434 dcosx = self.ObjC.dcosx_hydra
1435 dcosy = self.ObjC.dcosy_hydra
1436 ha = self.ObjC.ha_hydra*4.
1437 time = self.ObjC.time_hydra
1438 width_star = 0.25 # half width in minutes
1439 otitle = 'Hydra cut'
1440 # else:
1441 # print "Hydra is not passing over Observatory"
1442
1443 elif io==4:
1444 if self.ObjC.dcosx_galaxy.size!=0:
1445 dcosx = self.ObjC.dcosx_galaxy
1446 dcosy = self.ObjC.dcosy_galaxy
1447 ha = self.ObjC.ha_galaxy*4.
1448 time = self.ObjC.time_galaxy
1449 width_star = 25. # half width in minutes
1450 otitle = 'Galaxy cut'
1451 # else:
1452 # print "Galaxy center is not passing over Jicamarca"
1453 #
1454 #
1455 hour = numpy.int32(time)
1456 mins = numpy.int32((time - hour)*60.)
1457 secs = numpy.int32(((time - hour)*60. - mins)*60.)
1458
1459 ObjT = TimeTools.Time(self.year,self.month,self.dom,hour,mins,secs)
1460 subtitle = ObjT.change2strdate()
1461
1462 star_cut = numpy.exp(-(star_ha/width_star)**2./2.)
1463
1464 pol = scipy.polyfit(ha,dcosx,3.)
1465 polx = numpy.poly1d(pol); newdcosx = polx(newha)
1466 pol = scipy.polyfit(ha,dcosy,3.)
1467 poly = numpy.poly1d(pol);newdcosy = poly(newha)
1468
1469 patterns = []
1470 for icut in numpy.arange(self.pattern.size):
1471 # Getting Antenna cut.
1472 Obj = JroPattern(dcosx=newdcosx,
1473 dcosy=newdcosy,
1474 getcut=1,
1475 pattern=self.pattern[icut],
1476 path=self.path,
1477 filename=self.filename[icut])
1478
1479 Obj.getPattern()
1480
1481 patterns.append(Obj.pattern)
1482
1483
1484 ObjCut.drawCut(io,
1485 patterns,
1486 self.pattern.size,
1487 newha,
1488 otitle,
1489 subtitle,
1490 self.ptitle)
1491
1492 ObjCut.saveFig(self.path4plotname,self.plotname1)
1493
1494 def plotSkyNoise(self):
1495 # print 'Creating SkyNoise map over Jicamarca'
1496 dom = self.dom
1497 month = self.month
1498 year = self.year
1499
1500 julian = TimeTools.Time(year,month,dom).change2julday()
1501
1502 [powr,time, lst] = Astro_Coords.CelestialBodies().skyNoise(julian)
1503
1504 Graphics_OverJro.SkyNoisePlot([year,month,dom],powr,time,lst).getPlot(self.path4plotname,self.plotname2)
1505
1506
1507 def outputHead(self,title):
1508 print "Content-Type: text/html"
1509 print
1510 self.scriptHeaders = 1
1511 print '<html>'
1512 print '<head>'
1513 print '\t<title>' + title + '</title>'
1514 print '<style type="text/css">'
1515 print 'body'
1516 print '{'
1517 print 'background-color:#ffffff;'
1518 print '}'
1519 print 'h1'
1520 print '{'
1521 print 'color:black;'
1522 print 'font-size:18px;'
1523 print 'text-align:center;'
1524 print '}'
1525 print 'p'
1526 print '{'
1527 print 'font-family:"Arial";'
1528 print 'font-size:16px;'
1529 print 'color:black;'
1530 print '}'
1531 print '</style>'
1532 # self.printJavaScript()
1533 print '</head>'
1534
1535 def printJavaScript(self):
1536 print
1537
1538 def printBody(self):
1539 print '<body>'
1540 # print '<h1>Test Input Parms</h1>'
1541 # for key in self.madForm.keys():
1542 # #print '<p> name=' + str(key)
1543 # if type(self.madForm.getvalue(key)) == types.ListType:
1544 # for value in self.madForm.getvalue(key):
1545 # print '<p> name=' + str(key) + \
1546 # ' value=' + value + ''
1547 # else:
1548 # print '<p> name=' + str(key) + \
1549 # ' value=' + str(cgi.escape(self.madForm.getvalue(key))) + ''
1550
1551 print '<form name="form1" method="post" target="showFrame">'
1552 print ' <div align="center">'
1553 print ' <table width=98% border="1" cellpadding="1">'
1554 print ' <tr>'
1555 print ' <td colspan="2" align="center">'
1556 if self.showType == 0:
1557 print ' <IMG SRC="%s" BORDER="0" >'%(os.path.join(os.sep + self.__tmpDir,self.plotname0))
1558 if self.showType == 1:
1559 print ' <IMG SRC="%s" BORDER="0" >'%(os.path.join(os.sep + self.__tmpDir,self.plotname1))
1560 if self.showType == 2:
1561 print ' <IMG SRC="%s" BORDER="0" >'%(os.path.join(os.sep + self.__tmpDir,self.plotname2))
1562 print ' </td>'
1563 print ' </tr>'
1564 print ' </table>'
1565 print ' </div>'
1566 print '</form>'
1567
1568 print '</body>'
1569 print '</html>'
1570
1571 #def execute(self, serverdocspath, tmpdir, currentdate, finalpath, showType=0, maxphi=5.0, objects="[1,1]", heights="[150,500,1000]"):
1572 def setInputParameters(self, serverpath, currentdate, finalpath, showType=0, maxphi=5.0, objects="[1,1]", heights="[150,500,1000]"):
1573 self.objects=[]
1574 self.heights=[]
1575 #self.__serverdocspath = serverdocspath
1576 self.__serverdocspath = os.path.split(serverpath)[0]
1577 #self.__tmpDir = tmpdir
1578 self.__tmpDir = os.path.split(serverpath)[1]
1579 self.showType = int(showType)
1580 self.year = int(currentdate.strftime("%Y")) # Get year of currentdate
1581 self.month = int(currentdate.strftime("%m")) # Get month of currentdate
1582 self.dom = int(currentdate.strftime("%d")) # Get day of currentdate
1583 self.filename = os.path.split(finalpath)[1]
1584 self.path = os.path.split(finalpath)[0]
1585 self.maxphi = float(maxphi)
1586
1587 tmp_objects = (objects.replace("[","")).replace("]","")
1588 for s in tmp_objects.split(','):
1589 self.objects.append(int(s))
1590
1591 tmp_heights = (heights.replace("[","")).replace("]","")
1592 for s in tmp_heights.split(','):
1593 self.heights.append(float(s))
1594 self.heights = numpy.array(self.heights)
1595
1596 def setupParameters(self):
1597 self.initParameters()
1598
1599 def initParametersCGI(self):
1600 self.setScriptState()
1601 self.initParameters()
1602
1603 def execute(self):
1604 if self.showType == 0 or self.showType == 1:
1605 self.initParameters1()
1606 self.plotPattern()
1607
1608 if numpy.sum(self.show_object>0) != 0:
1609 self.plotBfield()
1610 self.plotCelestial()
1611
1612 if numpy.sum(self.show_object>1) != 0:
1613 self.plotAntennaCuts()
1614
1615 if self.showType == 2:
1616 self.plotSkyNoise()
1617
1618 def getPlot(self):
1619 print "GETPLot"
1620 print os.path.join(self.__serverdocspath,self.__tmpDir,self.plotname0)
1621 return os.path.join(self.__serverdocspath,self.__tmpDir,self.plotname0)
1622
1623
1624 if __name__ == '__main__':
1625
1626 # Script overJroShow.py
1627 # This script only calls the init function of the class overJroShow()
1628 # All work is done by the init function
1629
1630 newOverJro = overJroShow()
1631 newOverJro.initParametersCGI()
1632 newOverJro.execute()
@@ -0,0 +1,17
1 attenuation = numpy.array([[[-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
2 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
3 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
4 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
5 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
6 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
7 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25],
8 [-21.25,-15.25,-9.25,-3.25,03.25,09.25,15.25,21.25]],
9 [[21.25,21.25,21.25,21.25,21.25,21.25,21.25,21.25],
10 [15.25,15.25,15.25,15.25,15.25,15.25,15.25,15.25],
11 [09.25,09.25,09.25,09.25,09.25,09.25,09.25,09.25],
12 [03.25,03.25,03.25,03.25,03.25,03.25,03.25,03.25],
13 [-03.25,-03.25,-03.25,-03.25,-03.25,-03.25,-03.25,-03.25],
14 [-09.25,-09.25,-09.25,-09.25,-09.25,-09.25,-09.25,-09.25],
15 [-15.25,-15.25,-15.25,-15.25,-15.25,-15.25,-15.25,-15.25],
16 [-21.25,-21.25,-21.25,-21.25,-21.25,-21.25,-21.25,-21.25]]])
17
@@ -0,0 +1,99
1 0000 13.00
2 0015 13.00
3 0030 13.00
4 0045 13.00
5 0060 13.00
6 0075 12.50
7 0090 12.50
8 0105 12.50
9 0120 11.50
10 0135 11.00
11 0150 10.50
12 0165 10.00
13 0180 10.00
14 0195 10.00
15 0210 9.00
16 0225 8.50
17 0240 8.50
18 0255 8.50
19 0270 8.50
20 0285 8.00
21 0300 8.00
22 0315 8.50
23 0330 9.00
24 0345 10.00
25 0360 11.00
26 0375 12.50
27 0390 14.50
28 0405 17.00
29 0420 18.00
30 0435 17.00
31 0450 15.50
32 0465 15.00
33 0480 14.00
34 0495 12.50
35 0510 11.00
36 0525 10.00
37 0540 9.50
38 0555 9.00
39 0570 23.00
40 0585 8.00
41 0600 10.00
42 0615 10.50
43 0630 10.00
44 0645 9.00
45 0660 8.50
46 0675 9.00
47 0690 10.00
48 0705 11.00
49 0720 12.00
50 0735 12.50
51 0750 13.50
52 0765 13.00
53 0780 13.00
54 0795 13.00
55 0810 13.00
56 0825 12.50
57 0840 12.00
58 0855 12.50
59 0870 13.00
60 0885 14.00
61 0900 15.00
62 0915 17.00
63 0930 18.00
64 0945 17.50
65 0960 16.50
66 0975 16.50
67 0990 17.00
68 0990 17.00
69 1005 17.00
70 1020 20.00
71 1035 26.00
72 1050 30.00
73 1065 36.00
74 1080 47.00
75 1095 71.00
76 1102 60.00
77 1110 77.00
78 1115 87.00
79 1120 83.00
80 1130 60.00
81 1140 50.00
82 1155 35.00
83 1170 28.00
84 1185 21.00
85 1200 18.00
86 1215 16.00
87 1237 15.50
88 1260 15.00
89 1275 15.50
90 1290 16.00
91 1305 15.50
92 1320 15.00
93 1335 14.50
94 1350 14.00
95 1365 13.00
96 1380 12.00
97 1395 12.50
98 1410 13.00
99 1425 12.50
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,196
1 g/h n m 1900.0 1905.0 1910.0 1915.0 1920.0 1925.0 1930.0 1935.0 1940.0 1945.0 1950.0 1955.0 1960.0 1965.0 1970.0 1975.0 1980.0 1985.0 1990.0 1995.0 2000.0 2005.0 SV
2 g 1 0 -31543 -31464 -31354 -31212 -31060 -30926 -30805 -30715 -30654 -30594 -30554 -30500 -30421 -30334 -30220 -30100 -29992 -29873 -29775 -29692 -29619.4 -29556.8 8.8
3 g 1 1 -2298 -2298 -2297 -2306 -2317 -2318 -2316 -2306 -2292 -2285 -2250 -2215 -2169 -2119 -2068 -2013 -1956 -1905 -1848 -1784 -1728.2 -1671.8 10.8
4 h 1 1 5922 5909 5898 5875 5845 5817 5808 5812 5821 5810 5815 5820 5791 5776 5737 5675 5604 5500 5406 5306 5186.1 5080.0 -21.3
5 g 2 0 -677 -728 -769 -802 -839 -893 -951 -1018 -1106 -1244 -1341 -1440 -1555 -1662 -1781 -1902 -1997 -2072 -2131 -2200 -2267.7 -2340.5 -15.0
6 g 2 1 2905 2928 2948 2956 2959 2969 2980 2984 2981 2990 2998 3003 3002 2997 3000 3010 3027 3044 3059 3070 3068.4 3047.0 -6.9
7 h 2 1 -1061 -1086 -1128 -1191 -1259 -1334 -1424 -1520 -1614 -1702 -1810 -1898 -1967 -2016 -2047 -2067 -2129 -2197 -2279 -2366 -2481.6 -2594.9 -23.3
8 g 2 2 924 1041 1176 1309 1407 1471 1517 1550 1566 1578 1576 1581 1590 1594 1611 1632 1663 1687 1686 1681 1670.9 1656.9 -1.0
9 h 2 2 1121 1065 1000 917 823 728 644 586 528 477 381 291 206 114 25 -68 -200 -306 -373 -413 -458.0 -516.7 -14.0
10 g 3 0 1022 1037 1058 1084 1111 1140 1172 1206 1240 1282 1297 1302 1302 1297 1287 1276 1281 1296 1314 1335 1339.6 1335.7 -0.3
11 g 3 1 -1469 -1494 -1524 -1559 -1600 -1645 -1692 -1740 -1790 -1834 -1889 -1944 -1992 -2038 -2091 -2144 -2180 -2208 -2239 -2267 -2288.0 -2305.3 -3.1
12 h 3 1 -330 -357 -389 -421 -445 -462 -480 -494 -499 -499 -476 -462 -414 -404 -366 -333 -336 -310 -284 -262 -227.6 -200.4 5.4
13 g 3 2 1256 1239 1223 1212 1205 1202 1205 1215 1232 1255 1274 1288 1289 1292 1278 1260 1251 1247 1248 1249 1252.1 1246.8 -0.9
14 h 3 2 3 34 62 84 103 119 133 146 163 186 206 216 224 240 251 262 271 284 293 302 293.4 269.3 -6.5
15 g 3 3 572 635 705 778 839 881 907 918 916 913 896 882 878 856 838 830 833 829 802 759 714.5 674.4 -6.8
16 h 3 3 523 480 425 360 293 229 166 101 43 -11 -46 -83 -130 -165 -196 -223 -252 -297 -352 -427 -491.1 -524.5 -2.0
17 g 4 0 876 880 884 887 889 891 896 903 914 944 954 958 957 957 952 946 938 936 939 940 932.3 919.8 -2.5
18 g 4 1 628 643 660 678 695 711 727 744 762 776 792 796 800 804 800 791 782 780 780 780 786.8 798.2 2.8
19 h 4 1 195 203 211 218 220 216 205 188 169 144 136 133 135 148 167 191 212 232 247 262 272.6 281.4 2.0
20 g 4 2 660 653 644 631 616 601 584 565 550 544 528 510 504 479 461 438 398 361 325 290 250.0 211.5 -7.1
21 h 4 2 -69 -77 -90 -109 -134 -163 -195 -226 -252 -276 -278 -274 -278 -269 -266 -265 -257 -249 -240 -236 -231.9 -225.8 1.8
22 g 4 3 -361 -380 -400 -416 -424 -426 -422 -415 -405 -421 -408 -397 -394 -390 -395 -405 -419 -424 -423 -418 -403.0 -379.5 5.9
23 h 4 3 -210 -201 -189 -173 -153 -130 -109 -90 -72 -55 -37 -23 3 13 26 39 53 69 84 97 119.8 145.7 5.6
24 g 4 4 134 146 160 178 199 217 234 249 265 304 303 290 269 252 234 216 199 170 141 122 111.3 100.2 -3.2
25 h 4 4 -75 -65 -55 -51 -57 -70 -90 -114 -141 -178 -210 -230 -255 -269 -279 -288 -297 -297 -299 -306 -303.8 -304.7 0.0
26 g 5 0 -184 -192 -201 -211 -221 -230 -237 -241 -241 -253 -240 -229 -222 -219 -216 -218 -218 -214 -214 -214 -218.8 -227.6 -2.6
27 g 5 1 328 328 327 327 326 326 327 329 334 346 349 360 362 358 359 356 357 355 353 352 351.4 354.4 0.4
28 h 5 1 -210 -193 -172 -148 -122 -96 -72 -51 -33 -12 3 15 16 19 26 31 46 47 46 46 43.8 42.7 0.1
29 g 5 2 264 259 253 245 236 226 218 211 208 194 211 230 242 254 262 264 261 253 245 235 222.3 208.8 -3.0
30 h 5 2 53 56 57 58 58 58 60 64 71 95 103 110 125 128 139 148 150 150 154 165 171.9 179.8 1.8
31 g 5 3 5 -1 -9 -16 -23 -28 -32 -33 -33 -20 -20 -23 -26 -31 -42 -59 -74 -93 -109 -118 -130.4 -136.6 -1.2
32 h 5 3 -33 -32 -33 -34 -38 -44 -53 -64 -75 -67 -87 -98 -117 -126 -139 -152 -151 -154 -153 -143 -133.1 -123.0 2.0
33 g 5 4 -86 -93 -102 -111 -119 -125 -131 -136 -141 -142 -147 -152 -156 -157 -160 -159 -162 -164 -165 -166 -168.6 -168.3 0.2
34 h 5 4 -124 -125 -126 -126 -125 -122 -118 -115 -113 -119 -122 -121 -114 -97 -91 -83 -78 -75 -69 -55 -39.3 -19.5 4.5
35 g 5 5 -16 -26 -38 -51 -62 -69 -74 -76 -76 -82 -76 -69 -63 -62 -56 -49 -48 -46 -36 -17 -12.9 -14.1 -0.6
36 h 5 5 3 11 21 32 43 51 58 64 69 82 80 78 81 81 83 88 92 95 97 107 106.3 103.6 -1.0
37 g 6 0 63 62 62 61 61 61 60 59 57 59 54 47 46 45 43 45 48 53 61 68 72.3 72.9 -0.8
38 g 6 1 61 60 58 57 55 54 53 53 54 57 57 57 58 61 64 66 66 65 65 67 68.2 69.6 0.2
39 h 6 1 -9 -7 -5 -2 0 3 4 4 4 6 -1 -9 -10 -11 -12 -13 -15 -16 -16 -17 -17.4 -20.2 -0.4
40 g 6 2 -11 -11 -11 -10 -10 -9 -9 -8 -7 6 4 3 1 8 15 28 42 51 59 68 74.2 76.6 -0.2
41 h 6 2 83 86 89 93 96 99 102 104 105 100 99 96 99 100 100 99 93 88 82 72 63.7 54.7 -1.9
42 g 6 3 -217 -221 -224 -228 -233 -238 -242 -246 -249 -246 -247 -247 -237 -228 -212 -198 -192 -185 -178 -170 -160.9 -151.1 2.1
43 h 6 3 2 4 5 8 11 14 19 25 33 16 33 48 60 68 72 75 71 69 69 67 65.1 63.7 -0.4
44 g 6 4 -58 -57 -54 -51 -46 -40 -32 -25 -18 -25 -16 -8 -1 4 2 1 4 4 3 -1 -5.9 -15.0 -2.1
45 h 6 4 -35 -32 -29 -26 -22 -18 -16 -15 -15 -9 -12 -16 -20 -32 -37 -41 -43 -48 -52 -58 -61.2 -63.4 -0.4
46 g 6 5 59 57 54 49 44 39 32 25 18 21 12 7 -2 1 3 6 14 16 18 19 16.9 14.7 -0.4
47 h 6 5 36 32 28 23 18 13 8 4 0 -16 -12 -12 -11 -8 -6 -4 -2 -1 1 1 0.7 0.0 -0.2
48 g 6 6 -90 -92 -95 -98 -101 -103 -104 -106 -107 -104 -105 -107 -113 -111 -112 -111 -108 -102 -96 -93 -90.4 -86.4 1.3
49 h 6 6 -69 -67 -65 -62 -57 -52 -46 -40 -33 -39 -30 -24 -17 -7 1 11 17 21 24 36 43.8 50.3 0.9
50 g 7 0 70 70 71 72 73 73 74 74 74 70 65 65 67 75 72 71 72 74 77 77 79.0 79.8 -0.4
51 g 7 1 -55 -54 -54 -54 -54 -54 -54 -53 -53 -40 -55 -56 -56 -57 -57 -56 -59 -62 -64 -72 -74.0 -74.4 0.0
52 h 7 1 -45 -46 -47 -48 -49 -50 -51 -52 -52 -45 -35 -50 -55 -61 -70 -77 -82 -83 -80 -69 -64.6 -61.4 0.8
53 g 7 2 0 0 1 2 2 3 4 4 4 0 2 2 5 4 1 1 2 3 2 1 0.0 -1.4 -0.2
54 h 7 2 -13 -14 -14 -14 -14 -14 -15 -17 -18 -18 -17 -24 -28 -27 -27 -26 -27 -27 -26 -25 -24.2 -22.5 0.4
55 g 7 3 34 33 32 31 29 27 25 23 20 0 1 10 15 13 14 16 21 24 26 28 33.3 38.6 1.1
56 h 7 3 -10 -11 -12 -12 -13 -14 -14 -14 -14 2 0 -4 -6 -2 -4 -5 -5 -2 0 4 6.2 6.9 0.1
57 g 7 4 -41 -41 -40 -38 -37 -35 -34 -33 -31 -29 -40 -32 -32 -26 -22 -14 -12 -6 -1 5 9.1 12.3 0.6
58 h 7 4 -1 0 1 2 4 5 6 7 7 6 10 8 7 6 8 10 16 20 21 24 24.0 25.4 0.2
59 g 7 5 -21 -20 -19 -18 -16 -14 -12 -11 -9 -10 -7 -11 -7 -6 -2 0 1 4 5 4 6.9 9.4 0.4
60 h 7 5 28 28 28 28 28 29 29 29 29 28 36 28 23 26 23 22 18 17 17 17 14.8 10.9 -0.9
61 g 7 6 18 18 18 19 19 19 18 18 17 15 5 9 17 13 13 12 11 10 9 8 7.3 5.5 -0.5
62 h 7 6 -12 -12 -13 -15 -16 -17 -18 -19 -20 -17 -18 -20 -18 -23 -23 -23 -23 -23 -23 -24 -25.4 -26.4 -0.3
63 g 7 7 6 6 6 6 6 6 6 6 5 29 19 18 8 1 -2 -5 -2 0 0 -2 -1.2 2.0 0.9
64 h 7 7 -22 -22 -22 -22 -22 -21 -20 -19 -19 -22 -16 -18 -17 -12 -11 -12 -10 -7 -4 -6 -5.8 -4.8 0.3
65 g 8 0 11 11 11 11 11 11 11 11 11 13 22 11 15 13 14 14 18 21 23 25 24.4 24.8 -0.2
66 g 8 1 8 8 8 8 7 7 7 7 7 7 15 9 6 5 6 6 6 6 5 6 6.6 7.7 0.2
67 h 8 1 8 8 8 8 8 8 8 8 8 12 5 10 11 7 7 6 7 8 10 11 11.9 11.2 -0.2
68 g 8 2 -4 -4 -4 -4 -3 -3 -3 -3 -3 -8 -4 -6 -4 -4 -2 -1 0 0 -1 -6 -9.2 -11.4 -0.2
69 h 8 2 -14 -15 -15 -15 -15 -15 -15 -15 -14 -21 -22 -15 -14 -12 -15 -16 -18 -19 -19 -21 -21.5 -21.0 0.2
70 g 8 3 -9 -9 -9 -9 -9 -9 -9 -9 -10 -5 -1 -14 -11 -14 -13 -12 -11 -11 -10 -9 -7.9 -6.8 0.2
71 h 8 3 7 7 6 6 6 6 5 5 5 -12 0 5 7 9 6 4 4 5 6 8 8.5 9.7 0.2
72 g 8 4 1 1 1 2 2 2 2 1 1 9 11 6 2 0 -3 -8 -7 -9 -12 -14 -16.6 -18.0 -0.2
73 h 8 4 -13 -13 -13 -13 -14 -14 -14 -15 -15 -7 -21 -23 -18 -16 -17 -19 -22 -23 -22 -23 -21.5 -19.8 0.4
74 g 8 5 2 2 2 3 4 4 5 6 6 7 15 10 10 8 5 4 4 4 3 9 9.1 10.0 0.2
75 h 8 5 5 5 5 5 5 5 5 5 5 2 -8 3 4 4 6 6 9 11 12 15 15.5 16.1 0.2
76 g 8 6 -9 -8 -8 -8 -7 -7 -6 -6 -5 -10 -13 -7 -5 -1 0 0 3 4 4 6 7.0 9.4 0.5
77 h 8 6 16 16 16 16 17 17 18 18 19 18 17 23 23 24 21 18 16 14 12 11 8.9 7.7 -0.3
78 g 8 7 5 5 5 6 6 7 8 8 9 7 5 6 10 11 11 10 6 4 2 -5 -7.9 -11.4 -0.7
79 h 8 7 -5 -5 -5 -5 -5 -5 -5 -5 -5 3 -4 -4 1 -3 -6 -10 -13 -15 -16 -16 -14.9 -12.8 0.5
80 g 8 8 8 8 8 8 8 8 8 7 7 2 -1 9 8 4 3 1 -1 -4 -6 -7 -7.0 -5.0 0.5
81 h 8 8 -18 -18 -18 -18 -19 -19 -19 -19 -19 -11 -17 -13 -20 -17 -16 -17 -15 -11 -10 -4 -2.1 -0.1 0.4
82 g 9 0 8 8 8 8 8 8 8 8 8 5 3 4 4 8 8 7 5 5 4 4 5.0 5.6
83 g 9 1 10 10 10 10 10 10 10 10 10 -21 -7 9 6 10 10 10 10 10 9 9 9.4 9.8
84 h 9 1 -20 -20 -20 -20 -20 -20 -20 -20 -21 -27 -24 -11 -18 -22 -21 -21 -21 -21 -20 -20 -19.7 -20.1
85 g 9 2 1 1 1 1 1 1 1 1 1 1 -1 -4 0 2 2 2 1 1 1 3 3.0 3.6
86 h 9 2 14 14 14 14 14 14 14 15 15 17 19 12 12 15 16 16 16 15 15 15 13.4 12.9
87 g 9 3 -11 -11 -11 -11 -11 -11 -12 -12 -12 -11 -25 -5 -9 -13 -12 -12 -12 -12 -12 -10 -8.4 -7.0
88 h 9 3 5 5 5 5 5 5 5 5 5 29 12 7 2 7 6 7 9 9 11 12 12.5 12.7
89 g 9 4 12 12 12 12 12 12 12 11 11 3 10 2 1 10 10 10 9 9 9 8 6.3 5.0
90 h 9 4 -3 -3 -3 -3 -3 -3 -3 -3 -3 -9 2 6 0 -4 -4 -4 -5 -6 -7 -6 -6.2 -6.7
91 g 9 5 1 1 1 1 1 1 1 1 1 16 5 4 4 -1 -1 -1 -3 -3 -4 -8 -8.9 -10.8
92 h 9 5 -2 -2 -2 -2 -2 -2 -2 -3 -3 4 2 -2 -3 -5 -5 -5 -6 -6 -7 -8 -8.4 -8.1
93 g 9 6 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -5 1 -1 -1 0 -1 -1 -1 -2 -1 -1.5 -1.3
94 h 9 6 8 8 8 8 9 9 9 9 9 9 8 10 9 10 10 10 9 9 9 8 8.4 8.1
95 g 9 7 2 2 2 2 2 2 3 3 3 -4 -2 2 -2 5 3 4 7 7 7 10 9.3 8.7
96 h 9 7 10 10 10 10 10 10 10 11 11 6 8 7 8 10 11 11 10 9 8 5 3.8 2.9
97 g 9 8 -1 0 0 0 0 0 0 0 1 -3 3 2 3 1 1 1 2 1 1 -2 -4.3 -6.7
98 h 9 8 -2 -2 -2 -2 -2 -2 -2 -2 -2 1 -11 -6 0 -4 -2 -3 -6 -7 -7 -8 -8.2 -7.9
99 g 9 9 -1 -1 -1 -1 -1 -1 -2 -2 -2 -4 8 5 -1 -2 -1 -2 -5 -5 -6 -8 -8.2 -9.2
100 h 9 9 2 2 2 2 2 2 2 2 2 8 -7 5 5 1 1 1 2 2 2 3 4.8 5.9
101 g 10 0 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -8 -3 1 -2 -3 -3 -4 -4 -3 -3 -2.6 -2.2
102 g 10 1 -4 -4 -4 -4 -4 -4 -4 -4 -4 11 4 -5 -3 -3 -3 -3 -4 -4 -4 -6 -6.0 -6.3
103 h 10 1 2 2 2 2 2 2 2 2 2 5 13 -4 4 2 1 1 1 1 2 1 1.7 2.4
104 g 10 2 2 2 2 2 2 2 2 2 2 1 -1 -1 4 2 2 2 2 3 2 2 1.7 1.6
105 h 10 2 1 1 1 1 1 1 1 1 1 1 -2 0 1 1 1 1 0 0 1 0 0.0 0.2
106 g 10 3 -5 -5 -5 -5 -5 -5 -5 -5 -5 2 13 2 0 -5 -5 -5 -5 -5 -5 -4 -3.1 -2.5
107 h 10 3 2 2 2 2 2 2 2 2 2 -20 -10 -8 0 2 3 3 3 3 3 4 4.0 4.4
108 g 10 4 -2 -2 -2 -2 -2 -2 -2 -2 -2 -5 -4 -3 -1 -2 -1 -2 -2 -2 -2 -1 -0.5 -0.1
109 h 10 4 6 6 6 6 6 6 6 6 6 -1 2 -2 2 6 4 4 6 6 6 5 4.9 4.7
110 g 10 5 6 6 6 6 6 6 6 6 6 -1 4 7 4 4 6 5 5 5 4 4 3.7 3.0
111 h 10 5 -4 -4 -4 -4 -4 -4 -4 -4 -4 -6 -3 -4 -5 -4 -4 -4 -4 -4 -4 -5 -5.9 -6.5
112 g 10 6 4 4 4 4 4 4 4 4 4 8 12 4 6 4 4 4 3 3 3 2 1.0 0.3
113 h 10 6 0 0 0 0 0 0 0 0 0 6 6 1 1 0 0 -1 0 0 0 -1 -1.2 -1.0
114 g 10 7 0 0 0 0 0 0 0 0 0 -1 3 -2 1 0 1 1 1 1 1 2 2.0 2.1
115 h 10 7 -2 -2 -2 -2 -2 -2 -2 -1 -1 -4 -3 -3 -1 -2 -1 -1 -1 -1 -2 -2 -2.9 -3.4
116 g 10 8 2 2 2 1 1 1 1 2 2 -3 2 6 -1 2 0 0 2 2 3 5 4.2 3.9
117 h 10 8 4 4 4 4 4 4 4 4 4 -2 6 7 6 3 3 3 4 4 3 1 0.2 -0.9
118 g 10 9 2 2 2 2 3 3 3 3 3 5 10 -2 2 2 3 3 3 3 3 1 0.3 -0.1
119 h 10 9 0 0 0 0 0 0 0 0 0 0 11 -1 0 0 1 1 0 0 -1 -2 -2.2 -2.3
120 g 10 10 0 0 0 0 0 0 0 0 0 -2 3 0 0 0 -1 -1 0 0 0 0 -1.1 -2.2
121 h 10 10 -6 -6 -6 -6 -6 -6 -6 -6 -6 -2 8 -3 -7 -6 -4 -5 -6 -6 -6 -7 -7.4 -8.0
122 g 11 0 2.7 2.9
123 g 11 1 -1.7 -1.6
124 h 11 1 0.1 0.3
125 g 11 2 -1.9 -1.7
126 h 11 2 1.3 1.4
127 g 11 3 1.5 1.5
128 h 11 3 -0.9 -0.7
129 g 11 4 -0.1 -0.2
130 h 11 4 -2.6 -2.4
131 g 11 5 0.1 0.2
132 h 11 5 0.9 0.9
133 g 11 6 -0.7 -0.7
134 h 11 6 -0.7 -0.6
135 g 11 7 0.7 0.5
136 h 11 7 -2.8 -2.7
137 g 11 8 1.7 1.8
138 h 11 8 -0.9 -1.0
139 g 11 9 0.1 0.1
140 h 11 9 -1.2 -1.5
141 g 11 10 1.2 1.0
142 h 11 10 -1.9 -2.0
143 g 11 11 4.0 4.1
144 h 11 11 -0.9 -1.4
145 g 12 0 -2.2 -2.2
146 g 12 1 -0.3 -0.3
147 h 12 1 -0.4 -0.5
148 g 12 2 0.2 0.3
149 h 12 2 0.3 0.3
150 g 12 3 0.9 0.9
151 h 12 3 2.5 2.3
152 g 12 4 -0.2 -0.4
153 h 12 4 -2.6 -2.7
154 g 12 5 0.9 1.0
155 h 12 5 0.7 0.6
156 g 12 6 -0.5 -0.4
157 h 12 6 0.3 0.4
158 g 12 7 0.3 0.5
159 h 12 7 0.0 0.0
160 g 12 8 -0.3 -0.3
161 h 12 8 0.0 0.0
162 g 12 9 -0.4 -0.4
163 h 12 9 0.3 0.3
164 g 12 10 -0.1 0.0
165 h 12 10 -0.9 -0.8
166 g 12 11 -0.2 -0.4
167 h 12 11 -0.4 -0.4
168 g 12 12 -0.4 0.0
169 h 12 12 0.8 1.0
170 g 13 0 -0.2 -0.2
171 g 13 1 -0.9 -0.9
172 h 13 1 -0.9 -0.7
173 g 13 2 0.3 0.3
174 h 13 2 0.2 0.3
175 g 13 3 0.1 0.3
176 h 13 3 1.8 1.7
177 g 13 4 -0.4 -0.4
178 h 13 4 -0.4 -0.5
179 g 13 5 1.3 1.2
180 h 13 5 -1.0 -1.0
181 g 13 6 -0.4 -0.4
182 h 13 6 -0.1 0.0
183 g 13 7 0.7 0.7
184 h 13 7 0.7 0.7
185 g 13 8 -0.4 -0.3
186 h 13 8 0.3 0.2
187 g 13 9 0.3 0.4
188 h 13 9 0.6 0.6
189 g 13 10 -0.1 -0.1
190 h 13 10 0.3 0.4
191 g 13 11 0.4 0.4
192 h 13 11 -0.2 -0.2
193 g 13 12 0.0 -0.1
194 h 13 12 -0.5 -0.5
195 g 13 13 0.1 -0.3
196 h 13 13 -0.9 -1.0
@@ -0,0 +1,196
1 g/h n m 1900.0 1905.0 1910.0 1915.0 1920.0 1925.0 1930.0 1935.0 1940.0 1945.0 1950.0 1955.0 1960.0 1965.0 1970.0 1975.0 1980.0 1985.0 1990.0 1995.0 2000.0 2005.0 2010.0 SV
2 g 1 0 -31543 -31464 -31354 -31212 -31060 -30926 -30805 -30715 -30654 -30594 -30554 -30500 -30421 -30334 -30220 -30100 -29992 -29873 -29775 -29692 -29619.4 -29554.63 -29496.5 11.4
3 g 1 1 -2298 -2298 -2297 -2306 -2317 -2318 -2316 -2306 -2292 -2285 -2250 -2215 -2169 -2119 -2068 -2013 -1956 -1905 -1848 -1784 -1728.2 -1669.05 -1585.9 16.7
4 h 1 1 5922 5909 5898 5875 5845 5817 5808 5812 5821 5810 5815 5820 5791 5776 5737 5675 5604 5500 5406 5306 5186.1 5077.99 4945.1 -28.8
5 g 2 0 -677 -728 -769 -802 -839 -893 -951 -1018 -1106 -1244 -1341 -1440 -1555 -1662 -1781 -1902 -1997 -2072 -2131 -2200 -2267.7 -2337.24 -2396.6 -11.3
6 g 2 1 2905 2928 2948 2956 2959 2969 2980 2984 2981 2990 2998 3003 3002 2997 3000 3010 3027 3044 3059 3070 3068.4 3047.69 3026.0 -3.9
7 h 2 1 -1061 -1086 -1128 -1191 -1259 -1334 -1424 -1520 -1614 -1702 -1810 -1898 -1967 -2016 -2047 -2067 -2129 -2197 -2279 -2366 -2481.6 -2594.50 -2707.7 -23.0
8 g 2 2 924 1041 1176 1309 1407 1471 1517 1550 1566 1578 1576 1581 1590 1594 1611 1632 1663 1687 1686 1681 1670.9 1657.76 1668.6 2.7
9 h 2 2 1121 1065 1000 917 823 728 644 586 528 477 381 291 206 114 25 -68 -200 -306 -373 -413 -458.0 -515.43 -575.4 -12.9
10 g 3 0 1022 1037 1058 1084 1111 1140 1172 1206 1240 1282 1297 1302 1302 1297 1287 1276 1281 1296 1314 1335 1339.6 1336.30 1339.7 1.3
11 g 3 1 -1469 -1494 -1524 -1559 -1600 -1645 -1692 -1740 -1790 -1834 -1889 -1944 -1992 -2038 -2091 -2144 -2180 -2208 -2239 -2267 -2288.0 -2305.83 -2326.3 -3.9
12 h 3 1 -330 -357 -389 -421 -445 -462 -480 -494 -499 -499 -476 -462 -414 -404 -366 -333 -336 -310 -284 -262 -227.6 -198.86 -160.5 8.6
13 g 3 2 1256 1239 1223 1212 1205 1202 1205 1215 1232 1255 1274 1288 1289 1292 1278 1260 1251 1247 1248 1249 1252.1 1246.39 1231.7 -2.9
14 h 3 2 3 34 62 84 103 119 133 146 163 186 206 216 224 240 251 262 271 284 293 302 293.4 269.72 251.7 -2.9
15 g 3 3 572 635 705 778 839 881 907 918 916 913 896 882 878 856 838 830 833 829 802 759 714.5 672.51 634.2 -8.1
16 h 3 3 523 480 425 360 293 229 166 101 43 -11 -46 -83 -130 -165 -196 -223 -252 -297 -352 -427 -491.1 -524.72 -536.8 -2.1
17 g 4 0 876 880 884 887 889 891 896 903 914 944 954 958 957 957 952 946 938 936 939 940 932.3 920.55 912.6 -1.4
18 g 4 1 628 643 660 678 695 711 727 744 762 776 792 796 800 804 800 791 782 780 780 780 786.8 797.96 809.0 2.0
19 h 4 1 195 203 211 218 220 216 205 188 169 144 136 133 135 148 167 191 212 232 247 262 272.6 282.07 286.4 0.4
20 g 4 2 660 653 644 631 616 601 584 565 550 544 528 510 504 479 461 438 398 361 325 290 250.0 210.65 166.6 -8.9
21 h 4 2 -69 -77 -90 -109 -134 -163 -195 -226 -252 -276 -278 -274 -278 -269 -266 -265 -257 -249 -240 -236 -231.9 -225.23 -211.2 3.2
22 g 4 3 -361 -380 -400 -416 -424 -426 -422 -415 -405 -421 -408 -397 -394 -390 -395 -405 -419 -424 -423 -418 -403.0 -379.86 -357.1 4.4
23 h 4 3 -210 -201 -189 -173 -153 -130 -109 -90 -72 -55 -37 -23 3 13 26 39 53 69 84 97 119.8 145.15 164.4 3.6
24 g 4 4 134 146 160 178 199 217 234 249 265 304 303 290 269 252 234 216 199 170 141 122 111.3 100.00 89.7 -2.3
25 h 4 4 -75 -65 -55 -51 -57 -70 -90 -114 -141 -178 -210 -230 -255 -269 -279 -288 -297 -297 -299 -306 -303.8 -305.36 -309.2 -0.8
26 g 5 0 -184 -192 -201 -211 -221 -230 -237 -241 -241 -253 -240 -229 -222 -219 -216 -218 -218 -214 -214 -214 -218.8 -227.00 -231.1 -0.5
27 g 5 1 328 328 327 327 326 326 327 329 334 346 349 360 362 358 359 356 357 355 353 352 351.4 354.41 357.2 0.5
28 h 5 1 -210 -193 -172 -148 -122 -96 -72 -51 -33 -12 3 15 16 19 26 31 46 47 46 46 43.8 42.72 44.7 0.5
29 g 5 2 264 259 253 245 236 226 218 211 208 194 211 230 242 254 262 264 261 253 245 235 222.3 208.95 200.3 -1.5
30 h 5 2 53 56 57 58 58 58 60 64 71 95 103 110 125 128 139 148 150 150 154 165 171.9 180.25 188.9 1.5
31 g 5 3 5 -1 -9 -16 -23 -28 -32 -33 -33 -20 -20 -23 -26 -31 -42 -59 -74 -93 -109 -118 -130.4 -136.54 -141.2 -0.7
32 h 5 3 -33 -32 -33 -34 -38 -44 -53 -64 -75 -67 -87 -98 -117 -126 -139 -152 -151 -154 -153 -143 -133.1 -123.45 -118.1 0.9
33 g 5 4 -86 -93 -102 -111 -119 -125 -131 -136 -141 -142 -147 -152 -156 -157 -160 -159 -162 -164 -165 -166 -168.6 -168.05 -163.1 1.3
34 h 5 4 -124 -125 -126 -126 -125 -122 -118 -115 -113 -119 -122 -121 -114 -97 -91 -83 -78 -75 -69 -55 -39.3 -19.57 0.1 3.7
35 g 5 5 -16 -26 -38 -51 -62 -69 -74 -76 -76 -82 -76 -69 -63 -62 -56 -49 -48 -46 -36 -17 -12.9 -13.55 -7.7 1.4
36 h 5 5 3 11 21 32 43 51 58 64 69 82 80 78 81 81 83 88 92 95 97 107 106.3 103.85 100.9 -0.6
37 g 6 0 63 62 62 61 61 61 60 59 57 59 54 47 46 45 43 45 48 53 61 68 72.3 73.60 72.8 -0.3
38 g 6 1 61 60 58 57 55 54 53 53 54 57 57 57 58 61 64 66 66 65 65 67 68.2 69.56 68.6 -0.3
39 h 6 1 -9 -7 -5 -2 0 3 4 4 4 6 -1 -9 -10 -11 -12 -13 -15 -16 -16 -17 -17.4 -20.33 -20.8 -0.1
40 g 6 2 -11 -11 -11 -10 -10 -9 -9 -8 -7 6 4 3 1 8 15 28 42 51 59 68 74.2 76.74 76.0 -0.3
41 h 6 2 83 86 89 93 96 99 102 104 105 100 99 96 99 100 100 99 93 88 82 72 63.7 54.75 44.2 -2.1
42 g 6 3 -217 -221 -224 -228 -233 -238 -242 -246 -249 -246 -247 -247 -237 -228 -212 -198 -192 -185 -178 -170 -160.9 -151.34 -141.4 1.9
43 h 6 3 2 4 5 8 11 14 19 25 33 16 33 48 60 68 72 75 71 69 69 67 65.1 63.63 61.5 -0.4
44 g 6 4 -58 -57 -54 -51 -46 -40 -32 -25 -18 -25 -16 -8 -1 4 2 1 4 4 3 -1 -5.9 -14.58 -22.9 -1.6
45 h 6 4 -35 -32 -29 -26 -22 -18 -16 -15 -15 -9 -12 -16 -20 -32 -37 -41 -43 -48 -52 -58 -61.2 -63.53 -66.3 -0.5
46 g 6 5 59 57 54 49 44 39 32 25 18 21 12 7 -2 1 3 6 14 16 18 19 16.9 14.58 13.1 -0.2
47 h 6 5 36 32 28 23 18 13 8 4 0 -16 -12 -12 -11 -8 -6 -4 -2 -1 1 1 0.7 0.24 3.1 0.8
48 g 6 6 -90 -92 -95 -98 -101 -103 -104 -106 -107 -104 -105 -107 -113 -111 -112 -111 -108 -102 -96 -93 -90.4 -86.36 -77.9 1.8
49 h 6 6 -69 -67 -65 -62 -57 -52 -46 -40 -33 -39 -30 -24 -17 -7 1 11 17 21 24 36 43.8 50.94 54.9 0.5
50 g 7 0 70 70 71 72 73 73 74 74 74 70 65 65 67 75 72 71 72 74 77 77 79.0 79.88 80.4 0.2
51 g 7 1 -55 -54 -54 -54 -54 -54 -54 -53 -53 -40 -55 -56 -56 -57 -57 -56 -59 -62 -64 -72 -74.0 -74.46 -75.0 -0.1
52 h 7 1 -45 -46 -47 -48 -49 -50 -51 -52 -52 -45 -35 -50 -55 -61 -70 -77 -82 -83 -80 -69 -64.6 -61.14 -57.8 0.6
53 g 7 2 0 0 1 2 2 3 4 4 4 0 2 2 5 4 1 1 2 3 2 1 0.0 -1.65 -4.7 -0.6
54 h 7 2 -13 -14 -14 -14 -14 -14 -15 -17 -18 -18 -17 -24 -28 -27 -27 -26 -27 -27 -26 -25 -24.2 -22.57 -21.2 0.3
55 g 7 3 34 33 32 31 29 27 25 23 20 0 1 10 15 13 14 16 21 24 26 28 33.3 38.73 45.3 1.4
56 h 7 3 -10 -11 -12 -12 -13 -14 -14 -14 -14 2 0 -4 -6 -2 -4 -5 -5 -2 0 4 6.2 6.82 6.6 -0.2
57 g 7 4 -41 -41 -40 -38 -37 -35 -34 -33 -31 -29 -40 -32 -32 -26 -22 -14 -12 -6 -1 5 9.1 12.30 14.0 0.3
58 h 7 4 -1 0 1 2 4 5 6 7 7 6 10 8 7 6 8 10 16 20 21 24 24.0 25.35 24.9 -0.1
59 g 7 5 -21 -20 -19 -18 -16 -14 -12 -11 -9 -10 -7 -11 -7 -6 -2 0 1 4 5 4 6.9 9.37 10.4 0.1
60 h 7 5 28 28 28 28 28 29 29 29 29 28 36 28 23 26 23 22 18 17 17 17 14.8 10.93 7.0 -0.8
61 g 7 6 18 18 18 19 19 19 18 18 17 15 5 9 17 13 13 12 11 10 9 8 7.3 5.42 1.6 -0.8
62 h 7 6 -12 -12 -13 -15 -16 -17 -18 -19 -20 -17 -18 -20 -18 -23 -23 -23 -23 -23 -23 -24 -25.4 -26.32 -27.7 -0.3
63 g 7 7 6 6 6 6 6 6 6 6 5 29 19 18 8 1 -2 -5 -2 0 0 -2 -1.2 1.94 4.9 0.4
64 h 7 7 -22 -22 -22 -22 -22 -21 -20 -19 -19 -22 -16 -18 -17 -12 -11 -12 -10 -7 -4 -6 -5.8 -4.64 -3.4 0.2
65 g 8 0 11 11 11 11 11 11 11 11 11 13 22 11 15 13 14 14 18 21 23 25 24.4 24.80 24.3 -0.1
66 g 8 1 8 8 8 8 7 7 7 7 7 7 15 9 6 5 6 6 6 6 5 6 6.6 7.62 8.2 0.1
67 h 8 1 8 8 8 8 8 8 8 8 8 12 5 10 11 7 7 6 7 8 10 11 11.9 11.20 10.9 0.0
68 g 8 2 -4 -4 -4 -4 -3 -3 -3 -3 -3 -8 -4 -6 -4 -4 -2 -1 0 0 -1 -6 -9.2 -11.73 -14.5 -0.5
69 h 8 2 -14 -15 -15 -15 -15 -15 -15 -15 -14 -21 -22 -15 -14 -12 -15 -16 -18 -19 -19 -21 -21.5 -20.88 -20.0 0.2
70 g 8 3 -9 -9 -9 -9 -9 -9 -9 -9 -10 -5 -1 -14 -11 -14 -13 -12 -11 -11 -10 -9 -7.9 -6.88 -5.7 0.3
71 h 8 3 7 7 6 6 6 6 5 5 5 -12 0 5 7 9 6 4 4 5 6 8 8.5 9.83 11.9 0.5
72 g 8 4 1 1 1 2 2 2 2 1 1 9 11 6 2 0 -3 -8 -7 -9 -12 -14 -16.6 -18.11 -19.3 -0.3
73 h 8 4 -13 -13 -13 -13 -14 -14 -14 -15 -15 -7 -21 -23 -18 -16 -17 -19 -22 -23 -22 -23 -21.5 -19.71 -17.4 0.4
74 g 8 5 2 2 2 3 4 4 5 6 6 7 15 10 10 8 5 4 4 4 3 9 9.1 10.17 11.6 0.3
75 h 8 5 5 5 5 5 5 5 5 5 5 2 -8 3 4 4 6 6 9 11 12 15 15.5 16.22 16.7 0.1
76 g 8 6 -9 -8 -8 -8 -7 -7 -6 -6 -5 -10 -13 -7 -5 -1 0 0 3 4 4 6 7.0 9.36 10.9 0.2
77 h 8 6 16 16 16 16 17 17 18 18 19 18 17 23 23 24 21 18 16 14 12 11 8.9 7.61 7.1 -0.1
78 g 8 7 5 5 5 6 6 7 8 8 9 7 5 6 10 11 11 10 6 4 2 -5 -7.9 -11.25 -14.1 -0.5
79 h 8 7 -5 -5 -5 -5 -5 -5 -5 -5 -5 3 -4 -4 1 -3 -6 -10 -13 -15 -16 -16 -14.9 -12.76 -10.8 0.4
80 g 8 8 8 8 8 8 8 8 8 7 7 2 -1 9 8 4 3 1 -1 -4 -6 -7 -7.0 -4.87 -3.7 0.2
81 h 8 8 -18 -18 -18 -18 -19 -19 -19 -19 -19 -11 -17 -13 -20 -17 -16 -17 -15 -11 -10 -4 -2.1 -0.06 1.7 0.4
82 g 9 0 8 8 8 8 8 8 8 8 8 5 3 4 4 8 8 7 5 5 4 4 5.0 5.58 5.4 0.0
83 g 9 1 10 10 10 10 10 10 10 10 10 -21 -7 9 6 10 10 10 10 10 9 9 9.4 9.76 9.4 0.0
84 h 9 1 -20 -20 -20 -20 -20 -20 -20 -20 -21 -27 -24 -11 -18 -22 -21 -21 -21 -21 -20 -20 -19.7 -20.11 -20.5 0.0
85 g 9 2 1 1 1 1 1 1 1 1 1 1 -1 -4 0 2 2 2 1 1 1 3 3.0 3.58 3.4 0.0
86 h 9 2 14 14 14 14 14 14 14 15 15 17 19 12 12 15 16 16 16 15 15 15 13.4 12.69 11.6 0.0
87 g 9 3 -11 -11 -11 -11 -11 -11 -12 -12 -12 -11 -25 -5 -9 -13 -12 -12 -12 -12 -12 -10 -8.4 -6.94 -5.3 0.0
88 h 9 3 5 5 5 5 5 5 5 5 5 29 12 7 2 7 6 7 9 9 11 12 12.5 12.67 12.8 0.0
89 g 9 4 12 12 12 12 12 12 12 11 11 3 10 2 1 10 10 10 9 9 9 8 6.3 5.01 3.1 0.0
90 h 9 4 -3 -3 -3 -3 -3 -3 -3 -3 -3 -9 2 6 0 -4 -4 -4 -5 -6 -7 -6 -6.2 -6.72 -7.2 0.0
91 g 9 5 1 1 1 1 1 1 1 1 1 16 5 4 4 -1 -1 -1 -3 -3 -4 -8 -8.9 -10.76 -12.4 0.0
92 h 9 5 -2 -2 -2 -2 -2 -2 -2 -3 -3 4 2 -2 -3 -5 -5 -5 -6 -6 -7 -8 -8.4 -8.16 -7.4 0.0
93 g 9 6 -2 -2 -2 -2 -2 -2 -2 -2 -2 -3 -5 1 -1 -1 0 -1 -1 -1 -2 -1 -1.5 -1.25 -0.8 0.0
94 h 9 6 8 8 8 8 9 9 9 9 9 9 8 10 9 10 10 10 9 9 9 8 8.4 8.10 8.0 0.0
95 g 9 7 2 2 2 2 2 2 3 3 3 -4 -2 2 -2 5 3 4 7 7 7 10 9.3 8.76 8.4 0.0
96 h 9 7 10 10 10 10 10 10 10 11 11 6 8 7 8 10 11 11 10 9 8 5 3.8 2.92 2.2 0.0
97 g 9 8 -1 0 0 0 0 0 0 0 1 -3 3 2 3 1 1 1 2 1 1 -2 -4.3 -6.66 -8.4 0.0
98 h 9 8 -2 -2 -2 -2 -2 -2 -2 -2 -2 1 -11 -6 0 -4 -2 -3 -6 -7 -7 -8 -8.2 -7.73 -6.1 0.0
99 g 9 9 -1 -1 -1 -1 -1 -1 -2 -2 -2 -4 8 5 -1 -2 -1 -2 -5 -5 -6 -8 -8.2 -9.22 -10.1 0.0
100 h 9 9 2 2 2 2 2 2 2 2 2 8 -7 5 5 1 1 1 2 2 2 3 4.8 6.01 7.0 0.0
101 g 10 0 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -8 -3 1 -2 -3 -3 -4 -4 -3 -3 -2.6 -2.17 -2.0 0.0
102 g 10 1 -4 -4 -4 -4 -4 -4 -4 -4 -4 11 4 -5 -3 -3 -3 -3 -4 -4 -4 -6 -6.0 -6.12 -6.3 0.0
103 h 10 1 2 2 2 2 2 2 2 2 2 5 13 -4 4 2 1 1 1 1 2 1 1.7 2.19 2.8 0.0
104 g 10 2 2 2 2 2 2 2 2 2 2 1 -1 -1 4 2 2 2 2 3 2 2 1.7 1.42 0.9 0.0
105 h 10 2 1 1 1 1 1 1 1 1 1 1 -2 0 1 1 1 1 0 0 1 0 0.0 0.10 -0.1 0.0
106 g 10 3 -5 -5 -5 -5 -5 -5 -5 -5 -5 2 13 2 0 -5 -5 -5 -5 -5 -5 -4 -3.1 -2.35 -1.1 0.0
107 h 10 3 2 2 2 2 2 2 2 2 2 -20 -10 -8 0 2 3 3 3 3 3 4 4.0 4.46 4.7 0.0
108 g 10 4 -2 -2 -2 -2 -2 -2 -2 -2 -2 -5 -4 -3 -1 -2 -1 -2 -2 -2 -2 -1 -0.5 -0.15 -0.2 0.0
109 h 10 4 6 6 6 6 6 6 6 6 6 -1 2 -2 2 6 4 4 6 6 6 5 4.9 4.76 4.4 0.0
110 g 10 5 6 6 6 6 6 6 6 6 6 -1 4 7 4 4 6 5 5 5 4 4 3.7 3.06 2.5 0.0
111 h 10 5 -4 -4 -4 -4 -4 -4 -4 -4 -4 -6 -3 -4 -5 -4 -4 -4 -4 -4 -4 -5 -5.9 -6.58 -7.2 0.0
112 g 10 6 4 4 4 4 4 4 4 4 4 8 12 4 6 4 4 4 3 3 3 2 1.0 0.29 -0.3 0.0
113 h 10 6 0 0 0 0 0 0 0 0 0 6 6 1 1 0 0 -1 0 0 0 -1 -1.2 -1.01 -1.0 0.0
114 g 10 7 0 0 0 0 0 0 0 0 0 -1 3 -2 1 0 1 1 1 1 1 2 2.0 2.06 2.2 0.0
115 h 10 7 -2 -2 -2 -2 -2 -2 -2 -1 -1 -4 -3 -3 -1 -2 -1 -1 -1 -1 -2 -2 -2.9 -3.47 -4.0 0.0
116 g 10 8 2 2 2 1 1 1 1 2 2 -3 2 6 -1 2 0 0 2 2 3 5 4.2 3.77 3.1 0.0
117 h 10 8 4 4 4 4 4 4 4 4 4 -2 6 7 6 3 3 3 4 4 3 1 0.2 -0.86 -2.0 0.0
118 g 10 9 2 2 2 2 3 3 3 3 3 5 10 -2 2 2 3 3 3 3 3 1 0.3 -0.21 -1.0 0.0
119 h 10 9 0 0 0 0 0 0 0 0 0 0 11 -1 0 0 1 1 0 0 -1 -2 -2.2 -2.31 -2.0 0.0
120 g 10 10 0 0 0 0 0 0 0 0 0 -2 3 0 0 0 -1 -1 0 0 0 0 -1.1 -2.09 -2.8 0.0
121 h 10 10 -6 -6 -6 -6 -6 -6 -6 -6 -6 -2 8 -3 -7 -6 -4 -5 -6 -6 -6 -7 -7.4 -7.93 -8.3 0.0
122 g 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.7 2.95 3.0 0.0
123 g 11 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.7 -1.60 -1.5 0.0
124 h 11 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0.26 0.1 0.0
125 g 11 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.9 -1.88 -2.1 0.0
126 h 11 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.3 1.44 1.7 0.0
127 g 11 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.5 1.44 1.6 0.0
128 h 11 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -0.77 -0.6 0.0
129 g 11 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1 -0.31 -0.5 0.0
130 h 11 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 -2.27 -1.8 0.0
131 g 11 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0.29 0.5 0.0
132 h 11 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0.90 0.9 0.0
133 g 11 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.7 -0.79 -0.8 0.0
134 h 11 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.7 -0.58 -0.4 0.0
135 g 11 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0.53 0.4 0.0
136 h 11 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.8 -2.69 -2.5 0.0
137 g 11 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.7 1.80 1.8 0.0
138 h 11 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -1.08 -1.3 0.0
139 g 11 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0.16 0.2 0.0
140 h 11 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.2 -1.58 -2.1 0.0
141 g 11 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.96 0.8 0.0
142 h 11 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.9 -1.90 -1.9 0.0
143 g 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4.0 3.99 3.8 0.0
144 h 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -1.39 -1.8 0.0
145 g 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 -2.15 -2.1 0.0
146 g 12 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.3 -0.29 -0.2 0.0
147 h 12 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.55 -0.8 0.0
148 g 12 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0.21 0.3 0.0
149 h 12 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.23 0.3 0.0
150 g 12 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0.89 1.0 0.0
151 h 12 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.5 2.38 2.2 0.0
152 g 12 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2 -0.38 -0.7 0.0
153 h 12 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 -2.63 -2.5 0.0
154 g 12 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0.96 0.9 0.0
155 h 12 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0.61 0.5 0.0
156 g 12 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.5 -0.30 -0.1 0.0
157 h 12 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.40 0.6 0.0
158 g 12 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.46 0.5 0.0
159 h 12 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0.01 0.0 0.0
160 g 12 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.3 -0.35 -0.4 0.0
161 h 12 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0.02 0.1 0.0
162 g 12 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.36 -0.4 0.0
163 h 12 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.28 0.3 0.0
164 g 12 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1 0.08 0.2 0.0
165 h 12 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -0.87 -0.9 0.0
166 g 12 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2 -0.49 -0.8 0.0
167 h 12 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.34 -0.2 0.0
168 g 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.08 0.0 0.0
169 h 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.8 0.88 0.8 0.0
170 g 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2 -0.16 -0.2 0.0
171 g 13 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -0.88 -0.9 0.0
172 h 13 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -0.76 -0.8 0.0
173 g 13 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.30 0.3 0.0
174 h 13 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0.33 0.3 0.0
175 g 13 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0.28 0.4 0.0
176 h 13 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.8 1.72 1.7 0.0
177 g 13 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.43 -0.4 0.0
178 h 13 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.54 -0.6 0.0
179 g 13 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.3 1.18 1.1 0.0
180 h 13 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.0 -1.07 -1.2 0.0
181 g 13 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.37 -0.3 0.0
182 h 13 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1 -0.04 -0.1 0.0
183 g 13 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0.75 0.8 0.0
184 h 13 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0.63 0.5 0.0
185 g 13 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4 -0.26 -0.2 0.0
186 h 13 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.21 0.1 0.0
187 g 13 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.35 0.4 0.0
188 h 13 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0.53 0.5 0.0
189 g 13 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1 -0.05 0.0 0.0
190 h 13 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.38 0.4 0.0
191 g 13 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0.41 0.4 0.0
192 h 13 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2 -0.22 -0.2 0.0
193 g 13 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 -0.10 -0.3 0.0
194 h 13 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.5 -0.57 -0.5 0.0
195 g 13 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 -0.18 -0.3 0.0
196 h 13 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.9 -0.82 -0.8 0.0
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -167,194 +167,6
167
167
168 </style>
168 </style>
169
169
170 <script>
171 $(document).ready(function() {
172
173 {% for beam in abs_beams %}
174 $( "#button-{{ forloop.counter }}" ).click(function() {
175
176 var antenna_upvalues = {{beam.antenna_upvalues}};
177 var antenna_downvalues = {{beam.antenna_downvalues}};
178
179 var table_up = document.getElementById('antenna_up');
180 var cells_up = table_up.getElementsByTagName('td');
181
182 var table_down = document.getElementById('antenna_down');
183 var cells_down = table_down.getElementsByTagName('td');
184
185 //TX Tables
186 var tx_upvalues = {{beam.get_tx.up}};
187 var tx_downvalues = {{beam.get_tx.down}};
188
189 var tabletx_up = document.getElementById('tx_up');
190 var cellstx_up = tabletx_up.getElementsByTagName('td');
191 var tabletx_down = document.getElementById('tx_down');
192 var cellstx_down = tabletx_down.getElementsByTagName('td');
193
194 //RX Tables
195 var rx_upvalues = {{beam.get_rx.up}};
196 var rx_downvalues = {{beam.get_rx.down}};
197
198 var tablerx_up = document.getElementById('rx_up');
199 var cellsrx_up = tablerx_up.getElementsByTagName('td');
200 var tablerx_down = document.getElementById('rx_down');
201 var cellsrx_down = tablerx_down.getElementsByTagName('td');
202
203 //alert(cells_down[51].textContent);
204 //alert(cells_up[51].textContent);
205
206 for (var i = 1, len = 17; i < len; i++) {
207 if ((i > 12) && (i<17)){
208 cells_up[i].innerHTML = antenna_upvalues[3][i-13].toFixed(1);
209 cells_down[i].innerHTML = antenna_downvalues[3][i-13].toFixed(1);
210 cellstx_up[i].innerHTML = tx_upvalues[3][i-13];
211 cellstx_down[i].innerHTML = tx_downvalues[3][i-13];
212 cellsrx_up[i].innerHTML = rx_upvalues[3][i-13];
213 cellsrx_down[i].innerHTML = rx_downvalues[3][i-13];
214 }
215 else if ((i > 8) && (i<13)){
216 cells_up[i].innerHTML = antenna_upvalues[2][i-9].toFixed(1);
217 cells_down[i].innerHTML = antenna_downvalues[2][i-9].toFixed(1);
218 cellstx_up[i].innerHTML = tx_upvalues[2][i-9];
219 cellstx_down[i].innerHTML = tx_downvalues[2][i-9];
220 cellsrx_up[i].innerHTML = rx_upvalues[2][i-9];
221 cellsrx_down[i].innerHTML = rx_downvalues[2][i-9];
222 }
223 else if ((i > 4) && (i<9)){
224 cells_up[i].innerHTML = antenna_upvalues[1][i-5].toFixed(1);
225 cells_down[i].innerHTML = antenna_downvalues[1][i-5].toFixed(1);
226 cellstx_up[i].innerHTML = tx_upvalues[1][i-5];
227 cellstx_down[i].innerHTML = tx_downvalues[1][i-5];
228 cellsrx_up[i].innerHTML = rx_upvalues[1][i-5];
229 cellsrx_down[i].innerHTML = rx_downvalues[1][i-5];
230 }
231 else if (i < 5) {
232 cells_up[i].innerHTML = antenna_upvalues[0][i-1].toFixed(1);
233 cells_down[i].innerHTML = antenna_downvalues[0][i-1].toFixed(1);
234 cellstx_up[i].innerHTML = tx_upvalues[0][i-1];
235 cellstx_down[i].innerHTML = tx_downvalues[0][i-1];
236 cellsrx_up[i].innerHTML = rx_upvalues[0][i-1];
237 cellsrx_down[i].innerHTML = rx_downvalues[0][i-1];
238 }
239 }
240
241 for (var i = 18, len = 34; i < len; i++) {
242 if ((i > 29) && (i<34)) {
243 cells_up[i].innerHTML = antenna_upvalues[3][i-26].toFixed(1);
244 cells_down[i].innerHTML = antenna_downvalues[3][i-26].toFixed(1);
245 cellstx_up[i].innerHTML = tx_upvalues[3][i-26];
246 cellstx_down[i].innerHTML = tx_downvalues[3][i-26];
247 cellsrx_up[i].innerHTML = rx_upvalues[3][i-26];
248 cellsrx_down[i].innerHTML = rx_downvalues[3][i-26];
249 }
250 if ((i > 25) && (i<30)) {
251 cells_up[i].innerHTML = antenna_upvalues[2][i-22].toFixed(1);
252 cells_down[i].innerHTML = antenna_downvalues[2][i-22].toFixed(1);
253 cellstx_up[i].innerHTML = tx_upvalues[2][i-22];
254 cellstx_down[i].innerHTML = tx_downvalues[2][i-22];
255 cellsrx_up[i].innerHTML = rx_upvalues[2][i-22];
256 cellsrx_down[i].innerHTML = rx_downvalues[2][i-22];
257 }
258 else if ((i > 21) && (i<26)) {
259 cells_up[i].innerHTML = antenna_upvalues[1][i-18].toFixed(1);
260 cells_down[i].innerHTML = antenna_downvalues[1][i-18].toFixed(1);
261 cellstx_up[i].innerHTML = tx_upvalues[1][i-18];
262 cellstx_down[i].innerHTML = tx_downvalues[1][i-18];
263 cellsrx_up[i].innerHTML = rx_upvalues[1][i-18];
264 cellsrx_down[i].innerHTML = rx_downvalues[1][i-18];
265 }
266 else if (i < 22) {
267 cells_up[i].innerHTML = antenna_upvalues[0][i-14].toFixed(1);
268 cells_down[i].innerHTML = antenna_downvalues[0][i-14].toFixed(1);
269 cellstx_up[i].innerHTML = tx_upvalues[0][i-14];
270 cellstx_down[i].innerHTML = tx_downvalues[0][i-14];
271 cellsrx_up[i].innerHTML = rx_upvalues[0][i-14];
272 cellsrx_down[i].innerHTML = rx_downvalues[0][i-14];
273 }
274 }
275
276 for (var i = 35, len = 51; i < len; i++) {
277 if ((i > 46) && (i<51)) {
278 cells_up[i].innerHTML = antenna_upvalues[7][i-47].toFixed(1);
279 cells_down[i].innerHTML = antenna_downvalues[7][i-47].toFixed(1);
280 cellstx_up[i].innerHTML = tx_upvalues[7][i-47];
281 cellstx_down[i].innerHTML = tx_downvalues[7][i-47];
282 cellsrx_up[i].innerHTML = rx_upvalues[7][i-47];
283 cellsrx_down[i].innerHTML = rx_downvalues[7][i-47];
284 }
285 else if ((i > 42) && (i<47)) {
286 cells_up[i].innerHTML = antenna_upvalues[6][i-43].toFixed(1);
287 cells_down[i].innerHTML = antenna_downvalues[6][i-43].toFixed(1);
288 cellstx_up[i].innerHTML = tx_upvalues[6][i-43];
289 cellstx_down[i].innerHTML = tx_downvalues[6][i-43];
290 cellsrx_up[i].innerHTML = rx_upvalues[6][i-43];
291 cellsrx_down[i].innerHTML = rx_downvalues[6][i-43];
292 }
293 else if ((i > 38) && (i<43)) {
294 cells_up[i].innerHTML = antenna_upvalues[5][i-39].toFixed(1);
295 cells_down[i].innerHTML = antenna_downvalues[5][i-39].toFixed(1);
296 cellstx_up[i].innerHTML = tx_upvalues[5][i-39];
297 cellstx_down[i].innerHTML = tx_downvalues[5][i-39];
298 cellsrx_up[i].innerHTML = rx_upvalues[5][i-39];
299 cellsrx_down[i].innerHTML = rx_downvalues[5][i-39];
300 }
301 else if (i < 39) {
302 cells_up[i].innerHTML = antenna_upvalues[4][i-35].toFixed(1);
303 cells_down[i].innerHTML = antenna_downvalues[4][i-35].toFixed(1);
304 cellstx_up[i].innerHTML = tx_upvalues[4][i-35];
305 cellstx_down[i].innerHTML = tx_downvalues[4][i-35];
306 cellsrx_up[i].innerHTML = rx_upvalues[4][i-35];
307 cellsrx_down[i].innerHTML = rx_downvalues[4][i-35];
308 }
309 }
310
311 for (var i = 52, len = 68; i < len; i++) {
312 if ((i > 63) && (i<68)) {
313 cells_up[i].innerHTML = antenna_upvalues[7][i-60].toFixed(1);
314 cells_down[i].innerHTML = antenna_downvalues[7][i-60].toFixed(1);
315 cellstx_up[i].innerHTML = tx_upvalues[7][i-60];
316 cellstx_down[i].innerHTML = tx_downvalues[7][i-60];
317 cellsrx_up[i].innerHTML = rx_upvalues[7][i-60];
318 cellsrx_down[i].innerHTML = rx_downvalues[7][i-60];
319 }
320 else if ((i > 59) && (i<64)) {
321 cells_up[i].innerHTML = antenna_upvalues[6][i-56].toFixed(1);
322 cells_down[i].innerHTML = antenna_downvalues[6][i-56].toFixed(1);
323 cellstx_up[i].innerHTML = tx_upvalues[6][i-56];
324 cellstx_down[i].innerHTML = tx_downvalues[6][i-56];
325 cellsrx_up[i].innerHTML = rx_upvalues[6][i-56];
326 cellsrx_down[i].innerHTML = rx_downvalues[6][i-56];
327 }
328 else if ((i > 55) && (i<60)) {
329 cells_up[i].innerHTML = antenna_upvalues[5][i-52].toFixed(1);
330 cells_down[i].innerHTML = antenna_downvalues[5][i-52].toFixed(1);
331 cellstx_up[i].innerHTML = tx_upvalues[5][i-52];
332 cellstx_down[i].innerHTML = tx_downvalues[5][i-52];
333 cellsrx_up[i].innerHTML = rx_upvalues[5][i-52];
334 cellsrx_down[i].innerHTML = rx_downvalues[5][i-52];
335 }
336 else if (i < 56) {
337 cells_up[i].innerHTML = antenna_upvalues[4][i-48].toFixed(1);
338 cells_down[i].innerHTML = antenna_downvalues[4][i-48].toFixed(1);
339 cellstx_up[i].innerHTML = tx_upvalues[4][i-48];
340 cellstx_down[i].innerHTML = tx_downvalues[4][i-48];
341 cellsrx_up[i].innerHTML = rx_upvalues[4][i-48];
342 cellsrx_down[i].innerHTML = rx_downvalues[4][i-48];
343 }
344 }
345
346 var up_ues = document.getElementById('up_ues');
347 up_ues.innerHTML = "{{beam.get_up_ues}}";
348 var down_ues = document.getElementById('down_ues');
349 down_ues.innerHTML = "{{beam.get_down_ues}}";
350
351 });
352
353 {% endfor %}
354
355 });
356 </script>
357
358
170
359 <div id="UP" class="panel-group">
171 <div id="UP" class="panel-group">
360 <div class="panel panel-default">
172 <div class="panel panel-default">
@@ -367,68 +179,36 $(document).ready(function() {
367 <tr>
179 <tr>
368 <td> North Quarter
180 <td> North Quarter
369 <table class="north_quarter">
181 <table class="north_quarter">
370 <tr>
182 <tr> <td>{{beam.get_upvalues.0}}</td> <td>{{beam.get_upvalues.1}}</td> <td>{{beam.get_upvalues.2}}</td> <td>{{beam.get_upvalues.3}}</td> </tr>
371 <td>{{abs_beams.0.get_upvalues.0}}</td> <td>{{abs_beams.0.get_upvalues.1}}</td> <td>{{abs_beams.0.get_upvalues.2}}</td> <td>{{abs_beams.0.get_upvalues.3}}</td>
183 <tr> <td>{{beam.get_upvalues.8}}</td> <td>{{beam.get_upvalues.9}}</td> <td>{{beam.get_upvalues.10}}</td> <td>{{beam.get_upvalues.11}}</td> </tr>
372 </tr>
184 <tr> <td>{{beam.get_upvalues.16}}</td> <td>{{beam.get_upvalues.17}}</td> <td>{{beam.get_upvalues.18}}</td> <td>{{beam.get_upvalues.19}}</td> </tr>
373 <tr>
185 <tr> <td>{{beam.get_upvalues.24}}</td> <td>{{beam.get_upvalues.25}}</td> <td>{{beam.get_upvalues.26}}</td> <td>{{beam.get_upvalues.27}}</td> </tr>
374 <td>{{abs_beams.0.get_upvalues.8}}</td> <td>{{abs_beams.0.get_upvalues.9}}</td> <td>{{abs_beams.0.get_upvalues.10}}</td> <td>{{abs_beams.0.get_upvalues.11}}</td>
375 </tr>
376 <tr>
377 <td>{{abs_beams.0.get_upvalues.16}}</td> <td>{{abs_beams.0.get_upvalues.17}}</td> <td>{{abs_beams.0.get_upvalues.18}}</td> <td>{{abs_beams.0.get_upvalues.19}}</td>
378 </tr>
379 <tr>
380 <td>{{abs_beams.0.get_upvalues.24}}</td> <td>{{abs_beams.0.get_upvalues.25}}</td> <td>{{abs_beams.0.get_upvalues.26}}</td> <td>{{abs_beams.0.get_upvalues.27}}</td>
381 </tr>
382 </table>
186 </table>
383 </td>
187 </td>
384 <td> East Quarter
188 <td> East Quarter
385 <table class="east_quarter">
189 <table class="east_quarter">
386 <tr>
190 <tr> <td>{{beam.get_upvalues.4}}</td> <td>{{beam.get_upvalues.5}}</td> <td>{{beam.get_upvalues.6}}</td> <td>{{beam.get_upvalues.7}}</td> </tr>
387 <td>{{abs_beams.0.get_upvalues.4}}</td> <td>{{abs_beams.0.get_upvalues.5}}</td> <td>{{abs_beams.0.get_upvalues.6}}</td> <td>{{abs_beams.0.get_upvalues.7}}</td>
191 <tr> <td>{{beam.get_upvalues.12}}</td> <td>{{beam.get_upvalues.13}}</td> <td>{{beam.get_upvalues.14}}</td> <td>{{beam.get_upvalues.15}}</td> </tr>
388 </tr>
192 <tr> <td>{{beam.get_upvalues.20}}</td> <td>{{beam.get_upvalues.21}}</td> <td>{{beam.get_upvalues.22}}</td> <td>{{beam.get_upvalues.23}}</td> </tr>
389 <tr>
193 <tr> <td>{{beam.get_upvalues.28}}</td> <td>{{beam.get_upvalues.29}}</td> <td>{{beam.get_upvalues.30}}</td> <td>{{beam.get_upvalues.31}}</td> </tr>
390 <td>{{abs_beams.0.get_upvalues.12}}</td> <td>{{abs_beams.0.get_upvalues.13}}</td> <td>{{abs_beams.0.get_upvalues.14}}</td> <td>{{abs_beams.0.get_upvalues.15}}</td>
391 </tr>
392 <tr>
393 <td>{{abs_beams.0.get_upvalues.20}}</td> <td>{{abs_beams.0.get_upvalues.21}}</td> <td>{{abs_beams.0.get_upvalues.22}}</td> <td>{{abs_beams.0.get_upvalues.23}}</td>
394 </tr>
395 <tr>
396 <td>{{abs_beams.0.get_upvalues.28}}</td> <td>{{abs_beams.0.get_upvalues.29}}</td> <td>{{abs_beams.0.get_upvalues.30}}</td> <td>{{abs_beams.0.get_upvalues.31}}</td>
397 </tr>
398 </table>
194 </table>
399 </td>
195 </td>
400 </tr>
196 </tr>
401 <tr>
197 <tr>
402 <td> West Quarter
198 <td> West Quarter
403 <table class="west_quarter">
199 <table class="west_quarter">
404 <tr>
200 <tr> <td>{{beam.get_upvalues.32}}</td> <td>{{beam.get_upvalues.33}}</td> <td>{{beam.get_upvalues.34}}</td> <td>{{beam.get_upvalues.35}}</td> </tr>
405 <td>{{abs_beams.0.get_upvalues.32}}</td> <td>{{abs_beams.0.get_upvalues.33}}</td> <td>{{abs_beams.0.get_upvalues.34}}</td> <td>{{abs_beams.0.get_upvalues.35}}</td>
201 <tr> <td>{{beam.get_upvalues.40}}</td> <td>{{beam.get_upvalues.41}}</td> <td>{{beam.get_upvalues.42}}</td> <td>{{beam.get_upvalues.43}}</td> </tr>
406 </tr>
202 <tr> <td>{{beam.get_upvalues.48}}</td> <td>{{beam.get_upvalues.49}}</td> <td>{{beam.get_upvalues.50}}</td> <td>{{beam.get_upvalues.51}}</td> </tr>
407 <tr>
203 <tr> <td>{{beam.get_upvalues.56}}</td> <td>{{beam.get_upvalues.57}}</td> <td>{{beam.get_upvalues.58}}</td> <td>{{beam.get_upvalues.59}}</td> </tr>
408 <td>{{abs_beams.0.get_upvalues.40}}</td> <td>{{abs_beams.0.get_upvalues.41}}</td> <td>{{abs_beams.0.get_upvalues.42}}</td> <td>{{abs_beams.0.get_upvalues.43}}</td>
409 </tr>
410 <tr>
411 <td>{{abs_beams.0.get_upvalues.48}}</td> <td>{{abs_beams.0.get_upvalues.49}}</td> <td>{{abs_beams.0.get_upvalues.50}}</td> <td>{{abs_beams.0.get_upvalues.51}}</td>
412 </tr>
413 <tr>
414 <td>{{abs_beams.0.get_upvalues.56}}</td> <td>{{abs_beams.0.get_upvalues.57}}</td> <td>{{abs_beams.0.get_upvalues.58}}</td> <td>{{abs_beams.0.get_upvalues.59}}</td>
415 </tr>
416 </table>
204 </table>
417 </td>
205 </td>
418 <td> South Quarter
206 <td> South Quarter
419 <table class="south_quarter">
207 <table class="south_quarter">
420 <tr>
208 <tr> <td>{{beam.get_upvalues.36}}</td> <td>{{beam.get_upvalues.37}}</td> <td>{{beam.get_upvalues.38}}</td> <td>{{beam.get_upvalues.39}}</td> </tr>
421 <td>{{abs_beams.0.get_upvalues.36}}</td> <td>{{abs_beams.0.get_upvalues.37}}</td> <td>{{abs_beams.0.get_upvalues.38}}</td> <td>{{abs_beams.0.get_upvalues.39}}</td>
209 <tr> <td>{{beam.get_upvalues.44}}</td> <td>{{beam.get_upvalues.45}}</td> <td>{{beam.get_upvalues.46}}</td> <td>{{beam.get_upvalues.47}}</td> </tr>
422 </tr>
210 <tr> <td>{{beam.get_upvalues.52}}</td> <td>{{beam.get_upvalues.53}}</td> <td>{{beam.get_upvalues.54}}</td> <td>{{beam.get_upvalues.55}}</td> </tr>
423 <tr>
211 <tr> <td>{{beam.get_upvalues.60}}</td> <td>{{beam.get_upvalues.61}}</td> <td>{{beam.get_upvalues.62}}</td> <td>{{beam.get_upvalues.63}}</td> </tr>
424 <td>{{abs_beams.0.get_upvalues.44}}</td> <td>{{abs_beams.0.get_upvalues.45}}</td> <td>{{abs_beams.0.get_upvalues.46}}</td> <td>{{abs_beams.0.get_upvalues.47}}</td>
425 </tr>
426 <tr>
427 <td>{{abs_beams.0.get_upvalues.52}}</td> <td>{{abs_beams.0.get_upvalues.53}}</td> <td>{{abs_beams.0.get_upvalues.54}}</td> <td>{{abs_beams.0.get_upvalues.55}}</td>
428 </tr>
429 <tr>
430 <td>{{abs_beams.0.get_upvalues.60}}</td> <td>{{abs_beams.0.get_upvalues.61}}</td> <td>{{abs_beams.0.get_upvalues.62}}</td> <td>{{abs_beams.0.get_upvalues.63}}</td>
431 </tr>
432 </table>
212 </table>
433 </td>
213 </td>
434 </tr>
214 </tr>
@@ -446,32 +226,32 $(document).ready(function() {
446 <td> North Quarter
226 <td> North Quarter
447 <table align="center" class="north_quarter">
227 <table align="center" class="north_quarter">
448 <tr>
228 <tr>
449 <td>{{abs_beams.0.get_tx.up.0.0}}</td> <td>{{abs_beams.0.get_tx.up.0.1}}</td> <td>{{abs_beams.0.get_tx.up.0.2}}</td> <td>{{abs_beams.0.get_tx.up.0.3}}</td>
229 <td>{{beam.get_tx.up.0.0}}</td> <td>{{beam.get_tx.up.0.1}}</td> <td>{{beam.get_tx.up.0.2}}</td> <td>{{beam.get_tx.up.0.3}}</td>
450 </tr>
230 </tr>
451 <tr>
231 <tr>
452 <td>{{abs_beams.0.get_tx.up.1.0}}</td> <td>{{abs_beams.0.get_tx.up.1.1}}</td> <td>{{abs_beams.0.get_tx.up.1.2}}</td> <td>{{abs_beams.0.get_tx.up.1.3}}</td>
232 <td>{{beam.get_tx.up.1.0}}</td> <td>{{beam.get_tx.up.1.1}}</td> <td>{{beam.get_tx.up.1.2}}</td> <td>{{beam.get_tx.up.1.3}}</td>
453 </tr>
233 </tr>
454 <tr>
234 <tr>
455 <td>{{abs_beams.0.get_tx.up.2.0}}</td> <td>{{abs_beams.0.get_tx.up.2.1}}</td> <td>{{abs_beams.0.get_tx.up.2.2}}</td> <td>{{abs_beams.0.get_tx.up.2.3}}</td>
235 <td>{{beam.get_tx.up.2.0}}</td> <td>{{beam.get_tx.up.2.1}}</td> <td>{{beam.get_tx.up.2.2}}</td> <td>{{beam.get_tx.up.2.3}}</td>
456 </tr>
236 </tr>
457 <tr>
237 <tr>
458 <td>{{abs_beams.0.get_tx.up.3.0}}</td> <td>{{abs_beams.0.get_tx.up.3.1}}</td> <td>{{abs_beams.0.get_tx.up.3.2}}</td> <td>{{abs_beams.0.get_tx.up.3.3}}</td>
238 <td>{{beam.get_tx.up.3.0}}</td> <td>{{beam.get_tx.up.3.1}}</td> <td>{{beam.get_tx.up.3.2}}</td> <td>{{beam.get_tx.up.3.3}}</td>
459 </tr>
239 </tr>
460 </table>
240 </table>
461 </td>
241 </td>
462 <td> East Quarter
242 <td> East Quarter
463 <table align="center" class="east_quarter">
243 <table align="center" class="east_quarter">
464 <tr>
244 <tr>
465 <td>{{abs_beams.0.get_tx.up.0.4}}</td> <td>{{abs_beams.0.get_tx.up.0.5}}</td> <td>{{abs_beams.0.get_tx.up.0.6}}</td> <td>{{abs_beams.0.get_tx.up.0.7}}</td>
245 <td>{{beam.get_tx.up.0.4}}</td> <td>{{beam.get_tx.up.0.5}}</td> <td>{{beam.get_tx.up.0.6}}</td> <td>{{beam.get_tx.up.0.7}}</td>
466 </tr>
246 </tr>
467 <tr>
247 <tr>
468 <td>{{abs_beams.0.get_tx.up.1.4}}</td> <td>{{abs_beams.0.get_tx.up.1.5}}</td> <td>{{abs_beams.0.get_tx.up.1.6}}</td> <td>{{abs_beams.0.get_tx.up.1.7}}</td>
248 <td>{{beam.get_tx.up.1.4}}</td> <td>{{beam.get_tx.up.1.5}}</td> <td>{{beam.get_tx.up.1.6}}</td> <td>{{beam.get_tx.up.1.7}}</td>
469 </tr>
249 </tr>
470 <tr>
250 <tr>
471 <td>{{abs_beams.0.get_tx.up.2.4}}</td> <td>{{abs_beams.0.get_tx.up.2.5}}</td> <td>{{abs_beams.0.get_tx.up.2.6}}</td> <td>{{abs_beams.0.get_tx.up.2.7}}</td>
251 <td>{{beam.get_tx.up.2.4}}</td> <td>{{beam.get_tx.up.2.5}}</td> <td>{{beam.get_tx.up.2.6}}</td> <td>{{beam.get_tx.up.2.7}}</td>
472 </tr>
252 </tr>
473 <tr>
253 <tr>
474 <td>{{abs_beams.0.get_tx.up.3.4}}</td> <td>{{abs_beams.0.get_tx.up.3.5}}</td> <td>{{abs_beams.0.get_tx.up.3.6}}</td> <td>{{abs_beams.0.get_tx.up.3.7}}</td>
254 <td>{{beam.get_tx.up.3.4}}</td> <td>{{beam.get_tx.up.3.5}}</td> <td>{{beam.get_tx.up.3.6}}</td> <td>{{beam.get_tx.up.3.7}}</td>
475 </tr>
255 </tr>
476 </table>
256 </table>
477 </td>
257 </td>
@@ -480,32 +260,32 $(document).ready(function() {
480 <td> West Quarter
260 <td> West Quarter
481 <table align="center" class="west_quarter">
261 <table align="center" class="west_quarter">
482 <tr>
262 <tr>
483 <td>{{abs_beams.0.get_tx.up.4.0}}</td> <td>{{abs_beams.0.get_tx.up.4.1}}</td> <td>{{abs_beams.0.get_tx.up.4.2}}</td> <td>{{abs_beams.0.get_tx.up.4.3}}</td>
263 <td>{{beam.get_tx.up.4.0}}</td> <td>{{beam.get_tx.up.4.1}}</td> <td>{{beam.get_tx.up.4.2}}</td> <td>{{beam.get_tx.up.4.3}}</td>
484 </tr>
264 </tr>
485 <tr>
265 <tr>
486 <td>{{abs_beams.0.get_tx.up.5.0}}</td> <td>{{abs_beams.0.get_tx.up.5.1}}</td> <td>{{abs_beams.0.get_tx.up.5.2}}</td> <td>{{abs_beams.0.get_tx.up.5.3}}</td>
266 <td>{{beam.get_tx.up.5.0}}</td> <td>{{beam.get_tx.up.5.1}}</td> <td>{{beam.get_tx.up.5.2}}</td> <td>{{beam.get_tx.up.5.3}}</td>
487 </tr>
267 </tr>
488 <tr>
268 <tr>
489 <td>{{abs_beams.0.get_tx.up.6.0}}</td> <td>{{abs_beams.0.get_tx.up.6.1}}</td> <td>{{abs_beams.0.get_tx.up.6.2}}</td> <td>{{abs_beams.0.get_tx.up.6.3}}</td>
269 <td>{{beam.get_tx.up.6.0}}</td> <td>{{beam.get_tx.up.6.1}}</td> <td>{{beam.get_tx.up.6.2}}</td> <td>{{beam.get_tx.up.6.3}}</td>
490 </tr>
270 </tr>
491 <tr>
271 <tr>
492 <td>{{abs_beams.0.get_tx.up.7.0}}</td> <td>{{abs_beams.0.get_tx.up.7.1}}</td> <td>{{abs_beams.0.get_tx.up.7.2}}</td> <td>{{abs_beams.0.get_tx.up.7.3}}</td>
272 <td>{{beam.get_tx.up.7.0}}</td> <td>{{beam.get_tx.up.7.1}}</td> <td>{{beam.get_tx.up.7.2}}</td> <td>{{beam.get_tx.up.7.3}}</td>
493 </tr>
273 </tr>
494 </table>
274 </table>
495 </td>
275 </td>
496 <td> South Quarter
276 <td> South Quarter
497 <table align="center" class="south_quarter">
277 <table align="center" class="south_quarter">
498 <tr>
278 <tr>
499 <td>{{abs_beams.0.get_tx.up.4.4}}</td> <td>{{abs_beams.0.get_tx.up.4.5}}</td> <td>{{abs_beams.0.get_tx.up.4.6}}</td> <td>{{abs_beams.0.get_tx.up.4.7}}</td>
279 <td>{{beam.get_tx.up.4.4}}</td> <td>{{beam.get_tx.up.4.5}}</td> <td>{{beam.get_tx.up.4.6}}</td> <td>{{beam.get_tx.up.4.7}}</td>
500 </tr>
280 </tr>
501 <tr>
281 <tr>
502 <td>{{abs_beams.0.get_tx.up.5.4}}</td> <td>{{abs_beams.0.get_tx.up.5.5}}</td> <td>{{abs_beams.0.get_tx.up.5.6}}</td> <td>{{abs_beams.0.get_tx.up.5.7}}</td>
282 <td>{{beam.get_tx.up.5.4}}</td> <td>{{beam.get_tx.up.5.5}}</td> <td>{{beam.get_tx.up.5.6}}</td> <td>{{beam.get_tx.up.5.7}}</td>
503 </tr>
283 </tr>
504 <tr>
284 <tr>
505 <td>{{abs_beams.0.get_tx.up.6.4}}</td> <td>{{abs_beams.0.get_tx.up.6.5}}</td> <td>{{abs_beams.0.get_tx.up.6.6}}</td> <td>{{abs_beams.0.get_tx.up.6.7}}</td>
285 <td>{{beam.get_tx.up.6.4}}</td> <td>{{beam.get_tx.up.6.5}}</td> <td>{{beam.get_tx.up.6.6}}</td> <td>{{beam.get_tx.up.6.7}}</td>
506 </tr>
286 </tr>
507 <tr>
287 <tr>
508 <td>{{abs_beams.0.get_tx.up.7.4}}</td> <td>{{abs_beams.0.get_tx.up.7.5}}</td> <td>{{abs_beams.0.get_tx.up.7.6}}</td> <td>{{abs_beams.0.get_tx.up.7.7}}</td>
288 <td>{{beam.get_tx.up.7.4}}</td> <td>{{beam.get_tx.up.7.5}}</td> <td>{{beam.get_tx.up.7.6}}</td> <td>{{beam.get_tx.up.7.7}}</td>
509 </tr>
289 </tr>
510 </table>
290 </table>
511 </td>
291 </td>
@@ -524,32 +304,32 $(document).ready(function() {
524 <td> North Quarter
304 <td> North Quarter
525 <table align="center" class="north_quarter">
305 <table align="center" class="north_quarter">
526 <tr>
306 <tr>
527 <td>{{abs_beams.0.get_rx.up.0.0}}</td> <td>{{abs_beams.0.get_rx.up.0.1}}</td> <td>{{abs_beams.0.get_rx.up.0.2}}</td> <td>{{abs_beams.0.get_rx.up.0.3}}</td>
307 <td>{{beam.get_rx.up.0.0}}</td> <td>{{beam.get_rx.up.0.1}}</td> <td>{{beam.get_rx.up.0.2}}</td> <td>{{beam.get_rx.up.0.3}}</td>
528 </tr>
308 </tr>
529 <tr>
309 <tr>
530 <td>{{abs_beams.0.get_rx.up.1.0}}</td> <td>{{abs_beams.0.get_rx.up.1.1}}</td> <td>{{abs_beams.0.get_rx.up.1.2}}</td> <td>{{abs_beams.0.get_rx.up.1.3}}</td>
310 <td>{{beam.get_rx.up.1.0}}</td> <td>{{beam.get_rx.up.1.1}}</td> <td>{{beam.get_rx.up.1.2}}</td> <td>{{beam.get_rx.up.1.3}}</td>
531 </tr>
311 </tr>
532 <tr>
312 <tr>
533 <td>{{abs_beams.0.get_rx.up.2.0}}</td> <td>{{abs_beams.0.get_rx.up.2.1}}</td> <td>{{abs_beams.0.get_rx.up.2.2}}</td> <td>{{abs_beams.0.get_rx.up.2.3}}</td>
313 <td>{{beam.get_rx.up.2.0}}</td> <td>{{beam.get_rx.up.2.1}}</td> <td>{{beam.get_rx.up.2.2}}</td> <td>{{beam.get_rx.up.2.3}}</td>
534 </tr>
314 </tr>
535 <tr>
315 <tr>
536 <td>{{abs_beams.0.get_rx.up.3.0}}</td> <td>{{abs_beams.0.get_rx.up.3.1}}</td> <td>{{abs_beams.0.get_rx.up.3.2}}</td> <td>{{abs_beams.0.get_rx.up.3.3}}</td>
316 <td>{{beam.get_rx.up.3.0}}</td> <td>{{beam.get_rx.up.3.1}}</td> <td>{{beam.get_rx.up.3.2}}</td> <td>{{beam.get_rx.up.3.3}}</td>
537 </tr>
317 </tr>
538 </table>
318 </table>
539 </td>
319 </td>
540 <td> East Quarter
320 <td> East Quarter
541 <table align="center" class="east_quarter">
321 <table align="center" class="east_quarter">
542 <tr>
322 <tr>
543 <td>{{abs_beams.0.get_rx.up.0.4}}</td> <td>{{abs_beams.0.get_rx.up.0.5}}</td> <td>{{abs_beams.0.get_rx.up.0.6}}</td> <td>{{abs_beams.0.get_rx.up.0.7}}</td>
323 <td>{{beam.get_rx.up.0.4}}</td> <td>{{beam.get_rx.up.0.5}}</td> <td>{{beam.get_rx.up.0.6}}</td> <td>{{beam.get_rx.up.0.7}}</td>
544 </tr>
324 </tr>
545 <tr>
325 <tr>
546 <td>{{abs_beams.0.get_rx.up.1.4}}</td> <td>{{abs_beams.0.get_rx.up.1.5}}</td> <td>{{abs_beams.0.get_rx.up.1.6}}</td> <td>{{abs_beams.0.get_rx.up.1.7}}</td>
326 <td>{{beam.get_rx.up.1.4}}</td> <td>{{beam.get_rx.up.1.5}}</td> <td>{{beam.get_rx.up.1.6}}</td> <td>{{beam.get_rx.up.1.7}}</td>
547 </tr>
327 </tr>
548 <tr>
328 <tr>
549 <td>{{abs_beams.0.get_rx.up.2.4}}</td> <td>{{abs_beams.0.get_rx.up.2.5}}</td> <td>{{abs_beams.0.get_rx.up.2.6}}</td> <td>{{abs_beams.0.get_rx.up.2.7}}</td>
329 <td>{{beam.get_rx.up.2.4}}</td> <td>{{beam.get_rx.up.2.5}}</td> <td>{{beam.get_rx.up.2.6}}</td> <td>{{beam.get_rx.up.2.7}}</td>
550 </tr>
330 </tr>
551 <tr>
331 <tr>
552 <td>{{abs_beams.0.get_rx.up.3.4}}</td> <td>{{abs_beams.0.get_rx.up.3.5}}</td> <td>{{abs_beams.0.get_rx.up.3.6}}</td> <td>{{abs_beams.0.get_rx.up.3.7}}</td>
332 <td>{{beam.get_rx.up.3.4}}</td> <td>{{beam.get_rx.up.3.5}}</td> <td>{{beam.get_rx.up.3.6}}</td> <td>{{beam.get_rx.up.3.7}}</td>
553 </tr>
333 </tr>
554 </table>
334 </table>
555 </td>
335 </td>
@@ -558,32 +338,32 $(document).ready(function() {
558 <td> West Quarter
338 <td> West Quarter
559 <table align="center" class="west_quarter">
339 <table align="center" class="west_quarter">
560 <tr>
340 <tr>
561 <td>{{abs_beams.0.get_rx.up.4.0}}</td> <td>{{abs_beams.0.get_rx.up.4.1}}</td> <td>{{abs_beams.0.get_rx.up.4.2}}</td> <td>{{abs_beams.0.get_rx.up.4.3}}</td>
341 <td>{{beam.get_rx.up.4.0}}</td> <td>{{beam.get_rx.up.4.1}}</td> <td>{{beam.get_rx.up.4.2}}</td> <td>{{beam.get_rx.up.4.3}}</td>
562 </tr>
342 </tr>
563 <tr>
343 <tr>
564 <td>{{abs_beams.0.get_rx.up.5.0}}</td> <td>{{abs_beams.0.get_rx.up.5.1}}</td> <td>{{abs_beams.0.get_rx.up.5.2}}</td> <td>{{abs_beams.0.get_rx.up.5.3}}</td>
344 <td>{{beam.get_rx.up.5.0}}</td> <td>{{beam.get_rx.up.5.1}}</td> <td>{{beam.get_rx.up.5.2}}</td> <td>{{beam.get_rx.up.5.3}}</td>
565 </tr>
345 </tr>
566 <tr>
346 <tr>
567 <td>{{abs_beams.0.get_rx.up.6.0}}</td> <td>{{abs_beams.0.get_rx.up.6.1}}</td> <td>{{abs_beams.0.get_rx.up.6.2}}</td> <td>{{abs_beams.0.get_rx.up.6.3}}</td>
347 <td>{{beam.get_rx.up.6.0}}</td> <td>{{beam.get_rx.up.6.1}}</td> <td>{{beam.get_rx.up.6.2}}</td> <td>{{beam.get_rx.up.6.3}}</td>
568 </tr>
348 </tr>
569 <tr>
349 <tr>
570 <td>{{abs_beams.0.get_rx.up.7.0}}</td> <td>{{abs_beams.0.get_rx.up.7.1}}</td> <td>{{abs_beams.0.get_rx.up.7.2}}</td> <td>{{abs_beams.0.get_rx.up.7.3}}</td>
350 <td>{{beam.get_rx.up.7.0}}</td> <td>{{beam.get_rx.up.7.1}}</td> <td>{{beam.get_rx.up.7.2}}</td> <td>{{beam.get_rx.up.7.3}}</td>
571 </tr>
351 </tr>
572 </table>
352 </table>
573 </td>
353 </td>
574 <td> South Quarter
354 <td> South Quarter
575 <table align="center" class="south_quarter">
355 <table align="center" class="south_quarter">
576 <tr>
356 <tr>
577 <td>{{abs_beams.0.get_rx.up.4.4}}</td> <td>{{abs_beams.0.get_rx.up.4.5}}</td> <td>{{abs_beams.0.get_rx.up.4.6}}</td> <td>{{abs_beams.0.get_rx.up.4.7}}</td>
357 <td>{{beam.get_rx.up.4.4}}</td> <td>{{beam.get_rx.up.4.5}}</td> <td>{{beam.get_rx.up.4.6}}</td> <td>{{beam.get_rx.up.4.7}}</td>
578 </tr>
358 </tr>
579 <tr>
359 <tr>
580 <td>{{abs_beams.0.get_rx.up.5.4}}</td> <td>{{abs_beams.0.get_rx.up.5.5}}</td> <td>{{abs_beams.0.get_rx.up.5.6}}</td> <td>{{abs_beams.0.get_rx.up.5.7}}</td>
360 <td>{{beam.get_rx.up.5.4}}</td> <td>{{beam.get_rx.up.5.5}}</td> <td>{{beam.get_rx.up.5.6}}</td> <td>{{beam.get_rx.up.5.7}}</td>
581 </tr>
361 </tr>
582 <tr>
362 <tr>
583 <td>{{abs_beams.0.get_rx.up.6.4}}</td> <td>{{abs_beams.0.get_rx.up.6.5}}</td> <td>{{abs_beams.0.get_rx.up.6.6}}</td> <td>{{abs_beams.0.get_rx.up.6.7}}</td>
363 <td>{{beam.get_rx.up.6.4}}</td> <td>{{beam.get_rx.up.6.5}}</td> <td>{{beam.get_rx.up.6.6}}</td> <td>{{beam.get_rx.up.6.7}}</td>
584 </tr>
364 </tr>
585 <tr>
365 <tr>
586 <td>{{abs_beams.0.get_rx.up.7.4}}</td> <td>{{abs_beams.0.get_rx.up.7.5}}</td> <td>{{abs_beams.0.get_rx.up.7.6}}</td> <td>{{abs_beams.0.get_rx.up.7.7}}</td>
366 <td>{{beam.get_rx.up.7.4}}</td> <td>{{beam.get_rx.up.7.5}}</td> <td>{{beam.get_rx.up.7.6}}</td> <td>{{beam.get_rx.up.7.7}}</td>
587 </tr>
367 </tr>
588 </table>
368 </table>
589 </td>
369 </td>
@@ -594,17 +374,17 $(document).ready(function() {
594 </table>
374 </table>
595
375
596 {% if not edit %}
376 {% if not edit %}
597 {% include "abs_pattern_img.html" %}
377 {% include "abs_uppattern_img.html" %}
598 {% endif %}
378 {% endif %}
599
379
600 <br>
380 <br>
601
381
602 <div id="up_ues" style="display: inline-block">
382 <div id="up_ues" style="display: inline-block">
603 Ues: {{abs_beams.0.get_up_ues}}
383 Ues: {{beam.get_up_ues}}
604 </div>
384 </div>
605
385
606 <div style="margin-left: 70px; display: inline-block">
386 <div style="margin-left: 70px; display: inline-block">
607 <input type="checkbox" id="up_onlyrx" {% if abs_beams.0.get_up_onlyrx == True %} checked="True" {% endif %} disabled>
387 <input type="checkbox" id="up_onlyrx" {% if beam.get_up_onlyrx == True %} checked="True" {% endif %} disabled>
608 Only RX
388 Only RX
609 </input>
389 </input>
610 </div>
390 </div>
@@ -624,68 +404,36 $(document).ready(function() {
624 <tr>
404 <tr>
625 <td> <b>North Quarter</b>
405 <td> <b>North Quarter</b>
626 <table class="north_quarter">
406 <table class="north_quarter">
627 <tr>
407 <tr> <td>{{beam.get_downvalues.0}}</td> <td>{{beam.get_downvalues.1}}</td> <td>{{beam.get_downvalues.2}}</td> <td>{{beam.get_downvalues.3}}</td> </tr>
628 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
408 <tr> <td>{{beam.get_downvalues.8}}</td> <td>{{beam.get_downvalues.9}}</td> <td>{{beam.get_downvalues.10}}</td> <td>{{beam.get_downvalues.11}}</td> </tr>
629 </tr>
409 <tr> <td>{{beam.get_downvalues.16}}</td> <td>{{beam.get_downvalues.17}}</td> <td>{{beam.get_downvalues.18}}</td> <td>{{beam.get_downvalues.19}}</td> </tr>
630 <tr>
410 <tr> <td>{{beam.get_downvalues.24}}</td> <td>{{beam.get_downvalues.25}}</td> <td>{{beam.get_downvalues.26}}</td> <td>{{beam.get_downvalues.27}}</td> </tr>
631 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
632 </tr>
633 <tr>
634 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
635 </tr>
636 <tr>
637 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
638 </tr>
639 </table>
411 </table>
640 </td>
412 </td>
641 <td> <b>East Quarter</b>
413 <td> <b>East Quarter</b>
642 <table class="east_quarter">
414 <table class="east_quarter">
643 <tr>
415 <tr> <td>{{beam.get_downvalues.4}}</td> <td>{{beam.get_downvalues.5}}</td> <td>{{beam.get_downvalues.6}}</td> <td>{{beam.get_downvalues.7}}</td> </tr>
644 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
416 <tr> <td>{{beam.get_downvalues.12}}</td> <td>{{beam.get_downvalues.13}}</td> <td>{{beam.get_downvalues.14}}</td> <td>{{beam.get_downvalues.15}}</td> </tr>
645 </tr>
417 <tr> <td>{{beam.get_downvalues.20}}</td> <td>{{beam.get_downvalues.21}}</td> <td>{{beam.get_downvalues.22}}</td> <td>{{beam.get_downvalues.23}}</td> </tr>
646 <tr>
418 <tr> <td>{{beam.get_downvalues.28}}</td> <td>{{beam.get_downvalues.29}}</td> <td>{{beam.get_downvalues.30}}</td> <td>{{beam.get_downvalues.31}}</td> </tr>
647 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
648 </tr>
649 <tr>
650 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
651 </tr>
652 <tr>
653 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
654 </tr>
655 </table>
419 </table>
656 </td>
420 </td>
657 </tr>
421 </tr>
658 <tr>
422 <tr>
659 <td> <b>West Quarter</b>
423 <td> <b>West Quarter</b>
660 <table class="west_quarter">
424 <table class="west_quarter">
661 <tr>
425 <tr> <td>{{beam.get_downvalues.32}}</td> <td>{{beam.get_downvalues.33}}</td> <td>{{beam.get_downvalues.34}}</td> <td>{{beam.get_downvalues.35}}</td> </tr>
662 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
426 <tr> <td>{{beam.get_downvalues.40}}</td> <td>{{beam.get_downvalues.41}}</td> <td>{{beam.get_downvalues.42}}</td> <td>{{beam.get_downvalues.43}}</td> </tr>
663 </tr>
427 <tr> <td>{{beam.get_downvalues.48}}</td> <td>{{beam.get_downvalues.49}}</td> <td>{{beam.get_downvalues.50}}</td> <td>{{beam.get_downvalues.51}}</td> </tr>
664 <tr>
428 <tr> <td>{{beam.get_downvalues.56}}</td> <td>{{beam.get_downvalues.57}}</td> <td>{{beam.get_downvalues.58}}</td> <td>{{beam.get_downvalues.59}}</td> </tr>
665 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
666 </tr>
667 <tr>
668 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
669 </tr>
670 <tr>
671 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
672 </tr>
673 </table>
429 </table>
674 </td>
430 </td>
675 <td> <b>South Quarter</b>
431 <td> <b>South Quarter</b>
676 <table class="south_quarter">
432 <table class="south_quarter">
677 <tr>
433 <tr> <td>{{beam.get_downvalues.36}}</td> <td>{{beam.get_downvalues.37}}</td> <td>{{beam.get_downvalues.38}}</td> <td>{{beam.get_downvalues.39}}</td> </tr>
678 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
434 <tr> <td>{{beam.get_downvalues.44}}</td> <td>{{beam.get_downvalues.45}}</td> <td>{{beam.get_downvalues.46}}</td> <td>{{beam.get_downvalues.47}}</td> </tr>
679 </tr>
435 <tr> <td>{{beam.get_downvalues.52}}</td> <td>{{beam.get_downvalues.53}}</td> <td>{{beam.get_downvalues.54}}</td> <td>{{beam.get_downvalues.55}}</td> </tr>
680 <tr>
436 <tr> <td>{{beam.get_downvalues.60}}</td> <td>{{beam.get_downvalues.61}}</td> <td>{{beam.get_downvalues.62}}</td> <td>{{beam.get_downvalues.63}}</td> </tr>
681 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
682 </tr>
683 <tr>
684 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
685 </tr>
686 <tr>
687 <td>0.0</td> <td>0.0</td> <td>0.0</td> <td>0.0</td>
688 </tr>
689 </table>
437 </table>
690 </td>
438 </td>
691 </tr>
439 </tr>
@@ -702,32 +450,32 $(document).ready(function() {
702 <td> <b>North Quarter</b>
450 <td> <b>North Quarter</b>
703 <table align="center" class="north_quarter">
451 <table align="center" class="north_quarter">
704 <tr>
452 <tr>
705 <td>{{abs_beams.0.get_tx.down.0.0}}</td> <td>{{abs_beams.0.get_tx.down.0.1}}</td> <td>{{abs_beams.0.get_tx.down.0.2}}</td> <td>{{abs_beams.0.get_tx.down.0.3}}</td>
453 <td>{{beam.get_tx.down.0.0}}</td> <td>{{beam.get_tx.down.0.1}}</td> <td>{{beam.get_tx.down.0.2}}</td> <td>{{beam.get_tx.down.0.3}}</td>
706 </tr>
454 </tr>
707 <tr>
455 <tr>
708 <td>{{abs_beams.0.get_tx.down.1.0}}</td> <td>{{abs_beams.0.get_tx.down.1.1}}</td> <td>{{abs_beams.0.get_tx.down.1.2}}</td> <td>{{abs_beams.0.get_tx.down.1.3}}</td>
456 <td>{{beam.get_tx.down.1.0}}</td> <td>{{beam.get_tx.down.1.1}}</td> <td>{{beam.get_tx.down.1.2}}</td> <td>{{beam.get_tx.down.1.3}}</td>
709 </tr>
457 </tr>
710 <tr>
458 <tr>
711 <td>{{abs_beams.0.get_tx.down.2.0}}</td> <td>{{abs_beams.0.get_tx.down.2.1}}</td> <td>{{abs_beams.0.get_tx.down.2.2}}</td> <td>{{abs_beams.0.get_tx.down.2.3}}</td>
459 <td>{{beam.get_tx.down.2.0}}</td> <td>{{beam.get_tx.down.2.1}}</td> <td>{{beam.get_tx.down.2.2}}</td> <td>{{beam.get_tx.down.2.3}}</td>
712 </tr>
460 </tr>
713 <tr>
461 <tr>
714 <td>{{abs_beams.0.get_tx.down.3.0}}</td> <td>{{abs_beams.0.get_tx.down.3.1}}</td> <td>{{abs_beams.0.get_tx.down.3.2}}</td> <td>{{abs_beams.0.get_tx.down.3.3}}</td>
462 <td>{{beam.get_tx.down.3.0}}</td> <td>{{beam.get_tx.down.3.1}}</td> <td>{{beam.get_tx.down.3.2}}</td> <td>{{beam.get_tx.down.3.3}}</td>
715 </tr>
463 </tr>
716 </table>
464 </table>
717 </td>
465 </td>
718 <td> <b>East Quarter</b>
466 <td> <b>East Quarter</b>
719 <table align="center" class="east_quarter">
467 <table align="center" class="east_quarter">
720 <tr>
468 <tr>
721 <td>{{abs_beams.0.get_tx.down.0.4}}</td> <td>{{abs_beams.0.get_tx.down.0.5}}</td> <td>{{abs_beams.0.get_tx.down.0.6}}</td> <td>{{abs_beams.0.get_tx.down.0.7}}</td>
469 <td>{{beam.get_tx.down.0.4}}</td> <td>{{beam.get_tx.down.0.5}}</td> <td>{{beam.get_tx.down.0.6}}</td> <td>{{beam.get_tx.down.0.7}}</td>
722 </tr>
470 </tr>
723 <tr>
471 <tr>
724 <td>{{abs_beams.0.get_tx.down.1.4}}</td> <td>{{abs_beams.0.get_tx.down.1.5}}</td> <td>{{abs_beams.0.get_tx.down.1.6}}</td> <td>{{abs_beams.0.get_tx.down.1.7}}</td>
472 <td>{{beam.get_tx.down.1.4}}</td> <td>{{beam.get_tx.down.1.5}}</td> <td>{{beam.get_tx.down.1.6}}</td> <td>{{beam.get_tx.down.1.7}}</td>
725 </tr>
473 </tr>
726 <tr>
474 <tr>
727 <td>{{abs_beams.0.get_tx.down.2.4}}</td> <td>{{abs_beams.0.get_tx.down.2.5}}</td> <td>{{abs_beams.0.get_tx.down.2.6}}</td> <td>{{abs_beams.0.get_tx.down.2.7}}</td>
475 <td>{{beam.get_tx.down.2.4}}</td> <td>{{beam.get_tx.down.2.5}}</td> <td>{{beam.get_tx.down.2.6}}</td> <td>{{beam.get_tx.down.2.7}}</td>
728 </tr>
476 </tr>
729 <tr>
477 <tr>
730 <td>{{abs_beams.0.get_tx.down.3.4}}</td> <td>{{abs_beams.0.get_tx.down.3.5}}</td> <td>{{abs_beams.0.get_tx.down.3.6}}</td> <td>{{abs_beams.0.get_tx.down.3.7}}</td>
478 <td>{{beam.get_tx.down.3.4}}</td> <td>{{beam.get_tx.down.3.5}}</td> <td>{{beam.get_tx.down.3.6}}</td> <td>{{beam.get_tx.down.3.7}}</td>
731 </tr>
479 </tr>
732 </table>
480 </table>
733 </td>
481 </td>
@@ -736,32 +484,32 $(document).ready(function() {
736 <td> <b>West Quarter</b>
484 <td> <b>West Quarter</b>
737 <table align="center" class="west_quarter">
485 <table align="center" class="west_quarter">
738 <tr>
486 <tr>
739 <td>{{abs_beams.0.get_tx.down.4.0}}</td> <td>{{abs_beams.0.get_tx.down.4.1}}</td> <td>{{abs_beams.0.get_tx.down.4.2}}</td> <td>{{abs_beams.0.get_tx.down.4.3}}</td>
487 <td>{{beam.get_tx.down.4.0}}</td> <td>{{beam.get_tx.down.4.1}}</td> <td>{{beam.get_tx.down.4.2}}</td> <td>{{beam.get_tx.down.4.3}}</td>
740 </tr>
488 </tr>
741 <tr>
489 <tr>
742 <td>{{abs_beams.0.get_tx.down.5.0}}</td> <td>{{abs_beams.0.get_tx.down.5.1}}</td> <td>{{abs_beams.0.get_tx.down.5.2}}</td> <td>{{abs_beams.0.get_tx.down.5.3}}</td>
490 <td>{{beam.get_tx.down.5.0}}</td> <td>{{beam.get_tx.down.5.1}}</td> <td>{{beam.get_tx.down.5.2}}</td> <td>{{beam.get_tx.down.5.3}}</td>
743 </tr>
491 </tr>
744 <tr>
492 <tr>
745 <td>{{abs_beams.0.get_tx.down.6.0}}</td> <td>{{abs_beams.0.get_tx.down.6.1}}</td> <td>{{abs_beams.0.get_tx.down.6.2}}</td> <td>{{abs_beams.0.get_tx.down.6.3}}</td>
493 <td>{{beam.get_tx.down.6.0}}</td> <td>{{beam.get_tx.down.6.1}}</td> <td>{{beam.get_tx.down.6.2}}</td> <td>{{beam.get_tx.down.6.3}}</td>
746 </tr>
494 </tr>
747 <tr>
495 <tr>
748 <td>{{abs_beams.0.get_tx.down.7.0}}</td> <td>{{abs_beams.0.get_tx.down.7.1}}</td> <td>{{abs_beams.0.get_tx.down.7.2}}</td> <td>{{abs_beams.0.get_tx.down.7.3}}</td>
496 <td>{{beam.get_tx.down.7.0}}</td> <td>{{beam.get_tx.down.7.1}}</td> <td>{{beam.get_tx.down.7.2}}</td> <td>{{beam.get_tx.down.7.3}}</td>
749 </tr>
497 </tr>
750 </table>
498 </table>
751 </td>
499 </td>
752 <td> <b>South Quarter</b>
500 <td> <b>South Quarter</b>
753 <table align="center" class="south_quarter">
501 <table align="center" class="south_quarter">
754 <tr>
502 <tr>
755 <td>{{abs_beams.0.get_tx.down.4.4}}</td> <td>{{abs_beams.0.get_tx.down.4.5}}</td> <td>{{abs_beams.0.get_tx.down.4.6}}</td> <td>{{abs_beams.0.get_tx.down.4.7}}</td>
503 <td>{{beam.get_tx.down.4.4}}</td> <td>{{beam.get_tx.down.4.5}}</td> <td>{{beam.get_tx.down.4.6}}</td> <td>{{beam.get_tx.down.4.7}}</td>
756 </tr>
504 </tr>
757 <tr>
505 <tr>
758 <td>{{abs_beams.0.get_tx.down.5.4}}</td> <td>{{abs_beams.0.get_tx.down.5.5}}</td> <td>{{abs_beams.0.get_tx.down.5.6}}</td> <td>{{abs_beams.0.get_tx.down.5.7}}</td>
506 <td>{{beam.get_tx.down.5.4}}</td> <td>{{beam.get_tx.down.5.5}}</td> <td>{{beam.get_tx.down.5.6}}</td> <td>{{beam.get_tx.down.5.7}}</td>
759 </tr>
507 </tr>
760 <tr>
508 <tr>
761 <td>{{abs_beams.0.get_tx.down.6.4}}</td> <td>{{abs_beams.0.get_tx.down.6.5}}</td> <td>{{abs_beams.0.get_tx.down.6.6}}</td> <td>{{abs_beams.0.get_tx.down.6.7}}</td>
509 <td>{{beam.get_tx.down.6.4}}</td> <td>{{beam.get_tx.down.6.5}}</td> <td>{{beam.get_tx.down.6.6}}</td> <td>{{beam.get_tx.down.6.7}}</td>
762 </tr>
510 </tr>
763 <tr>
511 <tr>
764 <td>{{abs_beams.0.get_tx.down.7.4}}</td> <td>{{abs_beams.0.get_tx.down.7.5}}</td> <td>{{abs_beams.0.get_tx.down.7.6}}</td> <td>{{abs_beams.0.get_tx.down.7.7}}</td>
512 <td>{{beam.get_tx.down.7.4}}</td> <td>{{beam.get_tx.down.7.5}}</td> <td>{{beam.get_tx.down.7.6}}</td> <td>{{beam.get_tx.down.7.7}}</td>
765 </tr>
513 </tr>
766 </table>
514 </table>
767 </td>
515 </td>
@@ -780,32 +528,32 $(document).ready(function() {
780 <td> <b>North Quarter</b>
528 <td> <b>North Quarter</b>
781 <table align="center" class="north_quarter">
529 <table align="center" class="north_quarter">
782 <tr>
530 <tr>
783 <td>{{abs_beams.0.get_rx.down.0.0}}</td> <td>{{abs_beams.0.get_rx.down.0.1}}</td> <td>{{abs_beams.0.get_rx.down.0.2}}</td> <td>{{abs_beams.0.get_rx.down.0.3}}</td>
531 <td>{{beam.get_rx.down.0.0}}</td> <td>{{beam.get_rx.down.0.1}}</td> <td>{{beam.get_rx.down.0.2}}</td> <td>{{beam.get_rx.down.0.3}}</td>
784 </tr>
532 </tr>
785 <tr>
533 <tr>
786 <td>{{abs_beams.0.get_rx.down.1.0}}</td> <td>{{abs_beams.0.get_rx.down.1.1}}</td> <td>{{abs_beams.0.get_rx.down.1.2}}</td> <td>{{abs_beams.0.get_rx.down.1.3}}</td>
534 <td>{{beam.get_rx.down.1.0}}</td> <td>{{beam.get_rx.down.1.1}}</td> <td>{{beam.get_rx.down.1.2}}</td> <td>{{beam.get_rx.down.1.3}}</td>
787 </tr>
535 </tr>
788 <tr>
536 <tr>
789 <td>{{abs_beams.0.get_rx.down.2.0}}</td> <td>{{abs_beams.0.get_rx.down.2.1}}</td> <td>{{abs_beams.0.get_rx.down.2.2}}</td> <td>{{abs_beams.0.get_rx.down.2.3}}</td>
537 <td>{{beam.get_rx.down.2.0}}</td> <td>{{beam.get_rx.down.2.1}}</td> <td>{{beam.get_rx.down.2.2}}</td> <td>{{beam.get_rx.down.2.3}}</td>
790 </tr>
538 </tr>
791 <tr>
539 <tr>
792 <td>{{abs_beams.0.get_rx.down.3.0}}</td> <td>{{abs_beams.0.get_rx.down.3.1}}</td> <td>{{abs_beams.0.get_rx.down.3.2}}</td> <td>{{abs_beams.0.get_rx.down.3.3}}</td>
540 <td>{{beam.get_rx.down.3.0}}</td> <td>{{beam.get_rx.down.3.1}}</td> <td>{{beam.get_rx.down.3.2}}</td> <td>{{beam.get_rx.down.3.3}}</td>
793 </tr>
541 </tr>
794 </table>
542 </table>
795 </td>
543 </td>
796 <td> <b>East Quarter</b>
544 <td> <b>East Quarter</b>
797 <table align="center" class="east_quarter">
545 <table align="center" class="east_quarter">
798 <tr>
546 <tr>
799 <td>{{abs_beams.0.get_rx.down.0.4}}</td> <td>{{abs_beams.0.get_rx.down.0.5}}</td> <td>{{abs_beams.0.get_rx.down.0.6}}</td> <td>{{abs_beams.0.get_rx.down.0.7}}</td>
547 <td>{{beam.get_rx.down.0.4}}</td> <td>{{beam.get_rx.down.0.5}}</td> <td>{{beam.get_rx.down.0.6}}</td> <td>{{beam.get_rx.down.0.7}}</td>
800 </tr>
548 </tr>
801 <tr>
549 <tr>
802 <td>{{abs_beams.0.get_rx.down.1.4}}</td> <td>{{abs_beams.0.get_rx.down.1.5}}</td> <td>{{abs_beams.0.get_rx.down.1.6}}</td> <td>{{abs_beams.0.get_rx.down.1.7}}</td>
550 <td>{{beam.get_rx.down.1.4}}</td> <td>{{beam.get_rx.down.1.5}}</td> <td>{{beam.get_rx.down.1.6}}</td> <td>{{beam.get_rx.down.1.7}}</td>
803 </tr>
551 </tr>
804 <tr>
552 <tr>
805 <td>{{abs_beams.0.get_rx.down.2.4}}</td> <td>{{abs_beams.0.get_rx.down.2.5}}</td> <td>{{abs_beams.0.get_rx.down.2.6}}</td> <td>{{abs_beams.0.get_rx.down.2.7}}</td>
553 <td>{{beam.get_rx.down.2.4}}</td> <td>{{beam.get_rx.down.2.5}}</td> <td>{{beam.get_rx.down.2.6}}</td> <td>{{beam.get_rx.down.2.7}}</td>
806 </tr>
554 </tr>
807 <tr>
555 <tr>
808 <td>{{abs_beams.0.get_rx.down.3.4}}</td> <td>{{abs_beams.0.get_rx.down.3.5}}</td> <td>{{abs_beams.0.get_rx.down.3.6}}</td> <td>{{abs_beams.0.get_rx.down.3.7}}</td>
556 <td>{{beam.get_rx.down.3.4}}</td> <td>{{beam.get_rx.down.3.5}}</td> <td>{{beam.get_rx.down.3.6}}</td> <td>{{beam.get_rx.down.3.7}}</td>
809 </tr>
557 </tr>
810 </table>
558 </table>
811 </td>
559 </td>
@@ -814,32 +562,32 $(document).ready(function() {
814 <td> <b>West Quarter</b>
562 <td> <b>West Quarter</b>
815 <table align="center" class="west_quarter">
563 <table align="center" class="west_quarter">
816 <tr>
564 <tr>
817 <td>{{abs_beams.0.get_rx.down.4.0}}</td> <td>{{abs_beams.0.get_rx.down.4.1}}</td> <td>{{abs_beams.0.get_rx.down.4.2}}</td> <td>{{abs_beams.0.get_rx.down.4.3}}</td>
565 <td>{{beam.get_rx.down.4.0}}</td> <td>{{beam.get_rx.down.4.1}}</td> <td>{{beam.get_rx.down.4.2}}</td> <td>{{beam.get_rx.down.4.3}}</td>
818 </tr>
566 </tr>
819 <tr>
567 <tr>
820 <td>{{abs_beams.0.get_rx.down.5.0}}</td> <td>{{abs_beams.0.get_rx.down.5.1}}</td> <td>{{abs_beams.0.get_rx.down.5.2}}</td> <td>{{abs_beams.0.get_rx.down.5.3}}</td>
568 <td>{{beam.get_rx.down.5.0}}</td> <td>{{beam.get_rx.down.5.1}}</td> <td>{{beam.get_rx.down.5.2}}</td> <td>{{beam.get_rx.down.5.3}}</td>
821 </tr>
569 </tr>
822 <tr>
570 <tr>
823 <td>{{abs_beams.0.get_rx.down.6.0}}</td> <td>{{abs_beams.0.get_rx.down.6.1}}</td> <td>{{abs_beams.0.get_rx.down.6.2}}</td> <td>{{abs_beams.0.get_rx.down.6.3}}</td>
571 <td>{{beam.get_rx.down.6.0}}</td> <td>{{beam.get_rx.down.6.1}}</td> <td>{{beam.get_rx.down.6.2}}</td> <td>{{beam.get_rx.down.6.3}}</td>
824 </tr>
572 </tr>
825 <tr>
573 <tr>
826 <td>{{abs_beams.0.get_rx.down.7.0}}</td> <td>{{abs_beams.0.get_rx.down.7.1}}</td> <td>{{abs_beams.0.get_rx.down.7.2}}</td> <td>{{abs_beams.0.get_rx.down.7.3}}</td>
574 <td>{{beam.get_rx.down.7.0}}</td> <td>{{beam.get_rx.down.7.1}}</td> <td>{{beam.get_rx.down.7.2}}</td> <td>{{beam.get_rx.down.7.3}}</td>
827 </tr>
575 </tr>
828 </table>
576 </table>
829 </td>
577 </td>
830 <td> <b>South Quarter</b>
578 <td> <b>South Quarter</b>
831 <table class="south_quarter">
579 <table class="south_quarter">
832 <tr>
580 <tr>
833 <td>{{abs_beams.0.get_rx.down.4.4}}</td> <td>{{abs_beams.0.get_rx.down.4.5}}</td> <td>{{abs_beams.0.get_rx.down.4.6}}</td> <td>{{abs_beams.0.get_rx.down.4.7}}</td>
581 <td>{{beam.get_rx.down.4.4}}</td> <td>{{beam.get_rx.down.4.5}}</td> <td>{{beam.get_rx.down.4.6}}</td> <td>{{beam.get_rx.down.4.7}}</td>
834 </tr>
582 </tr>
835 <tr>
583 <tr>
836 <td>{{abs_beams.0.get_rx.down.5.4}}</td> <td>{{abs_beams.0.get_rx.down.5.5}}</td> <td>{{abs_beams.0.get_rx.down.5.6}}</td> <td>{{abs_beams.0.get_rx.down.5.7}}</td>
584 <td>{{beam.get_rx.down.5.4}}</td> <td>{{beam.get_rx.down.5.5}}</td> <td>{{beam.get_rx.down.5.6}}</td> <td>{{beam.get_rx.down.5.7}}</td>
837 </tr>
585 </tr>
838 <tr>
586 <tr>
839 <td>{{abs_beams.0.get_rx.down.6.4}}</td> <td>{{abs_beams.0.get_rx.down.6.5}}</td> <td>{{abs_beams.0.get_rx.down.6.6}}</td> <td>{{abs_beams.0.get_rx.down.6.7}}</td>
587 <td>{{beam.get_rx.down.6.4}}</td> <td>{{beam.get_rx.down.6.5}}</td> <td>{{beam.get_rx.down.6.6}}</td> <td>{{beam.get_rx.down.6.7}}</td>
840 </tr>
588 </tr>
841 <tr>
589 <tr>
842 <td>{{abs_beams.0.get_rx.down.7.4}}</td> <td>{{abs_beams.0.get_rx.down.7.5}}</td> <td>{{abs_beams.0.get_rx.down.7.6}}</td> <td>{{abs_beams.0.get_rx.down.7.7}}</td>
590 <td>{{beam.get_rx.down.7.4}}</td> <td>{{beam.get_rx.down.7.5}}</td> <td>{{beam.get_rx.down.7.6}}</td> <td>{{beam.get_rx.down.7.7}}</td>
843 </tr>
591 </tr>
844 </table>
592 </table>
845 </td>
593 </td>
@@ -850,17 +598,17 $(document).ready(function() {
850 </table>
598 </table>
851
599
852 {% if not edit %}
600 {% if not edit %}
853 {% include "abs_pattern_img.html" %}
601 {% include "abs_downpattern_img.html" %}
854 {% endif %}
602 {% endif %}
855
603
856 <br>
604 <br>
857
605
858 <div id="down_ues" style="display: inline-block">
606 <div id="down_ues" style="display: inline-block">
859 Ues: {{abs_beams.0.get_down_ues}}
607 Ues: {{beam.get_down_ues}}
860 </div>
608 </div>
861
609
862 <div style="margin-left: 70px; display: inline-block">
610 <div style="margin-left: 70px; display: inline-block">
863 <input type="checkbox" id="up_onlyrx" {% if abs_beams.0.get_down_onlyrx == True %} checked="True" {% endif %} disabled>
611 <input type="checkbox" id="up_onlyrx" {% if beam.get_down_onlyrx == True %} checked="True" {% endif %} disabled>
864 Only RX
612 Only RX
865 </input>
613 </input>
866 </div>
614 </div>
@@ -8,27 +8,28
8
8
9 </style>
9 </style>
10
10
11
12
11 {% if abs_beams %}
13 {% if abs_beams %}
12 <div>
14 <div>
13 <h4>Beams:</h4>
15 <h4>Beams:</h4>
14
16
15 <div class="container">
17 <div class="container">
16 <ul class="nav nav-pills">
18 <div class="btn-group">
17
19 {% for abs_beam in abs_beams %}
18 {% for beam in abs_beams %}
20 <button id="bt_beam{{ forloop.counter }}" type="button" class="btn btn-default">{{ forloop.counter }}</button>
19 <li {% if forloop.counter == 1 %} class="active" {% endif %}>
21 {% endfor %}
20 <a data-toggle="pill" id="button-{{ forloop.counter }}" href="#">{{ forloop.counter }}</a>
22 </div>
21 </li>
22 {% endfor %}
23
24 </ul>
25 </div>
23 </div>
26
24
27 </div>
28
25
26 </div>
29 <br>
27 <br>
30 {% include "abs_pattern.html" %}
28
31 <br>
29 {% if beam %}
30 {% include "abs_pattern.html" %}
31 {% endif %}
32
32
33
33 {% else %}
34 {% else %}
34 <div>
35 <div>
@@ -37,11 +38,17
37 </div>
38 </div>
38 {% endif %}
39 {% endif %}
39
40
40 {% endblock %}
41
41
42 <script>
42 <script>
43 function ChangeColor() {
43 {% for abs_beam in abs_beams %}
44 document.getElementById("button_1").style.backgroundColor = "#2c3e50";
44 $("#bt_beam{{ forloop.counter }}").click(function() {
45 document.getElementById("button_1").style.color = "#ecf0f1";
45 document.location = "{% url 'url_plot_abs_pattern' abs_beam.abs_conf.id abs_beam.id %}";
46 }
46 });
47 {% endfor %}
48 //function ChangeColor() {
49 // document.getElementById("button_1").style.backgroundColor = "#2c3e50";
50 // document.getElementById("button_1").style.color = "#ecf0f1";
51 //}
47 </script>
52 </script>
53
54 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now