aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpux <pux@pux.dom>2021-03-22 01:06:39 +0100
committerpux <pux@pux.dom>2021-03-22 01:06:39 +0100
commit46169e6a75130cd8e0719a39b92a1454279da312 (patch)
tree66a68219c09126838fc5213f67e8ecb2502f4500
parent89fb2f470b08068a8578e75fd093bc62493ec413 (diff)
downloadcalctenna-46169e6a75130cd8e0719a39b92a1454279da312.tar.gz
calctenna-46169e6a75130cd8e0719a39b92a1454279da312.tar.bz2
calctenna-46169e6a75130cd8e0719a39b92a1454279da312.zip
floatsy
-rwxr-xr-xcalctenna.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/calctenna.py b/calctenna.py
index 8bf9bb3..88a6758 100755
--- a/calctenna.py
+++ b/calctenna.py
@@ -85,12 +85,12 @@ def check_input(frequency, velocity_factor):
# fill struct
def calc(antenna_data):
- c = 299792458 # speed of light
- antenna_data.wavelength = float(c) / float(antenna_data.frequency)
+ c = 299792458.0 # speed of light
+ antenna_data.wavelength = c / antenna_data.frequency
antenna_data.wavelength_2 = antenna_data.wavelength/2
antenna_data.wavelength_4 = antenna_data.wavelength/4
antenna_data.dipole_leg_length = antenna_data.wavelength_4 \
- * float(antenna_data.velocity_factor)
+ * antenna_data.velocity_factor
if __name__ == '__main__':
args = run_argparse()
@@ -102,7 +102,8 @@ if __name__ == '__main__':
if not check_input(args.frequency, args.velocity_factor):
exit()
- antenna_data = AntennaData(args.frequency, args.velocity_factor)
+ # check_input OK -> float()
+ antenna_data = AntennaData(float(args.frequency), float(args.velocity_factor))
calc(antenna_data)
if not args.quiet:
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa