plot-antenna 2.1__tar.gz → 2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plot-antenna
3
- Version: 2.1
3
+ Version: 2.3
4
4
  Summary: Antenna plotting program for plotting antenna simulation results
5
5
  Home-page: https://github.com/schlatterbeck/plot-antenna
6
6
  Author: Ralf Schlatterbeck
@@ -0,0 +1 @@
1
+ 2.3
@@ -0,0 +1 @@
1
+ VERSION="2.3"
@@ -1231,12 +1231,13 @@ class Gain_Plot:
1231
1231
  geo.wires [-1].append ([float (a) for a in l [:3]])
1232
1232
  continue
1233
1233
  if status == 'necgeo':
1234
- # Fixme: This should really be lambda-dependent
1235
- eps = 1e-3
1236
1234
  started = False
1237
1235
  ll = line.split ()
1238
1236
  idx = int (ll [0])
1239
1237
  x, y, z, l, alpha, beta = (float (a) for a in ll [1:7])
1238
+ # Make eps dependent on segment length
1239
+ # Listing in segmentation data in NEC can be very crude
1240
+ eps = l / 10
1240
1241
  tag = int (ll [-1])
1241
1242
  if tag not in self.seg_by_tag:
1242
1243
  self.seg_by_tag [tag] = []
@@ -1252,15 +1253,16 @@ class Gain_Plot:
1252
1253
  elif aprev != idx - 1 and aprev != idx:
1253
1254
  geo.append ([])
1254
1255
  a, b = necidx [aprev]
1255
- if prev > 0:
1256
- b += 1
1256
+ if prev < 0:
1257
+ b -= 1
1258
+ assert b >= 0
1257
1259
  geo [-1].append (geo [a][b])
1258
- started = True
1260
+ # Enabling this masks bugs in computation above:
1261
+ #started = True
1259
1262
  elif prev == cur and gnd:
1260
1263
  geo.append ([])
1261
1264
  started = True
1262
1265
  gnd = None
1263
- necidx [idx] = (len (geo) - 1, len (geo [-1]) - 1)
1264
1266
  alpha = alpha / 180 * np.pi
1265
1267
  beta = beta / 180 * np.pi
1266
1268
  cos_t = np.cos (alpha)
@@ -1279,6 +1281,10 @@ class Gain_Plot:
1279
1281
  else:
1280
1282
  assert np.linalg.norm (geo [-1][-1] - st) < eps
1281
1283
  geo [-1].append (en)
1284
+ necidx [idx] = (len (geo) - 1, len (geo [-1]) - 1)
1285
+ assert necidx [idx][0] >= 0 and necidx [idx][1] >= 0
1286
+ # Just assert we can access geo at this indeces
1287
+ assert len (geo [necidx [idx][0]][necidx [idx][1]]) == 3
1282
1288
  continue
1283
1289
  # Similar for NEC, MININEC, ASAP:
1284
1290
  if line.startswith ('FREQUENCY'):
@@ -1719,7 +1725,7 @@ class Gain_Plot:
1719
1725
  tickangle = -90
1720
1726
  fig.layout.polar.radialaxis.tickangle = tickangle
1721
1727
  fig.layout.polar.radialaxis.angle = lbl_deg
1722
- fig.layout.polar.radialaxis.range = [0,1]
1728
+ fig.layout.polar.radialaxis.range = [0, 1.01]
1723
1729
  # Trying to display 'X' and 'Y' on Azimuth plot
1724
1730
  # Doesn't work: This doesn't correctly scale and it seems giving
1725
1731
  # annotations in polar coordinates is still not possible
@@ -1755,6 +1761,7 @@ class Gain_Plot:
1755
1761
  ax.set_rmax (1)
1756
1762
  ax.set_rlabel_position (self.lbl_deg or 0)
1757
1763
  ax.set_thetagrids (range (0, 360, 15))
1764
+ ax.set_ylim ([0, 1.01])
1758
1765
  if self.labels:
1759
1766
  d = dict (fontsize = 18, transform = ax.transAxes)
1760
1767
  plt.text (1.1, 0.5, self.labels [0], va = 'center', **d)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plot-antenna
3
- Version: 2.1
3
+ Version: 2.3
4
4
  Summary: Antenna plotting program for plotting antenna simulation results
5
5
  Home-page: https://github.com/schlatterbeck/plot-antenna
6
6
  Author: Ralf Schlatterbeck
@@ -739,4 +739,41 @@ class Test_Plot (unittest.TestCase):
739
739
  self.compare_cs ()
740
740
  # end def test_fortran_swr
741
741
 
742
+ def test_geo_gridhelix (self):
743
+ infile = "test/helix-small.nout"
744
+ args = ["--title=", "--geo", infile]
745
+ main (args, pic_io = self.pic_io)
746
+ self.compare_cs ()
747
+ # end def test_geo_gridhelix
748
+
749
+ def test_geo_gridhelix_plotly (self):
750
+ infile = "test/helix-small.nout"
751
+ args = ["--title=", "--geo", "-S", infile]
752
+ main (args, pic_io = self.pic_io)
753
+ self.compare_cs ()
754
+ # end def test_geo_gridhelix_plotly
755
+
756
+ def test_geo_simple (self):
757
+ infile = "test/t2.nout"
758
+ args = ["--title=", "--geo", infile]
759
+ main (args, pic_io = self.pic_io)
760
+ self.compare_cs ()
761
+ # end def test_geo_simple
762
+
763
+ def test_scale_by_angle (self):
764
+ infile = "test/inve802B.pout"
765
+ args = "--title= --azi --angle-ele=35 --scale-by-angle".split ()
766
+ args.append (infile)
767
+ main (args, pic_io = self.pic_io)
768
+ self.compare_cs ()
769
+ # end def test_scale_by_angle
770
+
771
+ def test_scale_by_angle_plotly (self):
772
+ infile = "test/inve802B.pout"
773
+ args = "-S --title= --azi --angle-ele=35 --scale-by-angle".split ()
774
+ args.append (infile)
775
+ main (args, pic_io = self.pic_io)
776
+ self.compare_cs ()
777
+ # end def test_scale_by_angle_plotly
778
+
742
779
  # end class Test_Plot
plot_antenna-2.1/VERSION DELETED
@@ -1 +0,0 @@
1
- 2.1
@@ -1 +0,0 @@
1
- VERSION="2.1"
File without changes
File without changes
File without changes
File without changes
File without changes