#!/usr/bin/perl ## --> Microwave Radio Path Analysis, path.cgi ## --> Green Bay Professional Packet Radio, www.gbppr.net # # Visit 'www.gbppr.net/splat' for more information. # ## This file Copyright 2003 under the GPL. ## NO WARRANTY. Please send bug reports / patches. ## Program Setup # $ENV{PATH} = "/bin:/usr/bin:/usr/local/bin"; select STDOUT; $| = 1; use warnings; require "flush.pl"; use Math::Trig; use Math::Complex; use Time::Piece; use Geo::Coder::OSM; # For LAT/LON to state decoding / Install: sudo cpan Geo::Coder::OSM use Geo::Coordinates::UTM; # For UTM results / Install: sudo cpan Geo::Coordinates::UTM use GIS::Distance; # For the Vincenty great-circle distance calculations / Install: sudo cpan GIS::Distance ## User Setup # my $banner = "A service of Green Bay Professional Packet Radio - www.gbppr.net"; my $url = "http://gbppr.ddns.net/path.main.cgi"; my $ver = "v2.80"; # Jan2025 my $splat = "/usr/local/bin/splat"; my $splatdir = "/usr/splat/sdf"; my $splatdirhd = "/usr/splat/sdf-hd"; my $pdfdir = "../pdf"; # Location of coax/waveguide PDF datasheets my $gnuplot = "/usr/bin/gnuplot"; my $htmldoc = "/usr/bin/htmldoc"; my $do_utm = "yes"; # Calculates UTM coordinates - Requires the installation of Geo::Coordinates::UTM my $do_lulc = "yes"; # Generates U.S land coverage maps - Requires land usage data and the "ptelev" util from FCC's TVStudy program: https://www.fcc.gov/oet/tvstudy my $do_vinc = "yes"; # Uses the proper Vincenty great-circle distance calculations # Requires the installation of GIS::Distance / https://metacpan.org/pod/GIS::Distance::Vincenty my $DEBUG = 0; # 0=leave temp files 1=delete temp file ## Create a random directory for working files # my $sec = 0; my $min = 0; my $hour = 0; my $mday = 0; my $mon = 0; my $year = 0; ($sec, $min, $hour, $mday, $mon, $year) = gmtime; $mon = sprintf "%02.0f", $mon + 1; $mday = sprintf "%02.0f", $mday; $year = sprintf "%02.0f", $year; $year = 1900 + $year; my $RAN = sprintf "%.f", rand(10000000); mkdir "tmp/$mon-$mday"; mkdir "tmp/$mon-$mday/$RAN"; chdir "tmp/$mon-$mday/$RAN"; if ($do_lulc eq "yes") { # LOL mkdir "lib"; system "/bin/cp /usr/splat/tvstudy/lib/ptelev.conf lib/ptelev.conf"; system "/bin/cp /usr/splat/tvstudy/lib/ptelev lib/ptelev"; system "ln -s /usr/splat/tvstudy/dbase dbase"; } ## Print MIME # print "content-type:text/html\n\n"; &flush(STDOUT); ## Read Web Browser Environment # read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } my $frq = $FORM{'frq'}; my $frq_val = $FORM{'frq_val'}; my $frq_div = $FORM{'frq_div'}; my $frq_div_val = $FORM{'frq_div_val'}; my $pwr_out = $FORM{'pwr_out'}; my $pwr_out_val = $FORM{'pwr_out_val'}; my $project = $FORM{'project'}; my $tx_name = $FORM{'tx_name'}; my $tx_cab = $FORM{'tx_cab'}; my $tx_len = $FORM{'tx_len'}; my $tx_len_val = $FORM{'tx_len_val'}; my $tx_ant_gain = $FORM{'tx_ant_gain'}; my $tx_ant_gain_radome = $FORM{'tx_ant_gain_radome'}; my $tx_ant_val = $FORM{'tx_ant_val'}; my $tx_ant_ht = $FORM{'tx_ant_ht'}; my $tx_ant_ht_val = $FORM{'tx_ant_ht_val'}; my $tx_misc_loss = $FORM{'tx_misc_loss'}; my $tx_misc_cab_loss = $FORM{'tx_misc_cab_loss'}; my $tx_misc_gain = $FORM{'tx_misc_gain'}; my $tx_cab_other = $FORM{'tx_cab_other'}; my $LAT1_D = $FORM{'LAT1_D'}; my $LAT1_M = $FORM{'LAT1_M'}; my $LAT1_S = $FORM{'LAT1_S'}; my $LAT1_val = $FORM{'LAT1_val'}; my $LON1_D = $FORM{'LON1_D'}; my $LON1_M = $FORM{'LON1_M'}; my $LON1_S = $FORM{'LON1_S'}; my $LON1_val = $FORM{'LON1_val'}; my $LAT2_D = $FORM{'LAT2_D'}; my $LAT2_M = $FORM{'LAT2_M'}; my $LAT2_S = $FORM{'LAT2_S'}; my $LAT2_val = $FORM{'LAT2_val'}; my $LON2_D = $FORM{'LON2_D'}; my $LON2_M = $FORM{'LON2_M'}; my $LON2_S = $FORM{'LON2_S'}; my $LON2_val = $FORM{'LON2_val'}; my $rx_name = $FORM{'rx_name'}; my $rx_cab = $FORM{'rx_cab'}; my $rx_len = $FORM{'rx_len'}; my $rx_len_val = $FORM{'rx_len_val'}; my $rx_ant_gain = $FORM{'rx_ant_gain'}; my $rx_ant_gain_radome = $FORM{'rx_ant_gain_radome'}; my $rx_ant_val = $FORM{'rx_ant_val'}; my $rx_ant_ht = $FORM{'rx_ant_ht'}; my $rx_ant_ht_val = $FORM{'rx_ant_ht_val'}; my $rx_misc_cab_loss = $FORM{'rx_misc_cab_loss'}; my $rx_misc_gain = $FORM{'rx_misc_gain'}; my $rx_cab_other = $FORM{'rx_cab_other'}; my $rx_div_ant_ht = $FORM{'rx_div_ant_ht'}; my $rx_div_ant_ht_val = $FORM{'rx_div_ant_ht_val'}; my $rx_div_ant_gain = $FORM{'rx_div_ant_gain'}; my $rx_div_ant_gain_radome = $FORM{'rx_div_ant_gain_radome'}; my $rx_div_ant_val = $FORM{'rx_div_ant_val'}; my $rx_div_len = $FORM{'rx_div_len'}; my $rx_div_len_val = $FORM{'rx_div_len_val'}; my $rx_div_misc_cab_loss = $FORM{'rx_div_misc_cab_loss'}; my $BER = $FORM{'BER'}; my $BER_crit = $FORM{'BER_crit'}; my $dfm = $FORM{'dfm'}; my $eifm = $FORM{'eifm'}; my $aifm = $FORM{'aifm'}; my $nth = $FORM{'nth'}; my $k = $FORM{'k'}; my $vigants = $FORM{'vigants'}; my $temp = $FORM{'temp'}; my $temp_val = $FORM{'temp_val'}; my $rain = $FORM{'rain'}; my $geo = $FORM{'geo'}; my $rh = $FORM{'rh'}; my $baro = $FORM{'baro'}; my $rate = $FORM{'rate'}; my $envy = $FORM{'envy'}; my $wvd = $FORM{'wvd'}; my $check1 = $FORM{'check1'}; my $check2 = $FORM{'check2'}; my $check3 = $FORM{'check3'}; my $check4 = $FORM{'check4'}; my $rough = $FORM{'rough'}; my $rough_hum = $FORM{'rough_hum'}; my $rough_val = $FORM{'rough_val'}; my $gc = $FORM{'gc'}; my $gc_val = $FORM{'gc_val'}; my $k_ht = $FORM{'k_ht'}; my $k_ht_val = $FORM{'k_ht_val'}; my $earcon = $FORM{'earcon'}; my $diecon = $FORM{'diecon'}; my $climate = $FORM{'climate'}; my $polar = $FORM{'polar'}; my $sit = $FORM{'sit'}; my $time = $FORM{'time'}; my $tx_ant_notes = $FORM{'tx_ant_notes'}; my $rx_ant_notes = $FORM{'rx_ant_notes'}; my $tx_notes = $FORM{'tx_notes'}; my $rx_notes = $FORM{'rx_notes'}; my $quality = $FORM{'quality'}; my $land_clutter = $FORM{'land_clutter'}; my $ht_water = $FORM{'ht_water'}; my $ht_ice = $FORM{'ht_ice'}; my $ht_devlow = $FORM{'ht_devlow'}; my $ht_devmed = $FORM{'ht_devmed'}; my $ht_devhgh = $FORM{'ht_devhgh'}; my $ht_devspc = $FORM{'ht_devspc'}; my $ht_barrn = $FORM{'ht_barrn'}; my $ht_dedfor = $FORM{'ht_dedfor'}; my $ht_evrfor = $FORM{'ht_evrfor'}; my $ht_mxdfor = $FORM{'ht_mxdfor'}; my $ht_grass = $FORM{'ht_grass'}; my $ht_shrub = $FORM{'ht_shrub'}; my $ht_hay = $FORM{'ht_hay'}; my $ht_crop = $FORM{'ht_crop'}; my $ht_wood = $FORM{'ht_wood'}; my $ht_hrbwet = $FORM{'ht_hrbwet'}; my $ht_water_val = $FORM{'ht_water_val'}; my $ht_ice_val = $FORM{'ht_ice_val'}; my $ht_devlow_val = $FORM{'ht_devlow_val'}; my $ht_devmed_val = $FORM{'ht_devmed_val'}; my $ht_devhgh_val = $FORM{'ht_devhgh_val'}; my $ht_devspc_val = $FORM{'ht_devspc_val'}; my $ht_barrn_val = $FORM{'ht_barrn_val'}; my $ht_dedfor_val = $FORM{'ht_dedfor_val'}; my $ht_evrfor_val = $FORM{'ht_evrfor_val'}; my $ht_mxdfor_val = $FORM{'ht_mxdfor_val'}; my $ht_grass_val = $FORM{'ht_grass_val'}; my $ht_shrub_val = $FORM{'ht_shrub_val'}; my $ht_hay_val = $FORM{'ht_hay_val'}; my $ht_crop_val = $FORM{'ht_crop_val'}; my $ht_wood_val = $FORM{'ht_wood_val'}; my $ht_hrbwet_val = $FORM{'ht_hrbwet_val'}; ## Subroutines # sub System { if ((0xffff & system $args) != 0 ) { print STDERR "error: $!\n"; exit 1; } } ## Get Coordinates and Cleanup # $LAT1_D =~ tr/0-9.//csd; $LAT1_M =~ tr/0-9.//csd; $LAT1_S =~ tr/0-9.//csd; $LON1_D =~ tr/0-9.//csd; $LON1_M =~ tr/0-9.//csd; $LON1_S =~ tr/0-9.//csd; $LAT2_D =~ tr/0-9.//csd; $LAT2_M =~ tr/0-9.//csd; $LAT2_S =~ tr/0-9.//csd; $LON2_D =~ tr/0-9.//csd; $LON2_M =~ tr/0-9.//csd; $LON2_S =~ tr/0-9.//csd; if ($LAT1_D > 90 || $LAT1_D < 0) { print "BAD COORDINATES - $LAT1_D > 90 or $LAT1_D < 0\n"; exit 1; } if ($LAT1_M >= 60) { print "BAD COORDINATES - $LAT1_M >= 60\n"; exit 1; } if ($LAT1_S >= 60) { print "BAD COORDINATES - $LAT1_S >= 60\n"; exit 1; } if ($LON1_D > 180) { print "BAD COORDINATES - $LON1_D > 180\n"; exit 1; } if ($LON1_M >= 60) { print "BAD COORDINATES - $LON1_M >= 60\n"; exit 1; } if ($LON1_S >= 60) { print "BAD COORDINATES - $LON1_S >= 60\n"; exit 1; } if ($LAT2_D > 90 || $LAT2_D < 0) { print "BAD COORDINATES - $LAT2_D > 90 or $LAT2_D < 0\n"; exit 1; } if ($LAT2_M >= 60) { print "BAD COORDINATES - $LAT2_M >= 60\n"; exit 1; } if ($LAT2_S >= 60) { print "BAD COORDINATES - $LAT2_S >= 60\n"; exit 1; } if ($LON2_D > 180) { print "BAD COORDINATES - $LON2_D > 180\n"; exit 1; } if ($LON2_M >= 60) { print "BAD COORDINATES - $LON2_M >= 60\n"; exit 1; } if ($LON2_S >= 60) { print "BAD COORDINATES - $LON2_S >= 60\n"; exit 1; } if ($LAT1_val eq "North") { $LAT1 = sprintf "%.6f", $LAT1_D + ($LAT1_M / 60) + ($LAT1_S / 3600); $LAT1_gnu = "N"; } elsif ($LAT1_val eq "South") { $LAT1 = sprintf "-%.6f", $LAT1_D + ($LAT1_M / 60) + ($LAT1_S / 3600); $LAT1_gnu = "S"; } if ($LON1_val eq "West") { $LON1 = sprintf "%.6f", $LON1_D + ($LON1_M / 60) + ($LON1_S / 3600); $LON1_geo = sprintf "-%.6f", $LON1_D + ($LON1_M / 60) + ($LON1_S / 3600); $LON1_gnu = "W"; } elsif ($LON1_val eq "East") { $LON1 = sprintf "-%.6f", $LON1_D + ($LON1_M / 60) + ($LON1_S / 3600); $LON1_geo = sprintf "%.6f", $LON1_D + ($LON1_M / 60) + ($LON1_S / 3600); $LON1_gnu = "E"; } if ($LAT2_val eq "North") { $LAT2 = sprintf "%.6f", $LAT2_D + ($LAT2_M / 60) + ($LAT2_S / 3600); $LAT2_gnu = "N"; } elsif ($LAT2_val eq "South") { $LAT2 = sprintf "-%.6f", $LAT2_D + ($LAT2_M / 60) + ($LAT2_S / 3600); $LAT2_gnu = "S"; } if ($LON2_val eq "West") { $LON2 = sprintf "%.6f", $LON2_D + ($LON2_M / 60) + ($LON2_S / 3600); $LON2_geo = sprintf "-%.6f", $LON2_D + ($LON2_M / 60) + ($LON2_S / 3600); $LON2_gnu = "W"; } elsif ($LON2_val eq "East") { $LON2 = sprintf "-%.6f", $LON2_D + ($LON2_M / 60) + ($LON2_S / 3600); $LON2_geo = sprintf "%.6f", $LON2_D + ($LON2_M / 60) + ($LON2_S / 3600); $LON2_gnu = "E"; } ## Format Coordinates for Display # $LAT1_D = sprintf "%03d", $LAT1_D; $LAT1_M = sprintf "%02d", $LAT1_M; $LAT1_S = sprintf "%05.2f", $LAT1_S; $LON1_D = sprintf "%03d", $LON1_D; $LON1_M = sprintf "%02d", $LON1_M; $LON1_S = sprintf "%05.2f", $LON1_S; $LAT2_D = sprintf "%03d", $LAT2_D; $LAT2_M = sprintf "%02d", $LAT2_M; $LAT2_S = sprintf "%05.2f", $LAT2_S; $LON2_D = sprintf "%03d", $LON2_D; $LON2_M = sprintf "%02d", $LON2_M; $LON2_S = sprintf "%05.2f", $LON2_S; ## Calculate Path Distance Based on LAT/LON # if ($do_vinc eq "yes") { # Great-circle distance (ellipsoid) $gis = GIS::Distance->new('Vincenty'); $distance = $gis->distance($LAT1, $LON1, $LAT2, $LON2); $dist_km = sprintf "%.2f", $distance; $dist_mi = sprintf "%.2f", $distance * 0.62137119; } else { # Great-circle distance (spherical) $H = ($LON1 - $LON2) * (68.962 + 0.04525 * (($LAT1 + $LAT2) / 2) - 0.01274 * (($LAT1 + $LAT2) / 2) ** 2 + 0.00004117 * (($LAT1 + $LAT2) / 2) ** 3); $V = ($LAT1 - $LAT2) * (68.712 - 0.001184 * (($LAT1 + $LAT2) / 2) + 0.0002928 * (($LAT1 + $LAT2) / 2) ** 2 - 0.000002162 * (($LAT1 + $LAT2) / 2) ** 3); $dist_km = sprintf "%.2f", sqrt(($H ** 2) + ($V ** 2)) * 1.609344; $dist_mi = sprintf "%.2f", sqrt(($H ** 2) + ($V ** 2)); } if ($dist_mi > 100 || $dist_mi < 0 || !$dist_mi) { print "PATH LENGTH TOO LONG OR TOO SHORT (100 MILES MAX): $dist_mi"; exit 1; } ## Get Primary/Diversity Frequency # $frq =~ tr/0-9.//csd; $frq_div =~ tr/0-9.//csd; if ($frq < 0 || !$frq) { print "ENTER A FREQUENCY: $frq"; exit 1; } if ($frq_val eq "GHz") { $frq_mhz = sprintf "%.4f", $frq * 1000; # convert GHz to MHz $frq_ghz = sprintf "%.4f", $frq; } elsif ($frq_val eq "MHz") { $frq_ghz = sprintf "%.4f", $frq / 1000; # convert MHz to GHz $frq_mhz = sprintf "%.4f", $frq; } if ($frq_mhz > 40000 || $frq_mhz < 20 || !$frq_mhz) { print "BAD PRIMARY FREQUENCY (20 - 40,000 MHz): $frq_mhz MHz"; exit 1; } if ($frq_ghz > 40 || $frq_ghz < 0.020 || !$frq_ghz) { print "BAD PRIMARY FREQUENCY (.020 - 40 GHz): $frq_ghz GHz"; exit 1; } if ($frq_div_val eq "GHz") { $frq_mhz_div = sprintf "%.4f", $frq_div * 1000; # convert GHz to MHz $frq_ghz_div = sprintf "%.4f", $frq_div; } elsif ($frq_div_val eq "MHz") { $frq_ghz_div = sprintf "%.4f", $frq_div / 1000; # convert MHz to GHz $frq_mhz_div = sprintf "%.4f", $frq_div; } if ($frq_mhz_div > 40000) { print "BAD DIVERSITY FREQUENCY (20 - 40,000 MHz): $frq_mhz_div MHz"; } if ($frq_ghz_div > 40) { print "BAD DIVERSITY FREQUENCY (.020 - 40 GHz): $frq_ghz_div GHz"; } ## Calculate Wavelength # $wav_in = sprintf "%.3f", (299.792458 / $frq_mhz) * 39.370079; # wavelength in inches $wav_ft = sprintf "%.3f", (299.792458 / $frq_mhz) * 3.2808399; # wavelength in feet $wav_cm = sprintf "%.3f", (299.792458 / $frq_mhz) * 100; # wavelength in centimeters $wav_m = sprintf "%.3f", (299.792458 / $frq_mhz); # wavelength in meters $wav_half_ft = ((299.792458 / $frq_mhz) * 3.2808399) / 2; # 1/2 wavelength in feet ## Transmitter RF Output Power # $pwr_out =~ tr/0-9.-//csd; if ($pwr_out_val eq "milliwatts") { $pwr_out = 10 * log10($pwr_out); # mW to dBm } elsif ($pwr_out_val eq "watts") { $pwr_out = 10 * log10($pwr_out) + 30; # Watts to dBm } elsif ($pwr_out_val eq "kilowatts") { $pwr_out = 10 * log10($pwr_out) + 60; # kilowatts to dBm } elsif ($pwr_out_val eq "dBW") { $pwr_out = 10 * log10((10 ** (($pwr_out + 30) / 10))); # dBW to dBm } elsif ($pwr_out_val eq "dBk") { $pwr_out = 10 * log10((10 ** (($pwr_out + 60) / 10))); # dBk to dBm } # Do all path calculations in dBm $pwr_out_mw = sprintf "%.2f", 10 ** ($pwr_out / 10); $pwr_out_w = sprintf "%.2f", 10 ** (($pwr_out - 30) / 10); $pwr_out_kw = sprintf "%.2f", (10 ** (($pwr_out - 30) / 10)) / 1000; $pwr_out_dbw = sprintf "%.2f", 10 * log10((10 ** (($pwr_out - 30) / 10))); $pwr_out_dbk = sprintf "%.2f", (10 * log10((10 ** (($pwr_out - 30) / 10)))) - 30; $pwr_out_dbm = sprintf "%.2f", $pwr_out; ## Get Fresnel Zone # $nth =~ tr/0-9//csd; if ($nth) { $fres = sprintf "%s", $nth; # For SPLAT! file } ## Get Ground Clutter # $gc =~ tr/0-9//csd; if ($gc_val eq "feet") { $gc_m = sprintf "%.1f", $gc * 0.3048; # feet to meters $gc_ft = sprintf "%.1f", $gc; } elsif ($gc_val eq "meters") { $gc_ft = sprintf "%.1f", $gc * 3.2808399; # meters to feet $gc_m = sprintf "%.1f", $gc; } if ($gc_ft > 0) { $clutter = 1; # Do SPLAT! clutter } else { $clutter = 0; # Don't do SPLAT! clutter } ## Transmitter Site Information # $OK_CHARS='-a-zA-Z0-9_.+=()\[\] ';# Allowed Characters $project =~ s/[^$OK_CHARS]//go; $tx_ant_notes =~ s/[^$OK_CHARS]//go; $tx_notes =~ s/[^$OK_CHARS]//go; $tx_name =~ tr/A-Za-z0-9//csd; $tx_len =~ tr/0-9.//csd; $tx_ant_gain =~ tr/0-9.//csd; $rx_ant_gain_radome =~ tr/0-9.//csd; $tx_ant_ht =~ tr/0-9.//csd; $tx_misc_loss =~ tr/0-9.//csd; $tx_misc_cab_loss =~ tr/0-9.//csd; $tx_cab_other =~ tr/0-9.//csd; $tx_misc_gain =~ tr/0-9.//csd; # Limit characters for plotting $project = sprintf "%.26s", $project; $tx_name = sprintf "%.15s", $tx_name; $tx_ant_notes = sprintf "%.20s", $tx_ant_notes; $tx_notes = sprintf "%.20s", $tx_notes; if (!$tx_name) { $tx_name = "TX"; } if ($tx_len < 1|| !$tx_len) { print "YOU NEED TO ENTER THE TRANSMITTER'S TOTAL CABLE LENGTH: $tx_len"; exit 1; } if ($tx_ant_ht < 1 || !$tx_ant_ht) { print "YOU NEED TO ENTER THE TRANSMITTER'S ANTENNA HEIGHT: $tx_ant_ht"; exit 1; } if ($tx_ant_ht_val eq "feet") { $tx_ant_ht_m = sprintf "%.2f", $tx_ant_ht * 0.3048; # feet to meters $tx_ant_ht_ft = sprintf "%.2f", $tx_ant_ht; } elsif ($tx_ant_ht_val eq "meters") { $tx_ant_ht_ft = sprintf "%.2f", $tx_ant_ht * 3.2808399; # meters to feet $tx_ant_ht_m = sprintf "%.2f", $tx_ant_ht; } ## Receiver Site Information # $rx_ant_notes =~ s/[^$OK_CHARS]//go; $rx_notes =~ s/[^$OK_CHARS]//go; $rx_name =~ tr/A-Za-z0-9//csd; $rx_len =~ tr/0-9.//csd; $rx_ant_gain =~ tr/0-9.//csd; $rx_ant_gain_radome =~ tr/0-9.//csd; $rx_ant_ht =~ tr/0-9.//csd; $rx_misc_cab_loss =~ tr/0-9.//csd; $rx_cab_other =~ tr/0-9.//csd; $rx_misc_gain =~ tr/0-9.//csd; $rx_div_ant_ht =~ tr/0-9.//csd; $rx_div_ant_gain =~ tr/0-9.//csd; $rx_div_ant_gain_radome =~ tr/0-9.//csd; $rx_div_len =~ tr/0-9.//csd; $rx_div_misc_cab_loss =~ tr/0-9.//csd; # Limit characters for plotting $rx_name = sprintf "%.15s", $rx_name; $rx_ant_notes = sprintf "%.20s", $rx_ant_notes; $rx_notes = sprintf "%.20s", $rx_ant_notes; if (!$rx_name) { $rx_name = "RX"; } if ($rx_len < 1 || !$rx_len) { print "YOU NEED TO ENTER THE RECEIVER'S TOTAL CABLE LENGTH: $rx_len"; exit 1; } if ($rx_ant_ht < 1 || !$rx_ant_ht) { print "YOU NEED TO ENTER THE RECEIVER'S ANTENNA HEIGHT: $rx_ant_ht"; exit 1; } if ($rx_ant_ht_val eq "feet") { $rx_ant_ht_m = sprintf "%.2f", $rx_ant_ht * 0.3048; # feet to meters $rx_ant_ht_ft = sprintf "%.2f", $rx_ant_ht; } elsif ($rx_ant_ht_val eq "meters") { $rx_ant_ht_ft = sprintf "%.2f", $rx_ant_ht * 3.2808399; # meters to feet $rx_ant_ht_m = sprintf "%.2f", $rx_ant_ht; } ## Calculate Antenna Gains, Minus Radome Losses # if ($tx_ant_val eq "dBd") { $tx_ant_gain_dbi = sprintf "%.2f", ($tx_ant_gain + 2.15) - $tx_ant_gain_radome; # dBd to dBi $tx_ant_gain_dbd = sprintf "%.2f", $tx_ant_gain - $tx_ant_gain_radome; $tx_ant_gain_radome = sprintf "%.2f", $tx_ant_gain_radome; } elsif ($tx_ant_val eq "dBi") { $tx_ant_gain_dbd = sprintf "%.2f", ($tx_ant_gain - 2.15) - $tx_ant_gain_radome; # dBi to dBd $tx_ant_gain_dbi = sprintf "%.2f", $tx_ant_gain - $tx_ant_gain_radome; $tx_ant_gain_radome = sprintf "%.2f", $tx_ant_gain_radome; } if ($rx_ant_val eq "dBd") { $rx_ant_gain_dbi = sprintf "%.2f", ($rx_ant_gain + 2.15) - $rx_ant_gain_radome; # dBd to dBi $rx_ant_gain_dbd = sprintf "%.2f", $rx_ant_gain - $rx_ant_gain_radome; $rx_ant_gain_radome = sprintf "%.2f", $rx_ant_gain_radome; } elsif ($rx_ant_val eq "dBi") { $rx_ant_gain_dbd = sprintf "%.2f", ($rx_ant_gain - 2.15) - $rx_ant_gain_radome; # dBi to dBd $rx_ant_gain_dbi = sprintf "%.2f", $rx_ant_gain - $rx_ant_gain_radome; $rx_ant_gain_radome = sprintf "%.2f", $rx_ant_gain_radome; } ## Get Diversity Antenna Parameters # if ($rx_div_ant_ht <= 1) { $do_div = "no"; # Don't do diversity calculations if spacing is less than 1 feet $div_ft = sprintf "%.2f", 0; $div_m = sprintf "%.2f", 0; $div_ant_dbi = sprintf "%.2f", 0; $div_ant_dbd = sprintf "%.2f", 0; $div_ant_ht_ft = "Not Applicable"; $div_ant_ht_m = "N/A"; $rx_div_ant_gain_radome = sprintf "%.2f", 0; } elsif ($rx_div_ant_ht > 1) { $do_div = "yes"; if ($rx_div_ant_ht_val eq "feet") { $div_m = $rx_div_ant_ht * 0.3048; # feet to meters $div_ft = $rx_div_ant_ht; } elsif ($rx_div_ant_ht_val eq "meters") { $div_ft = $rx_div_ant_ht * 3.2808399; # meters to feet $div_m = $rx_div_ant_ht; } if ($rx_div_ant_val eq "dBd") { $div_ant_dbi = sprintf "%.2f", ($rx_div_ant_gain + 2.15) - $rx_div_ant_gain_radome; $div_ant_dbd = sprintf "%.2f", $rx_div_ant_gain - $rx_div_ant_gain_radome; } elsif ($rx_div_ant_val eq "dBi") { $div_ant_dbd = sprintf "%.2f", ($rx_div_ant_gain - 2.15) - $rx_div_ant_gain_radome; $div_ant_dbi = sprintf "%.2f", $rx_div_ant_gain - $rx_div_ant_gain_radome; } $div_ant_ht_ft = sprintf "%.2f", ($div_ft + $rx_ant_ht_ft); $div_ant_ht_m = sprintf "%.2f", ($div_ft + $rx_ant_ht_ft) * 0.3048; $div_ft = sprintf "%.2f", $div_ft; $div_m = sprintf "%.2f", $div_m; if ($div_ft > 50 || $div_ft < 9) { $div_ft_check = "(Spacing Error)"; } else { $div_ft_check = "(Spacing O.K.)"; } if (abs($rx_ant_gain_dbi - $div_ant_dbi) > 6) { $div_gain_check = "(Gain Error)"; } else { $div_gain_check = "(Gain O.K.)"; } } ## Calculate Vertical Diversity Spacing Based on Wavelength and Distance # if ($do_div eq "yes") { # User supplied diversity spacing # Spacing should be an ODD multiple of 1/2 wavelength $div_check = sprintf "%.f", $div_ft / $wav_half_ft; if ($div_check % 2 == 0) { $div_check--; } # Adjust user supplied value $div_calc_ft = sprintf "%.2f", $div_check * $wav_half_ft; $div_calc_m = sprintf "%.2f", $div_check * $wav_half_ft * 0.3048; # Calculate ideal spacing based on wavelength $div_space_m = $wav_m * ((3 * ($dist_km * 1000)) / (8 * $tx_ant_ht_m)); $div_space_ft = $div_space_m * 3.28084; if ($div_space_ft > 50) { $div_space_ft = 50; # Vigants space diversity improvement equations are only accurate for 10-50 ft spacing } # Spacing should be an ODD multiple of 1/2 wavelength $div_check = sprintf "%.f", $div_space_ft / $wav_half_ft; if ($div_check % 2 == 0) { $div_check--; } # Adjust calculted value $div_space_ft = sprintf "%.2f", $div_check * $wav_half_ft; $div_space_m = sprintf "%.2f", $div_check * $wav_half_ft * 0.3048; # feet to meters } else { # Calculate ideal spacing based on wavelength $div_space_m = $wav_m * ((3 * ($dist_km * 1000)) / (8 * $tx_ant_ht_m)); $div_space_ft = $div_space_m * 3.28084; if ($div_space_ft > 50) { $div_space_ft = 50; # Vigants space diversity improvement equations are only accurate for 10-50 ft spacing } # Spacing should be an ODD multiple of 1/2 wavelength $div_check = sprintf "%.f", $div_space_ft / $wav_half_ft; if ($div_check % 2 == 0) { $div_check--; } $div_space_ft = sprintf "%.2f", $div_check * $wav_half_ft; $div_space_m = sprintf "%.2f", $div_check * $wav_half_ft * 0.3048; # feet to meters $div_calc_ft = "Not Applicable"; $div_calc_m = "N/A"; } ## Average Annual Temperature # $temp =~ tr/0-9.//csd; ## F to Umm C & K # if ($temp_val eq "fahrenheit") { $temp_c = sprintf "%.1f", (5 / 9) * ($temp - 32); $temp_k = sprintf "%.1f", 273.15 + ((5 / 9) * ($temp - 32)); $temp_f = sprintf "%.1f", $temp; } elsif ($temp_val eq "celsius") { $temp_f = sprintf "%.1f", ((9 / 5) * $temp) + 32; $temp_k = sprintf "%.1f", 273.15 + (((9 / 5) * $temp) + 32); $temp_c = sprintf "%.1f", $temp; } ## Humidity & Pressure # $rh =~ tr/0-9.//csd; $baro =~ tr/0-9.//csd; if (!$rh) { $rh = 50; # 50% relative humidity } if (!$baro) { $baro = 30; # 30 inches of mercury } ## Get K-Factor # # check3 = Would You Like to Calculate the Effective Earth Radius, K-Factor? if ($check3 eq "yes") { $k_ht =~ tr/0-9//csd; # Get general site elevation for k-factor if ($k_ht_val eq "meters") { $k_ht_m = sprintf "%.2f", $k_ht; $k_ht_ft = sprintf "%.2f", $k_ht * 3.2808399; } if ($k_ht_val eq "feet") { $k_ht_m = sprintf "%.2f", $k_ht * 0.3048; $k_ht_ft = sprintf "%.2f", $k_ht } # Atmospheric pressure from inches of mercury to millibars with sea level correction. $atmos_p = (33.86 * $baro) - ($k_ht_ft * 0.025); # Saturation vapor pressure, millibars $es = exp(1.805 + (0.0738 * $temp_c) - (0.000298 * ($temp_c ** 2))); # Partial vapor pressure, millibars $vapor_p = ($rh / 100) * $es; # Index of refraction $N = (77.6 / $temp_k) * ($atmos_p + (4810 * ($vapor_p / $temp_k))); # Effective Earth radius, K factor $k = sprintf "%.2f", 1 / (1 - 0.04665 * exp(0.005577 * $N)); $k_str = sprintf "%.2f", $k; if (!$k) { $k = "1.33"; $k_str = "4/3"; } if ($N < 50) { $N = 50; } if ($N > 500) { $N = 500; } $nunits = sprintf "%.f", $N; $vapor_p = sprintf "%.2f", $vapor_p; $es = sprintf "%.2f", $es; $atmos_p = sprintf "%.2f", $atmos_p; $k_dec = sprintf "%.2f", $k; $k_val = "Calculated"; } elsif ($check3 eq "no") { if ($k eq "5/12") { $k = 0.417; $k_str = "5/12"; } elsif ($k eq "1/2") { $k = 0.500; $k_str = "1/2"; } elsif ($k eq "2/3") { $k = 0.667; $k_str = "2/3"; } elsif ($k eq "1.0") { $k = 1.001; # to prevent divide-by-0 errors $k_str = "1.0"; } elsif ($k eq "7/6") { $k = 1.167; $k_str = "7/6"; } elsif ($k eq "5/4") { $k = 1.250; $k_str = "5/4"; } elsif ($k eq "4/3") { $k = 1.333; $k_str = "4/3"; } elsif ($k eq "5/3") { $k = 1.667; $k_str = "5/3"; } elsif ($k eq "7/4") { $k = 1.750; $k_str = "7/4"; } elsif ($k eq "2.0") { $k = 2.000; $k_str = "2.0"; } elsif ($k eq "3.0") { $k = 3.000; $k_str = "3.0"; } elsif ($k eq "4.0") { $k = 4.000; $k_str = "4.0"; } elsif ($k eq "20.0") { $k = 20.000; $k_str = "20.0"; } elsif ($k eq "Infinity") { $k = 100.000; $k_str = "Infinity"; } ## Calculate N-units based on K-factor $nunits = 179.3 * (ln ((1 / 0.04665) * (1 - (1 / $k)))); if ($nunits < 50) { $nunits = 50; } if ($nunits > 500) { $nunits = 500; } $nunits = sprintf "%.f", $nunits; $es = sprintf "%.2f", exp(1.805 + (0.0738 * $temp_c) - (0.000298 * ($temp_c ** 2))); $atmos_p = sprintf "%.2f", 1013.25; $k_dec = sprintf "%.2f", $k; $k_val = "User Supplied"; $vapor_p = "Not Applicable"; } ## Get Earth Dielectric Constant # $diecon =~ tr/0-9A-Za-z,: //csd; if ($diecon eq "81 : Salt Water") { $diecon = 81; $diecon_desc = "Salt Water"; } elsif ($diecon eq "80 : Fresh Water") { $diecon = 80; $diecon_desc = "Fresh Water"; } elsif ($diecon eq "30 : Wet Ground") { $diecon = 30; $diecon_desc = "Wet Ground"; } elsif ($diecon eq "25 : Good Ground") { $diecon = 25; $diecon_desc = "Good Ground"; } elsif ($diecon eq "20 : Pastoral, Low Hills, Rich Soil") { $diecon = 20; $diecon_desc = "Pastoral, Low Hills, Rich Soil"; } elsif ($diecon eq "15 : Average Ground, Farmland, Forest") { $diecon = 15; $diecon_desc = "Average Ground, Farmland, Forest"; } elsif ($diecon eq "13 : Pastoral, Medium Hills, Forestation") { $diecon = 13; $diecon_desc = "Pastoral, Medium Hills, Forestation"; } elsif ($diecon eq "12 : Marshy Land, Flat Country, Densely Wooded") { $diecon = 12; $diecon_desc = "Marshy Land, Flat Country, Densely Wooded"; } elsif ($diecon eq "11 : Rocky Soil, Steep Hills, Mountainous") { $diecon = 11; $diecon_desc = "Rocky Soil, Steep Hills, Mountainous"; } elsif ($diecon eq "10 : Sandy, Dry, Flat, Coastal") { $diecon = 10; $diecon_desc = "Sandy, Dry, Flat, Coastal"; } elsif ($diecon eq "5 : Industrial Areas, Residential Areas") { $diecon = 5; $diecon_desc = "Industrial Areas, Cities"; } elsif ($diecon eq "4 : Poor Ground") { $diecon = 4; $diecon_desc = "Poor Ground"; } elsif ($diecon eq "3 : Heavy Industrial Areas, Very Dry Ground") { $diecon = 3; $diecon_desc = "Heavy Industrial Areas"; } if (!$diecon) { $diecon = 15; $diecon_desc = "Average Ground, Farmland, Forest"; } $diecon = sprintf "%.1f", $diecon; ## Get Earth Conductivity # $earcon =~ tr/0-9//csd; if ($earcon > 99 || $earcon < 0 || !$earcon) { $earcon = 5; # millisiemens per meter } $earcon = sprintf "%.3f", $earcon / 1000; # millisiemens to siemens ## Antenna Polarization # if ($polar eq "Vertical") { $ant = 1; # Vertical } elsif ($polar eq "Horizontal") { $ant = 0; # Horizontal } ## Get Longley-Rice Confidence and Time # $sit =~ tr/0-9//csd; $time =~ tr/0-9//csd; $si = sprintf "%.2f", $sit / 100; $ti = sprintf "%.2f", $time / 100; ## Get Longley-Rice Climate # if ($climate eq "Equatorial") { $cli = 1; } elsif ($climate eq "Continental Subtropical") { $cli = 2; } elsif ($climate eq "Maritime Subtropical") { $cli = 3; } elsif ($climate eq "Desert") { $cli = 4; } elsif ($climate eq "Continental Temperate") { $cli = 5; } elsif ($climate eq "Maritime Temperate, Overland") { $cli = 6; } elsif ($climate eq "Maritime Temperate, Oversea") { $cli = 7; } ## Attempt to Get UTM Coordinates # if ($do_utm eq "yes") { # TX ($utm_zone_tx, $easting_tx, $northing_tx) = latlon_to_utm('WGS-84', $LAT1, $LON1_geo); $northing_tx = sprintf "%.3f", $northing_tx / 1000; $easting_tx = sprintf "%.3f", $easting_tx / 1000; # RX ($utm_zone_rx, $easting_rx, $northing_rx) = latlon_to_utm('WGS-84', $LAT2, $LON2_geo); $northing_rx = sprintf "%.3f", $northing_rx / 1000; $easting_rx = sprintf "%.3f", $easting_rx / 1000; } else { $utm_zone_tx = "N/A"; $easting_tx = "N/A"; $northing_tx = "N/A"; $utm_zone_rx = "N/A"; $easting_rx = "N/A"; $northing_rx = "N/A"; } ## Attempt to Get the State from the TX LAT/LON # my $geocoder = Geo::Coder::OSM->new(); my $result_tx = $geocoder->reverse_geocode(lat => $LAT1, lon => $LON1_geo); my $result_rx = $geocoder->reverse_geocode(lat => $LAT2, lon => $LON2_geo); if ($result_rx) { # Get RX sites stats from OSM $country_rx = $result_rx->{address}{country}; $state_rx = $result_rx->{address}{state}; $city_rx = $result_rx->{address}{city}; $county_rx = $result_rx->{address}{county}; } if ($result_tx) { # Get TX sites stats from OSM $country_tx = $result_tx->{address}{country}; $state_tx = $result_tx->{address}{state}; $city_tx = $result_tx->{address}{city}; $county_tx = $result_tx->{address}{county}; } else { # Get user supplied state $geo =~ tr/A-Z//csd; $state_tx = $geo; } if (!$county_tx) { $county_tx = "N/A"; } if (!$state_tx) { $state_tx = "N/A"; } if (!$city_tx) { $city_tx = $county_tx; } if (!$county_rx) { $county_rx = "N/A"; } if (!$state_rx) { $state_rx = "N/A"; } if (!$city_rx) { $city_rx = $county_rx; } ## Convert State Names to 2-Letter Postal Codes # if ($state_tx eq "Alabama") { $state_name_tx = "AL"; } elsif ($state_tx eq "Alaska") { $state_name_tx = "AK"; } elsif ($state_tx eq "Arizona") { $state_name_tx = "AR"; } elsif ($state_tx eq "California") { $state_name_tx = "CA"; } elsif ($state_tx eq "Colorado") { $state_name_tx = "CO"; } elsif ($state_tx eq "Connecticut") { $state_name_tx = "CT"; } elsif ($state_tx eq "Delaware") { $state_name_tx = "DE"; } elsif ($state_tx eq "District of Columbia") { $state_name_tx = "DC"; } elsif ($state_tx eq "Florida") { $state_name_tx = "FL"; } elsif ($state_tx eq "Georgia") { $state_name_tx = "GA"; } elsif ($state_tx eq "Hawaii") { $state_name_tx = "HI"; } elsif ($state_tx eq "Idaho") { $state_name_tx = "ID"; } elsif ($state_tx eq "Illinois") { $state_name_tx = "IL"; } elsif ($state_tx eq "Indiana") { $state_name_tx = "IN"; } elsif ($state_tx eq "Iowa") { $state_name_tx = "IA"; } elsif ($state_tx eq "Kansas") { $state_name_tx = "KS"; } elsif ($state_tx eq "Kentucky") { $state_name_tx = "KY"; } elsif ($state_tx eq "Louisiana") { $state_name_tx = "LA"; } elsif ($state_tx eq "Maine") { $state_name_tx = "ME"; } elsif ($state_tx eq "Maryland") { $state_name_tx = "MD"; } elsif ($state_tx eq "Massachusetts") { $state_name_tx = "MA"; } elsif ($state_tx eq "Michigan") { $state_name_tx = "MI"; } elsif ($state_tx eq "Minnesota") { $state_name_tx = "MN"; } elsif ($state_tx eq "Mississippi") { $state_name_tx = "MS"; } elsif ($state_tx eq "Missouri") { $state_name_tx = "MO"; } elsif ($state_tx eq "Montana") { $state_name_tx = "MT"; } elsif ($state_tx eq "Nebraska") { $state_name_tx = "NE"; } elsif ($state_tx eq "Nevada") { $state_name_tx = "NV"; } elsif ($state_tx eq "New Hampshire") { $state_name_tx = "NH"; } elsif ($state_tx eq "New Mexico") { $state_name_tx = "NM"; } elsif ($state_tx eq "New York") { $state_name_tx = "NY"; } elsif ($state_tx eq "North Carolina") { $state_name_tx = "NC"; } elsif ($state_tx eq "North Dakota") { $state_name_tx = "ND"; } elsif ($state_tx eq "Ohio") { $state_name_tx = "OH"; } elsif ($state_tx eq "Oklahoma") { $state_name_tx = "OK"; } elsif ($state_tx eq "Oregon") { $state_name_tx = "OR"; } elsif ($state_tx eq "Pennsylvania") { $state_name_tx = "PA"; } elsif ($state_tx eq "Rhode Island") { $state_name_tx = "RI"; } elsif ($state_tx eq "South Carolina") { $state_name_tx = "SC"; } elsif ($state_tx eq "South Dakota") { $state_name_tx = "SD"; } elsif ($state_tx eq "Tennessee") { $state_name_tx = "TN"; } elsif ($state_tx eq "Texas") { $state_name_tx = "TX"; } elsif ($state_tx eq "Utah") { $state_name_tx = "UT"; } elsif ($state_tx eq "Vermont") { $state_name_tx = "VT"; } elsif ($state_tx eq "Virginia") { $state_name_tx = "VA"; } elsif ($state_tx eq "Washington") { $state_name_tx = "WA"; } elsif ($state_tx eq "West Virginia") { $state_name_tx = "WV"; } elsif ($state_tx eq "Wisconsin") { $state_name_tx = "WI"; } elsif ($state_tx eq "Wyoming") { $state_name_tx = "WY"; } else { $state_name_tx = "NONE"; } ## City/County Data for SPLAT! # if ($country_tx eq "United States") { $cities = $state_name_tx . ".dat"; $counties = $state_name_tx . ".co.dat"; } ## Generate Config Files for SPLAT! # open(TX, ">", "tx.qth") or die "Can't open tx.qth: $!\n" ; print TX "$tx_name\n"; print TX "$LAT1\n"; print TX "$LON1\n"; print TX "$tx_ant_ht_ft\n"; close TX; open(RX, ">", "rx.qth") or die "Can't open rx.qth: $!\n"; print RX "$rx_name\n"; print RX "$LAT2\n"; print RX "$LON2\n"; print RX "$rx_ant_ht_ft\n"; close RX; if ($do_div eq "yes") { $rx_div_name = $rx_name . "-DIV"; open(RX, ">", "rx-div.qth") or die "Can't open rx-div.qth: $!\n"; print RX "$rx_div_name\n"; print RX "$LAT2\n"; print RX "$LON2\n"; print RX "$div_ant_ht_ft\n"; close RX; } open(LR, ">", "tx.lrp") or die "Can't open tx.lrp: $!\n"; print LR "$diecon\n"; # Earth Dielectric Constant (Relative permittivity) - 15.000 print LR "$earcon\n"; # Earth Conductivity (Siemens per meter) - 0.005 print LR "$nunits\n"; # Atmospheric Bending Constant (N-units) - 301.000 print LR "$frq_mhz\n"; # # Frequency in MHz (20 MHz to 20 GHz) print LR "$cli\n"; # Radio Climate (5 = Continental Temperate) print LR "$ant\n"; # Polarization (0 = Horizontal, 1 = Vertical) print LR "$si\n"; # Fraction of situations (50% of locations) print LR "$ti\n"; # Fraction of time (90% of the time) print LR "0\n"; # Effective Radiated Power (ERP) in Watts (optional) close TX; # Use TX Longley-Rice parameters for RX also open(LR, ">", "rx.lrp") or die "Can't open rx.lrp: $!\n"; print LR "$diecon\n"; # Earth Dielectric Constant (Relative permittivity) - 15.000 print LR "$earcon\n"; # Earth Conductivity (Siemens per meter) - 0.005 print LR "$nunits\n"; # Atmospheric Bending Constant (N-units) - 301.000 print LR "$frq_mhz\n"; # # Frequency in MHz (20 MHz to 20 GHz) print LR "$cli\n"; # Radio Climate (5 = Continental Temperate) print LR "$ant\n"; # Polarization (0 = Horizontal, 1 = Vertical) print LR "$si\n"; # Fraction of situations (50% of locations) print LR "$ti\n"; # Fraction of time (90% of the time) print LR "0\n"; # Effective Radiated Power (ERP) in Watts (optional) close TX; # Run SPLAT! # if ($country_tx eq "United States") { if ($quality eq "Low / Fast") { $qual = "SRTMv3 3 Arc-Second Resolution (Standard)"; $file1 = sprintf "%s/%.f:%.f:%.f:%.f.sdf", $splatdir, $LAT1_D, ($LAT1_D + 1), $LON1_D, ($LON1_D + 1); $file2 = sprintf "%s/%.f_%.f_%.f_%.f.sdf", $splatdir, $LAT2_D, ($LAT2_D + 1), $LON2_D, ($LON2_D + 1); if (!-f $file1) { #print "

Elevation Data Unavailable for: $file1

\n"; } if (!-f $file2) { print "

Elevation Data Unavailable for: $file2

\n"; } if ($do_div eq "yes") { # Diversity: TX -> RX Primary Path system("$splat -t tx.qth -r rx.qth -p pro1 -e ElevPro1 -gc $gc_ft -H PathProfile1 -l PathLoss1 -m $k -f $frq_mhz -fz $fres -o TopoMap -sc -png -itwom -gpsav -imperial -kml -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile1.gp"); system("/bin/mv reference.gp reference1.gp"); system("/bin/mv fresnel.gp fresnel1.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61.gp"); system("/bin/mv curvature.gp curvature1.gp"); system("/bin/mv elevation-profile.gp elevation-profile1.gp"); system("/bin/mv elevation-reference.gp elevation-reference1.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1.gp >/dev/null 2>&1"); # Diversity: TX -> RX Diversity Path system("$splat -t tx.qth -r rx-div.qth -p pro1-div -e ElevPro1-div -gc $gc_ft -H PathProfile1-div -l PathLoss1-div -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile1-div.gp"); system("/bin/mv reference.gp reference1-div.gp"); system("/bin/mv fresnel.gp fresnel1-div.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61-div.gp"); system("/bin/mv curvature.gp curvature1-div.gp"); system("/bin/mv elevation-profile.gp elevation-profile1-div.gp"); system("/bin/mv elevation-reference.gp elevation-reference1-div.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1-div.gp >/dev/null 2>&1"); # Diversity: RX Diversity Path -> TX system("$splat -t rx-div.qth -r tx.qth -p pro2-div -e ElevPro2-div -gc $gc_ft -H PathProfile2-div -l PathLoss2-div -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile2-div.gp"); system("/bin/mv reference.gp reference2-div.gp"); system("/bin/mv fresnel.gp fresnel2-div.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_62-div.gp"); system("/bin/mv curvature.gp curvature2-div.gp"); system("/bin/mv elevation-profile.gp elevation-profile2-div.gp"); system("/bin/mv elevation-reference.gp elevation-reference2-div.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter2-div.gp >/dev/null 2>&1"); # Diversity: RX Primary Path to TX # This is the one used for the Diversity TerrainProfile system("$splat -t rx.qth -r tx.qth -p pro2 -e ElevPro2 -gc $gc_ft -H PathProfile2 -l PathLoss2 -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } elsif ($do_div eq "no") { # Non-Diversity: TX -> RX system("$splat -t tx.qth -r rx.qth -p pro1 -e ElevPro1 -gc $gc_ft -H PathProfile1 -l PathLoss1 -m $k -f $frq_mhz -fz $fres -o TopoMap -sc -png -itwom -gpsav -imperial -kml -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile1.gp"); system("/bin/mv reference.gp reference1.gp"); system("/bin/mv fresnel.gp fresnel1.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61.gp"); system("/bin/mv curvature.gp curvature1.gp"); system("/bin/mv elevation-profile.gp elevation-profile1.gp"); system("/bin/mv elevation-reference.gp elevation-reference1.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1.gp >/dev/null 2>&1"); # Non-Diversity: RX -> TX # This is the one used for the Non-Diversity TerrainProfile system("$splat -t rx.qth -r tx.qth -p pro2 -e ElevPro2 -gc $gc_ft -H PathProfile2 -l PathLoss2 -m 1 -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } } elsif ($quality eq "High / Slow") { #$qual = "SRTMv3 1 Arc-Second Resolution (HD)"; $qual = "ASTER Global Digital Elevation (HD)"; $file1 = sprintf "%s/%.f:%.f:%.f:%.f-hd.sdf", $splatdirhd, $LAT1_D, ($LAT1_D + 1), $LON1_D, ($LON1_D + 1); $file2 = sprintf "%s/%.f_%.f_%.f_%.f-hd.sdf", $splatdirhd, $LAT2_D, ($LAT2_D + 1), $LON2_D, ($LON2_D + 1); if (!-f $file1) { #print "

HD Elevation Data Unavailable for: $file1

\n"; } if (!-f $file2) { print "

HD Elevation Data Unavailable for: $file2

\n"; } if ($do_div eq "no") { # Non-Diversity: TX -> RX system("$splat -hd -t tx.qth -r rx.qth -p pro1 -e ElevPro1 -gc $gc_ft -H PathProfile1 -l PathLoss1 -m $k -f $frq_mhz -fz $fres -o TopoMap -sc -png -itwom -gpsav -imperial -kml -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile1.gp"); system("/bin/mv reference.gp reference1.gp"); system("/bin/mv fresnel.gp fresnel1.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61.gp"); system("/bin/mv curvature.gp curvature1.gp"); system("/bin/mv elevation-profile.gp elevation-profile1.gp"); system("/bin/mv elevation-reference.gp elevation-reference1.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1.gp >/dev/null 2>&1"); # Non-Diversity: RX -> TX # This is the one used for the HD Non-Diversity TerrainProfile system("$splat -hd -t rx.qth -r tx.qth -p pro2 -e ElevPro2 -gc $gc_ft -H PathProfile2 -l PathLoss2 -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } elsif($do_div eq "yes") { # Diversity: TX -> RX Primary Path system("$splat -hd -t tx.qth -r rx.qth -p pro1 -e ElevPro1 -gc $gc_ft -H PathProfile1 -l PathLoss1 -m $k -f $frq_mhz -fz $fres -o TopoMap -sc -png -itwom -gpsav -imperial -kml -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile1.gp"); system("/bin/mv reference.gp reference1.gp"); system("/bin/mv fresnel.gp fresnel1.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61.gp"); system("/bin/mv curvature.gp curvature1.gp"); system("/bin/mv elevation-profile.gp elevation-profile1.gp"); system("/bin/mv elevation-reference.gp elevation-reference1.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1.gp >/dev/null 2>&1"); # Diversity: TX -> RX Diversity Path system("$splat -hd -t tx.qth -r rx-div.qth -p pro1-div -e ElevPro1-div -gc $gc_ft -H PathProfile1-div -l PathLoss1-div -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile1-div.gp"); system("/bin/mv reference.gp reference1-div.gp"); system("/bin/mv fresnel.gp fresnel1-div.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61-div.gp"); system("/bin/mv curvature.gp curvature1-div.gp"); system("/bin/mv elevation-profile.gp elevation-profile1-div.gp"); system("/bin/mv elevation-reference.gp elevation-reference1-div.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1-div.gp >/dev/null 2>&1"); # Diversity: RX Diversity Path -> TX system("$splat -hd -t rx-div.qth -r tx.qth -p pro2-div -e ElevPro2-div -gc $gc_ft -H PathProfile2-div -l PathLoss2-div -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("/bin/mv profile.gp profile2-div.gp"); system("/bin/mv reference.gp reference2-div.gp"); system("/bin/mv fresnel.gp fresnel2-div.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_62-div.gp"); system("/bin/mv curvature.gp curvature2-div.gp"); system("/bin/mv elevation-profile.gp elevation-profile2-div.gp"); system("/bin/mv elevation-reference.gp elevation-reference2-div.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter2-div.gp >/dev/null 2>&1"); # Diversity: RX Primary Path -> TX # This is the one used for the HD Diversity TerrainProfile system("$splat -hd -t rx.qth -r tx.qth -p pro2 -e ElevPro2 -gc $gc_ft -H PathProfile2 -l PathLoss2 -m 1 -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } } } else { # International $qual = "SRTMv3 3 Arc-Second Resolution (Standard)"; if ($do_div eq "yes") { # Diversity: TX -> RX Primary Path system("$splat -t tx.qth -r rx.qth -p pro1 -e ElevPro1 -gc $gc_ft -H PathProfile1 -l PathLoss1 -m $k -f $frq_mhz -fz $fres -o TopoMap -sc -png -itwom -imperial -gpsav -kml -d $splatdir >/dev/null 2>&1"); system("/bin/mv profile.gp profile1.gp"); system("/bin/mv reference.gp reference1.gp"); system("/bin/mv fresnel.gp fresnel1.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61.gp"); system("/bin/mv curvature.gp curvature1.gp"); system("/bin/mv elevation-profile.gp elevation-profile1.gp"); system("/bin/mv elevation-reference.gp elevation-reference1.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1.gp >/dev/null 2>&1"); # Diversity: TX -> RX Diversity Path system("$splat -t tx.qth -r rx-div.qth -p pro1-div -e ElevPro1-div -gc $gc_ft -H PathProfile1-div -l PathLoss1-div -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdir >/dev/null 2>&1"); system("/bin/mv profile.gp profile1-div.gp"); system("/bin/mv reference.gp reference1-div.gp"); system("/bin/mv fresnel.gp fresnel1-div.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_61-div.gp"); system("/bin/mv curvature.gp curvature1-div.gp"); system("/bin/mv elevation-profile.gp elevation-profile1-div.gp"); system("/bin/mv elevation-reference.gp elevation-reference1-div.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter1-div.gp >/dev/null 2>&1"); # Diversity: RX Diversity Path -> TX system("$splat -t rx-div.qth -r tx.qth -p pro2-div -e ElevPro2-div -gc $gc_ft -H PathProfile2-div -l PathLoss2-div -m $k -f $frq_mhz -fz $fres -sc -png -itwom -gpsav -imperial -d $splatdir >/dev/null 2>&1"); system("/bin/mv profile.gp profile2-div.gp"); system("/bin/mv reference.gp reference2-div.gp"); system("/bin/mv fresnel.gp fresnel2-div.gp"); system("/bin/mv fresnel_pt_6.gp fresnel_pt_62-div.gp"); system("/bin/mv curvature.gp curvature2-div.gp"); system("/bin/mv elevation-profile.gp elevation-profile2-div.gp"); system("/bin/mv elevation-reference.gp elevation-reference2-div.gp"); system("/bin/mv elevation-clutter.gp elevation-clutter2-div.gp >/dev/null 2>&1"); # Diversity: RX Primary Path -> TX system("$splat -t rx.qth -r tx.qth -p pro2 -e ElevPro2 -gc $gc_ft -H PathProfile2 -l PathLoss2 -m $k -f $frq_mhz -fz $fres -sc -png -itwom -imperial -gpsav -d $splatdir >/dev/null 2>&1"); } elsif ($do_div eq "no") { # Non-Diversity: TX -> RX system("$splat -t tx.qth -r rx.qth -p pro1 -e ElevPro1 -gc $gc_ft -H PathProfile1 -l PathLoss1 -m $k -f $frq_mhz -fz $fres -o TopoMap -sc -png -itwom -imperial -gpsav -kml -d $splatdir >/dev/null 2>&1"); # Non-Diversity; RX -> TX system("$splat -t rx.qth -r tx.qth -p pro2 -e ElevPro2 -gc $gc_ft -H PathProfile2 -l PathLoss2 -m $k -f $frq_mhz -fz $fres -sc -png -itwom -imperial -gpsav -d $splatdir >/dev/null 2>&1"); } } ## Total Hack to Remove Antenna Heights from SPLAT! Terrain Profile Data # chomp($first = `/usr/bin/head -n 1 profile.gp`); ($first_dist, $first_elev) = split '\t', $first; $new_elev = $first_elev - $tx_ant_ht_ft; # Subtract TX antenna height from FIRST elevation point if ($new_elev > 0) { $tx_elv_ft = sprintf "%.2f", $new_elev; $tx_elv_m = sprintf "%.2f", $new_elev * 0.3048; } else { $tx_elv_ft = sprintf "%.2f", 0; $tx_elv_m = sprintf "%.2f", 0; } chomp($last = `/usr/bin/tail -n 1 profile.gp`); ($last_dist, $last_elev) = split '\t', $last ; $new_elev = $last_elev - $rx_ant_ht_ft; # Subtract RX antenna height from LAST elevation point if ($new_elev > 0) { $rx_elv_ft = sprintf "%.2f", $new_elev; $rx_elv_m = sprintf "%.2f", $new_elev * 0.3048; } else { $rx_elv_ft = sprintf "%.2f", 0; $rx_elv_m = sprintf "%.2f", 0; } # Get antenna height above AMSL $tx_ant_ht_ov_m = sprintf "%.2f", $tx_elv_m + $tx_ant_ht_m; $rx_ant_ht_ov_m = sprintf "%.2f", $rx_elv_m + $rx_ant_ht_m; $tx_ant_ht_ov_ft = sprintf "%.2f", $tx_elv_ft + $tx_ant_ht_ft; $rx_ant_ht_ov_ft = sprintf "%.2f", $rx_elv_ft + $rx_ant_ht_ft; # Subtract TX and RX antenna heights from elevation data open(F, ">", "elev1") or die "Can't open elev1: $!\n"; chomp($first = `head -n 1 profile.gp`); ($a, $b) = split '\t', $first; $b = $b - $tx_ant_ht_ft; if ($b < 0) { $b = 0; } print F "$a\t$b\n"; close F; &System($args = "/usr/bin/tail -n +2 profile.gp >> elev1"); chomp($last = `tail -n 1 profile.gp`); ($a, $b) = split('\t', $last); $b = $b - $rx_ant_ht_ft; if ($b < 0) { $b = 0; } &System($args = "/usr/bin/head -n -1 elev1 > profile2.gp"); open(F, ">>", "profile2.gp") or die "Can't open elev2: $!\n"; print F "$a\t$b\n"; close F; # Average height, minimum height, maximum height system("/usr/bin/sed -e '1d' -e '\$d' profile.gp > average.gp"); # skip first and last lines to get fake antenna elevations open(F, "<", "average.gp") || die "Can't open average.gp: $!\n"; chomp(my @AVG = ); close F; foreach (@AVG) { ($x, $y) = split; push (@DIST, $x); push (@ELEV, $y); } ## Sort the Array # use List::Util qw(min max); $max_dist = max(@DIST); $min_elev = min(@ELEV); $max_elev = max(@ELEV); $count = 0; $ee = 0; $e = 0; foreach $e (@ELEV) { $ee += $e; $count++; } $avg_ht_ft = sprintf "%.2f", ($ee / $count); $avg_ht_m = sprintf "%.2f", ($ee / $count) * 0.3048; $min_elev_ft = sprintf "%.2f", $min_elev; $min_elev_m = sprintf "%.2f", $min_elev * 0.3048; $max_elev_ft = sprintf "%.2f", $max_elev; $max_elev_m = sprintf "%.2f", $max_elev * 0.3048; ## Earth Bulge # if ($k_str eq "Infinity") { $bulge_ft = sprintf "%.2f", 0; $bulge_m = sprintf "%.2f", 0; } else { $bulge = ($dist_mi / 2) * ($dist_mi / 2) / (1.5 * $k); $bulge_ft = sprintf "%.2f", $bulge; $bulge_m = sprintf "%.2f", $bulge_ft * 0.3048; } ## Maximum Fresnel Zone Radius # $max_fres_m = sprintf "%.2f", (17.34 * sqrt($dist_km / (4 * $frq_ghz))); $max_fres_ft = sprintf "%.2f", (17.34 * sqrt($dist_km / (4 * $frq_ghz))) / 0.3048; ## Obstruction Arrows on Terrain Graph (Only First 5) # $obs_count = 5; open(F, "<", "$rx_name-to-$tx_name.txt") or die "Can't open file $rx_name-to-$tx_name.txt: $!\n"; while () { chomp; if ($obs_count > 0) { if (/OBS:/) { ($z, $y, $x, $w, $v) = split '>'; $w =~ tr/0-9.//csd; push (@OBS, $w); $obs_count--; } } } close F; $obs1 = shift @OBS; $obs2 = shift @OBS; $obs3 = shift @OBS; $obs4 = shift @OBS; $obs5 = shift @OBS; ## Get ITM Path Loss Value - Primary # open(F, "<", "$rx_name-to-$tx_name.txt") or die "Can't open file $rx_name-to-$tx_name.txt: $!\n"; while () { chomp; if (/ITWOM Version/) { ($z, $y, $x, $w, $v) = split '>'; $w =~ tr/0-9.//csd; $itm = sprintf "%.2f", $w; } } close F; ## Get ITM Path Loss Value - Diversity # if ($do_div eq "yes") { open(F, "<", "$rx_div_name-to-$tx_name.txt") or die "Can't open file $rx_div_name-to-$tx_name.txt: $!\n"; while () { chomp; if (/ITWOM Version/) { ($z, $y, $x, $w, $v) = split '>'; $w =~ tr/0-9.//csd; $div_itm = sprintf "%.2f", $w; } } close F; } elsif ($do_div eq "no") { $div_itm = sprintf "%.2f", 0; $div_itm_rain = sprintf "%.2f", 0; } ## Generate Approximate ITM Path Loss Coverage at TX # $pathdist = sprintf "%.f", ($max_dist + 10); if ($country_tx eq "United States") { if ($quality eq "Low / Fast") { system("$splat -t tx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap1 -sc -png -imperial -itwom -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); if ($do_div eq "no") { system("$splat -t rx.qth -L $rx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap2 -sc -png -imperial -itwom -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } elsif ($do_div eq "yes") { system("$splat -t rx.qth -L $rx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap2 -sc -png -imperial -itwom -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("$splat -t rx-div.qth -L $rx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap-div -sc -png -imperial -itwom -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } } elsif ($quality eq "High / Slow") { if ($do_div eq "no") { system("$splat -hd -t tx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap1 -sc -png -imperial -itwom -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("$splat -hd -t rx.qth -L $rx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap2 -sc -png -imperial -itwom -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } elsif ($do_div eq "yes") { system("$splat -hd -t tx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap1 -sc -png -imperial -itwom -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("$splat -hd -t rx.qth -L $rx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap2 -sc -png -imperial -itwom -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("$splat -hd -t rx-div.qth -L $rx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap-div -sc -png -imperial -itwom -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } } } else { # International if ($do_div eq "no") { system("$splat -t tx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap1 -sc -png -imperial -itwom -d $splatdir >/dev/null 2>&1"); system("$splat -t tx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap2 -sc -png -imperial -itwom -d $splatdir >/dev/null 2>&1"); } if ($do_div eq "yes") { system("$splat -t tx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap1 -sc -png -imperial -itwom -d $splatdir >/dev/null 2>&1"); system("$splat -t rx.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap2 -sc -png -imperial -itwom -d $splatdir >/dev/null 2>&1"); system("$splat -t rx-div.qth -L $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LossMap-div -sc -png -imperial -itwom -d $splatdir >/dev/null 2>&1"); } } ## Generate Line-of-Sight Coverage at TX and RX # if ($country_tx eq "United States") { if ($quality eq "Low / Fast") { if ($do_div eq "no") { system("$splat -t tx.qth rx.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap -sc -png -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } elsif ($do_div eq "yes") { system("$splat -t tx.qth rx.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap -sc -png -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("$splat -t tx.qth rx-div.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap-div -sc -png -imperial -d $splatdir -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } } elsif ($quality eq "High / Slow") { if ($do_div eq "no") { system("$splat -hd -t tx.qth rx.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap -sc -png -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } elsif ($do_div eq "yes") { system("$splat -hd -t tx.qth rx.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap -sc -png -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); system("$splat -hd -t tx.qth rx-div.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap-div -sc -png -imperial -d $splatdirhd -s $splatdir/$cities -b $splatdir/$counties >/dev/null 2>&1"); } } } else { # International if ($do_div eq "no") { system("$splat -t tx.qth rx.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap -sc -png -imperial -d $splatdir >/dev/null 2>&1"); } elsif ($do_div eq "yes") { system("$splat -t tx.qth rx.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap -sc -png -imperial -d $splatdir >/dev/null 2>&1"); system("$splat -t tx.qth rx-div.qth -c $tx_ant_ht_ft -m $k -R $pathdist -gc $gc_ft -o LOSMap-div -sc -png -imperial -d $splatdir >/dev/null 2>&1"); } } ## Approx. Antenna 3 dB Beamwidth # $tx_ant_bw = sprintf "%.2f", 164 * sqrt(1 / (10 ** ($tx_ant_gain_dbi / 10))); $rx_ant_bw = sprintf "%.2f", 164 * sqrt(1 / (10 ** ($rx_ant_gain_dbi / 10))); ## Calculate Azimuths # $lat1_az = deg2rad($LAT1); $lon1_az = deg2rad($LON1 * -1); $lat2_az = deg2rad($LAT2); $lon2_az = deg2rad($LON2 * -1); $cosd = sin($lat2_az) * sin($lat1_az) + cos($lat1_az) * cos($lat2_az) * cos($lon1_az - $lon2_az); $daz = rad2deg(acos $cosd); $cosb = (sin($lat2_az) - sin($lat1_az) * cos(deg2rad($daz))) / (cos($lat1_az) * sin(deg2rad($daz))); if ($cosb > 0.999999) { $AZ = 0; } elsif ($cosb < -0.999999) { $AZ = 180; } else { $AZ = rad2deg(acos $cosb); } if (sin($lon2_az - $lon1_az) >= 0) { $AZSP = $AZ; $AZLP = 180 + $AZ; } else { $AZSP = 360 - $AZ; $AZLP = 180 - $AZ; } $AZSP = sprintf "%.2f", $AZSP; # TX to RX - TN $AZLP = sprintf "%.2f", $AZLP; # RX to TX - TN ## Calculate Magnetic Declination # # Magnetic declination calculation based on WMM2025 Earth Magnet Model. # See: https://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml # https://perlmonks.org/?node_id=1191907 # # magnetic_declination($lon, $lat, $hgt, $yr) # $lon: degrees longitude (east is positive) # $lat: degrees latitude (north is positive) # $hgt: elevation from sea level in meters, default=0 # $yr: year, default=2025 # Returns magnetic declination for the given location in degrees. # In array context, also returns magnetic inclination (dip). BEGIN { my @WMM2025 = ( [], [ [-29351.8, 0.0, 12.0, 0.0], [ -1410.8, 4545.4, 9.7, -21.5] ], [ [ -2556.6, 0.0, -11.6, 0.0], [ 2951.1, -3133.6, -5.2, -27.7], [ 1649.3, -815.1, -8.0, -12.1] ], [ [ 1361.0, 0.0, -1.3, 0.0], [ -2404.1, -56.6, -4.2, 4.0], [ 1243.8, 237.5, 0.4, -0.3], [ 453.6, -549.5, -15.6, -4.1] ], [ [ 895.0, 0.0, -1.6, 0.0], [ 799.5, 278.6, -2.4, -1.1], [ 55.7, -133.9, -6.0, 4.1], [ -281.1, 212.0, 5.6, 1.6], [ 12.1, -375.6, -7.0, -4.4] ], [ [ -233.2, 0.0, 0.6, 0.0], [ 368.9, 45.4, 1.4, -0.5], [ 187.2, 220.2, 0.0, 2.2], [ -138.7, -122.9, 0.6, 0.4], [ -142.0, 43.0, 2.2, 1.7], [ 20.9, 106.1, 0.9, 1.9] ], [ [ 64.4, 0.0, -0.2, 0.0], [ 63.8, -18.4, -0.4, 0.3], [ 76.9, 16.8, 0.9, -1.6], [ -115.7, 48.8, 1.2, -0.4], [ -40.9, -59.8, -0.9, 0.9], [ 14.9, 10.9, 0.3, 0.7], [ -60.7, 72.7, 0.9, 0.9] ], [ [ 79.5, 0.0, 0.0, 0.0], [ -77.0, -48.9, -0.1, 0.6], [ -8.8, -14.4, -0.1, 0.5], [ 59.3, -1.0, 0.5, -0.8], [ 15.8, 23.4, -0.1, 0.0], [ 2.5, -7.4, -0.8, -1.0], [ -11.1, -25.1, -0.8, 0.6], [ 14.2, -2.3, 0.8, -0.2] ], [ [ 23.2, 0.0, -0.1, 0.0], [ 10.8, 7.1, 0.2, -0.2], [ -17.5, -12.6, 0.0, 0.5], [ 2.0, 11.4, 0.5, -0.4], [ -21.7, -9.7, -0.1, 0.4], [ 16.9, 12.7, 0.3, -0.5], [ 15.0, 0.7, 0.2, -0.6], [ -16.8, -5.2, 0.0, 0.3], [ 0.9, 3.9, 0.2, 0.2] ], [ [ 4.6, 0.0, 0.0, 0.0], [ 7.8, -24.8, -0.1, -0.3], [ 3.0, 12.2, 0.1, 0.3], [ -0.2, 8.3, 0.3, -0.3], [ -2.5, -3.3, -0.3, 0.3], [ -13.1, -5.2, 0.0, 0.2], [ 2.4, 7.2, 0.3, -0.1], [ 8.6, -0.6, -0.1, -0.2], [ -8.7, 0.8, 0.1, 0.4], [ -12.9, 10.0, -0.1, 0.1] ], [ [ -1.3, 0.0, 0.1, 0.0], [ -6.4, 3.3, 0.0, 0.0], [ 0.2, 0.0, 0.1, 0.0], [ 2.0, 2.4, 0.1, -0.2], [ -1.0, 5.3, 0.0, 0.1], [ -0.6, -9.1, -0.3, -0.1], [ -0.9, 0.4, 0.0, 0.1], [ 1.5, -4.2, -0.1, 0.0], [ 0.9, -3.8, -0.1, -0.1], [ -2.7, 0.9, 0.0, 0.2], [ -3.9, -9.1, 0.0, 0.0] ], [ [ 2.9, 0.0, 0.0, 0.0], [ -1.5, 0.0, 0.0, 0.0], [ -2.5, 2.9, 0.0, 0.1], [ 2.4, -0.6, 0.0, 0.0], [ -0.6, 0.2, 0.0, 0.1], [ -0.1, 0.5, -0.1, 0.0], [ -0.6, -0.3, 0.0, 0.0], [ -0.1, -1.2, 0.0, 0.1], [ 1.1, -1.7, -0.1, 0.0], [ -1.0, -2.9, -0.1, 0.0], [ -0.2, -1.8, -0.1, 0.0], [ 2.6, -2.3, -0.1, 0.0] ], [ [ -2.0, 0.0, 0.0, 0.0], [ -0.2, -1.3, 0.0, 0.0], [ 0.3, 0.7, 0.0, 0.0], [ 1.2, 1.0, 0.0, -0.1], [ -1.3, -1.4, 0.0, 0.1], [ 0.6, 0.0, 0.0, 0.0], [ 0.6, 0.6, 0.1, 0.0], [ 0.5, -0.1, 0.0, 0.0], [ -0.1, 0.8, 0.0, 0.0], [ -0.4, 0.1, 0.0, 0.0], [ -0.2, -1.0, -0.1, 0.0], [ -1.3, 0.1, 0.0, 0.0], [ -0.7, 0.2, -0.1, -0.1] ], ); my $DEG2RAD = atan2(1,1)/45; sub magnetic_declination { my ($lon, $lat, $hgt, $yr) = @_; $lon *= $DEG2RAD; $lat *= $DEG2RAD; $hgt //= 0; $yr //= 2025; warn "Model is valid only from 2025 to 2030" if $yr < 2025 || $yr > 2030; my ($geo_r, $geo_lat) = do { # geocentric coordinates my $A = 6378137; # reference ellipsoid semimajor axis my $f = 1 / 298.257223563; # flattening my $e2 = $f * (2 - $f); # eccentricity my $Rc = $A / sqrt(1 - $e2 * sin($lat) ** 2); # radius of curvature my $p = ($Rc + $hgt) * cos($lat); # radius in x-y plane my $z = ($Rc * (1 - $e2) + $hgt) * sin($lat); (sqrt($p * $p + $z * $z), atan2($z, $p)) }; my $s = sin($geo_lat); my $c = cos($geo_lat); # Associated Legendre polynomials (P) and derivatives (dP) my @P = ([1],[$s, $c]); my @dP = ([0],[$c, -$s]); for my $n (2 .. $#WMM2025) { my $k = 2 * $n-1; for my $m (0 .. $n-2) { my $k1 = $k / ($n - $m); my $k2 = ($n + $m - 1) / ($n - $m); $P[$n][$m] = $k1 * $s * $P[$n-1][$m] - $k2 * $P[$n-2][$m]; $dP[$n][$m] = $k1 * ($s * $dP[$n-1][$m] + $c * $P[$n-1][$m]) - $k2 * $dP[$n-2][$m]; } my $y = $k * $P[$n-1][$n-1]; my $dy = $k * $dP[$n-1][$n-1]; $P[$n][$n-1] = $s * $y; $dP[$n][$n-1] = $s * $dy + $c * $y; $P[$n][$n] = $c * $y; $dP[$n][$n] = $c * $dy - $s * $y; } # Schmidt quasi-normalization for my $n (1 .. $#WMM2025) { my $f = sqrt(2); for my $m (1 .. $n) { $f /= sqrt(($n - $m + 1) * ($n + $m)); $P[$n][$m] *= $f; $dP[$n][$m] *= $f; } } my $X = 0; # magnetic field north component in nT my $Y = 0; # east component my $Z = 0; # vertical component my $t = $yr - 2025; my $r = 6371200 / $geo_r; # radius relative to geomagnetic reference my $R = $r * $r; my @c = map cos($_ * $lon), 0 .. $#WMM2025; my @s = map sin($_ * $lon), 0 .. $#WMM2025; for my $n (1 .. $#WMM2025) { my $x = my $y = my $z = 0; for my $m (0 .. $n) { my $row = $WMM2025[$n][$m]; my $g = $row->[0] + $t * $row->[2]; my $h = $row->[1] + $t * $row->[3]; $x += ($g * $c[$m] + $h * $s[$m]) * $dP[$n][$m]; $y += ($g * $s[$m] - $h * $c[$m]) * $P[$n][$m] * $m; $z += ($g * $c[$m] + $h * $s[$m]) * $P[$n][$m]; } $R *= $r; $X -= $x * $R; $Y += $y * $R; $Z -= $z * $R * ($n + 1); } $Y /= $c; $c = cos($geo_lat - $lat); # transform back to geodetic coords $s = sin($geo_lat - $lat); ($X, $Z) = ($X * $c - $Z * $s, $X * $s + $Z * $c); my $decl = atan2($Y, $X) / $DEG2RAD; return($decl); }} $day_of_year = localtime->yday + 1; $dec_date = sprintf "%.2f", $year + ($day_of_year / 365); # TX Site $magdec_tx = sprintf "%.2f", magnetic_declination($LON1_geo, $LAT1, $tx_elv_m, $dec_date); if ($magdec_tx < 0) { $magdir_tx = "West"; $AZSP_MN = sprintf "%.2f", $AZSP + abs($magdec_tx); if ($AZSP_MN >= 360) { $AZSP_MN = sprintf "%.2f", $AZSP_MN - 360; } } else { $magdir_tx = "East"; $AZSP_MN = sprintf "%.2f", $AZSP - abs($magdec_tx); if ($AZSP_MN < 0) { $AZSP_MN = sprintf "%.2f", $AZSP_MN + 360; } } $magdec_tx = abs($magdec_tx); # RX Site $magdec_rx = sprintf "%.2f", magnetic_declination($LON2_geo, $LAT2, $rx_elv_m, $dec_date); if ($magdec_rx < 0) { $magdir_rx = "West"; $AZLP_MN = sprintf "%.2f", $AZLP + abs($magdec_rx); if ($AZLP_MN >= 360) { $AZLP_MN = sprintf "%.2f", $AZLP_MN - 360; } } else { $magdir_rx = "East"; $AZLP_MN = sprintf "%.2f", $AZLP - abs($magdec_rx); if ($AZLP_MN < 0) { $AZLP_MN = sprintf "%.2f", $AZLP_MN + 360; } } $magdec_rx = abs($magdec_rx); ## Misc Stuff I Forgot # if ($do_div eq "no") { $div_rx_ant_ht_ov_ft = "Not Applicable"; $div_rx_ant_ht_ov_m = "N/A"; } elsif ($do_div eq "yes") { $div_rx_ant_ht_ov_ft = sprintf "%.2f", $rx_elv_ft + $div_ant_ht_ft; $div_rx_ant_ht_ov_m = sprintf "%.2f", $rx_elv_m + $div_ant_ht_m; } ## Calculate Antenna Tilt # #$TR = sprintf "%.2f", (180 / pi) * ((($rx_ant_ht_ov_ft - $tx_ant_ht_ov_ft) / (5280 * $dist_mi)) - ($dist_mi / (7920 * $k))); #$RT = sprintf "%.2f", (180 / pi) * ((($tx_ant_ht_ov_ft - $rx_ant_ht_ov_ft) / (5280 * $dist_mi)) - ($dist_mi / (7920 * $k))); if ($do_div eq "no") { $tilt = rad2deg(atan(($tx_ant_ht_ov_ft - $rx_ant_ht_ov_ft) / ((5280 * $dist_mi) - ($dist_mi / 7920 * $k)))); $tilt_rtd = sprintf "%.2f", 0 } elsif ($do_div eq "yes") { $tilt = rad2deg(atan(($tx_ant_ht_ov_ft - $rx_ant_ht_ov_ft) / ((5280 * $dist_mi) - ($dist_mi / 7920)))); $tilt_div = rad2deg(atan(($tx_ant_ht_ov_ft - $div_rx_ant_ht_ov_ft) / ((5280 * $dist_mi) - ($dist_mi / 7920)))); if ($tilt_div < 0) { $tilt_rtd = sprintf "-%.2f", abs($tilt_div); } elsif ($tilt_div > 0) { $tilt_rtd = sprintf "+%.2f", abs($tilt_div); } } if ($tilt < 0) { # TX is higher than RX, so make tilt UPWARD $tilt_tr = sprintf "+%.2f", abs($tilt); $tilt_rt = sprintf "-%.2f", abs($tilt); # Determine the inner radius of the coverage area, helping you understand the closer range of the signal. $inner = ($tx_ant_ht_ov_ft / tan(deg2rad(abs($tilt)) + deg2rad($tx_ant_bw) / 2)) / 5280; # Calculate the outer radius of the coverage area, providing insight into the maximum reach of your antenna’s signal. $outer = ($tx_ant_ht_ov_ft / tan(deg2rad(abs($tilt)) - deg2rad($tx_ant_bw) / 2)) / 5280; $inner_mi = sprintf "%.2f", $inner; $inner_km = sprintf "%.2f", $inner * 1.609344; $outer_mi = sprintf "%.2f", $outer; $outer_km = sprintf "%.2f", $outer * 1.609344; if ($outer <= 0 || $outer > $dist_mi) { $outer_mi = "Horizon"; $outer_km = "Horizon"; } if ($inner <= 0) { $inner_mi = "Error"; $inner_km = "Error" } } elsif ($tilt > 0) { # TX is lower than RX, so make tilt DOWNWARD $tilt_tr = sprintf "-%.2f", abs($tilt); $tilt_rt = sprintf "+%.2f", abs($tilt); # Determine the inner radius of the coverage area, helping you understand the closer range of the signal. $inner = ($tx_ant_ht_ov_ft / tan(deg2rad($tilt) + deg2rad($tx_ant_bw) / 2)) / 5280; # Calculate the outer radius of the coverage area, providing insight into the maximum reach of your antenna’s signal. $outer = ($tx_ant_ht_ov_ft / tan(deg2rad($tilt) - deg2rad($tx_ant_bw) / 2)) / 5280; $inner_mi = sprintf "%.2f", $inner; $inner_km = sprintf "%.2f", $inner * 1.609344; $outer_mi = sprintf "%.2f", $outer; $outer_km = sprintf "%.2f", $outer * 1.609344; # Horizon means that the -3dB point on the main lobe shoots off into the horizon and does not touch the earth (assuming flat terrain.) if ($outer <= 0 || $outer > $dist_mi) { $outer_mi = "Horizon"; $outer_km = "Horizon"; } if ($inner <= 0) { $inner_mi = "Error"; $inner_km = "Error" } } ## Plot Fancy Terrain Profile: TX to RX # open(F1, "<", "profile2.gp") or die "Can't open file profile2.gp: $!\n"; # Ground elevation used for SPLAT! analysis open(F2, ">", "profile-k.gp") or die "Can't open file profile-k.gp: $!\n"; # Ground elevation without K-factor open(F3, ">", "profile-terr.gp") or die "Can't open file profile-terr.gp: $!\n"; # Ground elevation with K-factor while () { chomp; ($dist, $elev) = split(/\t/); $d1 = $dist_mi - $dist; $d2 = ($dist_mi + $dist) - $dist_mi; $ht = ($d1 * $d2) / (1.5 * $k); $new = sprintf "%.6f", $elev - $ht; # Subtract Earth K-factor from terrain data print F2 "$dist\t$new\n"; print F3 "$dist\t$elev\n"; } close F1; close F2; close F3; if ($do_div eq "yes") { open(F1, "<", "reference2-div.gp") or die "Can't open file reference2-div.gp: $!\n"; while () { chomp(@REFDIV = ); } close F1; foreach (@REFDIV) { ($dist, $elev) = split; push(@REFDIV_DIST, $dist); push(@REFDIV_ELEV, $elev); } $size = (@REFDIV_DIST); $count = 1; open(F2, ">", "fresnel-div-nth.gp"); while ($count < $size) { $dist = shift(@REFDIV_DIST); $elev = shift(@REFDIV_ELEV); $d1 = $dist; $d2 = $dist_mi - $d1; $fn = sprintf "%.6f", 72.05 * ($fres/100) * sqrt(($d1 * $d2) / ($frq_ghz * $dist_mi)); $new = sprintf "%.6f", $elev - abs($fn); print F2 "$d1\t$new\n"; $count++; } close F2; } ## Plot Terrain Profile # open(F, ">", "splat2.gp") or die "Can't open splat2.gp: $!\n"; print F "set clip\n"; print F "set tics scale 2, 1\n"; print F "set mytics 10\n"; print F "set mxtics 20\n"; print F "set tics out\n"; print F "set border 7\n"; print F "set label 3 '\\U+1F6F8'\n"; # ufo print F "set label 3 at screen 0.015, screen 0.97 font ',30'\n"; print F "set key below enhanced font \"Helvetica,18\"\n"; print F "set grid back xtics ytics mxtics mytics\n"; print F "set xtics\n"; print F "set ytics nomirror\n"; if ($tx_ant_ht_ov_ft > $rx_ant_ht_ov_ft) { $ymax = $tx_ant_ht_ov_ft + $div_ft; } else { $ymax = $rx_ant_ht_ov_ft + $div_ft + 5; } if ($max_elev_ft > $ymax) { $ymax = $max_elev_ft; } print F "set yrange [($min_elev - 5) to ($ymax + 10)]\n"; print F "set xrange [0.0 to $dist_mi]\n"; print F "set encoding utf8\n"; print F "set samples 500\n"; print F "set term pngcairo enhanced size 2000,1600\n"; print F "set title \"{/:Bold Path Profile Between $tx_name and $rx_name\\n$qual }\" font \"Helvetica,30\"\n"; print F "set xlabel \"Distance Between {/:Bold $tx_name } and {/:Bold $rx_name } ($dist_mi miles)\\n\" font \"Helvetica,22\"\n"; print F "set x2label \"{/:Bold Frequency: } $frq_mhz MHz\t\t{/:Bold Azimuth: } $AZSP\\U+00B0 TN / $AZSP_MN\\U+00B0 MN ($AZLP\\U+00B0 TN / $AZLP_MN\\U+00B0 MN)\" font \"Helvetica,20\" tc rgb \"blue\"\n"; print F "set ylabel \"Elevation - Above Mean Sea Level (feet)\" font \"Helvetica,22\"\n"; print F "set y2label \"Estimated Path Loss (dB)\" font \"Helvetica,22\" textcolor rgb \"dark-grey\"\n"; print F "set y2tics textcolor rgb \"dark-grey\"\n"; print F "set arrow from 0,$tx_elv_ft to 0,$tx_ant_ht_ov_ft front head size screen 0.008,45.0,30.0 filled lw 3\n"; print F "set arrow from $dist_mi,$rx_elv_ft to $dist_mi,$rx_ant_ht_ov_ft front head size screen 0.008,45.0,30.0 filled lw 3\n"; if ($do_div eq "yes") { my $a = $rx_ant_ht_ov_ft + $div_ft; print F "set arrow from $dist_mi,$rx_ant_ht_ov_ft to $dist_mi,$a front head size screen 0.008,40.0,30.0 filled lw 3\n"; print F "set label \"Div. $a \\n\\n\" right front at $dist_mi,$a tc rgb \"gray60\"\n"; } if ($obs1) { print F "set arrow from $obs1,$min_elev to $obs1,$avg_ht_ft lw 2\n"; } if ($obs2) { print F "set arrow from $obs2,$min_elev to $obs2,$avg_ht_ft lw 2\n"; } if ($obs3) { print F "set arrow from $obs3,$min_elev to $obs3,$avg_ht_ft lw 2\n"; } if ($obs4) { print F "set arrow from $obs4,$min_elev to $obs4,$avg_ht_ft lw 2\n"; } if ($obs5) { print F "set arrow from $obs5,$min_elev to $obs5,$avg_ht_ft lw 2\n"; } print F "set label \" $tx_ant_ht_ov_ft\" left front at 0,$tx_ant_ht_ov_ft tc rgb \"gray60\"\n"; print F "set label \"Pri. $rx_ant_ht_ov_ft \" right front at $dist_mi,$rx_ant_ht_ov_ft tc rgb \"gray60\"\n"; print F "set label '{/:Bold Lat: } $LAT1_D\\U+00B0 $LAT1_M\\U+0027 $LAT1_S\" $LAT1_gnu' left at 0,graph 1.08 tc rgb \"blue\"\n"; print F "set label '{/:Bold Lon: } $LON1_D\\U+00B0 $LON1_M\\U+0027 $LON1_S\" $LON1_gnu' left at 0,graph 1.06 tc rgb \"blue\"\n"; print F "set label '{/:Bold Gnd Elv: } $tx_elv_ft ft' left at 0,graph 1.04 tc rgb \"blue\"\n"; print F "set label '{/:Bold Ant Hgt: } $tx_ant_ht_ft ft' left at 0,graph 1.02 tc rgb \"blue\"\n"; print F "set label '{/:Bold Lat: } $LAT2_D\\U+00B0 $LAT2_M\\U+0027 $LAT2_S\" $LAT2_gnu' right at $dist_mi,graph 1.08 tc rgb \"blue\"\n"; print F "set label '{/:Bold Lon: } $LON2_D\\U+00B0 $LON2_M\\U+0027 $LON2_S\" $LON2_gnu' right at $dist_mi,graph 1.06 tc rgb \"blue\"\n"; print F "set label '{/:Bold Gnd Elv: } $rx_elv_ft ft' right at $dist_mi,graph 1.04 tc rgb \"blue\"\n"; print F "set label '{/:Bold Ant Hgt: } $rx_ant_ht_ft ft' right at $dist_mi,graph 1.02 tc rgb \"blue\"\n"; print F "set timestamp '%d-%b-%Y %H:%M CST' bottom font \"Helvetica\"\n"; print F "set output \"TerrainProfile1.png\"\n"; print F "set style fill transparent solid 0.8 border -1\n"; if ($clutter == 1) { # Do clutter if ($do_div eq "yes") { # Do clutter and diversity antenna print F "plot \"profile-terr.gp\" title \"$k_str Earth Terrain Profile\" with filledcurves above fc \"grey80\", \"profile-k.gp\" title \"1/1 Earth Terrain Profile\" with filledcurves above fc \"brown\", \"reference.gp\" title \"Pri. Reference Path\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines title \"Pri. First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines title \"Pri. $fres% First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"red\", \"clutter.gp\" title \"$gc_ft ft Additional Ground Clutter\" with lines lt 1 lw 2 linecolor rgb 'black' dashtype 3, \"reference-div.gp\" title \"Div. Reference Path\" with line lt 1 lw 1 linecolor rgb \"blue\" dashtype 5, \"path-loss.gp\" title 'Pri. Path Loss' axes x1y2 with lines lw 1 linecolor rgb \"dark-grey\" dashtype 7\n"; } elsif ($do_div eq "no") { # Do clutter, no diversity antenna print F "plot \"profile-terr.gp\" title \"$k_str Earth Terrain Profile\" with filledcurves above fc \"grey80\", \"profile-k.gp\" title \"1/1 Earth Terrain Profile\" with filledcurves above fc \"brown\", \"reference.gp\" title \"Reference Path\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines title \"First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines title \"$fres% First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"red\", \"clutter.gp\" title \"$gc_ft ft Additional Ground Clutter\" with lines lt 1 lw 2 linecolor rgb 'black' dashtype 3, \"path-loss.gp\" title 'Path Loss' axes x1y2 lw 1 linecolor rgb \"dark-grey\" dashtype 7\n"; } } elsif ($clutter == 0) { # No clutter if ($do_div eq "yes") { # No clutter, but with diversity antenna print F "plot \"profile-terr.gp\" title \"$k_str Earth Terrain Profile\" with filledcurves above fc \"grey80\", \"profile-k.gp\" title \"1/1 Earth Terrain Profile\" with filledcurves above fc \"brown\", \"reference.gp\" title \"Pri. Reference Path\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines title \"Pri. First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines title \"Pri. $fres% First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"red\", \"reference2-div.gp\" title \"Div. Reference Path\" with lines lt 1 lw 1 linecolor rgb \"blue\" dashtype 5, \"fresnel-div-nth.gp\" smooth csplines title \"Div. $fres% First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"red\" dashtype 5, \"path-loss.gp\" title 'Pri. Path Loss' axes x1y2 with lines lw 1 linecolor rgb \"dark-grey\" dashtype 7\n"; } elsif ($do_div eq "no") { # No clutter, no diversity antenna print F "plot \"profile-terr.gp\" title \"$k_str Earth Terrain Profile\" with filledcurves above fc \"grey80\", \"profile-k.gp\" title \"1/1 Earth Terrain Profile\" with filledcurves above fc \"brown\", \"reference.gp\" title \"Reference Path\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines title \"First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines title \"$fres% First Fresnel Zone\" lt 1 lw 1 linecolor rgb \"red\", \"path-loss.gp\" title 'Path Loss' axes x1y2 with lines lw 1 linecolor rgb \"dark-grey\" dashtype 7\n"; } } close F; &System($args = "$gnuplot splat2.gp >/dev/null 2>&1"); ## Climate & Terrain Factors # # check4 = Would You Like to Calculate the Vigants-Barnett Climate Factor? ## Calculate Terrain Roughness Factor # # Open raw terrain elevation profile which doesn't have K-factor correction open(TER, "<", "profile-k.gp") or die "Can't open file profile-k.gp: $!\n"; while () { chomp; ($ter_dist, $ter_elev) = split; push(@ELEV_ARRAY, $ter_elev); } close TER; # Remove end point data $i = 0; while ($i < 5) { $tmp = shift(@ELEV_ARRAY); $tmp = pop(@ELEV_ARRAY); $i++; } $ter_size = scalar(@ELEV_ARRAY); if (!$ter_size) { $ter_size = 10; # Divide-by-zero catch } $ter_count = $ter_size; $Eds = 0; $Esq = 0; while($ter_count > 0) { $elev = shift(@ELEV_ARRAY); $Eds = $Eds + $elev; $Esq = $Esq + ($elev ** 2); $ter_count--; } $ter_w = sqrt(abs(($Esq / $ter_size) - (($Eds / $ter_size) ** 2))); # Calculated terrain roughness factor $rough_calc_ft = sprintf "%.1f", $ter_w; $rough_calc_m = sprintf "%.1f", $ter_w * 0.3048; # User supplie terrain roughness factor $rough =~ tr/0-9.//csd; if ($check4 eq "yes") { if ($rough_val eq "meters") { $rough_m = sprintf "%.1f", $rough; $rough_ft = sprintf "%.1f", $rough * 3.2808399; } elsif ($rough_val eq "feet") { $rough_m = sprintf "%.1f", $rough * 0.3048; $rough_ft = sprintf "%.1f", $rough; } # Vigants-Barnett only uses 20-140 ft if ($rough_ft < 20) { $rough_ft = sprintf "%.1f", 20; $rough_m = sprintf "%.1f", 20 * 0.3048; } if ($rough_ft > 140) { $rough_ft = sprintf "%.1f", 140; $rough_m = sprintf "%.1f", 140 * 0.3048; } } if ($check4 eq "yes") { if ($rough_hum eq "Coastal, Very Humid Areas") { $cli_vig = sprintf "%.2f", 2.0 * (($rough_ft / 50) ** -1.3); $cli_val = "Calculated"; } elsif ($rough_hum eq "Non-Coastal, Humid Areas") { $cli_vig = sprintf "%.2f", 1.4 * (($rough_ft / 50) ** -1.3); $cli_val = "Calculated"; } elsif ($rough_hum eq "Average or Temperate Areas") { $cli_vig = sprintf "%.2f", 1.0 * (($rough_ft / 50) ** -1.3); $cli_val = "Calculated" } elsif ($rough_hum eq "Dry Areas") { $cli_vig = sprintf "%.2f", 0.5 * (($rough_ft / 50) ** -1.3); $cli_val = "Calculated" } $cli_vig_calc = $cli_vig; $vig_val = "N/A"; } elsif ($check4 eq "no") { $rough_ft = sprintf "%.1f", 50; $rough_m = sprintf "%.1f", 50 * 0.3048; $cli_vig_calc = sprintf "%.2f", 1.0 * (($rough_calc_ft / 50) ** -1.3); $rough_hum = "Average or Temperate Areas"; if ($vigants eq "6.00 : Very smooth terrain, over water or flat desert, coastal") { $cli_vig = sprintf "%.2f", 6.00; ($null, $vig_val) = split ':', $vigants; $vig_val = substr ($vig_val, 1, ((length $vig_val) - 1)); $cli_val = "Supplied"; } elsif ($vigants eq "4.00 : Very smooth terrain, over water or flat desert, non-coastal") { $cli_vig = sprintf "%.2f", 4.00; ($null, $vig_val) = split ':', $vig_val; $vig_val = substr ($vig_val, 1, ((length $vig_val) - 1)); $cli_val = "Supplied"; } elsif ($vigants eq "2.00 : Great Lakes area") { $cli_vig = sprintf "%.2f", 2.00; ($null, $vig_val) = split ':', $vigants; $vig_val = substr ($vig_val, 1, ((length $vig_val) - 1)); $cli_val = "Supplied"; } elsif ($vigants eq "1.00 : Average terrain, with some roughness") { $cli_vig = sprintf "%.2f", 1.00; ($null, $vig_val) = split ':', $vigants; $vig_val = substr ($vig_val, 1, ((length $vig_val) - 1)); $cli_val = "Supplied"; } elsif ($vigants eq "0.50 : Dry desert climate") { $cli_vig = sprintf "%.2f", 0.50; ($null, $vig_val) = split ':', $vigants; $vig_val = substr ($vig_val, 1, ((length $vig_val) - 1)); $cli_val = "Supplied"; } elsif ($vigants eq "0.25 : Mountainous, very rough, very dry but non-reflective") { $cli_vig = sprintf "%.2f", 0.25; ($null, $vig_val) = split ':', $vigants; $vig_val = substr ($vig_val, 1, ((length $vig_val) - 1)); $cli_val = "Supplied"; } } ## Distance to Radio Horizon # if ($k_str eq "Infinity") { $tx_rad_hor_mi = (sqrt(2 * 20925721.784777 * 1 * $tx_ant_ht_ft)) / 5280; $rx_rad_hor_mi = (sqrt(2 * 20925721.784777 * 1 * $rx_ant_ht_ft)) / 5280; $tx_rad_hor_km = sprintf "%.2f", $tx_rad_hor_mi * 1.609344; # distance (km) to radio horizon $rx_rad_hor_km = sprintf "%.2f", $rx_rad_hor_mi * 1.609344; # distance (km) to radio horizon $tx_rad_hor_mi = sprintf "%.2f", $tx_rad_hor_mi; $rx_rad_hor_mi = sprintf "%.2f", $rx_rad_hor_mi; } else { $tx_rad_hor_mi = (sqrt(2 * 20925721.784777 * $k * $tx_ant_ht_ft)) / 5280; $rx_rad_hor_mi = (sqrt(2 * 20925721.784777 * $k * $rx_ant_ht_ft)) / 5280; $tx_rad_hor_km = sprintf "%.2f", $tx_rad_hor_mi * 1.609344; # distance (km) to radio horizon $rx_rad_hor_km = sprintf "%.2f", $rx_rad_hor_mi * 1.609344; # distance (km) to radio horizon $tx_rad_hor_mi = sprintf "%.2f", $tx_rad_hor_mi; $rx_rad_hor_mi = sprintf "%.2f", $rx_rad_hor_mi; } ## Maximum Communication Distance # $distance_max_km = sprintf "%.2f", $tx_rad_hor_km + $rx_rad_hor_km; $distance_max_mi = sprintf "%.2f", $tx_rad_hor_mi + $rx_rad_hor_mi; $tx_ant_ht_ov_ft = sprintf "%.2f", $tx_ant_ht_ft + $tx_elv_ft; $tx_ant_ht_ov_m = sprintf "%.2f", $tx_ant_ht_m + $tx_elv_m; $rx_ant_ht_ov_ft = sprintf "%.2f", $rx_ant_ht_ft + $rx_elv_ft; $rx_ant_ht_ov_m = sprintf "%.2f", $rx_ant_ht_m + $rx_elv_m; ## Cable Loss per Meter # sub Cable { undef $loss_per_foot; undef $loss_per_meter; undef $cab_desc1; undef $cab_desc2; if ($val eq "Times Microwave LMR-200") { if ($frq_mhz <= 8000) { $loss_per_foot = ((0.320900 * sqrt $frq_mhz) + (0.000330 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-200
3/16\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-200
3/16\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-200
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-200
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-240") { if ($frq_mhz <= 8000) { $loss_per_foot = ((0.242080 * sqrt $frq_mhz) + (0.000330 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-240
1/4\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-240
1/4\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-240
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-240
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-400") { if ($frq_mhz <= 8000) { $loss_per_foot = ((0.122290 * sqrt $frq_mhz) + (0.000260 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-400
3/8\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-400
3/8\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-400
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-400
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-400 UltraFlex") { if ($frq_mhz <= 6000) { $loss_per_foot = ((0.146748 * sqrt $frq_mhz) + (0.000312 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-400 UltraFlex
3/8\" Strnd. Core, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-400 UltraFlex
3/8\" Strnd. Core, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-400 UltraFlex
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-400 UltraFlex
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-500") { if ($frq_mhz <= 8000) { $loss_per_foot = ((0.096590 * sqrt $frq_mhz) + (0.000260 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-500
1/2\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-500
1/2\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-500
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-500
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-600") { if ($frq_mhz <= 8000) { $loss_per_foot = ((0.075550 * sqrt $frq_mhz) + (0.000260 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-600
1/2\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-600
1/2\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-600
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-600
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-900") { if ($frq_mhz <= 6000) { $loss_per_foot = ((0.051770 * sqrt $frq_mhz) + (0.000160 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-900
5/8\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-900
5/8\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-900
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-900
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-1200") { if ($frq_mhz <= 3000) { $loss_per_foot = ((0.037370 * sqrt $frq_mhz) + (0.000160 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-1200
7/8\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-1200
7/8\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-1200
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-1200
Exceeds Frequency Limit"; } } elsif ($val eq "Times Microwave LMR-1700") { if ($frq_mhz <= 3000) { $loss_per_foot = ((0.026460 * sqrt $frq_mhz) + (0.000160 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Times Microwave LMR-1700
1-1/4\" Flexible, Foam Dielectric"; $cab_desc2 = "Times Microwave LMR-1700
1-1/4\" Flexible, Foam Dielectric"; } else { $cab_desc1 = "Times Microwave LMR-1700
Exceeds Frequency Limit"; $cab_desc2 = "Times Microwave LMR-1700
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF1-50") { if ($frq_mhz <= 15800) { $loss_per_foot = ((0.119736 * sqrt $frq_mhz) + (0.000373 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF1-50
1/4\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF1-50
1/4\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF1-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF1-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF2-50") { if ($frq_mhz <= 13000) { $loss_per_foot = ((0.101001 * sqrt $frq_mhz) + (0.000327 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF2-50
3/8\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF2-50
3/8\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF2-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF2-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF4.5-50") { if ($frq_mhz <= 6100) { $loss_per_foot = ((0.045231 * sqrt $frq_mhz) + (0.000209 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF4.5-50
5/8\" Low-Density Foam"; $cab_desc2 = "Andrew HELIAX LDF4.5-50
5/8\" Low-Density Foam"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF4.5-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF4.5-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF4-50A") { if ($frq_mhz <= 8800) { $loss_per_foot = ((0.064133 * sqrt $frq_mhz) + (0.000191 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF4-50A
1/2\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF4-50A
1/2\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF4-50A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF4-50A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF5-50A") { if ($frq_mhz <= 5000) { $loss_per_foot = ((0.034766 * sqrt $frq_mhz) + (0.000153 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF5-50A
7/8\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF5-50A
7/8\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF5-50A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF5-50A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF6-50") { if ($frq_mhz <= 3300) { $loss_per_foot = ((0.023874 * sqrt $frq_mhz) + (0.000141 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF6-50
1-1/4\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF6-50
1-1/4\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF6-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF6-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF7-50A") { if ($frq_mhz <= 2700) { $loss_per_foot = ((0.019152 * sqrt $frq_mhz) + (0.000137 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF7-50A
1-5/8\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF7-50A
1-5/8\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF7-50A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF7-50A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX LDF12-50") { if ($frq_mhz <= 2200) { $loss_per_foot = ((0.015831 * sqrt $frq_mhz) + (0.000143 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF12-50
2-1/4\" Foam Dielectric"; $cab_desc2 = "Andrew HELIAX LDF12-50
2-1/4\" Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX LDF12-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX LDF12-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX FSJ1-50A") { if ($frq_mhz <= 18000) { $loss_per_foot = ((0.175364 * sqrt $frq_mhz) + (0.000416 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX FSJ1-50A
1/4\" Flexible Foam Dielectric"; $cab_desc2 = "Andrew HELIAX FSJ1-50A
1/4\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX FSJ1-50A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX FSJ1-50A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX FSJ2-50") { if ($frq_mhz <= 13400) { $loss_per_foot = ((0.116375 * sqrt $frq_mhz) + (0.000386 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX FSJ2-50
3/8\" Flexible Foam Dielectric"; $cab_desc2 = "Andrew HELIAX FSJ2-50
3/8\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX FSJ2-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX FSJ2-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX FSJ4-50B") { if ($frq_mhz <= 10200) { $loss_per_foot = ((0.099126 * sqrt $frq_mhz) + (0.000469 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX FSJ4-50B
1/2\" Flexible, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX FSJ4-50B
1/2\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX FSJ4-50B
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX FSJ4-50B
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HT4-50") { if ($frq_mhz <= 10900) { $loss_per_foot = ((0.081505 * sqrt $frq_mhz) + (0.000735 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HT4-50
1/2\" High-Temp, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX HT4-50
1/2\" High-Temp, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HT4-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HT4-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HT5-50") { if ($frq_mhz <= 5200) { $loss_per_foot = ((0.035311 * sqrt $frq_mhz) + (0.000663 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HT5-50
7/8\" High-Temp, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX HT5-50
7/8\" High-Temp, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HT5-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HT5-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HST1-50") { if ($frq_mhz <= 18000) { $loss_per_foot = ((0.163779 * sqrt $frq_mhz) + (0.000382 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HST1-50
1/4\" High-Temp, Air Dielectric"; $cab_desc2 = "Andrew HELIAX HST1-50
1/4\" High-Temp, Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HST1-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HST1-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ4-50") { if ($frq_mhz <= 10900) { $loss_per_foot = ((0.078969 * sqrt $frq_mhz) + (0.000320 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ4-50
1/2\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ4-50
1/2\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ4-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ4-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ4.5-50") { if ($frq_mhz <= 6600) { $loss_per_foot = ((0.047997 * sqrt $frq_mhz) + (0.000122 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ4.5-50
5/8\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ4.5-50
5/8\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ4.5-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ4.5-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ5-50") { if ($frq_mhz <= 5200) { $loss_per_foot = ((0.035238 * sqrt $frq_mhz) + (0.000166 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ5-50
7/8\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ5-50
7/8\" Air Dielectric"; } else { $loss_per_foot = 3; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ5-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ5-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ7-50A") { if ($frq_mhz <= 2700) { $loss_per_foot = ((0.019456 * sqrt $frq_mhz) + (0.000086 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ7-50A
1-5/8\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ7-50A
1-5/8\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ7-50A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ7-50A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ12-50") { if ($frq_mhz <= 2300) { $loss_per_foot = ((0.016065 * sqrt $frq_mhz) + (0.000081 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ12-50
2-1/4\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ12-50
2-1/4\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ12-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ12-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ8-50B") { if ($frq_mhz <= 1640) { $loss_per_foot = ((0.012467 * sqrt $frq_mhz) + (0.000169 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ8-50B
3\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ8-50B
3\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ8-50B
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ8-50B
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ11-50") { if ($frq_mhz <= 1000) { $loss_per_foot = ((0.010391 * sqrt $frq_mhz) + (0.000105 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ11-50
4\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ11-50
4\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ11-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ11-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX HJ9-50") { if ($frq_mhz <= 960) { $loss_per_foot = ((0.007316 * sqrt $frq_mhz) + (0.000053 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ9-50
5\" Air Dielectric"; $cab_desc2 = "Andrew HELIAX HJ9-50
5\" Air Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX HJ9-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX HJ9-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX VXL5-50") { if ($frq_mhz <= 4900) { $loss_per_foot = ((0.038251 * sqrt $frq_mhz) + (0.000150 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX VXL5-50
7/8\" Flexible, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX VXL5-50
7/8\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX VXL5-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX VXL5-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX VXL6-50") { if ($frq_mhz <= 3300) { $loss_per_foot = ((0.025771 * sqrt $frq_mhz) + (0.000161 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX VXL6-50
1-1/4\" Flexible, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX VXL6-50
1-1/4\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX VXL6-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX VXL6-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX VXL7-50") { if ($frq_mhz <= 2500) { $loss_per_foot = ((0.019161 * sqrt $frq_mhz) + (0.000135 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX VXL7-50
1-5/8\" Flexible, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX VXL7-50
1-5/8\" Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX VXL7-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX VXL7-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EFX2-50") { if ($frq_mhz <= 13500) { $loss_per_foot = ((0.104631 * sqrt $frq_mhz) + (0.000364 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EFX2-50
3/8\" Extra Flexible, Foam Dielectric"; $cab_desc2 = "Andrew HELIAX EFX2-50
3/8\" Extra Flexible, Foam Dielectric"; } else { $loss_per_foot = 5; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EFX2-50
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EFX2-50
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW17") { if ($frq_mhz <= 2300 && $frq_mhz >= 1700) { $loss_per_foot = (0.7731 - 0.0002 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW17
Elliptical Waveguide, 1.7-2.3 GHz"; $cab_desc1 = "Andrew HELIAX EW17
Elliptical Waveguide, 1.7-2.3 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW17
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW17
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP17") { if ($frq_mhz <= 2300 && $frq_mhz >= 1700) { $loss_per_foot = (0.7731 - 0.0002 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP17
Elliptical Waveguide, 1.7-2.3 GHz"; $cab_desc2 = "Andrew HELIAX EWP17
Elliptical Waveguide, 1.7-2.3 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP17
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP17
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW20") { if ($frq_mhz <= 2700 && $frq_mhz >= 2100) { $loss_per_foot = (0.6576 - 0.00008667 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW20
Elliptical Waveguide, 2.1-2.7 GHz"; $cab_desc2 = "Andrew HELIAX EW20
Elliptical Waveguide, 2.1-2.7 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW20
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW20
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW28") { if ($frq_mhz <= 3400 && $frq_mhz >= 2900) { $loss_per_foot = (1.2952 - 0.0002164 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW28
Elliptical Waveguide, 2.9-3.4 GHz"; $cab_desc2 = "Andrew HELIAX EW28
Elliptical Waveguide, 2.9-3.4 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW28
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW28
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW34") { if ($frq_mhz <= 4200 && $frq_mhz >= 3100) { $loss_per_foot = (1.2509 - 0.0001507 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW34
Elliptical Waveguide, 3.1-4.2 GHz"; $cab_desc2 = "Andrew HELIAX EW34
Elliptical Waveguide, 3.1-4.2 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW34
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW34
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP34") { if ($frq_mhz <= 4200 && $frq_mhz >= 3100) { $loss_per_foot = (1.2509 - 0.0001507 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP34
Elliptical Waveguide, 3.1-4.2 GHz"; $cab_desc2 = "Andrew HELIAX EWP34
Elliptical Waveguide, 3.1-4.2 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP34
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP34
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW37") { if ($frq_mhz <= 4200 && $frq_mhz >= 3600) { $loss_per_foot = (2.3258 - 0.000373 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW37
Elliptical Waveguide, 3.6-4.2 GHz"; $cab_desc2 = "Andrew HELIAX EW37
Elliptical Waveguide, 3.6-4.2 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW37
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW37
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP37") { if ($frq_mhz <= 3900 && $frq_mhz >= 3400) { $loss_per_foot = (2.3258 - 0.000373 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP37
Elliptical Waveguide, 3.4-3.9 GHz"; $cab_desc2 = "Andrew HELIAX EWP37
Elliptical Waveguide, 3.4-3.9 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP37
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP37
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP37S") { if ($frq_mhz <= 4200 && $frq_mhz >= 3700) { $loss_per_foot = (2.3258 - 0.000373 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP37S
Elliptical Waveguide, 3.7-4.2 GHz"; $cab_desc2 = "Andrew HELIAX EWP37S
Elliptical Waveguide, 3.7-4.2 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP37S
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP37S
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW43") { if ($frq_mhz <= 5000 && $frq_mhz >= 4400) { $loss_per_foot = (3.2471 - 0.0004286 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW43
Elliptical Waveguide, 4.4-5.0 GHz"; $cab_desc2 = "Andrew HELIAX EW43
Elliptical Waveguide, 4.4-5.0 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW43
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW43
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP43") { if ($frq_mhz <= 5000 && $frq_mhz >= 4400) { $loss_per_foot = (3.2471 - 0.0004286 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP43
Elliptical Waveguide, 4.4-5.0 GHz"; $cab_desc2 = "Andrew HELIAX EWP43
Elliptical Waveguide, 4.4-5.0 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP43
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP43
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWS43") { if ($frq_mhz <= 5000 && $frq_mhz >= 4400) { $loss_per_foot = (3.2471 - 0.0004286 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWS43
Elliptical Waveguide, 4.4-5.0 GHz"; $cab_desc2 = "Andrew HELIAX EWS43
Elliptical Waveguide, 4.4-5.0 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWS43
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWS43
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW52") { if ($frq_mhz <= 6400 && $frq_mhz >= 5600) { $loss_per_foot = (1.9105 - 0.0001177 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW52
Elliptical Waveguide, 5.6-6.4 GHz"; $cab_desc2 = "Andrew HELIAX EW52
Elliptical Waveguide, 5.6-6.4 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW52
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW52
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP52") { if ($frq_mhz <= 6400 && $frq_mhz >= 5900) { $loss_per_foot = (1.9105 - 0.0001177 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP52
Elliptical Waveguide, 5.9-6.4 GHz"; $cab_desc2 = "Andrew HELIAX EWP52
Elliptical Waveguide, 5.9-6.4 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP52
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP52
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP52S") { if ($frq_mhz <= 6400 && $frq_mhz >= 5900) { $loss_per_foot = (1.9105 - 0.0001177 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP52S
Elliptical Waveguide, 5.9-6.4 GHz"; $cab_desc2 = "Andrew HELIAX EWP52S
Elliptical Waveguide, 5.9-6.4 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP52S
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP52S
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW63") { if ($frq_mhz <= 7100 && $frq_mhz >= 5900) { $loss_per_foot = (2.2812 - 0.0001367 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW63
Elliptical Waveguide, 5.9-7.1 GHz"; $cab_desc2 = "Andrew HELIAX EW63
Elliptical Waveguide, 5.9-7.1 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW63
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW63
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP63") { if ($frq_mhz <= 7100 && $frq_mhz >= 5800) { $loss_per_foot = (2.2812 - 0.0001367 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP63
Elliptical Waveguide, 5.8-7.1 GHz"; $cab_desc2 = "Andrew HELIAX EWP63
Elliptical Waveguide, 5.8-7.1 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP63
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP63
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP63S") { if ($frq_mhz <= 7100 && $frq_mhz >= 5800) { $loss_per_foot = (2.2812 - 0.0001367 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP63S
Elliptical Waveguide, 5.8-7.1 GHz"; $cab_desc2 = "Andrew HELIAX EWP63S
Elliptical Waveguide, 5.8-7.1 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP63S
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP63S
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW64") { if ($frq_mhz <= 7800 && $frq_mhz >= 6400) { $loss_per_foot = (2.2342 - 0.0001042 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW64
Elliptical Waveguide, 6.4-7.8 GHz"; $cab_desc2 = "Andrew HELIAX EW64
Elliptical Waveguide, 6.4-7.8 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW64
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW64
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP64") { if ($frq_mhz <= 7800 && $frq_mhz >= 7100) { $loss_per_foot = (2.2342 - 0.0001042 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP64
Elliptical Waveguide, 7.1-7.8 GHz"; $cab_desc2 = "Andrew HELIAX EWP64
Elliptical Waveguide, 7.1-7.8 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP64
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP64
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW77") { if ($frq_mhz <= 8500 && $frq_mhz >= 7100) { $loss_per_foot = (2.9572 - 0.0001496 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW77
Elliptical Waveguide, 7.1-8.5 GHz"; $cab_desc2 = "Andrew HELIAX EW77
Elliptical Waveguide, 7.1-8.5 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW77
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW77
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP77") { if ($frq_mhz <= 7800 && $frq_mhz >= 7100) { $loss_per_foot = (2.9572 - 0.0001496 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP77
Elliptical Waveguide, 7.1-7.8 GHz"; $cab_desc2 = "Andrew HELIAX EWP77
Elliptical Waveguide, 7.1-7.8 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP77
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP77
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW85") { if ($frq_mhz <= 9800 && $frq_mhz >= 8500) { $loss_per_foot = (6.7362 - 0.0003921 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW85
Elliptical Waveguide, 8.5-9.8 GHz"; $cab_desc2 = "Andrew HELIAX EW85
Elliptical Waveguide, 8.5-9.8 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW85
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW85
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW90") { if ($frq_mhz <= 11700 && $frq_mhz >= 10200) { $loss_per_foot = (4.7473 - 0.00015 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW90
Elliptical Waveguide, 10.2-11.7 GHz"; $cab_desc2 = "Andrew HELIAX EW90
Elliptical Waveguide, 10.2-11.7 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW90
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW90
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP90") { if ($frq_mhz <= 11700 && $frq_mhz >= 10700) { $loss_per_foot = (4.7473 - 0.00015 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP90
Elliptical Waveguide, 10.7-11.7 GHz"; $cab_desc2 = "Andrew HELIAX EWP90
Elliptical Waveguide, 10.7-11.7 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP90
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP90
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP90S") { if ($frq_mhz <= 11700 && $frq_mhz >= 10700) { $loss_per_foot = (4.7473 - 0.00015 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP90S
Elliptical Waveguide, 10.7-11.7 GHz"; $cab_desc2 = "Andrew HELIAX EWP90S
Elliptical Waveguide, 10.7-11.7 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP90S
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP90S
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW127A") { if ($frq_mhz <= 13300 && $frq_mhz >= 11700) { $loss_per_foot = (5.4481 - 0.0001501 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW127A
Elliptical Waveguide, 11.7-13.3 GHz"; $cab_desc2 = "Andrew HELIAX EW127A
Elliptical Waveguide, 11.7-13.3 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW127A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW127A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP127A") { if ($frq_mhz <= 12200 && $frq_mhz >= 11700) { $loss_per_foot = (5.4481 - 0.0001501 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP127A
Elliptical Waveguide, 11.7-12.2 GHz"; $cab_desc2 = "Andrew HELIAX EWP127A
Elliptical Waveguide, 11.7-12.2 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP127A
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP127A
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW132") { if ($frq_mhz <= 14800 && $frq_mhz >= 13750) { $loss_per_foot = (7.8522 - 0.000206 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW132
Elliptical Waveguide, 13.7-14.8 GHz"; $cab_desc2 = "Andrew HELIAX EW132
Elliptical Waveguide, 13.7-14.8 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW132
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW132
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP132") { if ($frq_mhz <= 15350 && $frq_mhz >= 14400) { $loss_per_foot = (7.8522 - 0.000206 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP132
Elliptical Waveguide, 14.4-15.3 GHz"; $cab_desc2 = "Andrew HELIAX EWP132
Elliptical Waveguide, 14.4-15.3 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP132
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP132
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW180") { if ($frq_mhz <= 19700 && $frq_mhz >= 17300) { $loss_per_foot = (9.6646 - 0.0002009 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW180
Elliptical Waveguide, 17.3-19.7 GHz"; $cab_desc2 = "Andrew HELIAX EW180
Elliptical Waveguide, 17.3-19.7 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW180
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW180
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EWP180") { if ($frq_mhz <= 19700 && $frq_mhz >= 17700) { $loss_per_foot = (9.6646 - 0.0002009 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP180
Elliptical Waveguide, 17.7-19.7 GHz"; $cab_desc2 = "Andrew HELIAX EWP180
Elliptical Waveguide, 17.7-19.7 GHz"; } else { $loss_per_foot = 10; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EWP180
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EWP180
Exceeds Frequency Limit"; } } elsif ($val eq "Andrew HELIAX EW220") { if ($frq_mhz <= 23600 && $frq_mhz >= 21200) { $loss_per_foot = (11.8539 - 0.0001445 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW220
Elliptical Waveguide, 21.2-23.6 GHz"; $cab_desc2 = "Andrew HELIAX EW220
Elliptical Waveguide, 21.2-23.6 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Andrew HELIAX EW220
Exceeds Frequency Limit"; $cab_desc2 = "Andrew HELIAX EW220
Exceeds Frequency Limit"; } } elsif ($val eq "WR284") { if ($frq_mhz <= 4000 && $frq_mhz >= 2600) { $loss_per_foot = (1.1628 - 0.0001659 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR284
Rectangular Waveguide, 2.6-4.0 GHz"; $cab_desc2 = "WR284
Rectangular Waveguide, 2.6-4.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR284 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR284 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR229") { if ($frq_mhz <= 4900 && $frq_mhz >= 3300) { $loss_per_foot = (1.4981 - 0.0001677 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR229
Rectangular Waveguide, 3.3-4.9 GHz"; $cab_desc2 = "WR229
Rectangular Waveguide, 3.3-4.9 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR229 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR229 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR187") { if ($frq_mhz <= 5800 && $frq_mhz >= 3900) { $loss_per_foot = (2.2445 - 0.0002179 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR187
Rectangular Waveguide, 3.9-5.8 GHz"; $cab_desc2 = "WR187
Rectangular Waveguide, 3.9-5.8 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR187 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR187 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR159") { if ($frq_mhz <= 7000 && $frq_mhz >= 4900) { $loss_per_foot = (2.449 - 0.0001786 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR159
Rectangular Waveguide, 4.9-7.0 GHz"; $cab_desc2 = "WR159
Rectangular Waveguide, 4.9-7.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR159 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR159 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR137") { if ($frq_mhz <= 8200 && $frq_mhz >= 5900) { $loss_per_foot = (3.0557 - 0.0001752 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR137
Rectangular Waveguide, 5.9-8.2 GHz"; $cab_desc2 = "WR137
Rectangular Waveguide, 5.9-8.2 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR137 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR137 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR112") { if ($frq_mhz <= 10000 && $frq_mhz >= 7000) { $loss_per_foot = (4.2834 - 0.000206 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR112
Rectangular Waveguide, 7.0-10.0 GHz"; $cab_desc2 = "WR112
Rectangular Waveguide, 7.0-10.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR112 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR112 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR90") { if ($frq_mhz <= 12400 && $frq_mhz >= 8200) { $loss_per_foot = (6.7045 - 0.0002979 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR90
Rectangular Waveguide, 8.2-12.4 GHz"; $cab_desc2 = "WR90
Rectangular Waveguide, 8.2-12.4 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR90 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR90 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR75") { if ($frq_mhz <= 15000 && $frq_mhz >= 10000) { $loss_per_foot = (8.0104 - 0.0002934 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR75
Rectangular Waveguide, 10.0-15.0 GHz"; $cab_desc2 = "WR75
Rectangular Waveguide, 10.0-15.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR75 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR75 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR62") { if ($frq_mhz <= 18000 && $frq_mhz >= 12000) { $loss_per_foot = (10.7559 - 0.0003321 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR62
Rectangular Waveguide, 12.0-18.0 GHz"; $cab_desc2 = "WR62
Rectangular Waveguide, 12.0-18.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR62 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR62 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "WR42") { if ($frq_mhz <= 26500 && $frq_mhz >= 18000) { $loss_per_foot = (21.2335 - 0.0004116 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR42
Rectangular Waveguide, 18.0-26.5 GHz"; $cab_desc2 = "WR42
Rectangular Waveguide, 18.0-26.5 GHz"; } else { $loss_per_foot = 20; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "WR42 Rectangular Waveguide
Exceeds Frequency Limit"; $cab_desc2 = "WR42 Rectangular Waveguide
Exceeds Frequency Limit"; } } elsif ($val eq "Belden 9913 (RG-8)") { $loss_per_foot = ((0.12050 * sqrt $frq_mhz) + (0.00066 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Belden 9913
RG-8, #10 Solid Core, PE Dielc."; $cab_desc2 = "Belden 9913
RG-8, #10 Solid Core, PE Dielc."; } elsif ($val eq "Belden 8237 (RG-8)") { $loss_per_foot = ((0.16925 * sqrt $frq_mhz) + (0.00204 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Belden 8237
RG-8, #13 Strd. Core, PE Dielc."; $cab_desc2 = "Belden 9913
RG-8, #13 Strnd. Core, PE Dielc."; } elsif ($val eq "Belden 8267 (RG-213)") { $loss_per_foot = ((0.18993 * sqrt $frq_mhz) + (0.00216 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Belden 8267
RG-8, #13 Strd. Core, PE Dielc., MIL-SPEC"; $cab_desc2 = "Belden 9913
RG-8, #13 Strnd. Core, PE Dielc., MIL-SPEC"; } elsif ($val eq "Belden 9258 (RG-8X)") { $loss_per_foot = ((0.26904 * sqrt $frq_mhz) + (0.00572 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Belden 9258
RG-8X, #16 Strd. Core, PE Dielc."; $cab_desc2 = "Belden 9258
RG-8X, #16 Strnd. Core, PE Dielc."; } elsif ($val eq "Belden 8240 (RG-58)") { $loss_per_foot = ((0.34190 * sqrt $frq_mhz) + (0.00377 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Belden 8240
RG-58, #20 Solid Core, PE Dielc."; $cab_desc2 = "Belden 8240
RG-58, #20 Solid Core, PE Dielc."; } elsif ($val eq "M&P AIRBORNE 10") { if ($frq_mhz <= 12000) { $loss_per_foot = (1.242 + 0.001312 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "M&P AIRBORNE 10
3/8\" PE Dielectric"; $cab_desc2 = "M&P AIRBORNE 10
3/8\" PE Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "M&P AIRBORNE 10
Exceeds Frequency Limit"; $cab_desc2 = "M&P AIRBORNE 10
Exceeds Frequency Limit"; } } elsif ($val eq "M&P BROAD PRO 50") { if ($frq_mhz <= 12000) { $loss_per_foot = (1.3126 + 0.00135 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "M&P BROAD PRO 50
3/8\" PE Dielectric"; $cab_desc2 = "M&P BROAD PRO 50
3/8\" PE Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "M&P BROAD PRO 50
Exceeds Frequency Limit"; $cab_desc2 = "M&P BROAD PRO 50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA78-50") { if ($frq_mhz <= 3000) { $loss_per_foot = (0.3049 + 0.000751 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA78-50
7/8\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA78-50
7/8\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA78-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA78-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA118-50") { if ($frq_mhz <= 3000) { $loss_per_foot = (0.2343 + 0.0005971 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA118-50
1-1/8\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA118-50
1-1/8\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA118-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA118-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA158-50") { if ($frq_mhz <= 3000) { $loss_per_foot = (0.1645 + 0.0003985 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA158-50
1-5/8\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA158-50
1-5/8\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA158-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA158-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA214-50") { if ($frq_mhz <= 2300) { $loss_per_foot = (0.1288 + 0.0004053 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA214-50
2-1/4\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA214-50
2-1/4\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA2148-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA214-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA300-50") { if ($frq_mhz <= 1700) { $loss_per_foot = (0.0792 + 0.0003667 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA300-50
3\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA300-50
3\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA300-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA300-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA400-50") { if ($frq_mhz <= 1000) { $loss_per_foot = (0.05606 + 0.0003561 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA400-50
4\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA400-50
4\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA400-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA400-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS HELIFLEX HCA495-50") { if ($frq_mhz <= 1000) { $loss_per_foot = (0.04487 + 0.0002695 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA495-50
5\" Air Dielectric"; $cab_desc2 = "RFS HELIFLEX HCA495-50
5\" Air Dielectric"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS HELIFLEX HCA495-50
Exceeds Frequency Limit"; $cab_desc2 = "RFS HELIFLEX HCA495-50
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E38") { if ($frq_mhz <= 4200 && $frq_mhz >= 3100) { $loss_per_foot = (1.5089 - 0.0002136 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E38
Elliptical Waveguide, 3.1-4.2 GHz"; $cab_desc2 = "RFS FLEXWELL E38
Elliptical Waveguide, 3.1-4.2 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E38
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E38
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP38") { if ($frq_mhz <= 4200 && $frq_mhz >= 3100) { $loss_per_foot = (1.5089 - 0.0002136 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP38
Elliptical Waveguide, 3.1-4.2 GHz"; $cab_desc2 = "RFS FLEXWELL EP38
Elliptical Waveguide, 3.1-4.2 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP38
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP38
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL ES46") { if ($frq_mhz <= 5000 && $frq_mhz >= 4400) { $loss_per_foot = (1.1888 - 0.00002256 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL ES46
Elliptical Waveguide, 4.4-5.0 GHz"; $cab_desc2 = "RFS FLEXWELL ES46
Elliptical Waveguide, 4.4-5.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL ES46
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL ES46
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL ESP46") { if ($frq_mhz <= 5000 && $frq_mhz >= 4400) { $loss_per_foot = (1.1888 - 0.00002256 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL ESP46
Elliptical Waveguide, 4.4-5.0 GHz"; $cab_desc2 = "RFS FLEXWELL ESP46
Elliptical Waveguide, 4.4-5.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL ES46
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL ESP46
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E60") { if ($frq_mhz <= 6425 && $frq_mhz >= 5600) { $loss_per_foot = (1.9547 - 0.0001242 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E60
Elliptical Waveguide, 5.6-6.4 GHz"; $cab_desc2 = "RFS FLEXWELL E60
Elliptical Waveguide, 5.6-6.4 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E60
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E60
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP60") { if ($frq_mhz <= 6425 && $frq_mhz >= 5600) { $loss_per_foot = (2.0029 - 0.0001325 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP60
Elliptical Waveguide, 5.6-6.4 GHz"; $cab_desc2 = "RFS FLEXWELL EP60
Elliptical Waveguide, 5.6-6.4 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP60
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP60
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E65") { if ($frq_mhz <= 7125 && $frq_mhz >= 5900) { $loss_per_foot = (2.4509 - 0.0001643 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E65
Elliptical Waveguide, 5.9-7.1 GHz"; $cab_desc2 = "RFS FLEXWELL E65
Elliptical Waveguide, 5.9-7.1 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E65
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E65
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP65") { if ($frq_mhz <= 7125 && $frq_mhz >= 5900) { $loss_per_foot = (2.4509 - 0.0001643 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP65
Elliptical Waveguide, 5.9-7.1 GHz"; $cab_desc2 = "RFS FLEXWELL EP65
Elliptical Waveguide, 5.9-7.1 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP65
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP65
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP70") { if ($frq_mhz <= 7800 && $frq_mhz >= 6400) { $loss_per_foot = (2.5967 - 0.0001489 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP70
Elliptical Waveguide, 6.4-7.8 GHz"; $cab_desc2 = "RFS FLEXWELL EP70
Elliptical Waveguide, 6.4-7.8 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP70
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP70
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E78") { if ($frq_mhz <= 8500 && $frq_mhz >= 7100) { $loss_per_foot = (2.746 - 0.0001239 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E78
Elliptical Waveguide, 7.1-8.5 GHz"; $cab_desc2 = "RFS FLEXWELL E78
Elliptical Waveguide, 7.1-8.5 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E78
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E78
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP78") { if ($frq_mhz <= 8500 && $frq_mhz >= 7100) { $loss_per_foot = (2.746 - 0.0001239 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP78
Elliptical Waveguide, 7.1-8.5 GHz"; $cab_desc2 = "RFS FLEXWELL EP78
Elliptical Waveguide, 7.1-8.5 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP78
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP78
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP100") { if ($frq_mhz <= 10000 && $frq_mhz >= 8500) { $loss_per_foot = (6.5049 - 0.0003982 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP100
Elliptical Waveguide, 8.5-10.0 GHz"; $cab_desc2 = "RFS FLEXWELL EP100
Elliptical Waveguide, 8.5-10.0 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP100
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP100
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E105") { if ($frq_mhz <= 11700 && $frq_mhz >= 10000) { $loss_per_foot = (4.0994 - 0.00012 & $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E105
Elliptical Waveguide, 10.0-11.7 GHz"; $cab_desc2 = "RFS FLEXWELL E105
Elliptical Waveguide, 10.0-11.7 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E105
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E105
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP105") { if ($frq_mhz <= 11700 && $frq_mhz >= 10000) { $loss_per_foot = (4.0994 - 0.00012 & $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP105
Elliptical Waveguide, 10.0-11.7 GHz"; $cab_desc2 = "RFS FLEXWELL EP105
Elliptical Waveguide, 10.0-11.7 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP105
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP105
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E130") { if ($frq_mhz <= 13300 && $frq_mhz >= 10700) { $loss_per_foot = (5.5306 - 0.0001649 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E130
Elliptical Waveguide, 10.7-13.3 GHz"; $cab_desc2 = "RFS FLEXWELL E130
Elliptical Waveguide, 10.7-13.3 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E130
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E130
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP130") { if ($frq_mhz <= 13300 && $frq_mhz >= 10700) { $loss_per_foot = (5.5306 - 0.0001649 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP130
Elliptical Waveguide, 10.7-13.3 GHz"; $cab_desc2 = "RFS FLEXWELL EP130
Elliptical Waveguide, 10.7-13.3 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP130
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP130
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E150") { if ($frq_mhz <= 15400 && $frq_mhz >= 13400) { $loss_per_foot = (6.3048 - 0.0001409 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E150
Elliptical Waveguide, 13.4-15.4 GHz"; $cab_desc2 = "RFS FLEXWELL E150
Elliptical Waveguide, 13.4-15.4 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E150
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E150
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP150") { if ($frq_mhz <= 15400 && $frq_mhz >= 13400) { $loss_per_foot = (6.3048 - 0.0001409 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP150
Elliptical Waveguide, 13.4-15.4 GHz"; $cab_desc2 = "RFS FLEXWELL EP150
Elliptical Waveguide, 13.4-15.4 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP150
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP150
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E185") { if ($frq_mhz <= 19700 && $frq_mhz >= 17300) { $loss_per_foot = (9.1257 - 0.0001725 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E185
Elliptical Waveguide, 17.3-19.7 GHz"; $cab_desc2 = "RFS FLEXWELL E185
Elliptical Waveguide, 17.3-19.7 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E185
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E185
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL EP185") { if ($frq_mhz <= 19700 && $frq_mhz >= 17300) { $loss_per_foot = (9.1257 - 0.0001725 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP185
Elliptical Waveguide, 17.3-19.7 GHz"; $cab_desc2 = "RFS FLEXWELL EP185
Elliptical Waveguide, 17.3-19.7 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL EP185
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL EP185
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E220") { if ($frq_mhz <= 23600 && $frq_mhz >= 21200) { $loss_per_foot = (10.5428 - 0.00008492 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E220
Elliptical Waveguide, 21.2-23.6 GHz"; $cab_desc2 = "RFS FLEXWELL E220
Elliptical Waveguide, 21.2-23.6 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E220
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E220
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E250") { if ($frq_mhz <= 26500 && $frq_mhz >= 24200) { $loss_per_foot = (13.944 - 0.0001594 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E250
Elliptical Waveguide, 24.2-26.5 GHz"; $cab_desc2 = "RFS FLEXWELL E250
Elliptical Waveguide, 24.2-26.5 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E250
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E250
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E300") { if ($frq_mhz <= 33400 && $frq_mhz >= 27500) { $loss_per_foot = (24.9143 - 0.0003569 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E300
Elliptical Waveguide, 27.5-33.4 GHz"; $cab_desc2 = "RFS FLEXWELL E300
Elliptical Waveguide, 27.5-33.4 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E300
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E300
Exceeds Frequency Limit"; } } elsif ($val eq "RFS FLEXWELL E380") { if ($frq_mhz <= 39500 && $frq_mhz >= 37000) { $loss_per_foot = (27.2057 - 0.0002269 * $frq_mhz) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E380
Elliptical Waveguide, 37.0-39.5 GHz"; $cab_desc2 = "RFS FLEXWELL E380
Elliptical Waveguide, 37.0-39.5 GHz"; } else { $loss_per_foot = 15; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "RFS FLEXWELL E380
Exceeds Frequency Limit"; $cab_desc2 = "RFS FLEXWELL E380
Exceeds Frequency Limit"; } } elsif ($val eq "Crap RG-8") { $loss_per_foot = ((0.21 * sqrt $frq_mhz) + (0.00026 * $frq_mhz)) / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "Crap RG-8
Stuff I found at a hamfest"; $cab_desc2 = "Crap RG-8
Stuff I found at a hamfest"; } elsif ($val eq "Other") { if ($val2 == 0) { $val2 = 1; $val1 = "feet"; } if ($val1 eq "meters") { $loss_per_meter = $val2 / 100; $loss_per_foot = $loss_per_meter / 3.2808399; $cab_desc1 = "User Supplied"; $cab_desc2 = "User Supplied"; } elsif ($val1 eq "feet") { $loss_per_foot = $val2 / 100; $loss_per_meter = $loss_per_foot * 3.2808399; $cab_desc1 = "User Supplied"; $cab_desc2 = "User Supplied"; } } } ## Transmitter Transmission Line # &Cable($val = $tx_cab, $val1 = $check1, $val2 = $tx_cab_other); if ($tx_len_val eq "meters") { $tx_cab_desc1 = $cab_desc1; $tx_cab_desc2 = $cab_desc2; $tx_cab_loss = sprintf "%.2f", $tx_len * $loss_per_meter; $tx_length_m = sprintf "%.2f", $tx_len; $tx_length_ft = sprintf "%.2f", $tx_len / 0.3048; $tx_loss_per_meter = sprintf "%.2f", $loss_per_meter; $tx_loss_per_foot = sprintf "%.2f", $loss_per_foot; $tx_loss_per_100m = sprintf "%.2f", $loss_per_meter * 100; $tx_loss_per_100f = sprintf "%.2f", $loss_per_foot * 100; } elsif ($tx_len_val eq "feet") { $tx_cab_desc1 = $cab_desc1; $tx_cab_desc2 = $cab_desc2; $tx_cab_loss = sprintf "%.2f", $tx_len * $loss_per_foot; $tx_length_m = sprintf "%.2f", $tx_len * 0.3048; # ft to m $tx_length_ft = sprintf "%.2f", $tx_len; $tx_loss_per_meter = sprintf "%.2f", $loss_per_meter; $tx_loss_per_foot = sprintf "%.2f", $loss_per_foot; $tx_loss_per_100m = sprintf "%.2f", $loss_per_meter * 100; $tx_loss_per_100f = sprintf "%.2f", $loss_per_foot * 100; } ## Transmitter Transmission Line Efficiency # $tx_eff = sprintf "%.f", 100 / (10 ** ($tx_cab_loss / 10)); # percent if ($tx_eff < 50) { $tx_eff_message = "Unacceptable Line Loss"; $tx_eff_color = "red"; } else { $tx_eff_message = "Acceptable Line Loss"; $tx_eff_color = "blue"; } ## Transmitter Connector and/or Adapter Loss # #$tx_con_loss = $con_tx * 0.025 * $frq_ghz; ## Total Transmitter Transmission Line Loss # $tx_total_cable_loss = sprintf "%.2f", $tx_cab_loss + $tx_misc_cab_loss; $tx_misc_cab_loss = sprintf "%.2f", $tx_misc_cab_loss; $tx_misc_loss = sprintf "%.3f", $tx_misc_loss; $tx_misc_gain = sprintf "%.2f", $tx_misc_gain; ## Receiver Transmission Line # &Cable($val = $rx_cab, $val1 = $check2, $val2 = $rx_cab_other); if ($rx_len_val eq "meters") { $rx_cab_desc1 = $cab_desc1; $rx_cab_desc2 = $cab_desc2; $rx_cab_loss = sprintf "%.2f", $rx_len * $loss_per_meter; $rx_length_m = sprintf "%.2f", $rx_len; $rx_length_ft = sprintf "%.2f", $rx_len / 0.3048; # m to ft $rx_loss_per_meter = sprintf "%.2f", $loss_per_meter; $rx_loss_per_foot = sprintf "%.2f", $loss_per_foot; $rx_loss_per_100m = sprintf "%.2f", $loss_per_meter * 100; $rx_loss_per_100f = sprintf "%.2f", $loss_per_foot * 100; } elsif ($rx_len_val eq "feet") { $rx_cab_desc1 = $cab_desc1; $rx_cab_desc2 = $cab_desc2; $rx_cab_loss = sprintf "%.2f", $rx_len * $loss_per_foot; $rx_length_m = sprintf "%.2f", $rx_len * 0.3048; # ft to m $rx_length_ft = sprintf "%.2f", $rx_len; $rx_loss_per_meter = sprintf "%.2f", $loss_per_meter; $rx_loss_per_foot = sprintf "%.2f", $loss_per_foot; $rx_loss_per_100m = sprintf "%.2f", $loss_per_meter * 100; $rx_loss_per_100f = sprintf "%.2f", $loss_per_foot * 100; } ## Diversity Antenna Transmission Line Loss # if ($do_div eq "yes") { if ($rx_div_len_val eq "feet") { $rx_div_loss = sprintf "%.2f", ($rx_div_len * $rx_loss_per_foot) + $rx_div_misc_cab_loss; } elsif ($rx_div_len_val eq "meters") { $rx_div_loss = sprintf "%.2f", ($rx_div_len * $rx_loss_per_meter) + $rx_div_misc_cab_loss; } } elsif ($do_div eq "no") { $rx_div_loss = sprintf "%.2f", 0; } $rx_div_misc_cab_loss = sprintf "%.2f", $rx_div_misc_cab_loss; # Receiver Transmission Line Efficiency # $rx_eff = sprintf "%.f", 100 / (10 ** ($rx_cab_loss / 10)); # percent if ($rx_eff < 50) { $rx_eff_message = "Unacceptable Line Loss"; $rx_eff_color = "red"; } else { $rx_eff_message = "Acceptable Line Loss"; $rx_eff_color = "blue"; } ## Receiver Connector and/or Adapter Loss # #$rx_con_loss = $con_rx * 0.025 * $frq_ghz; ## Total Receiver Transmission Line Loss # $rx_total_cable_loss = sprintf "%.2f", $rx_cab_loss + $rx_misc_cab_loss; $rx_misc_cab_loss = sprintf "%.2f", $rx_misc_cab_loss; $rx_misc_gain = sprintf "%.2f", $rx_misc_gain; ## Calculate rain absorption # $rate =~ tr/0-9.//csd; if ($rain eq "A: Polar Tundra") { $rate = sprintf "%.1f", 15.0; $region = "A: Polar Tundra"; } elsif ($rain eq "B: Polar Taiga - Moderate") { $rate = sprintf "%.1f", 19.0; $region = "B: Polar Taiga - Moderate"; } elsif ($rain eq "C: Temperate Maritime") { $rate = sprintf "%.1f", 28.0; $region = "C: Temperate Maritime"; } elsif ($rain eq "D1: Temperate Continental - Dry") { $rate = sprintf "%.1f", 37.0; $region = "D1: Temperate Continental - Dry"; } elsif ($rain eq "D2: Temperate Continental - Mid") { $rate = sprintf "%.1f", 49.0; $region = "D2: Temperate Continental - Mid"; } elsif ($rain eq "D3: Temperate Continental - Wet") { $rate = sprintf "%.1f", 63.0; $region = "D3: Temperate Continental - Wet"; } elsif ($rain eq "E: Subtropical - Wet") { $rate = sprintf "%.1f", 98.0; $region = "E: Subtropical - Wet"; } elsif ($rain eq "F: Subtropical - Arid") { $rate = sprintf "%.1f", 23.0; $region = "F: Subtropical - Arid"; } elsif ($rain eq "G: Tropical - Moderate") { $rate = sprintf "%.1f", 67.0; $region = "G: Tropical - Moderate"; } elsif ($rain eq "H: Tropical - Wet") { $rate = sprintf "%.1f", 147.0; $region = "H: Tropical - Wet"; } elsif ($rain eq "None") { $rate = sprintf "%.1f", $rate; $region = "User Supplied"; if ($rate > 200) { $rate = 200; } } ## Effective Rain Distance, ITU P.530 # $rain_eff_km = sprintf "%.2f", (1 / (1 + ($dist_km / (35 * exp(-0.015 * $rate))))) * $dist_km; $rain_eff_mi = sprintf "%.2f", $rain_eff_km / 1.609344; ## NASA Simplified Rain Attenuation # if ($frq_ghz >= 2.0 && $frq_ghz <= 54) { $nasa_a = (4.21 * (10 ** -5)) * ($frq_ghz ** 2.42); } elsif ($frq_ghz > 54 && $frq_ghz <= 180) { $nasa_a = (4.09 * (10 ** -2)) * ($frq_ghz ** 0.669); } else { $nasa_a = 0; } if ($frq_ghz >= 2.0 && $frq_ghz <= 25) { $nasa_b = 1.41 * ($frq_ghz ** -0.0779); } elsif ($frq_ghz > 25 && $frq_ghz <= 164) { $nasa_b = 2.63 * ($frq_ghz ** -0.272); } else { $nasa_b = 0; } $nasa_rain_att_total = sprintf "%.3f", ($nasa_a * ($rate ** $nasa_b)) * $rain_eff_km; ## Crane Rain Attenuation Model # if ($frq_mhz >= 500 && $frq_mhz < 2000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0000352; $Av_y1 = 0.880; $Kv_y2 = 0.0001380; $Av_y2 = 0.923; $A = $Av_y1 + (($frq_mhz - 1000) / (2000 - 1000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 1000) / (2000 - 1000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0000387; $Ah_y1 = 0.912; $Kh_y2 = 0.0001540; $Ah_y2 = 0.963; $A = $Ah_y1 + (($frq_mhz - 1000) / (2000 - 1000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 1000) / (2000 - 1000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 2000 && $frq_mhz < 4000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0001380; $Av_y1 = 0.923; $Kv_y2 = 0.0005910; $Av_y2 = 1.075; $A = $Av_y1 + (($frq_mhz - 2000) / (4000 - 2000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 2000) / (4000 - 2000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0001540; $Ah_y1 = 0.963; $Kh_y2 = 0.0006500; $Ah_y2 = 1.121; $A = $Ah_y1 + (($frq_mhz - 2000) / (4000 - 2000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 2000) / (4000 - 2000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 4000 && $frq_mhz < 6000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0005910; $Av_y1 = 1.075; $Kv_y2 = 0.0015500; $Av_y2 = 1.265; $A = $Av_y1 + (($frq_mhz - 4000) / (6000 - 4000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 4000) / (6000 - 4000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0006500; $Ah_y1 = 1.121; $Kh_y2 = 0.0017500; $Ah_y2 = 1.308; $A = $Ah_y1 + (($frq_mhz - 4000) / (6000 - 4000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 4000) / (6000 - 4000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 6000 && $frq_mhz < 7000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0015500; $Av_y1 = 1.265; $Kv_y2 = 0.0026500; $Av_y2 = 1.012; $A = $Av_y1 + (($frq_mhz - 6000) / (7000 - 6000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 6000) / (7000 - 6000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0017500; $Ah_y1 = 1.308; $Kh_y2 = 0.0030100; $Ah_y2 = 1.332; $A = $Ah_y1 + (($frq_mhz - 6000) / (7000 - 6000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 6000) / (7000 - 6000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 7000 && $frq_mhz < 8000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0026500; $Av_y1 = 1.012; $Kv_y2 = 0.0039500; $Av_y2 = 1.310; $A = $Av_y1 + (($frq_mhz - 7000) / (8000 - 7000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 7000) / (8000 - 7000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0030100; $Ah_y1 = 1.332; $Kh_y2 = 0.0045400; $Ah_y2 = 1.327; $A = $Ah_y1 + (($frq_mhz - 7000) / (8000 - 7000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 7000) / (8000 - 7000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 8000 && $frq_mhz < 10000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0039500; $Av_y1 = 1.310; $Kv_y2 = 0.0088700; $Av_y2 = 1.264; $A = $Av_y1 + (($frq_mhz - 8000) / (10000 - 8000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 7000) / (8000 - 7000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0045400; $Ah_y1 = 1.327; $Kh_y2 = 0.0101000; $Ah_y2 = 1.276; $A = $Ah_y1 + (($frq_mhz - 8000) / (10000 - 8000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 8000) / (10000 - 8000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 10000 && $frq_mhz < 12000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0088700; $Av_y1 = 1.264; $Kv_y2 = 0.0168000; $Av_y2 = 1.200; $A = $Av_y1 + (($frq_mhz - 10000) / (12000 - 10000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 10000) / (12000 - 10000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0101000; $Ah_y1 = 1.276; $Kh_y2 = 0.0188000; $Ah_y2 = 1.217; $A = $Ah_y1 + (($frq_mhz - 10000) / (12000 - 10000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 10000) / (12000 - 10000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 12000 && $frq_mhz < 15000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0168000; $Av_y1 = 1.200; $Kv_y2 = 0.0335000; $Av_y2 = 1.128; $A = $Av_y1 + (($frq_mhz - 12000) / (15000 - 12000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 12000) / (15000 - 12000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0188000; $Ah_y1 = 1.217; $Kh_y2 = 0.0367000; $Ah_y2 = 1.154; $A = $Ah_y1 + (($frq_mhz - 12000) / (15000 - 12000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 12000) / (15000 - 12000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 15000 && $frq_mhz < 20000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0335000; $Av_y1 = 1.128; $Kv_y2 = 0.0691000; $Av_y2 = 1.065; $A = $Av_y1 + (($frq_mhz - 15000) / (20000 - 15000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 15000) / (20000 - 15000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0367000; $Ah_y1 = 1.154; $Kh_y2 = 0.0751000; $Ah_y2 = 1.099; $A = $Ah_y1 + (($frq_mhz - 15000) / (20000 - 15000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 15000) / (20000 - 15000)) * (log10($Kh_y2) - log10($Kh_y1))); } } elsif ($frq_mhz >= 20000 && $frq_mhz < 25000) { if ($polar eq "Vertical") { $Kv_y1 = 0.0691000; $Av_y1 = 1.065; $Kv_y2 = 0.1130000; $Av_y2 = 1.030; $A = $Av_y1 + (($frq_mhz - 20000) / (25000 - 20000)) * ($Av_y2 - $Av_y1); $K = 10 ** (log10($Kv_y1) + (($frq_mhz - 20000) / (25000 - 20000)) * (log10($Kv_y2) - log10($Kv_y1))); } elsif ($polar eq "Horizontal") { $Kh_y1 = 0.0751000; $Ah_y1 = 1.099; $Kh_y2 = 0.1240000; $Ah_y2 = 1.061; $A = $Ah_y1 + (($frq_mhz - 20000) / (25000 - 20000)) * ($Ah_y2 - $Ah_y1); $K = 10 ** (log10($Kh_y1) + (($frq_mhz - 20000) / (25000 - 20000)) * (log10($Kh_y2) - log10($Kh_y1))); } } else { $A = 0; $K = 0; } $Do = 3.8 - (0.6 * log($rate)); $B = 2.3 * ($rate ** -0.17); $c = 0.026 - (0.03 * log($rate)); $u = (log($B * exp($c * $Do))) / $Do; if ((0 <= $dist_km) && ($dist_km <= $Do)) { $VAR_A = ((exp($u * $A * $dist_km) - 1) / ($u * $A)); $Ar = ($K * ($rate ** $A)) * $VAR_A; $crane_rain_att_mi = sprintf "%.3f", $Ar / $dist_mi; $crane_rain_att_km = sprintf "%.3f", $Ar / $dist_km; $crane_rain_att_total = sprintf "%.3f", $crane_rain_att_km * $rain_eff_km; } elsif (($Do <= $dist_km) && ($dist_km <= 22.5)) { $VAR_A = ((exp($u * $A * $Do) - 1) / ($u * $A)); $VAR_B = ((($B ** $A) * exp($c * $A * $Do)) / ($c * $A)); $VAR_C = ((($B ** $A) * exp($c * $A * $dist_km)) / ($c * $A)); $Ar = ($K * ($rate ** $A)) * (($VAR_A - $VAR_B) + $VAR_C); $crane_rain_att_mi = sprintf "%.3f", $Ar / $dist_mi; $crane_rain_att_km = sprintf "%.3f", $Ar / $dist_km; $crane_rain_att_total = sprintf "%.3f", $crane_rain_att_km * $rain_eff_km; } elsif ($dist_km > 22.5) { $VAR_A = ((exp($u * $A * $Do) - 1) / ($u * $A)); $VAR_B = ((($B ** $A) * exp($c * $A * $Do)) / ($c * $A)); $VAR_C = ((($B ** $A) * exp($c * $A * 22.5)) / ($c * $A)); $Ar = ($K * ($rate ** $A)) * (($VAR_A - $VAR_B) + $VAR_C); $crane_rain_att_mi = sprintf "%.3f", ($Ar * ($dist_km / 22.5)) / $dist_mi; $crane_rain_att_km = sprintf "%.3f", ($Ar * ($dist_km / 22.5)) / $dist_km; $crane_rain_att_total = sprintf "%.3f", $crane_rain_att_km * $rain_eff_km; } ## Atmospheric Attenuation (oxygen loss) # # ITU-R P.676-3 $rt = 288.15 / (273.15 + $temp_c); $rp = $atmos_p / 1013.25; if ($frq_ghz <= 57) { # Below 57 GHz $oxya = (7.27 * $rt) / ((($frq_ghz ** 2) + 0.351) * ($rp ** 2) * ($rt ** 2)); $oxyb = 7.50 / (((abs($frq_ghz - 57) ** 2) + 2.44) * ($rp ** 2) * ($rt ** 5)); $oxy_att_km = ($oxya + $oxyb) * ($frq_ghz ** 2) * ($rp ** 2) * ($rt ** 2) * (10 ** -3); $oxy_att_mi = $oxy_att_km / 1.609344; $oxy_att_total = sprintf "%.3f", $oxy_att_mi * $dist_mi; $oxy_att_mi = sprintf "%.4f", $oxy_att_mi; $oxy_att_km = sprintf "%.4f", $oxy_att_km; } elsif (57 < $frq_ghz && $frq_ghz <= 63) { # Between 57 and 63 GHz $oxy_att_km = 14.9; # 14.9 dB per km at 60 GHz $oxy_att_mi = $oxy_att_km / 1.609344; $oxy_att_total = sprintf "%.3f", $oxy_att_mi * $dist_mi; $oxy_att_mi = sprintf "%.4f", $oxy_att_mi; $oxy_att_km = sprintf "%.4f", $oxy_att_km; } elsif (63 <= $frq_ghz && $frq_ghz <= 350) { # Above 63 GHz $oxya = (2 * (10 ** -4)) * ($rt ** 1.5) * (1 - ((1.2 * (10 ** -5)) * ($frq_ghz ** 1.5))); $oxyb = 4 / (((abs($frq_ghz - 63) ** 2) + 1.5) * ($rp ** 2) * ($rt ** 5)); $oxyc = (0.28 * ($rt ** 2)) / (((($frq_ghz - 118.75) ** 2) + 2.84) * ($rp ** 2) * ($rt ** 2)); $oxy_att_km = ($oxya + $oxyb + $oxyc) * ($frq_ghz ** 2) * ($rp ** 2) * ($rt ** 2) * (10 ** -3); $oxy_att_mi = $oxy_att_km / 1.609344; $oxy_att_total = sprintf "%.3f", $oxy_att_mi * $dist_mi; $oxy_att_mi = sprintf "%.4f", $oxy_att_mi; $oxy_att_km = sprintf "%.4f", $oxy_att_km; } ## Water Vapor Attenuation # $wvd =~ tr/0-9.//csd; if (!$wvd || $wvd == 0.0) { $wvd = sprintf "%.2f", 7.5; # water vapor density in gram/meter-cubed, 7.5 corresponds to 50% humidity @ 16C or 75% humidity at 10C } if ($frq_ghz <= 350) { # ITU-R P.676-3 $wvpa = 0.0327 * $rt; $wvpb = 0.00167 * (($wvd * ($rt ** 7)) / $rp); $wvpc = 0.00077 * ($frq_ghz ** 0.5); $wvpd = 3.79 / ((($frq_ghz - 22.235) ** 2) + 9.81 * ($rp ** 2) * $rt); $wvpe = 11.73 * $rt / ((($frq_ghz - 183.31) ** 2) + 11.85 * ($rp ** 2) * $rt); $wvpf = 4.01 * $rt / ((($frq_ghz - 325.153) ** 2) + 10.44 * ($rp ** 2) * $rt); $water_att_km = ($wvpa + $wvpb + $wvpc + $wvpd + $wvpe + $wvpf) * ($frq_ghz ** 2) * $wvd * $rp * $rt * 0.0001; $water_att_mi = $water_att_km / 1.609344; $water_att_total = sprintf "%.3f", $water_att_mi * $dist_mi; $water_att_mi = sprintf "%.4f", $water_att_mi; $water_att_km = sprintf "%.4f", $water_att_km; } ## Fog Attenuation - NASA / 10-100 GHz # if ($frq_ghz >= 5.0) { # Fog density, dB/km/g/m3 $af = -1.347 + (11.152 / $frq_ghz) + (0.060 * $frq_ghz) - (0.022 * $temp_c); # Fog density for km visibility, g/m3 $vis = 0.1; # visibility in km $M = (0.024 / $vis) ** 1.54; # Total fog attenation, use same as effective rain distance $extent = $rain_eff_mi; $AF = $af * $M * $extent; $fog_att = sprintf "%.3f", $AF; $fvis = sprintf "%.f", $vis * 3280.8399; #$fdis = sprintf "%.f", $extent / 1.609344; $fog_message = "(Visibility: $fvis ft / Coverage: $rain_eff_mi mi)"; } elsif ($frq_ghz < 5.0) { $fog_att = sprintf "%.3f", 0; $fog_message = ""; } # Total Atmospheric Attenuation # $atmos_norain = sprintf "%.2f", $oxy_att_total + $water_att_total; $atmos_rain = sprintf "%.2f", $oxy_att_total + $water_att_total + $crane_rain_att_total; ## Effective Isotropic Radiated Power (EIRP) # $eirp = sprintf "%.2f", ($pwr_out_dbm - $tx_total_cable_loss) + $tx_misc_gain + $tx_ant_gain_dbi; $eirp_mw = sprintf "%.2f", 10 ** ($eirp / 10); $eirp_w = sprintf "%.2f", 10 ** (($eirp - 30) / 10); $eirp_dbw = sprintf "%.2f", 10 * log10((10 ** (($eirp - 30) / 10))); $eirp_kw = sprintf "%.2f", (10 ** (($eirp - 30) / 10)) / 1000; $eirp_dbk = sprintf "%.2f", (10 * log10((10 ** (($eirp - 30) / 10)))) - 30; ## RF Input to the Antenna # $tx_ant_input_mw = sprintf "%.2f", 10 ** ((($pwr_out_dbm - $tx_total_cable_loss) + $tx_misc_gain) / 10); $tx_ant_input = sprintf "%.2f", ($pwr_out_dbm - $tx_total_cable_loss) + $tx_misc_gain; ## RF Input Power, FCC Part 15.247 # if ($tx_ant_gain_dbi == 0 || $tx_ant_gain_dbi <= 6) { $max_ant_pwr = sprintf "%.2f", 30; $max_ant_pwr_mw = sprintf "%.2f", 10 ** (30 / 10); } if ($tx_ant_gain_dbi > 6) { $max_ant_pwr = sprintf "%.2f", 30 - (($tx_ant_gain_dbi - 6) / 3); $max_ant_pwr_mw = sprintf "%.2f", 10 ** ($max_ant_pwr / 10); } # FCC Part 74.644/74.636 Max EIRP Check # # https://www.ecfr.gov/current/title-47/chapter-I/subchapter-C/part-74/subpart-F/section-74.636 if ($frq_mhz >= 2025 && $frq_mhz <= 2110) { $MAXEIRP = 45; # dBW } elsif ($frq_mhz >= 2450 && $frq_mhz <= 2484) { $MAXEIRP = 45; # dBW } elsif ($frq_mhz >= 6875 && $frq_mhz <= 7125) { $MAXEIRP = 55; # dBW } elsif ($frq_mhz >= 12700 && $frq_mhz <= 13250) { $MAXEIRP = 55; # dBW } elsif ($frq_mhz >= 17700 && $frq_mhz < 18600) { $MAXEIRP = 55; # dBW } elsif ($frq_mhz >= 18600 && $frq_mhz <= 18800) { $MAXEIRP = 35; # dBW } elsif ($frq_mhz > 18800 && $frq_mhz <= 19700) { $MAXEIRP = 55; # dBW } else { $MAXEIRP = "N/A"; } if ($frq_mhz >= 1990 && $frq_mhz <= 7125) { $path_min = 17; # Minimum path length in kilometers } elsif ($frq_mhz >= 12200 && $frq_mhz <= 13250) { $path_min = 5; # Minimum path length in kilometers } else { $path_min = "N/A"; } if ($path_min eq "N/A") { if ($MAXEIRP eq "N/A") { $fcc_eirp_dbm = "N/A"; $fcc_eirp_mw = "N/A"; } else { $fcc_eirp_dbm = sprintf "%.2f", $MAXEIRP + 30; # dBW to dBm $fcc_eirp_mw = sprintf "%.2f", 10 ** (($MAXEIRP + 30) / 10); # dBm to mW if ($eirp <= $fcc_eirp_dbm) { $fcc_check = "(EIRP Pass)"; } elsif ($eirp > $fcc_eirp_dbm) { $fcc_check = "(EIRP Fail)"; } } } elsif ($path_min > 0) { if ($MAXEIRP eq "N/A") { $fcc_eirp_dbm = "N/A"; $fcc_eirp_mw = "N/A"; } else { $fcc_eirp = 30 - 20 * log10($path_min / $dist_km); $fcc_eirp_dbm = sprintf "%.2f", $fcc_eirp + 30; $fcc_eirp_mw = sprintf "%.2f", 10 ** ($fcc_eirp / 10); if ($eirp <= $fcc_eirp_dbm) { $fcc_check = "(EIRP Pass)"; } elsif ($eirp > $fcc_eirp_dbm) { $fcc_check = "(EIRP Fail)"; } } } ## Calculate Free-Space and ITM Losses # $fs = sprintf "%.2f", (20 * (log10 $frq_mhz)) + (20 * (log10 $dist_km)) + 32.447782; $fs_rain = sprintf "%.2f", ((20 * (log10 $frq_mhz)) + (20 * (log10 $dist_km)) + 32.447782) + $crane_rain_att_total; $itm_rain = sprintf "%.2f", $itm + $crane_rain_att_total; if ($do_div eq "yes") { $div_itm_rain = sprintf "%.2f", $div_itm + $crane_rain_att_total; } else { $div_itm_rain = sprintf "%.2f", 0; } # Total Free-Space Path Loss = Free-Space + Atmospheric Losses + Misc. $fs_pl = sprintf "%.2f", $fs + $atmos_norain + $tx_misc_loss; $fs_pl_rain = sprintf "%.2f", $fs + $atmos_rain + $tx_misc_loss; # Total ITM Path Loss = ITM + Atmospheric Losses + Misc if ($do_div eq "no") { $itm_pl = sprintf "%.2f", $itm + $atmos_norain + $tx_misc_loss; $itm_pl_rain = sprintf "%.2f", $itm + $atmos_rain + $tx_misc_loss; $div_itm_pl = sprintf "%.2f", 0; $div_itm_pl_rain = sprintf "%.2f", 0; } elsif ($do_div eq "yes") { $itm_pl = sprintf "%.2f", $itm + $atmos_norain + $tx_misc_loss; $itm_pl_rain = sprintf "%.2f", $itm + $atmos_rain + $tx_misc_loss; $div_itm_pl = sprintf "%.2f", $div_itm + $atmos_norain + $tx_misc_loss; $div_itm_pl_rain = sprintf "%.2f", $div_itm + $atmos_rain + $tx_misc_loss; } ## Received Power Level - Free-Space # $rx_pwr = sprintf "%.2f", ($eirp - $fs_pl) + (($rx_ant_gain_dbi + $rx_misc_gain) - $rx_total_cable_loss); $rx_pwr_uvolt = sprintf "%.2f", (sqrt(( 10 ** ($rx_pwr / 10) / 1000) * 50)) * 1000000; $rx_pwr_rain = sprintf "%.2f", ($eirp - $fs_pl_rain) + (($rx_ant_gain_dbi + $rx_misc_gain) - $rx_total_cable_loss); $rx_pwr_rain_uvolt = sprintf "%.2f", (sqrt(( 10 ** ($rx_pwr_rain / 10) / 1000) * 50)) * 1000000; $rx_div_pwr = sprintf "%.2f", ($eirp - $fs_pl) + (($div_ant_dbi + $rx_misc_gain) - $rx_div_loss); $rx_div_pwr_rain = sprintf "%.2f", ($eirp - $fs_pl_rain) + (($div_ant_dbi + $rx_misc_gain) - $rx_div_loss); ## Received Power Level - ITM # $rx_pwr_itm = sprintf "%.2f", ($eirp - $itm_pl) + (($rx_ant_gain_dbi + $rx_misc_gain) - $rx_total_cable_loss); $rx_pwr_itm_uvolt = sprintf "%.2f", (sqrt(( 10 ** ($rx_pwr_itm / 10) / 1000) * 50)) * 1000000; $rx_pwr_itm_rain = sprintf "%.2f", ($eirp - $itm_pl_rain) + (($rx_ant_gain_dbi + $rx_misc_gain) - $rx_total_cable_loss); $rx_pwr_itm_rain_uvolt = sprintf "%.2f", (sqrt(( 10 ** ($rx_pwr_itm_rain / 10) / 1000) * 50)) * 1000000; if ($do_div eq "yes") { $rx_div_pwr_itm = sprintf "%.2f", ($eirp - $div_itm_pl) + (($div_ant_dbi + $rx_misc_gain) - $rx_div_loss); $rx_div_pwr_itm_rain = sprintf "%.2f", ($eirp - $div_itm_pl_rain) + (($div_ant_dbi + $rx_misc_gain) - $rx_div_loss); $rx_div_pwr_itm_uvolt = sprintf "%.2f", (sqrt(( 10 ** ($rx_div_pwr_itm / 10) / 1000) * 50)) * 1000000; $rx_div_pwr_itm_rain_uvolt = sprintf "%.2f", (sqrt(( 10 ** ($rx_div_pwr_itm_rain / 10) / 1000) * 50)) * 1000000; } elsif ($do_div eq "no") { $rx_div_pwr_itm = "Not Applicable"; $rx_div_pwr_itm_rain = "Not Applicable"; $rx_div_pwr_itm_uvolt = "N/A"; $rx_div_pwr_itm_rain_uvolt = "N/A"; } ## Receiver Threshold # $BER =~ tr/0-9.-//csd; $BER_crit =~ tr/A-Za-z0-9.\-\ //csd; $BER_dbm = sprintf "%.2f", $BER; # dBm $BER_uvolt = sprintf "%.2f", (sqrt((10 ** ($BER / 10) / 1000) * 50)) * 1000000; # dBm to uV ## Thermal Fade Margin - Free-Space # if ($rx_pwr >= $BER_dbm) { $tfm = sprintf "%.2f", abs($BER_dbm - $rx_pwr); } else { $tfm = sprintf "%.2f", abs($BER_dbm - $rx_pwr) * -1; } if ($rx_pwr_rain >= $BER_dbm) { $tfm_rain = sprintf "%.2f", abs($BER_dbm - $rx_pwr_rain); } else { $tfm_rain = sprintf "%.2f", abs($BER_dbm - $rx_pwr_rain) * -1; } if ($tfm <= 0) { $tfm_color = "red"; } else { $tfm_color = "blue"; } if ($tfm_rain <= 0) { $tfm_color_rain = "red"; } else { $tfm_color_rain = "blue"; } if ($do_div eq "yes") { if ($rx_div_pwr >= $BER_dbm) { $div_tfm = sprintf "%.2f", abs($BER_dbm - $rx_div_pwr); } else { $div_tfm = sprintf "%.2f", abs($BER_dbm - $rx_div_pwr) * -1; } if ($rx_div_pwr_rain >= $BER_dbm) { $div_tfm_rain = sprintf "%.2f", abs($BER_dbm - $rx_div_pwr_rain); } else { $div_tfm_rain = sprintf "%.2f", abs($BER_dbm - $rx_div_pwr_rain) * -1; } if ($div_tfm <= 0) { $div_tfm_color = "red"; } else { $div_tfm_color = "blue"; } if ($div_tfm_rain <= 0) { $div_tfm_color_rain = "red"; } else { $div_tfm_color_rain = "blue"; } } else { $div_tfm = sprintf "%.2f", 0; $div_tfm_rain = sprintf "%.2f", 0; } ## Thermal Fade Margin - ITM # if ($rx_pwr_itm >= $BER_dbm) { $tfm_itm = sprintf "%.2f", abs($BER_dbm - $rx_pwr_itm); } else { $tfm_itm = sprintf "%.2f", ($BER_dbm - $rx_pwr_itm) * -1; } if ($rx_pwr_itm_rain >= $BER_dbm) { $tfm_itm_rain = sprintf "%.2f", abs($BER_dbm - $rx_pwr_itm_rain); } else { $tfm_itm_rain = sprintf "%.2f", ($BER_dbm - $rx_pwr_itm_rain) * -1; } if ($tfm_itm <= 0) { $tfm_itm_color = "red"; } else { $tfm_itm_color = "blue"; } if ($tfm_itm_rain <= 0) { $tfm_itm_color_rain = "red"; } else { $tfm_itm_color_rain = "blue"; } if ($do_div eq "yes") { if ($rx_div_pwr_itm >= $BER_dbm) { $div_tfm_itm = sprintf "%.2f", abs($BER_dbm - $rx_div_pwr_itm); } else { $div_tfm_itm = sprintf "%.2f", ($BER_dbm - $rx_div_pwr_itm) * -1; } if ($rx_div_pwr_itm_rain >= $BER_dbm) { $div_tfm_itm_rain = sprintf "%.2f", abs($BER_dbm - $rx_div_pwr_itm_rain); } else { $div_tfm_itm_rain = sprintf "%.2f", ($BER_dbm - $rx_div_pwr_itm_rain) * -1; } } else { $div_tfm_itm = "Not Applicable"; $div_tfm_itm_rain = "Not Applicable"; $div_tfm_color = "blue"; $div_tfm_color_rain = "blue"; } ## Vigants Composite, Dispersive, External Interference, Adjacent Channel Fade Margins - Free-Space and ITM # $dfm =~ tr/0-9.//csd; $eifm =~ tr/0-9.//csd; $aifm =~ tr/0-9.//csd; if ($dfm == 0) { $cmp_fs = sprintf "%.2f", $tfm; $cmp_fs_rain = sprintf "%.2f", $tfm_rain; $cmp_itm = sprintf "%.2f", $tfm_itm; $cmp_itm_rain = sprintf "%.2f", $tfm_itm_rain; $eifm_fs = sprintf "%.2f", $eifm; $aifm_fs = sprintf "%.2f", $aifm; $dfm_fs = $comp_fs = sprintf "%.2f", 0; if ($do_div eq "no") { $cmp_div_itm = "Not Applicable"; $cmp_div_itm_color = "blue"; $cmp_div_itm_rain = "Not Applicable"; $cmp_div_itm_rain_color = "blue"; } elsif ($do_div eq "yes") { $cmp_div_itm = sprintf "%.2f", $div_tfm_itm; $cmp_div_itm_rain = sprintf "%.2f", $div_tfm_itm_rain; if ($cmp_div_itm < 0) { $cmp_div_itm_color = "red"; } elsif ($cmp_div_itm > 0) { $cmp_div_itm_color = "blue"; } if ($cmp_div_itm_rain < 0) { $cmp_div_itm_rain_color = "red"; } elsif ($cmp_div_itm_rain > 0) { $cmp_div_itm_rain_color = "blue"; } } if ($cmp_itm < 0) { $cmp_itm_color = "red"; } elsif ($cmp_itm > 0) { $cmp_itm_color = "blue"; } if ($cmp_itm_rain < 0) { $cmp_itm_rain_color = "red"; } elsif ($cmp_itm_rain > 0) { $cmp_itm_rain_color = "blue"; } if ($cmp_fs < 0) { $cmp_fs_color = "red"; } elsif ($cmp_fs > 0) { $cmp_fs_color = "blue"; } if ($cmp_fs_rain < 0) { $cmp_fs_rain_color = "red"; } elsif ($cmp_fs_rain > 0) { $cmp_fs_rain_color = "blue"; } } elsif ($dfm && ($eifm == 0) && ($aifm == 0)) { $comp = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm / 10)))); $comp_rain = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm_rain / 10)))); $comp_itm = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm_itm / 10)))); $comp_itm_rain = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm_itm_rain / 10)))); $comp_fs = sprintf "%.2f", $comp; $cmp_fs = sprintf "%.2f", $comp; $cmp_fs_rain = sprintf "%.2f", $comp_rain; $cmp_itm = sprintf "%.2f", $comp_itm; $cmp_itm_rain = sprintf "%.2f", $comp_itm_rain; $comp_itm = sprintf "%.2f", $comp_itm; $dfm_fs = sprintf "%.2f", $dfm; $eifm_fs = sprintf "%.2f", 0; $aifm_fs = sprintf "%.2f", 0; if ($do_div eq "no") { $cmp_div_itm = "Not Applicable"; $cmp_div_itm_color = "blue"; $cmp_div_itm_rain = "Not Applicable"; $cmp_div_itm_rain_color = "blue"; } elsif ($do_div eq "yes") { $cmp_div_itm = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm / 10)))); $cmp_div_itm_rain = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm_rain / 10)))) } if ($cmp_itm < 0) { $cmp_itm_color = "red"; } elsif ($cmp_itm > 0) { $cmp_itm_color = "blue"; } if ($cmp_itm_rain < 0) { $cmp_itm_rain_color = "red"; } elsif ($cmp_itm_rain > 0) { $cmp_itm_rain_color = "blue"; } if ($cmp_fs < 0) { $cmp_fs_color = "red"; } elsif ($cmp_fs > 0) { $cmp_fs_color = "blue"; } if ($cmp_fs_rain < 0) { $cmp_fs_rain_color = "red"; } elsif ($cmp_fs_rain > 0) { $cmp_fs_rain_color = "blue"; } } elsif ($dfm && $eifm && ($aifm == 0)) { $comp = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm / 10))) + ((10 ** (-$eifm / 10)))); $comp_itm = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm_itm / 10))) + ((10 ** (-$eifm / 10)))); $cmp_fs = sprintf "%.2f", $comp; $comp_fs = sprintf "%.2f", $comp; $cmp_itm = sprintf "%.2f", $comp_itm; $comp_itm = sprintf "%.2f", $comp_itm; $dfm_fs = sprintf "%.2f", $dfm; $eifm_fs = sprintf "%.2f", $eifm; $aifm_fs = sprintf "%.2f", 0; if ($do_div eq "no") { $cmp_div_itm = "Not Applicable"; $cmp_div_itm_color = "blue"; $cmp_div_itm_rain = "Not Applicable"; $cmp_div_itm_rain_color = "blue"; } elsif ($do_div eq "yes") { $cmp_div_itm = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm / 10))) + ((10 ** (-$eifm / 10)))); $cmp_div_itm_rain = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm_rain / 10))) + ((10 ** (-$eifm / 10)))); } if ($cmp_itm < 0) { $cmp_itm_color = "red"; } elsif ($cmp_itm > 0) { $cmp_itm_color = "blue"; } if ($cmp_itm_rain < 0) { $cmp_itm_rain_color = "red"; } elsif ($cmp_itm_rain > 0) { $cmp_itm_rain_color = "blue"; } if ($cmp_fs < 0) { $cmp_fs_color = "red"; } elsif ($cmp_fs > 0) { $cmp_fs_color = "blue"; } if ($cmp_fs_rain < 0) { $cmp_fs_rain_color = "red"; } elsif ($cmp_fs_rain > 0) { $cmp_fs_rain_color = "blue"; } } elsif ($dfm && $aifm && ($eifm == 0)) { $comp = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm / 10))) + ((10 ** (-$aifm / 10)))); $comp_itm = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm_itm / 10))) + ((10 ** (-$aifm / 10)))); $cmp_fs = sprintf "%.2f", $comp; $comp_fs = sprintf "%.2f", $comp; $cmp_itm = sprintf "%.2f", $comp_itm; $comp_fs_itm = sprintf "%.2f", $comp_itm; $dfm_fs = sprintf "%.2f", $dfm; $aifm_fs = sprintf "%.2f", $aifm; $eifm_fs = sprintf "%.2f", 0; if ($do_div eq "no") { $cmp_div_itm = "Not Applicable"; $cmp_div_itm_color = "blue"; $cmp_div_itm_rain = "Not Applicable"; $cmp_div_itm_rain_color = "blue"; } elsif ($do_div eq "yes") { $cmp_div_itm = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm / 10))) + ((10 ** (-$aifm / 10)))); $cmp_div_itm_rain = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm_rain / 10))) + ((10 ** (-$aifm / 10)))); } if ($cmp_itm < 0) { $cmp_itm_color = "red"; } elsif ($cmp_itm > 0) { $cmp_itm_color = "blue"; } if ($cmp_itm_rain < 0) { $cmp_itm_rain_color = "red"; } elsif ($cmp_itm_rain > 0) { $cmp_itm_rain_color = "blue"; } if ($cmp_fs < 0) { $cmp_fs_color = "red"; } elsif ($cmp_fs > 0) { $cmp_fs_color = "blue"; } if ($cmp_fs_rain < 0) { $cmp_fs_rain_color = "red"; } elsif ($cmp_fs_rain > 0) { $cmp_fs_rain_color = "blue"; } } else { $comp = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm / 10))) + ((10 ** (-$eifm / 10))) + ((10 ** (-$aifm / 10)))); $comp_itm = -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$tfm_itm / 10))) + ((10 ** (-$eifm / 10))) + ((10 ** (-$aifm / 10)))); $cmp_fs = sprintf "%.2f", $comp; $comp_fs = sprintf "%.2f", $comp; $cmp_itm = sprintf "%.2f", $comp_itm; $comp_fs_itm = sprintf "%.2f", $comp_itm; $dfm_fs = sprintf "%.2f", $dfm; $eifm_fs = sprintf "%.2f", $eifm; $aifm_fs = sprintf "%.2f", $aifm; if ($do_div eq "no") { $cmp_div_itm = "Not Applicable"; $cmp_div_itm_color = "blue"; $cmp_div_itm_rain = "Not Applicable"; $cmp_div_itm_rain_color = "blue"; } elsif ($do_div eq "yes") { $cmp_div_itm = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm / 10))) + ((10 ** (-$eifm / 10))) + ((10 ** (-$aifm / 10)))); $cmp_div_itm_rain = sprintf "%.2f", -10 * log10(((10 ** (-$dfm / 10))) + ((10 ** (-$div_tfm_itm_rain / 10))) + ((10 ** (-$eifm / 10))) + ((10 ** (-$aifm / 10)))); } if ($cmp_itm < 0) { $cmp_itm_color = "red"; } elsif ($cmp_itm > 0) { $cmp_itm_color = "blue"; } if ($cmp_itm_rain < 0) { $cmp_itm_rain_color = "red"; } elsif ($cmp_itm_rain > 0) { $cmp_itm_rain_color = "blue"; } if ($cmp_fs < 0) { $cmp_fs_color = "red"; } elsif ($cmp_fs > 0) { $cmp_fs_color = "blue"; } if ($cmp_fs_rain < 0) { $cmp_fs_rain_color = "red"; } elsif ($cmp_fs_rain > 0) { $cmp_fs_rain_color = "blue"; } } ################################################################################# ################################################################################# ## North American Outage Calculations - Vigants # ## One-Way - WITHOUT Spaced Vertical Antenna Diversity (Vigants/Free-Space) # AAA # One-way probability of outage (SES/year) for a non-diversity path $Und_nodiv_fs = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_fs / 10); $Und_nodiv_fs_per = 100 * (1 - $Und_nodiv_fs); $Und_nodiv_fs_rain = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_fs_rain / 10); $Und_nodiv_fs_per_rain = 100 * (1 - $Und_nodiv_fs_rain); if ($Und_nodiv_fs_per <= 0) { $Und_nodiv_fs_per = 0.00000000000; } if ($Und_nodiv_fs_per > 100) { $Und_nodiv_fs_per = 99.9999999999; } if ($Und_nodiv_fs_per_rain <= 0) { $Und_nodiv_fs_per_rain = 0.00000000000; } if ($Und_nodiv_fs_per_rain > 100) { $Und_nodiv_fs_per_rain = 99.9999999999; } # Bell System short-haul one-way outage objective, SES/year $obj_nodiv_fs = 1600 * ($dist_mi / 250); $obj_nodiv_fs_per = 100 - (100 * ($obj_nodiv_fs / 31557600)); $obj_nodiv_fs_two = (1600 * ($dist_mi / 250)) * 2; $obj_nodiv_fs_per_two = 100 - (100 * ($obj_nodiv_fs_two / 31557600)); if ($obj_nodiv_fs_per <= 0) { $obj_nodiv_fs_per = 0.00000000000; } if ($obj_nodiv_fs_per > 100) { $obj_nodiv_fs_per = 99.9999999999; } if ($obj_nodiv_fs_per_two <= 0) { $obj_nodiv_fs_per_two = 0.00000000000; } if ($obj_nodiv_fs_per_two > 100) { $obj_nodiv_fs_per_two = 99.9999999999; } $obj_nodiv_fs_cfm = abs(log10(($obj_nodiv_fs / (0.4 * $cli_vig * $frq_ghz * $temp_f * ($dist_mi ** 3)))) * 10); $obj_nodiv_fs_cfm = sprintf "%.2f", $obj_nodiv_fs_cfm; $obj_nodiv_fs_cfm_two = abs(log10(($obj_nodiv_fs_two / (0.4 * $cli_vig * $frq_ghz * $temp_f * ($dist_mi ** 3)))) * 10); $obj_nodiv_fs_cfm_two = sprintf "%.2f", $obj_nodiv_fs_cfm_two; # Bell System long-haul one-way outage objective, SES/year #$obj1_nodiv_fs = 1600 * ($dist_mi / 2000); $obj1_nodiv_fs = 1600 * ($dist_mi / 4000); $obj1_nodiv_fs_per = 100 - (100 * ($obj1_nodiv_fs / 31557600)); #$obj1_nodiv_fs_two = (1600 * ($dist_mi / 2000)) * 2; $obj1_nodiv_fs_two = (1600 * ($dist_mi / 4000)) * 2; $obj1_nodiv_fs_per_two = 100 - (100 * ($obj1_nodiv_fs_two / 31557600)); if ($obj1_nodiv_fs_per <= 0) { $obj1_nodiv_fs_per = 0.00000000000; } if ($obj1_nodiv_fs_per > 100) { $obj1_nodiv_fs_per = 99.9999999999; } if ($obj1_nodiv_fs_per_two <= 0) { $obj1_nodiv_fs_per_two = 0.00000000000; } if ($obj1_nodiv_fs_per_two > 100) { $obj1_nodiv_fs_per_two = 99.9999999999; } $obj1_nodiv_fs_cfm = abs(log10(($obj1_nodiv_fs / (0.4 * $cli_vig * $frq_ghz * $temp_f * ($dist_mi ** 3)))) * 10); $obj1_nodiv_fs_cfm = sprintf "%.2f", $obj1_nodiv_fs_cfm; $obj1_nodiv_fs_cfm_two = abs(log10(($obj1_nodiv_fs_two / (0.4 * $cli_vig * $frq_ghz * $temp_f * ($dist_mi ** 3)))) * 10); $obj1_nodiv_fs_cfm_two = sprintf "%.2f", $obj1_nodiv_fs_cfm_two; # ITU-R high-grade reference one-way outage objective, SES/year $obj2_nodiv_fs = ((0.00054 * ($dist_km / 2500)) * 2680000) * 3 * ($temp_f / 50); $obj2_nodiv_fs_per = 100 - (100 * ($obj2_nodiv_fs / 31557600)); $obj2_nodiv_fs_two = (((0.00054 * ($dist_km / 2500)) * 2680000) * 3 * ($temp_f / 50)) * 2; $obj2_nodiv_fs_per_two = 100 - (100 * ($obj2_nodiv_fs_two / 31557600)); if ($obj2_nodiv_fs_per <= 0) { $obj_nodiv_fs_per = 0.00000000000; } if ($obj2_nodiv_fs_per > 100) { $obj2_nodiv_fs_per = 99.9999999999; } if ($obj2_nodiv_fs_per_two <= 0) { $obj_nodiv_fs_per_two = 0.00000000000; } if ($obj2_nodiv_fs_per_two > 100) { $obj2_nodiv_fs_per_two = 99.9999999999; } $obj2_nodiv_fs_cfm = abs(log10(($obj2_nodiv_fs / (0.4 * $cli_vig * $frq_ghz * $temp_f * ($dist_mi ** 3)))) * 10); $obj2_nodiv_fs_cfm = sprintf "%.2f", $obj2_nodiv_fs_cfm; $obj2_nodiv_fs_cfm_two = abs(log10(($obj2_nodiv_fs_two / (0.4 * $cli_vig * $frq_ghz * $temp_f * ($dist_mi ** 3)))) * 10); $obj2_nodiv_fs_cfm_two = sprintf "%.2f", $obj2_nodiv_fs_cfm_two; # Annual outage, SES/yr, assume an approx 3 month fade season $SES_nodiv_fs_mo = $Und_nodiv_fs * 2680000; # SES per month (2680000 seconds) $SES_nodiv_fs_yr = $SES_nodiv_fs_mo * 3 * ($temp_f / 50); # SES per year over a 3-month fade season $SES_nodiv_fs_per = 100 - (100 * ($SES_nodiv_fs_yr / 31557600)); $SES_nodiv_fs_mo_rain = $Und_nodiv_fs_rain * 2680000; # SES per month (2680000 seconds) $SES_nodiv_fs_yr_rain = $SES_nodiv_fs_mo_rain * 3 * ($temp_f / 50); # SES per year over a 3-month fade season $SES_nodiv_fs_per_rain = 100 - (100 * ($SES_nodiv_fs_yr_rain / 31557600)); if ($SES_nodiv_fs_per <= 0) { $SES_nodiv_fs_per = "0.00000000000"; $SES_nodiv_fs_yr = 31557600; } if ($SES_nodiv_fs_per >= 100) { $SES_nodiv_fs_per = "99.9999999999"; $SES_nodiv_fs_yr = 0; } if ($SES_nodiv_fs_per_rain <= 0) { $SES_nodiv_fs_per_rain = "0.00000000000"; $SES_nodiv_fs_yr_rain = 31557600; } if ($SES_nodiv_fs_per_rain >= 100) { $SES_nodiv_fs_per_rain = "99.9999999999"; $SES_nodiv_fs_yr_rain = 0; } # Turn SES into minutes/hours/days if ($SES_nodiv_fs_yr < 60) { $worst_nodiv_fs_yr = sprintf "%.2f", $SES_nodiv_fs_yr; $worst_nodiv_fs_yr_val = "seconds"; } elsif ($SES_nodiv_fs_yr >= 60 && $SES_nodiv_fs_yr < 3600) { $worst_nodiv_fs_yr = sprintf "%.2f", $SES_nodiv_fs_yr / 60; $worst_nodiv_fs_yr_val = "minutes"; } elsif ($SES_nodiv_fs_yr >= 3600 && $SES_nodiv_fs_yr < 86400) { $worst_nodiv_fs_yr = sprintf "%.2f", $SES_nodiv_fs_yr / 3600; $worst_nodiv_fs_yr_val = "hours"; } elsif ($SES_nodiv_fs_yr >= 86400) { $worst_nodiv_fs_yr = sprintf "%.2f", $SES_nodiv_fs_yr / 86400; $worst_nodiv_fs_yr_val = "days"; } # Turn SES into minutes/hours/days if ($SES_nodiv_fs_yr_rain < 60) { $worst_nodiv_fs_yr_rain = sprintf "%.2f", $SES_nodiv_fs_yr_rain; $worst_nodiv_fs_yr_val_rain = "seconds"; } elsif ($SES_nodiv_fs_yr_rain >= 60 && $SES_nodiv_fs_yr_rain < 3600) { $worst_nodiv_fs_yr_rain = sprintf "%.2f", $SES_nodiv_fs_yr_rain / 60; $worst_nodiv_fs_yr_val_rain = "minutes"; } elsif ($SES_nodiv_fs_yr_rain >= 3600 && $SES_nodiv_fs_yr_rain < 86400) { $worst_nodiv_fs_yr_rain = sprintf "%.2f", $SES_nodiv_fs_yr_rain / 3600; $worst_nodiv_fs_yr_val_rain = "hours"; } elsif ($SES_nodiv_fs_yr_rain >= 86400) { $worst_nodiv_fs_yr_rain = sprintf "%.2f", $SES_nodiv_fs_yr_rain / 86400; $worst_nodiv_fs_yr_val_rain = "days"; } $SES_nodiv_fs_yr = sprintf "%.2f", $SES_nodiv_fs_yr; $SES_nodiv_fs_per = sprintf "%.10f", $SES_nodiv_fs_per; $SES_nodiv_fs_yr_rain = sprintf "%.2f", $SES_nodiv_fs_yr_rain; $SES_nodiv_fs_per_rain = sprintf "%.10f", $SES_nodiv_fs_per_rain; $obj_nodiv_fs = sprintf "%.2f", $obj_nodiv_fs; $obj_nodiv_fs_per = sprintf "%.10f", $obj_nodiv_fs_per; $obj_nodiv_fs_two = sprintf "%.2f", $obj_nodiv_fs_two; $obj_nodiv_fs_per_two = sprintf "%.10f", $obj_nodiv_fs_per_two; $obj1_nodiv_fs = sprintf "%.2f", $obj1_nodiv_fs; $obj1_nodiv_fs_per = sprintf "%.10f", $obj1_nodiv_fs_per; $obj1_nodiv_fs_two = sprintf "%.2f", $obj1_nodiv_fs_two; $obj1_nodiv_fs_per_two = sprintf "%.10f", $obj1_nodiv_fs_per_two; $obj2_nodiv_fs = sprintf "%.2f", $obj2_nodiv_fs; $obj2_nodiv_fs_per = sprintf "%.10f", $obj2_nodiv_fs_per; $obj2_nodiv_fs_two = sprintf "%.2f", $obj2_nodiv_fs_two; $obj2_nodiv_fs_per_two = sprintf "%.10f", $obj2_nodiv_fs_per_two; $Und_nodiv_fs_per = sprintf "%.10f", $Und_nodiv_fs_per; $Und_nodiv_fs_per_rain = sprintf "%.10f", $Und_nodiv_fs_per_rain; ############################################################################################################################## ## One-Way - WITHOUT Spaced Vertical Antenna Diversity (Vigants/ITWOMv3) # BBB # One-way probability of outage (SES/year) for a non-diversity path $Und_nodiv_itm = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_itm / 10); $Und_nodiv_itm_per = 100 * (1 - $Und_nodiv_itm); $Und_nodiv_itm_rain = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_itm_rain / 10); $Und_nodiv_itm_per_rain = 100 * (1 - $Und_nodiv_itm_rain); if ($Und_nodiv_itm_per <= 0) { $Und_nodiv_itm_per = "0.00000000000"; } if ($Und_nodiv_itm_per > 100) { $Und_nodiv_itm_per = "99.9999999999"; } if ($Und_nodiv_itm_per_rain <= 0) { $Und_nodiv_itm_per_rain = "0.00000000000"; } if ($Und_nodiv_itm_per_rain > 100) { $Und_nodiv_itm_per_rain = "99.9999999999"; } # Annual outage, SES/yr, assume an approx 3 month fade season $SES_nodiv_itm_mo = $Und_nodiv_itm * 2680000; # SES per month (2680000 seconds) $SES_nodiv_itm_yr = $SES_nodiv_itm_mo * 3 * ($temp_f / 50); # SES per year over a 3-month fade season $SES_nodiv_itm_per = 100 - (100 * ($SES_nodiv_itm_yr / 31557600)); $SES_nodiv_itm_mo_rain = $Und_nodiv_itm_rain * 2680000; # SES per month (2680000 seconds) $SES_nodiv_itm_yr_rain = $SES_nodiv_itm_mo_rain * 3 * ($temp_f / 50); # SES per year over a 3-month fade season $SES_nodiv_itm_per_rain = 100 - (100 * ($SES_nodiv_itm_yr_rain / 31557600)); if ($SES_nodiv_itm_per <= 0) { $SES_nodiv_itm_per = "0.00000000000"; $SES_nodiv_itm_yr = 31557600; } if ($SES_nodiv_itm_per > 100) { $SES_nodiv_itm_per = "99.9999999999"; $SES_nodiv_itm_yr = 0; } if ($SES_nodiv_itm_per_rain <= 0) { $SES_nodiv_itm_per_rain = "0.00000000000"; $SES_nodiv_itm_yr_rain = 31557600; } if ($SES_nodiv_itm_per_rain > 100) { $SES_nodiv_itm_per_rain = "99.9999999999"; $SES_nodiv_itm_yr_rain = 0; } # Turn SES into minutes/hours/days - no rain if ($SES_nodiv_itm_yr < 60) { $worst_nodiv_itm_yr = sprintf "%.2f", $SES_nodiv_itm_yr; $worst_nodiv_itm_yr_val = "seconds"; } elsif ($SES_nodiv_itm_yr >= 60 && $SES_nodiv_itm_yr < 3600) { $worst_nodiv_itm_yr = sprintf "%.2f", $SES_nodiv_itm_yr / 60; $worst_nodiv_itm_yr_val = "minutes"; } elsif ($SES_nodiv_itm_yr >= 3600 && $SES_nodiv_itm_yr < 86400) { $worst_nodiv_itm_yr = sprintf "%.2f", $SES_nodiv_itm_yr / 3600; $worst_nodiv_itm_yr_val = "hours"; } elsif ($SES_nodiv_itm_yr >= 86400) { $worst_nodiv_itm_yr = sprintf "%.2f", $SES_nodiv_itm_yr / 86400; $worst_nodiv_itm_yr_val = "days"; } # Turn SES into minutes/hours/days - rain if ($SES_nodiv_itm_yr_rain < 60) { $worst_nodiv_itm_yr_rain = sprintf "%.2f", $SES_nodiv_itm_yr_rain; $worst_nodiv_itm_yr_val_rain = "seconds"; } elsif ($SES_nodiv_itm_yr_rain >= 60 && $SES_nodiv_itm_yr_rain < 3600) { $worst_nodiv_itm_yr_rain = sprintf "%.2f", $SES_nodiv_itm_yr_rain / 60; $worst_nodiv_itm_yr_val_rain = "minutes"; } elsif ($SES_nodiv_itm_yr_rain >= 3600 && $SES_nodiv_itm_yr_rain < 86400) { $worst_nodiv_itm_yr_rain = sprintf "%.2f", $SES_nodiv_itm_yr_rain / 3600; $worst_nodiv_itm_yr_val_rain = "hours"; } elsif ($SES_nodiv_itm_yr_rain >= 86400) { $worst_nodiv_itm_yr_rain = sprintf "%.2f", $SES_nodiv_itm_yr_rain / 86400; $worst_nodiv_itm_yr_val_rain = "days"; } $SES_nodiv_itm_yr = sprintf "%.2f", $SES_nodiv_itm_yr; $SES_nodiv_itm_per = sprintf "%.10f", $SES_nodiv_itm_per; $SES_nodiv_itm_yr_rain = sprintf "%.2f", $SES_nodiv_itm_yr_rain; $SES_nodiv_itm_per_rain = sprintf "%.10f", $SES_nodiv_itm_per_rain; ## Impossible Links # if ($tfm_itm <= 0) { $SES_nodiv_itm_yr = sprintf "%.2f", 31557600; $SES_nodiv_itm_per = sprintf "%.10f", 0; $worst_nodiv_itm_yr = "365.25"; $worst_nodiv_itm_yr_val = "days"; } if ($tfm_itm_rain <= 0) { $SES_nodiv_itm_yr_rain = sprintf "%.2f", 31557600; $SES_nodiv_itm_per_rain = sprintf "%.10f", 0; $worst_nodiv_itm_yr_rain = "365.25"; $worst_nodiv_itm_yr_val_rain = "days"; } if ($do_div eq "yes") { if ($div_tfm_itm <= 0) { $div_tfm_color = "red"; } if ($div_tfm_itm_rain <= 0) { $div_tfm_color_rain = "red"; } } elsif ($do_div eq "no") { $div_tfm_color = "blue"; $div_tfm_color_rain = "blue"; } ## One-Way - WITH Spaced Vertical Antenna Diversity (Vigants/ITWOMv3) # DDD # One-way probability of outage (SES/year) for a space diversity path if ($do_div eq "yes") { # Vigants space diversity improvement factor # $V = 1 for same gain antennas if ($div_ant_dbi == $rx_ant_gain_dbi) { $V = 1; #$V = 1 for same gain antennas } else { if ($div_ant_dbi < 1.1) { $div_ant_dbi = 1.01; } if ($rx_ant_gain_dbi < 1.1) { $rx_ant_gain_dbi = 1.01; } $V = (20 * log10($div_ant_dbi)) / (20 * log10($rx_ant_gain_dbi)); } # No Rain $Und_nodiv_itm = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_itm / 10); $Isd_itm = 7 * (10 ** -5) * $frq_ghz * ($V ** 2) * ($div_ft ** 2) * (10 ** ($cmp_div_itm / 10)) / $dist_mi; $Isd_itm_db = (10 * log10($frq_ghz)) + (20 * log10($div_ft)) - (10 * log($dist_mi)) - 41.55 + $cmp_div_itm; $Isd_itm = sprintf "%.1f", $Isd_itm; $Isd_itm_db = sprintf "%.1f", $Isd_itm_db; if ($Isd_itm > 1.0) { $Isd_message_itm = "(Will Improve Reliability)"; $Und_div_itm = $Und_nodiv_itm / $Isd_itm; # Annual outage, SES/yr, assume an approx 3 month fade season $SES_div_itm_mo = $Und_div_itm * 2680000; # SES per month (2680000 seconds) $SES_div_itm_yr = $SES_div_itm_mo * 3 * ($temp_f / 50); # SES per year over a 3-month fade season $SES_div_itm_per = 100 - (100 * ($SES_div_itm_yr / 31557600)); if ($SES_div_itm_per <= 0) { $SES_div_itm_per = 0.00000000000; $SES_div_itm_yr = 31557600; } if ($SES_div_itm_per >= 100) { $SES_div_itm_per = 99.9999999999; $SES_div_itm_yr = 0; } # Turn SES into minutes/hours/days if ($SES_div_itm_yr < 60) { $worst_div_itm_yr = sprintf "%.2f", $SES_div_itm_yr; $worst_div_itm_yr_val = "seconds"; } elsif ($SES_div_itm_yr >= 60 && $SES_div_itm_yr < 3600) { $worst_div_itm_yr = sprintf "%.2f", $SES_div_itm_yr / 60; $worst_div_itm_yr_val = "minutes"; } elsif ($SES_div_itm_yr >= 3600 && $SES_div_itm_yr < 86400) { $worst_div_itm_yr = sprintf "%.2f", $SES_div_itm_yr / 3600; $worst_div_itm_yr_val = "hours"; } elsif ($SES_div_itm_yr >= 86400) { $worst_div_itm_yr = sprintf "%.2f", $SES_div_itm_yr / 86400; $worst_div_itm_yr_val = "days"; } $SES_div_itm_yr = sprintf "%.2f", $SES_div_itm_yr; $SES_div_itm_per = sprintf "%.10f", $SES_div_itm_per; $Isd_color = "blue"; } elsif ($Isd_itm <= 1.0) { # Use One-Way - WITHOUT Spaced Vertical Antenna Diversity (Vigants/ITWOMv3) values $Isd_message_itm = "(Will Not Improve Reliability)"; $Isd_itm = sprintf "%.1f", $Isd_itm; $Isd_itm_db = sprintf "%.1f", $Isd_itm_db; $SES_div_itm_yr = $SES_nodiv_itm_yr; $SES_div_itm_per = $SES_nodiv_itm_per; $worst_div_itm_yr = $worst_nodiv_itm_yr; $worst_div_itm_yr_val = $worst_nodiv_itm_yr_val; $Isd_color = "red"; } # With Rain $Und_nodiv_itm_rain = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_itm_rain / 10); $Isd_itm_rain = 7 * (10 ** -5) * $frq_ghz * ($V ** 2) * ($div_ft ** 2) * (10 ** ($cmp_itm_rain / 10)) / $dist_mi; $Isd_itm_db_rain = (10 * log10($frq_ghz)) + (20 * log10($div_ft)) - (10 * log($dist_mi)) - 41.55 + $cmp_itm_rain; $Isd_itm_rain = sprintf "%.1f", $Isd_itm_rain; $Isd_itm_db_rain = sprintf "%.1f", $Isd_itm_db_rain; if ($Isd_itm_rain > 1.0) { $Isd_message_itm_rain = "(Will Improve Reliability)"; $Und_div_itm_rain = $Und_nodiv_itm_rain / $Isd_itm_rain; # Annual outage, SES/yr, assume an approx 3 month fade season $SES_div_itm_mo_rain = $Und_div_itm_rain * 2680000; # SES per month (2680000 seconds) $SES_div_itm_yr_rain = $SES_div_itm_mo_rain * 3 * ($temp_f / 50); # SES per year over a 3-month fade season $SES_div_itm_per_rain = 100 - (100 * ($SES_div_itm_yr_rain / 31557600)); if ($SES_div_itm_per_rain <= 0) { $SES_div_itm_per_rain = 0.00000000000; $SES_div_itm_yr_rain = 31557600; } if ($SES_div_itm_per_rain >= 100) { $SES_div_itm_per_rain = 99.9999999999; $SES_div_itm_yr_rain = 0; } # Turn SES into minutes/hours/days if ($SES_div_itm_yr_rain < 60) { $worst_div_itm_yr_rain = sprintf "%.2f", $SES_div_itm_yr_rain; $worst_div_itm_yr_val_rain = "seconds"; } elsif ($SES_div_itm_yr_rain >= 60 && $SES_div_itm_yr_rain < 3600) { $worst_div_itm_yr_rain = sprintf "%.2f", $SES_div_itm_yr_rain / 60; $worst_div_itm_yr_val_rain = "minutes"; } elsif ($SES_div_itm_yr_rain >= 3600 && $SES_div_itm_yr_rain < 86400) { $worst_div_itm_yr_rain = sprintf "%.2f", $SES_div_itm_yr_rain / 3600; $worst_div_itm_yr_val_rain = "hours"; } elsif ($SES_div_itm_yr_rain >= 86400) { $worst_div_itm_yr_rain = sprintf "%.2f", $SES_div_itm_yr_rain / 86400; $worst_div_itm_yr_val_rain = "days"; } $Isd_itm_rain = sprintf "%.1f", $Isd_itm_rain; $Isd_itm_db_rain = sprintf "%.1f", $Isd_itm_db_rain; $SES_div_itm_yr_rain = sprintf "%.2f", $SES_div_itm_yr_rain; $SES_div_itm_per_rain = sprintf "%.10f", $SES_div_itm_per_rain; $Isd_color_rain = "blue"; } elsif ($Isd_itm_rain <= 1.0) { # Use One-Way - WITHOUT Spaced Vertical Antenna Diversity (Vigants/ITWOMv3) values $Isd_message_itm_rain = "(Will Not Improve Reliability)"; $SES_div_itm_yr_rain = $SES_nodiv_itm_yr_rain; $SES_div_itm_per_rain = $SES_nodiv_itm_per_rain; $worst_div_itm_yr_rain = $worst_nodiv_itm_yr_rain; $worst_div_itm_yr_val_rain = $worst_nodiv_itm_yr_val_rain; $Isd_color_rain = "red"; } } elsif ($do_div eq "no") { $Isd_itm = "Not Applicable"; $Isd_message_itm = ""; $Isd_itm_db_rain = "N/A"; $Isd_itm_db = "N/A"; $SES_div_itm_yr = "Not Applicable"; $SES_div_itm_per = "Not Applicable"; $worst_div_itm_yr = "Not Applicable"; $worst_div_itm_yr_val = ""; $Isd_itm_rain = "Not Applicable"; $Isd_message_itm_rain = ""; $SES_div_itm_yr_rain = "Not Applicable"; $SES_div_itm_per_rain = "Not Applicable"; $worst_div_itm_yr_rain = "Not Applicable"; $worst_div_itm_yr_val_rain = ""; $Isd_color = "blue"; $Isd_color_rain = "blue"; } ## Frequency Diversity Improvement Factor - Vigants # EEE # if ($frq_ghz_div >= 0.020 && $frq_ghz_div <= 2.0) { # Frequency diversity is mostly used above 2 GHz $do_frq_div = "no"; $frq_ghz_div = "(Must Be Above 2 GHz)"; $Ifd_itm = "Not Applicable"; $Ifd_message_itm = ""; $Ifd_color = "blue"; $df = "N/A"; } elsif ($frq_ghz_div > 2.0) { $do_frq_div = "yes"; $df = sprintf "%.4f", abs($frq_ghz_div - $frq_ghz); if ($df > 0.5) { $df = 0.5; # use 0.5 GHz deltaF } $df_mhz = sprintf "%.2f", $df * 1000; # No Rain $Ifd_itm = 50 * $df * (10 ** ($cmp_itm / 10)) / (($frq_ghz ** 2) * $dist_mi); if ($Ifd_itm > 1.0) { $Und_nodiv_itm = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_itm / 10); $Und_frq_div_itm = $Und_nodiv_itm / $Ifd_itm; $SES_frq_div_itm_per = 100 * (1 - $Und_frq_div_itm); $SES_frq_div_mo_itm = $Und_frq_div_itm * 2680000; # SES per month (2680000 seconds) $SES_frq_div_yr_itm = $SES_frq_div_mo_itm * 3 * ($temp_f / 50); # SES per year over a 3-month fade season if ($SES_frq_div_itm_per <= 0) { $SES_frq_div_itm_per = sprintf "%.10f", 0.0; $SES_frq_div_yr_itm = 31557600; } if ($SES_frq_div_itm_per >= 100) { $SES_frq_div_itm_per = sprintf "%.10f", 99.999999999; $SES_frq_div_yr_itm = 0; } # Turn SES into minutes/hours/days if ($SES_frq_div_yr_itm < 60) { $worst_frq_div_mo_itm = sprintf "%.2f", $SES_frq_div_yr_itm; $worst_frq_div_mo_itm_val = "seconds"; } elsif ($SES_frq_div_yr_itm >= 60 && $SES_frq_div_yr_itm < 3600) { $worst_frq_div_mo_itm = sprintf "%.2f", $SES_frq_div_yr_itm / 60; $worst_frq_div_mo_itm_val = "minutes"; } elsif ($SES_frq_div_yr_itm >= 3600 && $SES_frq_div_yr_itm < 86400) { $worst_frq_div_mo_itm = sprintf "%.2f", $SES_frq_div_yr_itm / 3600; $worst_frq_div_mo_itm_val = "hours"; } elsif ($SES_frq_div_yr_itm >= 86400) { $worst_frq_div_mo_itm = sprintf "%.2f", $SES_frq_div_yr_itm / 86400; $worst_frq_div_mo_itm_val = "days"; } $SES_frq_div_itm_per = sprintf "%.10f", abs($SES_frq_div_itm_per); $SES_frq_div_yr_itm = sprintf "%.2f", $SES_frq_div_yr_itm; $Ifd_message_itm = "(Will Improve Reliability)"; $Ifd_itm = sprintf "%.1f", $Ifd_itm; $Ifd_color = "blue"; } elsif ($Ifd_itm < 1.0) { $Ifd_message_itm = "(Will Not Improve Reliability)"; $Ifd_itm = sprintf "%.1f", $Ifd_itm; $Ifd_color = "red"; $df_mhz = sprintf "%.2f", $df * 1000; $SES_frq_div_itm_per = $SES_nodiv_itm_per; $SES_frq_div_yr_itm = $SES_nodiv_itm_yr; $worst_frq_div_mo_itm = $worst_nodiv_itm_yr; $worst_frq_div_mo_itm_val = $worst_nodiv_itm_yr_val; } # With Rain $Ifd_itm_rain = 50 * $df * (10 ** ($cmp_itm_rain / 10)) / (($frq_ghz ** 2) * $dist_mi); if ($Ifd_itm_rain > 1.0) { $Und_nodiv_itm_rain = $cli_vig * ($frq_ghz / 4) * (10 ** -5) * ($dist_mi ** 3) * 10 ** -($cmp_itm_rain / 10); $Und_frq_div_itm_rain = $Und_nodiv_itm_rain / $Ifd_itm_rain; $SES_frq_div_itm_per_rain = 100 * (1 - $Und_frq_div_itm_rain); $SES_frq_div_mo_itm_rain = $Und_frq_div_itm_rain * 2680000; # SES per month (2680000 seconds) $SES_frq_div_yr_itm_rain = $SES_frq_div_mo_itm_rain * 3 * ($temp_f / 50); # SES per year over a 3-month fade season if ($SES_frq_div_itm_per_rain <= 0) { $SES_frq_div_itm_per_rain = sprintf "%.10f", 0.0; $SES_frq_div_yr_itm_rain = 31557600; } if ($SES_frq_div_itm_per_rain >= 100) { $SES_frq_div_itm_per_rain = sprintf "%.10f", 99.999999999; $SES_frq_div_yr_itm_rain = 0; } # Turn SES into minutes/hours/days if ($SES_frq_div_yr_itm_rain < 60) { $worst_frq_div_mo_itm_rain = sprintf "%.2f", $SES_frq_div_yr_itm_rain; $worst_frq_div_mo_itm_val_rain = "seconds"; } elsif ($SES_frq_div_yr_itm_rain >= 60 && $SES_frq_div_yr_itm_rain < 3600) { $worst_frq_div_mo_itm_rain = sprintf "%.2f", $SES_frq_div_yr_itm_rain / 60; $worst_frq_div_mo_itm_val_rain = "minutes"; } elsif ($SES_frq_div_yr_itm_rain >= 3600 && $SES_frq_div_yr_itm_rain < 86400) { $worst_frq_div_mo_itm_rain = sprintf "%.2f", $SES_frq_div_yr_itm_rain / 3600; $worst_frq_div_mo_itm_val_rain = "hours"; } elsif ($SES_frq_div_yr_itm_rain >= 86400) { $worst_frq_div_mo_itm_rain = sprintf "%.2f", $SES_frq_div_yr_itm_rain / 86400; $worst_frq_div_mo_itm_val_rain = "days"; } $SES_frq_div_itm_per_rain = sprintf "%.10f", abs($SES_frq_div_itm_per_rain); $SES_frq_div_yr_itm_rain = sprintf "%.2f", $SES_frq_div_yr_itm_rain; $Ifd_message_itm_rain = "(Will Improve Reliability)"; $Ifd_itm_rain = sprintf "%.1f", $Ifd_itm_rain; $Ifd_color_rain = "blue"; } elsif ($Ifd_itm_rain < 1.0) { $Ifd_message_itm_rain = "(Will Not Improve Reliability)"; $Ifd_itm_rain = sprintf "%.1f", $Ifd_itm_rain; $Ifd_color_rain = "red"; $SES_frq_div_itm_per_rain = $SES_nodiv_itm_per_rain; $SES_frq_div_yr_itm_rain = $SES_nodiv_itm_yr_rain; $worst_frq_div_mo_itm_rain = $worst_nodiv_itm_yr_rain; $worst_frq_div_mo_itm_val_rain = $worst_nodiv_itm_yr_val_rain; } } else { $do_frq_div = "no"; $frq_ghz_div = "Not Applicable"; $df_mhz = "N/A"; $Ifd_itm = "Not Applicable"; $Ifd_message_itm = ""; $Ifd_color = "blue"; $SES_frq_div_yr_itm = "Not Applicable"; $SES_frq_div_itm_per = "Not Applicable"; $worst_frq_div_mo_itm = "Not Applicable"; $worst_frq_div_mo_itm_val = ""; $Ifd_itm_rain = "Not Applicable"; $Ifd_color_rain = "blue"; $Ifd_message_itm_rain = ""; $SES_frq_div_yr_itm_rain = "Not Applicable"; $SES_frq_div_itm_per_rain = "Not Applicable"; $worst_frq_div_mo_itm_rain = "Not Applicable"; $worst_frq_div_mo_itm_val_rain = ""; } if ($do_frq_div eq "yes") { if ($do_div eq "yes") { # Hybrid (Space+Frequency) Improvement Factor $Ihd_itm = sprintf "%.1f", $Ifd_itm * $Isd_itm; if ($Ihd_itm > 1) { $Und_hyb_div_itm = $Und_nodiv_itm / $Ihd_itm; $SES_hyb_div_itm_per = 100 * (1 - $Und_hyb_div_itm); $SES_hyb_div_mo_itm = $Und_hyb_div_itm * 2680000; # SES per month (2680000 seconds) $SES_hyb_div_yr_itm = $SES_hyb_div_mo_itm * 3 * ($temp_f / 50); # SES per year over a 3-month fade season if ($SES_hyb_div_itm_per < 0) { $SES_hyb_div_itm_per = sprintf "%.10f", 0.0; $SES_hyb_div_yr_itm = 31557600; } if ($SES_hyb_div_itm_per > 100) { $SES_hyb_div_itm_per = sprintf "%.10f", 99.999999999; $SES_hyb_div_yr_itm = 0; } # Turn SES into minutes/hours/days if ($SES_hyb_div_yr_itm < 60) { $worst_hyb_div_yr_itm = sprintf "%.2f", $SES_hyb_div_yr_itm; $worst_hyb_div_yr_itm_val = "seconds"; } elsif ($SES_hyb_div_yr_itm >= 60 && $SES_hyb_div_yr_itm < 3600) { $worst_hyb_div_yr_itm = sprintf "%.2f", $SES_hyb_div_yr_itm / 60; $worst_hyb_div_yr_itm_val = "minutes"; } elsif ($SES_hyb_div_yr_itm >= 3600 && $SES_hyb_div_yr_itm < 86400) { $worst_hyb_div_yr_itm = sprintf "%.2f", $SES_hyb_div_yr_itm / 3600; $worst_hyb_div_yr_itm_val = "hours"; } elsif ($SES_hyb_div_yr_itm >= 86400) { $worst_hyb_div_yr_itm = sprintf "%.2f", $SES_hyb_div_yr_itm / 86400; $worst_hyb_div_yr_itm_val = "days"; } $SES_hyb_div_itm_per = sprintf "%.10f", abs($SES_hyb_div_itm_per); $SES_hyb_div_yr_itm = sprintf "%.2f", $SES_hyb_div_yr_itm; $Ihd_itm = sprintf "%.1f", $Ihd_itm; $Ihd_message = "(Will Improve Reliability)"; $Ihd_color = "blue"; } elsif ($Ihd_itm < 1) { $Ihd_message = "(Will Not Improve Reliability)"; $Ihd_itm = sprintf "%.1f", $Ihd_itm; $SES_hyb_div_yr_itm = "Not Applicable"; $SES_hyb_div_itm_per = "Not Applicable"; $worst_hyb_div_yr_itm = "Not Applicable"; $worst_hyb_div_yr_itm_val = ""; $Ihd_color = "red"; } } elsif ($do_div eq "no") { $SES_hyb_div_itm_per = "Not Applicable"; $SES_hyb_div_yr_itm = "Not Applicable"; $Ihd_itm = "Not Applicable"; $Ihd_message = ""; $worst_hyb_div_yr_itm = "Not Applicable"; $worst_hyb_div_yr_itm_val = ""; $Ihd_color = "blue"; } } if ($do_frq_div eq "no") { $SES_hyb_div_itm_per = "Not Applicable"; $SES_hyb_div_yr_itm = "Not Applicable"; $Ihd_itm = "Not Applicable"; $Ihd_message = ""; $worst_hyb_div_yr_itm = "Not Applicable"; $worst_hyb_div_yr_itm_val = ""; $Ihd_color = "blue"; } ## Foliage Loss # ITU $depth = 5; # Foliage depth in meters $foli_loss = 0.2 * ($frq_mhz ** 0.3) * ($depth ** 0.6); # Loss in dB $foli_m = sprintf "%.3f", ($foli_loss / 5); # Loss in dB/m $foli_ft = sprintf "%.3f", ($foli_loss / 5) / 3.2808399; ## RF Safety - FCC Limits for General Population/Uncontrolled Exposure and Occupational/Controlled Exposure # if ($frq_mhz >= 0.3 && $frq_mhz <= 1.34) { $std1 = 100.0; # Power Density (S) mW/cm2 - General $std2 = 100.0; # Power Density (S) mW/cm2 - Occupational } elsif ($frq_mhz > 1.34 && $frq_mhz <= 30.0) { $std1 = 180.0 / ($frq_mhz ** 2); # Power Density (S) mW/cm2 - General $std2 = 900.0 / ($frq_mhz ** 2); } elsif ($frq_mhz > 30.0 && $frq_mhz <= 300.0) { $std1 = 0.2; # Power Density (S) mW/cm2 - General $std2 = 1.0; } elsif ($frq_mhz > 300.0 && $frq_mhz <= 1500.0) { $std1 = $frq_mhz / 1500; # Power Density (S) mW/cm2 - General $std2 = $frq_mhz / 300; } elsif ($frq_mhz > 1500.0 && $frq_mhz < 100000.0) { $std1 = 1.0; # Power Density (S) mW/cm2 - General $std2 = 5.0; } else { $std1 = 1.0; # Power Density (S) mW/cm2 - General $std2 = 5.0; } $rf_safe_eirp = $tx_ant_input_mw * (10 ** ($tx_ant_gain_dbi / 10)); $rf_safe_dx = $tx_ant_ht_ft * 30.48; # ft to cm $pwrdens = (0.64 * $rf_safe_eirp) / (pi * ($rf_safe_dx ** 2)); $rf_safe_pwrdens = sprintf "%.4f", (($pwrdens * 10000) + 0.5) / 10000; $dx1 = (sqrt((0.64 * $rf_safe_eirp) / ($std1 * pi))) / 30.48; $dx1 = (($dx1 * 10) + 0.5) / 10; $dx1_ft = sprintf "%.2f", $dx1; $dx1_m = sprintf "%.2f", $dx1 * 0.3048; $std1 = sprintf "%.2f", ((($std1 * 100) + 0.5) / 100); $dx2 = (sqrt((0.64 * $rf_safe_eirp) / ($std2 * pi))) / 30.48; $dx2 = (($dx2 * 10) + 0.5) / 10; $dx2_ft = sprintf "%.2f", $dx2; $dx2_m = sprintf "%.2f", $dx2 * 0.3048; $std2 = sprintf "%.2f", ((($std2 * 100) + 0.5) / 100); ## Grazing Angle # $ae = 6378.137 * $k; # Earth radius with k-factor, km $gr_m = ($dist_km ** 2) / (4 * $ae * (($tx_ant_ht_ov_m / 1000) + ($rx_ant_ht_ov_m / 1000))); $gr_c = abs($tx_ant_ht_ov_m - $rx_ant_ht_ov_m) / ($tx_ant_ht_ov_m + $rx_ant_ht_ov_m); $gr_x = ((3 * $gr_c) / 2) * sqrt(($gr_m * 3) / (($gr_m + 1) ** 3)); $gr_y = cos((pi / 3) + (1 / 3) * acos($gr_x)); $gr_b = (2 * sqrt(($gr_m + 1) / ($gr_m * 3))) * $gr_y; $graze = (($tx_ant_ht_ov_m + $rx_ant_ht_ov_m) / $dist_km) * ((1 - $gr_m) * (1 + ($gr_b ** 2))); $graze_mr = sprintf "%.2f", $graze; # millirad $graze_dg = sprintf "%.2f", $graze * 0.0572958; # millirad to degree ## GTE Lenkurt - Path Reflection Point # if ($k_str eq "Infinity") { if ($tx_ant_ht_ft >= $rx_ant_ht_ft) { $grazing_dis = ($rx_ant_ht_ft / ($rx_ant_ht_ft + $tx_ant_ht_ft)) * $dist_mi; $grazing_k = "Not Applicable"; $grazing_dis_mi = sprintf "%.2f", $grazing_dis; $grazing_dis_km = sprintf "%.2f", $grazing_dis * 1.609344; } elsif ($rx_ant_ht_ft > $tx_ant_ht_ft) { $grazing_dis = ($tx_ant_ht_ft / ($tx_ant_ht_ft + $rx_ant_ht_ft)) * $dist_mi; $grazing_k = "Not Applicable"; $grazing_dis_mi = sprintf "%.2f", $grazing_dis; $grazing_dis_km = sprintf "%.2f", $grazing_dis * 1.609344; } } else { if ($tx_ant_ht_ft >= $rx_ant_ht_ft) { $X = $rx_ant_ht_ft / ($dist_mi ** 2); $Y = $rx_ant_ht_ft / ($dist_mi ** 2); $grazing_k = sprintf "%.2f", 1 / (1.5 * ($X + $Y + 2 * sqrt($X * $Y))); $grazing_dis = (1 / (1 + sqrt($Y / $X))) * $dist_mi; $grazing_dis_mi = sprintf "%.2f", $grazing_dis; $grazing_dis_km = sprintf "%.2f", $grazing_dis * 1.609344; } elsif ($rx_ant_ht_ft > $tx_ant_ht_ft) { $X = $tx_ant_ht_ft / ($dist_mi ** 2); $Y = $rx_ant_ht_ft / ($dist_mi ** 2); $grazing_k = sprintf "%.2f", 1 / (1.5 * ($X + $Y + 2 * sqrt($X * $Y))); $grazing_dis = (1 / (1 + sqrt($Y / $X))) * $dist_mi; $grazing_dis_mi = sprintf "%.2f", $grazing_dis; $grazing_dis_km = sprintf "%.2f", $grazing_dis * 1.609344; } } ## Path Reflection Point # # From Boithias (1987) and George Kizer's book # # h1 = physical height of the antenna at one end of the path above the reflection point physical height # h1 = physical height of the antenna at the other end of the path above the reflection point physical height # D = total path distance # d1 = distance from one end of the path to the reflection point # d2 = distance from the other end of the path to the reflection point # B = normalized distance from the center of the path to the reflection point (-1 to +1) # units should be in meters and radians if ($tx_ant_ht_m >= $rx_ant_ht_m) { $h1 = $tx_ant_ht_m; $h2 = $rx_ant_ht_m } elsif ($rx_ant_ht_m > $tx_ant_ht_m) { $h1 = $rx_ant_ht_m; $h2 = $tx_ant_ht_m } $C = ($h1 - $h2) / ($h1 + $h2); $M = (($dist_km * 1000) ** 2) / (4 * 6378137 * $k * ($h1 + $h2)); $B = (2 * sqrt(($M + 1) / (3 * $M))) * (cos((pi / 3) + ((1 / 3) * acos(((3 * $C) / 2) * sqrt((3 * $M) / (($M + 1) ** 3)))))); $d1 = (($dist_km * 1000) / 2) * (1 + $B); $d2 = ($dist_km * 1000) - $d1; $grazing_dis_mi = sprintf "%.2f", $d1 * 0.0006213712; $grazing_dis_km = sprintf "%.2f", $d1 / 1000; #$angle_of_incid = sprintf "%.2f", rad2deg((($h1 + $h2) / ($dist_km * 1000)) * (1 - $M * (1 + ($B ** 2)))); # Direct path $Id = sqrt((($dist_km * 1000) ** 2) + (($h1 - $h2) ** 2)); # Indirect path $Ii = sqrt((($dist_km * 1000) ** 2) + (($h1 + $h2) ** 2)); # Phase difference between paths $phase_delta = (($Ii - $Id) / $wav_m) * (2 * pi); # Relative signal amplitude $L = 1; # reflection coefficient $Arx = sqrt(((1 + $L * cos($phase_delta)) ** 2) + (($L * sin($phase_delta)) ** 2)); if ($Arx >= 1) { $Arx_mess = "(Received Signal O.K.)"; } elsif ($Arx < 1) { $Arx_mess = "(Received Signal Diminished)"; } $fade_depth = sprintf "%.2f", 10 * log($Arx); $phase_delta = sprintf "%.2f", rad2deg($phase_delta); ## Smooth Earth Diffraction Loss # ITU Rec. P.526-14 # For horizontal polarization at all frequencies, and for vertical polarization above 20 MHz over land # or 300 MHz over sea, Beta may be taken as equal to 1 $Beta = 1; $ae = 6378.137 * $k; # Earth radius with k-factor, km $X = 2.188 * $Beta * ($frq_mhz ** (1/3)) * ($ae ** -(2/3)) * $dist_km; $Y1 = 0.009575 * $Beta * ($frq_mhz ** (2/3)) * ($ae ** -(1/3)) * $rx_ant_ht_m; $Y2 = 0.009575 * $Beta * ($frq_mhz ** (2/3)) * ($ae ** -(1/3)) * $tx_ant_ht_m; if ($X >= 1.6) { $FX = 11 + (10 * log($X)) - (17.6 * $X); } elsif ($X < 1.6) { $FX = (-20 * log($X)) - (5.6488 * ($X ** 1.425)); } $B1 = $Beta * $Y1; $B2 = $Beta * $Y2; if ($B1 > 2) { $GY1 = 17.6 * (($B1 - 1.1) ** (1/2)) - (5 * log($B1 - 1.1)) - 8; } elsif ($B1 <= 2) { $GY1 = 20 * log($B1 + (0.1 * ($B1 ** 3))); } if ($B2 > 2) { $GY2 = 17.6 * (($B2 - 1.1) ** (1/2)) - (5 * log($B2 - 1.1)) - 8; } elsif ($B2 <= 2) { $GY2 = 20 * log($B2 + (0.1 * ($B2 ** 3))); } $diff_loss = sprintf "%.2f", abs($FX + $GY1 + $GY2); ## Ideal Fade Margin # $min_fade = log10(((0.9995 - 1) / (-2.5 * 2 * $cli_vig * $frq_ghz * ($dist_mi ** 3) * (10 ** -6)))) * -10; $min_fade = sprintf "%.2f", abs($min_fade); ## Amplitude Dispersion Fading # # From "Digital Microave Radio - Engineering Fundamentals" NEC, MSD-3003 # Relates to fading prediction on FDM/video (analog) links if ($check4 eq "yes") { $fade_rough_calc_m = $rough_m; } elsif ($check4 eq "no") { if ($rough_calc_m < 6) { $fade_rough_calc_m = 6; } if ($rough_calc_m > 42) { $fade_rough_calc_m = 42; } else { $fade_rough_calc_m = $rough_calc_m; } } # ITM Non-Div - Without Rain Loss $amp1 = 0.002088 * ((10 ** -($cmp_itm / 20)) ** 2) * $frq_ghz * ($dist_km ** 3) * ($fade_rough_calc_m ** -1.27) * $cli_vig; if ($amp1 >= 99) { $amp1 = (100 - (2.37 * ($fade_rough_calc_m ** -1.27) * $cli_vig * (10 ** ($cmp_itm / 7.88)))) / log10($dist_km / 10); } # ITM Non-Div - With Rain Loss $amp2 = 0.002088 * ((10 ** -($cmp_itm_rain / 20)) ** 2) * $frq_ghz * ($dist_km ** 3) * ($fade_rough_calc_m ** -1.27) * $cli_vig; if ($amp2 >= 99) { $amp2 = (100 - (2.37 * ($fade_rough_calc_m ** -1.27) * $cli_vig * (10 ** ($cmp_itm_rain / 7.88)))) / log10($dist_km / 10); } # Free-Space Non-Div - Without Rain Loss $amp3 = 0.002088 * ((10 ** -($cmp_fs / 20)) ** 2) * $frq_ghz * ($dist_km ** 3) * ($fade_rough_calc_m ** -1.27) * $cli_vig; if ($amp3 >= 99) { $amp3 = (100 - (2.37 * ($fade_rough_calc_m ** -1.27) * $cli_vig * (10 ** ($cmp_fs / 7.88)))) / log10($dist_km / 10); } # Free-Space Non-Div - With Rain Loss $amp4 = 0.002088 * ((10 ** -($cmp_fs_rain / 20)) ** 2) * $frq_ghz * ($dist_km ** 3) * ($fade_rough_calc_m ** -1.27) * $cli_vig; if ($amp4 >= 99) { $amp4 = (100 - (2.37 * ($fade_rough_calc_m ** -1.27) * $cli_vig * (10 ** ($cmp_fs_rain / 7.88)))) / log10($dist_km / 10); } $amp1_fade_s = ($amp1 / 100) * 31557600; $amp2_fade_s = ($amp2 / 100) * 31557600; $amp3_fade_s = ($amp3 / 100) * 31557600; $amp4_fade_s = ($amp4 / 100) * 31557600; # Turn amplitude dispersion fade outage into minutes/hours/days if ($amp1_fade_s < 60) { $worst_amp_fade = sprintf "%.2f", $amp1_fade_s; $worst_amp_fade_val = "seconds"; } elsif ($amp1_fade_s >= 60 && $amp1_fade_s < 3600) { $worst_amp_fade = sprintf "%.2f", $amp1_fade_s / 60; $worst_amp_fade_val = "minutes"; } elsif ($amp1_fade_s >= 3600 && $amp1_fade_s < 86400) { $worst_amp_fade = sprintf "%.2f", $amp1_fade_s / 3600; $worst_amp_fade_val = "hours"; } elsif ($amp1_fade_s >= 86400) { $worst_amp_fade = sprintf "%.2f", $amp1_fade_s / 86400; $worst_amp_fade_val = "days"; } # Turn amplitude dispersion fade outage into minutes/hours/days if ($amp2_fade_s < 60) { $worst_amp_fade_rain = sprintf "%.2f", $amp2_fade_s; $worst_amp_fade_rain_val = "seconds"; } elsif ($amp2_fade_s >= 60 && $amp2_fade_s < 3600) { $worst_amp_fade_rain = sprintf "%.2f", $amp2_fade_s / 60; $worst_amp_fade_rain_val = "minutes"; } elsif ($amp2_fade_s >= 3600 && $amp2_fade_s < 86400) { $worst_amp_fade_rain = sprintf "%.2f", $amp2_fade_s / 3600; $worst_amp_fade_rain_val = "hours"; } elsif ($amp2_fade_s >= 86400) { $worst_amp_fade_rain = sprintf "%.2f", $amp2_fade_s / 86400; $worst_amp_fade_rain_val = "days"; } # Turn amplitude dispersion fade outage into minutes/hours/days if ($amp3_fade_s < 60) { $worst_amp_fade_fs = sprintf "%.2f", $amp3_fade_s; $worst_amp_fade_fs_val = "seconds"; } elsif ($amp3_fade_s >= 60 && $amp3_fade_s < 3600) { $worst_amp_fade_fs = sprintf "%.2f", $amp3_fade_s / 60; $worst_amp_fade_fs_val = "minutes"; } elsif ($amp3_fade_s >= 3600 && $amp3_fade_s < 86400) { $worst_amp_fade_fs = sprintf "%.2f", $amp3_fade_s / 3600; $worst_amp_fade_fs_val = "hours"; } elsif ($amp3_fade_s >= 86400) { $worst_amp_fade_fs = sprintf "%.2f", $amp3_fade_s / 86400; $worst_amp_fade_fs_val = "days"; } # Turn amplitude dispersion fade outage into minutes/hours/days if ($amp4_fade_s < 60) { $worst_amp_fade_fs_rain = sprintf "%.2f", $amp4_fade_s; $worst_amp_fade_fs_rain_val = "seconds"; } elsif ($amp4_fade_s >= 60 && $amp4_fade_s < 3600) { $worst_amp_fade_fs_rain = sprintf "%.2f", $amp4_fade_s / 60; $worst_amp_fade_fs_rain_val = "minutes"; } elsif ($amp4_fade_s >= 3600 && $amp4_fade_s < 86400) { $worst_amp_fade_fs_rain = sprintf "%.2f", $amp4_fade_s / 3600; $worst_amp_fade_fs_rain_val = "hours"; } elsif ($amp4_fade_s >= 86400) { $worst_amp_fade_fs_rain = sprintf "%.2f", $amp4_fade_s / 86400; $worst_amp_fade_fs_rain_val = "days"; } if ($do_div eq "yes") { # Space Diversity Improvement - ITM - Without Rain $X = (830 * $dist_km * (10 ** -($cmp_itm / 10))) / ($frq_ghz * $div_m * $div_m); $amp1_itm_div = ($amp1 * $X) / sqrt(1 + ($X * $X)); $amp1_itm_div_s = ($amp1_itm_div / 100) * 31557600; # Turn amplitude dispersion fade outage into minutes/hours/days if ($amp1_itm_div_s < 60) { $worst_amp_fade_itm_div = sprintf "%.2f", $amp1_itm_div_s; $worst_amp_fade_itm_div_val = "seconds"; } elsif ($amp1_itm_div_s >= 60 && $amp1_itm_div_s < 3600) { $worst_amp_fade_itm_div = sprintf "%.2f", $amp1_itm_div_s / 60; $worst_amp_fade_itm_div_val = "minutes"; } elsif ($amp1_itm_div_s >= 3600 && $amp1_itm_div_s < 86400) { $worst_amp_fade_itm_div = sprintf "%.2f", $amp1_itm_div_s / 3600; $worst_amp_fade_itm_div_val = "hours"; } elsif ($amp1_itm_div_s >= 86400) { $worst_amp_fade_itm_div = sprintf "%.2f", $amp1_itm_div_s / 86400; $worst_amp_fade_itm_div_val = "days"; } } ## Potential Upfade # # If two signals reach the receiver in phase, then the signal amplifies. This is called upfade $upfade = sprintf "%.2f", (10 * log10($dist_mi)) - (0.03 * $dist_mi); ## Mean Path Time Delay # $time_delay = sprintf "%.2f", 0.7 * ($dist_km / 50) ** 1.3; # nanoseconds ## National Land Cover Map - Experimental / Requires 'ptelev' and NLCD 2021 data from the FCC's TVStudy program # if ($do_lulc eq "yes" && $country_tx eq "United States") { $LULC_LAT1 = abs($LAT1); $LULC_LON1 = abs($LON1); $LULC_LAT2 = abs($LAT2); $LULC_LON2 = abs($LON2); $do_duck = "no"; open(F1, ">", "lulc1.gp") or die "Can't open lulc1.gp: $!\n"; open(F2, "<", "profile2.gp") or die "Can't open profile2.gp: $!\n"; while () { chomp; ($dist, $elev) = split; $step_km = $dist * 1.609344; if ($step_km == 0) { $step_km = 0.01; } chomp($coord = `lib/ptelev 13 $LULC_LAT1 $LULC_LON1 $step_km $AZSP`); ($lat, $lon) = split ',', $coord; chomp($land = `lib/ptelev 15 $lat $lon 2021`); if ($land eq "Open Water") { $color = "0x486DA2"; } elsif ($land eq "Perennial Ice/Snow") { $color = "0xE7EFFC"; } elsif ($land eq "Developed, Low Intensity") { $color = "0xDC9881"; } elsif ($land eq "Developed, Medium Intensity") { $color = "0xF10100"; } elsif ($land eq "Developed, High Intensity") { $color = "0xAB0101"; } elsif ($land eq "Developed, Open Space") { $color = "0xE1CDCE"; } elsif ($land eq "Barren Land (Rock/Sand/Clay)") { $color = "0xB3AFA4"; } elsif ($land eq "Deciduous Forest") { $color = "0x6BA966"; } elsif ($land eq "Evergreen Forest") { $color = "0x1D6533"; } elsif ($land eq "Mixed Forest") { $color = "0xBDCC93"; } elsif ($land eq "Grassland/Herbaceous") { $color = "0xEDECCD"; } elsif ($land eq "Shrub/Scrub") { $color = "0xD1BB82"; } elsif ($land eq "Pasture/Hay") { $color = "0xDDD83E"; } elsif ($land eq "Cultivated Crops") { $color = "0xAE7229"; } elsif ($land eq "Woody Wetlands") { $color = "0xBBD7ED"; if ($do_duck eq "no") { $do_duck = "yes"; $duck_dist = $dist; $duck_elev = $elev; } } elsif ($land eq "Emergent Herbaceous Wetland") { $color = "0x71A4C1"; } else { $color = "0xE1CDCE"; # Developed, Open Space } $dist = sprintf "%.6f", $dist; $elev = sprintf "%.6f", $elev; print F1 "$dist\t$elev\t$color\n"; $color =~ s/0x/#/g; # Turn 0x into # for gnuplot key color codes $data = $land . ":" . $color; push(@DATA, $data); } close F2; close F1; # Generate Land Usage Key Boxes for GNUPlot %unique = (); foreach my $item (@DATA) { $unique{$item} ++; } @DATA_UNIQUE = keys %unique; foreach my $x (@DATA_UNIQUE) { ($land_new, $color_new) = split ':', $x; $var = ", keyentry with boxes lc rgb " . "'" . $color_new . "'" . " title " . "'" . $land_new . "'"; push(@KEY, $var); } # Generate Land Clutter Height Template $land_clutter =~ tr/A-Za-z//csd; $ht_water =~ tr/0-9.//csd; $ht_ice =~ tr/0-9.//csd; $ht_devlow =~ tr/0-9.//csd; $ht_devmed =~ tr/0-9.//csd; $ht_devhgh =~ tr/0-9.//csd; $ht_devspc =~ tr/0-9.//csd; $ht_barrn =~ tr/0-9.//csd; $ht_dedfor =~ tr/0-9.//csd; $ht_evrfor =~ tr/0-9.//csd; $ht_mxdfor =~ tr/0-9.//csd; $ht_grass =~ tr/0-9.//csd; $ht_shrub =~ tr/0-9.//csd; $ht_hay =~ tr/0-9.//csd; $ht_crop =~ tr/0-9.//csd; $ht_wood =~ tr/0-9.//csd; $ht_hrbwet =~ tr/0-9.//csd; $ht_water_val =~ tr/A-Za-z//csd; $ht_ice_val =~ tr/A-Za-z//csd; $ht_devlow_val =~ tr/A-Za-z//csd; $ht_devmed_val =~ tr/A-Za-z//csd; $ht_devhgh_val =~ tr/A-Za-z//csd; $ht_devspc_val =~ tr/A-Za-z//csd; $ht_barrn_val =~ tr/A-Za-z//csd; $ht_dedfor_val =~ tr/A-Za-z//csd; $ht_evrfor_val =~ tr/A-Za-z//csd; $ht_mxdfor_val =~ tr/A-Za-z//csd; $ht_grass_val =~ tr/A-Za-z//csd; $ht_shrub_val =~ tr/A-Za-z//csd; $ht_hay_val =~ tr/A-Za-z//csd; $ht_crop_val =~ tr/A-Za-z//csd; $ht_wood_val =~ tr/A-Za-z//csd; $ht_hrbwet_val =~ tr/A-Za-z//csd; if ($land_clutter eq "Yes") { $do_template = "yes"; } elsif ($land_clutter eq "No") { $do_template = "no"; } # Open Water if ($ht_water_val eq "meters") { $ht_water_ft = sprintf "%.1f", $ht_water * 3.2808399; $ht_water_m = sprintf "%.1f", $ht_water; } elsif ($ht_water_val eq "feet") { $ht_water_ft = sprintf "%.1f", $ht_water; $ht_water_m = sprintf "%.1f", $ht_water * 0.3048; } # Perennial Ice/Snow if ($ht_ice_val eq "meters") { $ht_ice_ft = sprintf "%.1f", $ht_ice * 3.2808399; $ht_ice_m = sprintf "%.1f", $ht_ice; } elsif ($ht_ice_val eq "feet") { $ht_ice_ft = sprintf "%.1f", $ht_ice; $ht_ice_m = sprintf "%.1f", $ht_ice * 0.3048; } # Developed, Low Intensity if ($ht_devlow_val eq "meters") { $ht_devlow_ft = sprintf "%.1f", $ht_devlow * 3.2808399; $ht_devlow_m = sprintf "%.1f", $ht_devlow; } elsif ($ht_devlow_val eq "feet") { $ht_devlow_ft = sprintf "%.1f", $ht_devlow; $ht_devlow_m = sprintf "%.1f", $ht_devlow * 0.3048; } # Developed, Medium Intensity if ($ht_devmed_val eq "meters") { $ht_devmed_ft = sprintf "%.1f", $ht_devmed * 3.2808399; $ht_devmed_m = sprintf "%.1f", $ht_devmed; } elsif ($ht_devmed_val eq "feet") { $ht_devmed_ft = sprintf "%.1f", $ht_devmed; $ht_devmed_m = sprintf "%.1f", $ht_devmed * 0.3048; } # Developed, High Intensity if ($ht_devhgh_val eq "meters") { $ht_devhgh_ft = sprintf "%.1f", $ht_devhgh * 3.2808399; $ht_devhgh_m = sprintf "%.1f", $ht_devhgh; } elsif ($ht_devhgh_val eq "feet") { $ht_devhgh_ft = sprintf "%.1f", $ht_devhgh; $ht_devhgh_m = sprintf "%.1f", $ht_devhgh * 0.3048; } # Developed, Open Space if ($ht_devspc_val eq "meters") { $ht_devspc_ft = sprintf "%.1f", $ht_devspc * 3.2808399; $ht_devspc_m = sprintf "%.1f", $ht_devspc; } elsif ($ht_devspc_val eq "feet") { $ht_devspc_ft = sprintf "%.1f", $ht_devspc; $ht_devspc_m = sprintf "%.1f", $ht_devspc * 0.3048; } # Barren Land (Rock/Sand/Clay) if ($ht_barrn_val eq "meters") { $ht_barrn_ft = sprintf "%.1f", $ht_barrn * 3.2808399; $ht_barrn_m = sprintf "%.1f", $ht_barrn; } elsif ($ht_barrn_val eq "feet") { $ht_barrn_ft = sprintf "%.1f", $ht_barrn; $ht_barrn_m = sprintf "%.1f", $ht_barrn * 0.3048; } # Deciduous Forest if ($ht_dedfor_val eq "meters") { $ht_dedfor_ft = sprintf "%.1f", $ht_dedfor * 3.2808399; $ht_dedfor_m = sprintf "%.1f", $ht_dedfor; } elsif ($ht_dedfor_val eq "feet") { $ht_dedfor_ft = sprintf "%.1f", $ht_dedfor; $ht_dedfor_m = sprintf "%.1f", $ht_dedfor * 0.3048; } # Evergreen Forest if ($ht_evrfor_val eq "meters") { $ht_evrfor_ft = sprintf "%.1f", $ht_evrfor * 3.2808399; $ht_evrfor_m = sprintf "%.1f", $ht_evrfor; } elsif ($ht_evrfor_val eq "feet") { $ht_evrfor_ft = sprintf "%.1f", $ht_evrfor; $ht_evrfor_m = sprintf "%.1f", $ht_evrfor * 0.3048; } # Mixed Forest if ($ht_mxdfor_val eq "meters") { $ht_mxdfor_ft = sprintf "%.1f", $ht_mxdfor * 3.2808399; $ht_mxdfor_m = sprintf "%.1f", $ht_mxdfor; } elsif ($ht_mxdfor_val eq "feet") { $ht_mxdfor_ft = sprintf "%.1f", $ht_mxdfor; $ht_mxdfor_m = sprintf "%.1f", $ht_mxdfor * 0.3048; } # Grassland/Herbaceous if ($ht_grass_val eq "meters") { $ht_grass_ft = sprintf "%.1f", $ht_grass * 3.2808399; $ht_grass_m = sprintf "%.1f", $ht_grass; } elsif ($ht_grass_val eq "feet") { $ht_grass_ft = sprintf "%.1f", $ht_grass; $ht_grass_m = sprintf "%.1f", $ht_grass * 0.3048; } # Shrub/Scrub if ($ht_shrub_val eq "meters") { $ht_shrub_ft = sprintf "%.1f", $ht_shrub * 3.2808399; $ht_shrub_m = sprintf "%.1f", $ht_shrub; } elsif ($ht_shrub_val eq "feet") { $ht_shrub_ft = sprintf "%.1f", $ht_shrub; $ht_shrub_m = sprintf "%.1f", $ht_shrub * 0.3048; } # Pasture/Hay if ($ht_hay_val eq "meters") { $ht_hay_ft = sprintf "%.1f", $ht_hay * 3.2808399; $ht_hay_m = sprintf "%.1f", $ht_hay; } elsif ($ht_shrub_val eq "feet") { $ht_hay_ft = sprintf "%.1f", $ht_hay; $ht_hay_m = sprintf "%.1f", $ht_hay * 0.3048; } # Cultivated Crops if ($ht_crop_val eq "meters") { $ht_crop_ft = sprintf "%.1f", $ht_crop * 3.2808399; $ht_crop_m = sprintf "%.1f", $ht_crop; } elsif ($ht_crop_val eq "feet") { $ht_crop_ft = sprintf "%.1f", $ht_crop; $ht_crop_m = sprintf "%.1f", $ht_crop * 0.3048; } # Woody Wetlands if ($ht_wood_val eq "meters") { $ht_wood_ft = sprintf "%.1f", $ht_wood * 3.2808399; $ht_wood_m = sprintf "%.1f", $ht_wood; } elsif ($ht_wood_val eq "feet") { $ht_wood_ft = sprintf "%.1f", $ht_wood; $ht_wood_m = sprintf "%.1f", $ht_wood * 0.3048; } # Emergent Herbaceous Wetland if ($ht_hrbwet_val eq "meters") { $ht_hrbwet_ft = sprintf "%.1f", $ht_hrbwet * 3.2808399; $ht_hrbwet_m = sprintf "%.1f", $ht_hrbwet; } elsif ($ht_hrbwet_val eq "feet") { $ht_hrbwet_ft = sprintf "%.1f", $ht_hrbwet; $ht_hrbwet_m = sprintf "%.1f", $ht_hrbwet * 0.3048; } open(F1, ">", "lulc2.gp") or die "Can't open lulc2.gp: $!\n"; open(F2, "<", "lulc1.gp") or die "Can't open lulc1.gp: $!\n"; while () { chomp; ($dist, $elev, $land) = split '\t'; # Additional clutter heights in feet if ($land eq "0x486DA2") { # Open Water $elev = $elev + $ht_water_ft; } elsif ($land eq "0xE7EFFC") { # Perennial Ice/Snow $elev = $elev + $ht_ice_ft; } elsif ($land eq "0xDC9881") { # Developed, Low Intensity $elev = $elev + $ht_devlow_ft; } elsif ($land eq "0xF10100") { # Developed, Medium Intensity $elev = $elev + $ht_devmed_ft; } elsif ($land eq "0xAB0101") { # Developed, High Intensity $elev = $elev + $ht_devhgh_ft; } elsif ($land eq "0xE1CDCE") { # Developed, Open Space $elev = $elev + $ht_devspc_ft; } elsif ($land eq "0xB3AFA4") { # Barren Land (Rock/Sand/Clay) $elev = $elev + $ht_barrn_ft; } elsif ($land eq "0x6BA966") { # Deciduous Forest $elev = $elev + $ht_dedfor_ft; } elsif ($land eq "0x1D6533") { # Evergreen Forest $elev = $elev + $ht_evrfor_ft; } elsif ($land eq "0xBDCC93") { # Mixed Forest $elev = $elev + $ht_mxdfor_ft; } elsif ($land eq "0xEDECCD") { # Grassland/Herbaceous $elev = $elev + $ht_grass_ft; } elsif ($land eq "0xD1BB82") { # Shrub/Scrub $elev = $elev + $ht_shrub_ft; } elsif ($land eq "0xDDD83E") { # Pasture/Hay $elev = $elev + $ht_hay_ft; } elsif ($land eq "0xAE7229") { # Cultivated Crops $elev = $elev + $ht_crop_ft; } elsif ($land eq "0xBBD7ED") { # Woody Wetlands $elev = $elev + $ht_wood_ft; } elsif ($land eq "0x71A4C1") { # Emergent Herbaceous Wetland $elev = $elev + $ht_hrbwet_ft; } $dist = sprintf "%.6f", $dist; $elev = sprintf "%.6f", $elev; print F1 "$dist\t$elev\t$land\n"; } close F1; close F2; open(F, ">", "splat3.gp") or die "Can't open splat3.gp: $!\n"; print F "set clip\n"; print F "set border 7\n"; print F "set key below enhanced font \"Helvetica,18\"\n"; print F "set key noautotitle\n"; print F "set grid back mxtics mytics\n"; print F "set ytics nomirror\n"; print F "set xtics\n"; print F "set mxtics 10\n"; print F "set mytics 10\n"; print F "set tics out\n"; print F "set tics scale 2, 1\n"; print F "set yrange [($min_elev - 5) to ($ymax + 10)]\n"; print F "set xrange [0.0 to $dist_mi]\n"; print F "set encoding utf8\n"; print F "set label 1 '\\U+1F985'\n"; # eagle print F "set label 2 '\\U+1F983'\n"; # turkey print F "set label 3 '\\U+1F6F8'\n"; # ufo print F "set label 4 '\\U+1F986'\n"; # duck $eagle = sprintf "%.2f", rand(0.87-0.60) + 0.61; $turkey = sprintf "%.2f", rand(0.81-0.55) + 0.54; print F "set label 1 at screen 0.5, screen $eagle front font ',30'\n"; print F "set label 2 at screen 0.35, screen $turkey front font ',30'\n"; print F "set label 3 at screen 0.015, screen 0.97 font ',30'\n"; if ($do_duck eq "yes") { print F "set label 4 at $duck_dist,$duck_elev front font ',30'\n"; } print F "set term pngcairo enhanced size 2000,1600\n"; if ($do_template eq "no") { print F "set title \"{/:Bold Path Profile Between $tx_name and $rx_name\\nU.S. National Land Cover Data (2021)}\" font \"Helvetica,30\"\n"; } elsif ($do_template eq "yes") { print F "set title \"{/:Bold Path Profile Between $tx_name and $rx_name\\nU.S. National Land Cover Data (2021) + Clutter Heights}\" font \"Helvetica,30\"\n"; } print F "set xlabel \"Distance Between {/:Bold $tx_name } and {/:Bold $rx_name } ($dist_mi miles)\\n\" font \"Helvetica,22\"\n"; print F "set x2label \"{/:Bold Frequency:} $frq_mhz MHz }\t\t{/:Bold Azimuth: } $AZSP\\U+00B0 TN / $AZSP_MN\\U+00B0 MN ($AZLP\\U+00B0 TN / $AZLP_MN\\U+00B0 MN)\" font \"Helvetica,20\" tc rgb \"blue\"\n"; print F "set ylabel \"Elevation - Above Mean Sea Level (feet)\" font \"Helvetica,22\"\n"; print F "set timestamp '%d-%b-%Y %H:%M CST' bottom font \"Helvetica\"\n"; print F "set style fill solid\n"; print F "set arrow from 0,$tx_elv_ft to 0,$tx_ant_ht_ov_ft front head size screen 0.008,45.0,30.0 filled lw 3\n"; print F "set arrow from $dist_mi,$rx_elv_ft to $dist_mi,$rx_ant_ht_ov_ft front head size screen 0.008,45.0,30.0 filled lw 3\n"; if ($do_div eq "yes") { my $a = $rx_ant_ht_ov_ft + $div_ft; print F "set arrow from $dist_mi,$rx_ant_ht_ov_ft to $dist_mi,$a front head size screen 0.008,40.0,30.0 filled lw 3\n"; print F "set label \"Div. $a \\n\\n\" right front at $dist_mi,$a tc rgb \"gray60\"\n"; } if ($do_lulc eq "yes" && $country_tx eq "United States") { chomp($graze_coord = `lib/ptelev 13 $LULC_LAT1 $LULC_LON1 $grazing_dis_km $AZSP`); ($lat, $lon) = split ',', $graze_coord; chomp($graze_elev = `lib/ptelev -t 0 1 $lat $lon`); $graze_elev_ft = sprintf "%.2f", $graze_elev * 3.2808399; chomp($graze_land = `lib/ptelev 15 $lat $lon 2021`); #print F "set arrow from 0,$tx_ant_ht_ov_ft to $grazing_dis_mi,$graze_elev_ft nohead lw 1 lt 0 dashtype 3\n"; #print F "set arrow from $grazing_dis_mi,$graze_elev_ft to $dist_mi,$rx_ant_ht_ov_ft nohead lw 1 lt 0 dashtype 3\n"; #print F "set arrow from $grazing_dis_mi,$min_elev to $grazing_dis_mi,$graze_elev_ft front lw 6\n"; #print F "set label \" Reflection Point\" front at $grazing_dis_mi,$graze_elev_ft left rotate by 90\n"; } elsif ($do_lulc eq "no") { $graze_elev_ft = "N/A"; $graze_land = "N/A"; } if ($country_tx ne "United States") { $graze_land = "N/A"; } print F "set label \" $tx_ant_ht_ov_ft\" left front at 0,$tx_ant_ht_ov_ft tc rgb \"gray60\"\n"; print F "set label \"Pri. $rx_ant_ht_ov_ft \" right front at $dist_mi,$rx_ant_ht_ov_ft tc rgb \"gray60\"\n"; print F "set label '{/:Bold Lat: } $LAT1_D\\U+00B0 $LAT1_M\\U+0027 $LAT1_S\" $LAT1_gnu' left at 0,graph 1.08 tc rgb \"blue\"\n"; print F "set label '{/:Bold Lon: } $LON1_D\\U+00B0 $LON1_M\\U+0027 $LON1_S\" $LON1_gnu' left at 0,graph 1.06 tc rgb \"blue\"\n"; print F "set label '{/:Bold Gnd Elv: } $tx_elv_ft ft' left at 0,graph 1.04 tc rgb \"blue\"\n"; print F "set label '{/:Bold Ant Hgt: } $tx_ant_ht_ft ft' left at 0,graph 1.02 tc rgb \"blue\"\n"; print F "set label '{/:Bold Lat: } $LAT2_D\\U+00B0 $LAT2_M\\U+0027 $LAT2_S\" $LAT2_gnu' right at $dist_mi,graph 1.08 tc rgb \"blue\"\n"; print F "set label '{/:Bold Lon: } $LON2_D\\U+00B0 $LON2_M\\U+0027 $LON2_S\" $LON2_gnu' right at $dist_mi,graph 1.06 tc rgb \"blue\"\n"; print F "set label '{/:Bold Gnd Elv: } $rx_elv_ft ft' right at $dist_mi,graph 1.04 tc rgb \"blue\"\n"; print F "set label '{/:Bold Ant Hgt: } $rx_ant_ht_ft ft' right at $dist_mi,graph 1.02 tc rgb \"blue\"\n"; print F "set output \"LULCProfile1.png\"\n"; $size = @KEY; $i = 0; $keyentry = ""; while($i < $size) { $x = shift(@KEY); $keyentry = $keyentry.$x; $i++; } if ($do_div eq "no") { if ($do_template eq "no") { # No Diversity, No Land Clutter print F "plot \"lulc1.gp\" using 1:2:3 with boxes lc rgb variable, \"reference.gp\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"red\"$keyentry\n"; } if ($do_template eq "yes") { # No Diversity, With Land Clutter print F "plot \"lulc2.gp\" using 1:2:3 with boxes lc rgb variable, \"profile-terr.gp\" title \"$k_str Earth Terrain Profile\" with filledcurves above fc \"grey80\" fs transparent solid 0.5, \"profile-terr.gp\" with lines lt 1 lw 1 linecolor rgb \"black\", \"reference.gp\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"red\"$keyentry\n"; } } elsif ($do_div eq "yes") { if ($do_template eq "no") { # With Diversity, No Land Clutter print F "plot \"lulc1.gp\" using 1:2:3 with boxes lc rgb variable, \"reference.gp\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"red\", \"reference2-div.gp\" with lines lt 1 lw 1 linecolor rgb \"blue\" dashtype 5, \"fresnel-div-nth.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"red\" dashtype 5$keyentry\n"; } if ($do_template eq "yes") { # With Diversity, With Land Clutter print F "plot \"lulc2.gp\" using 1:2:3 with boxes lc rgb variable, \"profile-terr.gp\" title \"$k_str Earth Terrain Profile\" with lines lt 1 lw 2 linecolor rgb \"black\", \"reference.gp\" with lines lt 1 lw 1 linecolor rgb \"blue\", \"fresnel.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"green\", \"fresnel_pt_6.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"red\", \"reference2-div.gp\" with lines lt 1 lw 1 linecolor rgb \"blue\" dashtype 5, \"fresnel-div-nth.gp\" smooth csplines lt 1 lw 1 linecolor rgb \"red\" dashtype 5$keyentry\n"; } } close F; &System($args = "$gnuplot splat3.gp >/dev/null 2>&1"); # Get TX & RX Site Land Cover chomp($tx_land = `lib/ptelev 15 $LULC_LAT1 $LULC_LON1 2021`); chomp($rx_land = `lib/ptelev 15 $LULC_LAT2 $LULC_LON2 2021`); ## TIA TR8 (May 20, 1997) Loss Estimates, in dB # These are mostly just guesses LOL if ($frq_mhz <= 50) { if ($rx_land eq "Developed, Low Intensity") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Developed, Medium Intensity") { $rx_land_loss = sprintf "%.2f", 4; } elsif ($rx_land eq "Developed, High Intensity") { $rx_land_loss = sprintf "%.2f", 4; } elsif ($rx_land eq "Developed, Open Space") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Deciduous Forest") { $rx_land_loss = sprintf "%.2f", 2; } elsif ($rx_land eq "Evergreen Forest") { $rx_land_loss = sprintf "%.2f", 2; } elsif ($rx_land eq "Mixed Forest") { $rx_land_loss = sprintf "%.2f", 2; } elsif ($rx_land eq "Grassland/Herbaceous") { $rx_land_loss = sprintf "%.2f", 2; } elsif ($rx_land eq "Shrub/Scrub") { $rx_land_loss = sprintf "%.2f", 2; } elsif ($rx_land eq "Woody Wetlands") { $rx_land_loss = sprintf "%.2f", 2; } elsif ($rx_land eq "Emergent Herbaceous Wetland") { $rx_land_loss = sprintf "%.2f", 3; } else { $rx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 50 && $frq_mhz <= 100) { if ($rx_land eq "Developed, Low Intensity") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Developed, Medium Intensity") { $rx_land_loss = sprintf "%.2f", 6; } elsif ($rx_land eq "Developed, High Intensity") { $rx_land_loss = sprintf "%.2f", 6; } elsif ($rx_land eq "Developed, Open Space") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Deciduous Forest") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Evergreen Forest") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Mixed Forest") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Grassland/Herbaceous") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Shrub/Scrub") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Woody Wetlands") { $rx_land_loss = sprintf "%.2f", 3; } elsif ($rx_land eq "Emergent Herbaceous Wetland") { $rx_land_loss = sprintf "%.2f", 3; } else { $rx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 100 && $frq_mhz <= 200) { if ($rx_land eq "Developed, Low Intensity") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Developed, Medium Intensity") { $rx_land_loss = sprintf "%.2f", 9; } elsif ($rx_land eq "Developed, High Intensity") { $rx_land_loss = sprintf "%.2f", 9; } elsif ($rx_land eq "Developed, Open Space") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Deciduous Forest") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Evergreen Forest") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Mixed Forest") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Grassland/Herbaceous") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Shrub/Scrub") { $rx_land_loss = sprintf "%.2f", 4; } elsif ($rx_land eq "Woody Wetlands") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Emergent Herbaceous Wetland") { $rx_land_loss = sprintf "%.2f", 5; } else { $rx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 200 && $frq_mhz <= 500) { if ($rx_land eq "Developed, Low Intensity") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Developed, Medium Intensity") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Developed, High Intensity") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Developed, Open Space") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Deciduous Forest") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Evergreen Forest") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Mixed Forest") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Grassland/Herbaceous") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Shrub/Scrub") { $rx_land_loss = sprintf "%.2f", 5; } elsif ($rx_land eq "Woody Wetlands") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Emergent Herbaceous Wetland") { $rx_land_loss = sprintf "%.2f", 7; } else { $rx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 500 && $frq_mhz <= 1000) { if ($rx_land eq "Developed, Low Intensity") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Developed, Medium Intensity") { $rx_land_loss = sprintf "%.2f", 15; } elsif ($rx_land eq "Developed, High Intensity") { $rx_land_loss = sprintf "%.2f", 15; } elsif ($rx_land eq "Developed, Open Space") { $rx_land_loss = sprintf "%.2f", 15; } elsif ($rx_land eq "Deciduous Forest") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Evergreen Forest") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Mixed Forest") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Grassland/Herbaceous") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Shrub/Scrub") { $rx_land_loss = sprintf "%.2f", 7; } elsif ($rx_land eq "Woody Wetlands") { $rx_land_loss = sprintf "%.2f", 10; } elsif ($rx_land eq "Emergent Herbaceous Wetland") { $rx_land_loss = sprintf "%.2f", 10; } else { $rx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 1000) { if ($rx_land eq "Developed, Low Intensity") { $rx_land_loss = sprintf "%.2f", 15; } elsif ($rx_land eq "Developed, Medium Intensity") { $rx_land_loss = sprintf "%.2f", 17; } elsif ($rx_land eq "Developed, High Intensity") { $rx_land_loss = sprintf "%.2f", 17; } elsif ($rx_land eq "Developed, Open Space") { $rx_land_loss = sprintf "%.2f", 17; } elsif ($rx_land eq "Deciduous Forest") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Evergreen Forest") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Mixed Forest") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Grassland/Herbaceous") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Shrub/Scrub") { $rx_land_loss = sprintf "%.2f", 9; } elsif ($rx_land eq "Woody Wetlands") { $rx_land_loss = sprintf "%.2f", 12; } elsif ($rx_land eq "Emergent Herbaceous Wetland") { $rx_land_loss = sprintf "%.2f", 12; } else { $rx_land_loss = sprintf "%.2f", 0; } } if ($frq_mhz <= 50) { if ($tx_land eq "Developed, Low Intensity") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Developed, Medium Intensity") { $tx_land_loss = sprintf "%.2f", 4; } elsif ($tx_land eq "Developed, High Intensity") { $tx_land_loss = sprintf "%.2f", 4; } elsif ($tx_land eq "Developed, Open Space") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Deciduous Forest") { $tx_land_loss = sprintf "%.2f", 2; } elsif ($tx_land eq "Evergreen Forest") { $tx_land_loss = sprintf "%.2f", 2; } elsif ($tx_land eq "Mixed Forest") { $tx_land_loss = sprintf "%.2f", 2; } elsif ($tx_land eq "Grassland/Herbaceous") { $tx_land_loss = sprintf "%.2f", 2; } elsif ($tx_land eq "Shrub/Scrub") { $tx_land_loss = sprintf "%.2f", 2; } elsif ($tx_land eq "Woody Wetlands") { $tx_land_loss = sprintf "%.2f", 2; } elsif ($tx_land eq "Emergent Herbaceous Wetland") { $tx_land_loss = sprintf "%.2f", 3; } else { $tx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 50 && $frq_mhz <= 100) { if ($tx_land eq "Developed, Low Intensity") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Developed, Medium Intensity") { $tx_land_loss = sprintf "%.2f", 6; } elsif ($tx_land eq "Developed, High Intensity") { $tx_land_loss = sprintf "%.2f", 6; } elsif ($tx_land eq "Developed, Open Space") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Deciduous Forest") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Evergreen Forest") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Mixed Forest") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Grassland/Herbaceous") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Shrub/Scrub") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Woody Wetlands") { $tx_land_loss = sprintf "%.2f", 3; } elsif ($tx_land eq "Emergent Herbaceous Wetland") { $tx_land_loss = sprintf "%.2f", 3; } else { $tx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 100 && $frq_mhz <= 200) { if ($tx_land eq "Developed, Low Intensity") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Developed, Medium Intensity") { $tx_land_loss = sprintf "%.2f", 9; } elsif ($tx_land eq "Developed, High Intensity") { $tx_land_loss = sprintf "%.2f", 9; } elsif ($tx_land eq "Developed, Open Space") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Deciduous Forest") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Evergreen Forest") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Mixed Forest") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Grassland/Herbaceous") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Shrub/Scrub") { $tx_land_loss = sprintf "%.2f", 4; } elsif ($tx_land eq "Woody Wetlands") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Emergent Herbaceous Wetland") { $tx_land_loss = sprintf "%.2f", 5; } else { $tx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 200 && $frq_mhz <= 500) { if ($tx_land eq "Developed, Low Intensity") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Developed, Medium Intensity") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Developed, High Intensity") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Developed, Open Space") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Deciduous Forest") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Evergreen Forest") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Mixed Forest") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Grassland/Herbaceous") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Shrub/Scrub") { $tx_land_loss = sprintf "%.2f", 5; } elsif ($tx_land eq "Woody Wetlands") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Emergent Herbaceous Wetland") { $tx_land_loss = sprintf "%.2f", 7; } else { $tx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 500 && $frq_mhz <= 1000) { if ($tx_land eq "Developed, Low Intensity") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Developed, Medium Intensity") { $tx_land_loss = sprintf "%.2f", 15; } elsif ($tx_land eq "Developed, High Intensity") { $tx_land_loss = sprintf "%.2f", 15; } elsif ($tx_land eq "Developed, Open Space") { $tx_land_loss = sprintf "%.2f", 15; } elsif ($tx_land eq "Deciduous Forest") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Evergreen Forest") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Mixed Forest") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Grassland/Herbaceous") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Shrub/Scrub") { $tx_land_loss = sprintf "%.2f", 7; } elsif ($tx_land eq "Woody Wetlands") { $tx_land_loss = sprintf "%.2f", 10; } elsif ($tx_land eq "Emergent Herbaceous Wetland") { $tx_land_loss = sprintf "%.2f", 10; } else { $tx_land_loss = sprintf "%.2f", 0; } } elsif ($frq_mhz > 1000) { if ($tx_land eq "Developed, Low Intensity") { $tx_land_loss = sprintf "%.2f", 15; } elsif ($tx_land eq "Developed, Medium Intensity") { $tx_land_loss = sprintf "%.2f", 17; } elsif ($tx_land eq "Developed, High Intensity") { $tx_land_loss = sprintf "%.2f", 17; } elsif ($tx_land eq "Developed, Open Space") { $tx_land_loss = sprintf "%.2f", 17; } elsif ($tx_land eq "Deciduous Forest") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Evergreen Forest") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Mixed Forest") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Grassland/Herbaceous") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Shrub/Scrub") { $tx_land_loss = sprintf "%.2f", 9; } elsif ($tx_land eq "Woody Wetlands") { $tx_land_loss = sprintf "%.2f", 12; } elsif ($tx_land eq "Emergent Herbaceous Wetland") { $tx_land_loss = sprintf "%.2f", 12; } else { $tx_land_loss = sprintf "%.2f", 0; } }} elsif ($country_tx ne "United States") { $graze_land = "N/A"; $tx_land = "N/A"; $rx_land = "N/A"; $rx_land_loss = "N/A"; $tx_land_loss = "N/A"; } ############################################################################################ ## Print Output HTML # $outpdf = "$rx_name" . "-to-" . "$tx_name" . ".pdf"; print "\n"; print "\n"; print "Microwave Radio Path Analysis Results\n"; print "\n"; print "\n"; print "\n"; print "
Microwave Radio Path Analysis Results
\n"; print "
\n"; print "

\n"; if ($do_lulc eq "yes" && $country_tx eq "United States") { print "  

\n"; } print "

\n"; if ($do_div eq "yes") { print "  

\n"; } else { print "

\n"; } print "
\n"; print "

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Path Profile Report: $project
Specifications$tx_name  (TX)$rx_name  (RX)
Site Equipment Notes$tx_notes$rx_notes
(WGS84)  Latitude$LAT1_D° $LAT1_M' $LAT1_S" $LAT1_val    ($LAT1°)$LAT2_D° $LAT2_M' $LAT2_S" $LAT2_val    ($LAT2°)
(WGS84)  Longitude$LON1_D° $LON1_M' $LON1_S" $LON1_val    ($LON1_geo°)$LON2_D° $LON2_M' $LON2_S" $LON2_val    ($LON2_geo°)
Land Cover$tx_land$rx_land
UTM Zone / Easting / Northing Coordinates$utm_zone_tx / $easting_tx / $northing_tx kilometers$utm_zone_rx / $easting_rx / $northing_rx kilometers
Local Ground Elevation (AMSL)$tx_elv_ft feet  ($tx_elv_m meters)$rx_elv_ft feet  ($rx_elv_m meters)
Antenna Height (Center-of-Radiation)$tx_ant_ht_ft feet  ($tx_ant_ht_m meters)$rx_ant_ht_ft feet  ($rx_ant_ht_m meters)
Overall Antenna Height (AMSL)$tx_ant_ht_ov_ft feet  ($tx_ant_ht_ov_m meters)$rx_ant_ht_ov_ft feet  ($rx_ant_ht_ov_m meters)
True North Azimuth$AZSP° to RX$AZLP° to TX
Magnetic North Azimuth$AZSP_MN° to RX$AZLP_MN° to TX
Magnetic Declination$magdec_tx° $magdir_tx$magdec_rx° $magdir_rx
Transmission Line Type$tx_cab_desc1$rx_cab_desc1
Transmission Line Length$tx_length_ft feet  ($tx_length_m meters)$rx_length_ft feet  ($rx_length_m meters)
Transmission Line Loss Specification$tx_loss_per_100f dB/100 feet  ($tx_loss_per_100m dB/100 meters)$rx_loss_per_100f dB/100 feet  ($rx_loss_per_100m dB/100 meters)
Transmission Line Loss Specification$tx_loss_per_foot dB/foot  ($tx_loss_per_meter dB/meter)$rx_loss_per_foot dB/foot  ($rx_loss_per_meter dB/meter)
Calculated Transmission Line Loss$tx_cab_loss dB$rx_cab_loss dB
Transmission Line Efficiency$tx_eff%  ($tx_eff_message)$rx_eff%  ($rx_eff_message)
Transmission Line Miscellaneous Loss$tx_misc_cab_loss dB$rx_misc_cab_loss dB
Total Transmission Line Loss$tx_total_cable_loss dB$rx_total_cable_loss dB
Miscellaneous Gain$tx_misc_gain dB$rx_misc_gain dB
Antenna Model / Notes$tx_ant_notes$rx_ant_notes
Antenna Gain$tx_ant_gain_dbi dBi  ($tx_ant_gain_dbd dBd)
Radome Loss: $tx_ant_gain_radome dB
$rx_ant_gain_dbi dBi  ($rx_ant_gain_dbd dBd)
Radome Loss: $rx_ant_gain_radome dB
Antenna Mechanical Tilt$tilt_tr°$tilt_rt°
Antenna (Parabolic) 3 dB Beamwidth$tx_ant_bw°$rx_ant_bw°
Antenna Coverage 3 dB RadiusInner: $inner_mi miles  ($inner_km km)
Outer: $outer_mi miles  ($outer_km km)
Highest Transmitted Frequency$frq_ghz GHz  ($frq_mhz MHz)
RF Power Output - dBx$pwr_out_dbm dBm  ($pwr_out_dbw dBW)  ($pwr_out_dbk dBk)
RF Power Output - Watts$pwr_out_mw mW  ($pwr_out_w W)  ($pwr_out_kw kW)
Wavelength$wav_in inches  ($wav_cm cm)  ($wav_ft feet)  ($wav_m m)
Effective Isotropic Radiated Power - dBx$eirp dBm  ($eirp_dbw dBW)  ($eirp_dbk dBk)
Effective Isotropic Radiated Power - Watts$eirp_mw mW  ($eirp_w W)  ($eirp_kw kW)


\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Transmitter Site RF Safety
SpecificationsGeneralOccupational
Maximum Permissible Exposure$std1 mW/cm2$std2 mW/cm2
Distance to RF Safety Compliance$dx1_ft feet  ($dx1_m meters)$dx2_ft feet  ($dx2_m meters)
(FCC OET Bulletin 65)  Estimated RF Power Density$rf_safe_pwrdens mW/cm2    (Directly Below the Radiating Antenna)
Total RF Input Power to the Antenna$tx_ant_input dBm  ($tx_ant_input_mw mW)
(FCC Part 15.247)  Allowed RF Input Power to Antenna$max_ant_pwr dBm  ($max_ant_pwr_mw mW)
(FCC Part 74.644)  Maximum Allowable EIRP$fcc_eirp_dbm dBm  $fcc_check


\n"; print "\n"; print "\n"; print "\n"; if ($check3 eq "no") { print "\n"; } if ($check3 eq "yes") { print "\n"; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; printf "\n", $earcon; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Terrain & Atmospheric Conditions
Specifications
Effective Earth Radius (K-Factor)$k_str  ($k_dec - $k_val)
Effective Earth Radius (K-Factor)$k_str  ($k_val)    (Local Elevation: $k_ht_ft feet / $k_ht_m m)
Grazing Angle$graze_dg°  ($graze_mr milliradians)
Approximate Distance to Reflection Point$grazing_dis_mi miles  ($grazing_dis_km kilometers)  (Phase Change: $phase_delta°)
Land Cover: $graze_land
Terrain RoughnessSupplied: $rough_ft feet  ($rough_m meters)
Calculated: $rough_calc_ft feet  ($rough_calc_m meters)
Average Annual Temperature$temp_f° F  ($temp_c° C)
Atmospheric Pressure$atmos_p millibars  (Sea Level Corrected)
Saturation Vapor Pressure$es millibars
Partial Vapor Pressure$vapor_p millibars
Ground Dielectric Constant$diecon  ($diecon_desc)
Ground Conductivity%.3f Siemens/meter
Vigants-Barnett Climate FactorSupplied: $cli_vig  ($vig_val)
Calculated: $cli_vig_calc
Longley-Rice Climate Type$climate
Crane Rain Region$region
Local Area Humidity Type$rough_hum
Index of Surface Refraction$nunits N-units (parts per million)
Antenna Polarization$polar
Longley-Rice Situation Variability$sit% Confidence
Longley-Rice Time Variability$time% Reliability


\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; if ($do_template eq "yes") { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "
Terrain Plotting Parameters
Specifications$tx_name  (TX)$rx_name  (RX)
Region for Terrain Plotting$city_tx, $state_tx
($country_rx)
$city_tx, $state_rx
($country_rx)
Distance to the Radio Horizon$tx_rad_hor_mi miles  ($tx_rad_hor_km km)$rx_rad_hor_mi miles  ($rx_rad_hor_km km)
Path Minimum Elevation$min_elev_ft feet  ($min_elev_m meters)
Path Average Elevation$avg_ht_ft feet  ($avg_ht_m meters)
Path Maximum Elevation$max_elev_ft feet  ($max_elev_m meters)
Earth Bulge at Path Midpoint$bulge_ft feet  ($bulge_m meters)
Maximum Fresnel Zone Radius$max_fres_ft feet  ($max_fres_m meters)
Additional Ground Clutter$gc_ft feet  ($gc_m meters)
Ideal Distance With These Antenna Heights$distance_max_mi miles  ($distance_max_km km)
Total Path Distance$dist_mi miles  ($dist_km km)
Additional Land Clutter Height Template
Open Water$ht_water_ft feet  ($ht_water_m meters)
Perennial Ice/Snow$ht_ice_ft feet  ($ht_ice_m meters)
Developed, Low Intensity$ht_devlow_ft feet  ($ht_devlow_m meters)
Developed, Medium Intensity$ht_devmed_ft feet  ($ht_devmed_m meters)
Developed, High Intensity$ht_devhgh_ft feet  ($ht_devhgh_m meters)
Developed, Open Space$ht_devspc_ft feet  ($ht_devspc_m meters)
Barren Land (Rock/Sand/Clay)$ht_barrn_ft feet  ($ht_barrn_m meters)
Deciduous Forest$ht_dedfor_ft feet  ($ht_dedfor_m meters)
Evergreen Forest$ht_evrfor_ft feet  ($ht_evrfor_m meters)
Mixed Forest$ht_mxdfor_ft feet  ($ht_mxdfor_m meters)
Grassland/Herbaceous$ht_grass_ft feet  ($ht_grass_m meters)
Shrub/Scrub$ht_shrub_ft feet  ($ht_shrub_m meters)
Pasture/Hay$ht_hay_ft feet  ($ht_hay_m meters)
Cultivated Crops$ht_crop_ft feet  ($ht_crop_m meters)
Woody Wetlands$ht_wood_ft feet  ($ht_wood_m meters)
Emergent Herbaceous Wetland$ht_hrbwet_ft feet  ($ht_hrbwet_ft meters)


\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Free-Space, ITM, Atmospheric, Rain, Misc. Losses
Specifications$tx_name  (TX)$rx_name  (RX)
Temperate Climate Foliage Loss$foli_ft dB/foot  ($foli_m dB/meter)  (Dense, Dry, In-Leaf)
Crane Rain Model Attenuation$crane_rain_att_total dB  ($crane_rain_att_mi dB/mile)  ($crane_rain_att_km dB/km)
Rain Rate: $rate mm/hr
NASA Simplified Rain Model Attenuation$nasa_rain_att_total dB
Effective Rain Path Distance$rain_eff_mi miles  ($rain_eff_km km)
Estimated Attenuation Due to Water Vapor$water_att_total dB  ($water_att_mi dB/mile)  ($water_att_km dB/km)
Water Vapor Density: $wvd gm/m3
Estimated Attenuation Due to Oxygen Loss$oxy_att_total dB  ($oxy_att_mi dB/mile)  ($oxy_att_km dB/km)
Miscellaneous Path Losses$tx_misc_loss dB
Potential Smooth Earth Diffraction Loss$diff_loss dB
Potential Depth of Fade$fade_depth dB  $Arx_mess
Potential Additional Land Cover Loss$tx_land_loss dB$rx_land_loss dB
Ideal vs. Realistic ExpectationsWithout Rain LossWith Rain Loss (Crane)
Friis Free-Space Path Loss$fs dB$fs_rain dB
ITWOMv3 Primary Path Loss$itm dB$itm_rain dB
ITWOMv3 Diversity Path Loss$div_itm dB$div_itm_rain dB
Total Atmospheric + Rain Path Losses$atmos_norain dB$atmos_rain dB
Free-Space + Atmospheric + Misc. Losses$fs_pl dB$fs_pl_rain dB
(Primary Path)  ITWOMv3 + Atmospheric + Misc. Losses$itm_pl dB$itm_pl_rain dB
(Diversity Path)  ITWOMv3 + Atmospheric + Misc. Losses$div_itm_pl dB$div_itm_pl_rain dB


\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Calculated Fade Margins
Specifications$tx_name  (TX)$rx_name  (RX)
Receiver Threshold$BER_dbm dBm  ($BER_uvolt µV)    ($BER_crit)
Dispersive Fade Margin $dfm_fs dB
External Interference Fade Margin $eifm_fs dB
Adjacent Channel Interference Fade Margin $aifm_fs dB
Minimum Composite Fade Margin for This Climate$min_fade dB
Potential Upfade$upfade dB
Path Mean Time Delay$time_delay nanoseconds
Unfaded ValuesWithout Rain LossWith Rain Loss (Crane)
Free-Space Loss Received Signal Level$rx_pwr dBm  ($rx_pwr_uvolt µV)$rx_pwr_rain dBm  ($rx_pwr_rain_uvolt µV)
Free-Space Thermal Fade Margin$tfm dB$tfm_rain dB
ITWOMv3 Loss Received Signal Level$rx_pwr_itm dBm  ($rx_pwr_itm_uvolt µV)$rx_pwr_itm_rain dBm  ($rx_pwr_itm_rain_uvolt µV)
ITWOMv3 Thermal Fade Margin$tfm_itm dB$tfm_itm_rain dB
Space Diversity ITWOMv3 Received Signal Level$rx_div_pwr_itm dBm  ($rx_div_pwr_itm_uvolt µV)$rx_div_pwr_itm_rain dBm  ($rx_div_pwr_itm_rain_uvolt µV)
Space Diversity ITWOMv3 Thermal Fade Margin$div_tfm_itm dB$div_tfm_itm_rain dB
Free-Space Loss Composite Fade Margin$cmp_fs dB$cmp_fs_rain dB
Non-Diverstiy ITWOMv3 Loss Composite Fade Margin$cmp_itm dB$cmp_itm_rain dB
Space Diversity ITWOMv3 Loss Composite Fade Margin$cmp_div_itm dB$cmp_div_itm_rain dB\


\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Vertical Space Diversity Antenna Parameters
Specifications$rx_name  (RX-DIV)
Local Ground Elevation (AMSL)$rx_elv_ft feet  ($rx_elv_m meters)
User Supplied Spacing for Diversity Antenna$div_ft feet  ($div_m meters)    $div_ft_check
Adjusted Spacing for Diversity Antenna$div_calc_ft feet  ($div_calc_m meters)    (Odd Multiple 1/2λ)
Calculated Ideal Spacing for Diversity Antenna$div_space_ft feet  ($div_space_m meters)
Diversity Antenna Height (AGL)$div_ant_ht_ft feet  ($div_ant_ht_m meters)
Overall Diversity Receiver Antenna Height (AMSL)$div_rx_ant_ht_ov_ft feet  ($div_rx_ant_ht_ov_m meters)
Diversity Antenna Gain$div_ant_dbi dBi  ($div_ant_dbd dBd)  $div_gain_check
Radome Loss: $rx_div_ant_gain_radome dB
Diversity Antenna Mechanical Tilt$tilt_rtd° to TX


\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Target Outage Objectives & Probabilities
SpecificationsOutage ObjectiveReliabilityRequired Composite Fade Margin
One-Way Bell System Short-Haul$obj_nodiv_fs SES/year$obj_nodiv_fs_per%$obj_nodiv_fs_cfm dB
One-Way Bell System Long-Haul$obj1_nodiv_fs SES/year$obj1_nodiv_fs_per%$obj1_nodiv_fs_cfm dB
One-Way ITU-R High-Grade$obj2_nodiv_fs SES/year$obj2_nodiv_fs_per%$obj2_nodiv_fs_cfm dB
Two-Way Bell System Short-Haul$obj_nodiv_fs_two SES/year$obj_nodiv_fs_per_two%$obj_nodiv_fs_cfm_two dB
Two-Way Bell System Long-Haul$obj1_nodiv_fs_two SES/year$obj1_nodiv_fs_per_two%$obj1_nodiv_fs_cfm_two dB
Two-Way ITU-R High-Grade$obj2_nodiv_fs_two SES/year$obj2_nodiv_fs_per_two%$obj2_nodiv_fs_cfm_two dB


\n"; # AAA print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # BBB print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # DDD print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # EEE print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; # FFF print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Calculated Outage Objectives & Probabilities
Without Spaced Vertical Antenna Diversity (Vigants/Free-Space)Without Rain LossWith Rain Loss (Crane)
One-Way Multipath Probability of Outage$SES_nodiv_fs_yr SES/year$SES_nodiv_fs_yr_rain SES/year
One-Way Multipath Reliability$SES_nodiv_fs_per%$SES_nodiv_fs_per_rain%
Annual Multipath Severely Errored Seconds$worst_nodiv_fs_yr  $worst_nodiv_fs_yr_val$worst_nodiv_fs_yr_rain  $worst_nodiv_fs_yr_val_rain
Annual Amplitude Dispersion Fading Outage$worst_amp_fade_fs $worst_amp_fade_fs_val$worst_amp_fade_fs_rain $worst_amp_fade_fs_val
Without Spaced Vertical Antenna Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
One-Way Multipath Probability of Outage$SES_nodiv_itm_yr SES/year$SES_nodiv_itm_yr_rain SES/year
One-Way Multipath Reliability$SES_nodiv_itm_per%$SES_nodiv_itm_per_rain%
Annual Multipath Severely Errored Seconds$worst_nodiv_itm_yr  $worst_nodiv_itm_yr_val$worst_nodiv_itm_yr_rain  $worst_nodiv_itm_yr_val_rain
Annual Amplitude Dispersion Fading Outage$worst_amp_fade $worst_amp_fade_val$worst_amp_fade_rain $worst_amp_fade_rain_val
With Spaced Vertical Antenna Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
Space Diversity Improvement Factor$Isd_itm  ($Isd_itm_db dB)  $Isd_message_itm$Isd_itm_rain  ($Isd_itm_db_rain dB)  $Isd_message_itm_rain
One-Way Multipath Probability of Outage$SES_div_itm_yr SES/year$SES_div_itm_yr_rain SES/year
One-Way Multipath Reliability$SES_div_itm_per%$SES_div_itm_per_rain%
Annual Multipath Severely Errored Seconds$worst_div_itm_yr  $worst_div_itm_yr_val$worst_div_itm_yr_rain  $worst_div_itm_yr_val_rain
With Frequency Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
Diversity Frequency$frq_ghz_div GHz    (ΔF: $df_mhz MHz)
Frequency Diversity Improvement Factor$Ifd_itm    $Ifd_message_itm$Ifd_itm_rain    $Ifd_message_itm_rain
One-Way Multipath Probability of Outage$SES_frq_div_yr_itm SES/year$SES_frq_div_yr_itm_rain SES/year
One-Way Multipath Reliability$SES_frq_div_itm_per%$SES_frq_div_itm_per_rain%
Annual Multipath Severely Errored Seconds$worst_frq_div_mo_itm  $worst_frq_div_mo_itm_val$worst_frq_div_mo_itm_rain  $worst_frq_div_mo_itm_val_rain
With Hybrid Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
Hybrid (Space + Frequency) Diversity Improvement Factor$Ihd_itm    $Ihd_message 
One-Way Multipath Probability of Outage$SES_hyb_div_yr_itm SES/year 
One-Way Multipath Reliability$SES_hyb_div_itm_per% 
Annual Multipath Severely Errored Seconds$worst_hyb_div_yr_itm  $worst_hyb_div_yr_itm_val 


\n"; # CCC #print "\n    WITH Spaced Vertical Antenna Diversity (Free-Space)\n\n"; #print " Space Diversity Improvement Factor : $Isd ($Isd_message)\n"; #print " One-Way Multipath Probability of Outage : $SES_div_fs_yr SES/year ($SES_div_fs_per%)\n"; #print " Annual Multipath Severely Errored Seconds : $worst_div_fs_yr $worst_div_fs_yr_val\n"; print "
Terrain Analysis Reports

\n"; print "\n"; print "\n"; print "
\n"; print "
\n";
print "SPLAT! HAAT Calculation\n\n";

open(F, "<", "$tx_name-site_report.txt") or die "Can't open file $tx_name-site_report.txt: $!\n";
while () {
  chomp $_;
  print "$_\n";
}
close F;

print "

\n"; print "\n"; print "\n"; print "
\n"; print "
\n";
print "SPLAT! HAAT Calculation\n\n";

open(F, "<", "$rx_name-site_report.txt") or die "Can't open file $rx_name-site_report.txt: $!\n";
while () {
  chomp $_;
  print "$_\n";
}
close F;
print "

\n"; if ($do_div eq "yes") { print "\n"; print "\n"; print "
\n"; print "
\n";
  print "SPLAT! HAAT Calculation\n\n";
  open(F, "<", "$rx_div_name-site_report.txt") or die "Can't open file $rx_div_name-site_report.txt: $!\n";
  while () {
    chomp $_;
    print "$_\n";
  }
  close F;
  print "

\n"; } print "\n"; print "\n"; print "
\n"; print "
\n";
print "SPLAT! Path Profile Calculations\n\n";

$found = 0;
open(F, "<", "$rx_name-to-$tx_name.txt") or die "Can't open file $rx_name-to-$tx_name.txt: $!\n";
while ($line = ) {
  chomp $line;
  if ($line =~ /Site Name/) {
    $found = 1;
  }

  if ($found) {
    print "$line\n";
  }
}
close F;

print "

\n"; if ($do_div eq "yes") { print "\n"; print "\n"; print "
\n"; print "
\n";
  print "SPLAT! Path Profile Calculations\n\n";
  $found = 0;
  open(F, "<", "$rx_div_name-to-$tx_name.txt") or die "Can't open file $rx_div_name-to-$tx_name.txt: $!\n";
  while ($line = ) {
    chomp $line;
    if ($line =~ /Site Name/) {
      $found = 1;
    }

    if ($found) {
      print "$line\n";
    }
  }
  close F;
  print "

\n"; } print "\n"; print "\n"; print "
\n"; print "
\n";
print "SPLAT! Path Profile Calculations\n\n";

$found = 0;
open(F, "<", "$tx_name-to-$rx_name.txt") or die "Can't open file $tx_name-to-$rx_name.txt: $!\n";
while ($line = ) {
  chomp $line;
  if ($line =~ /Site Name/) {
	$found = 1;
  }

  if ($found) {
    print "$line\n";
  }
}
close F;

print "
\n"; print "
General Coverage Topographical Map
$country_tx ($city_tx, $state_tx)

\n"; if ($do_div eq "no") { print "

Approximate Line-of Sight Radio Coverage with a $tx_ant_ht_ft ft Receive Antenna Height
$tx_name    $rx_name     $tx_name+$rx_name

\n"; } elsif ($do_div eq "yes") { print "

Approximate Line-of Sight Radio Coverage with a $tx_ant_ht_ft ft Receive Antenna Height
$tx_name    $rx_name     $tx_name+$rx_name

\n"; print "

Approximate Line-of Sight Radio Coverage with a $tx_ant_ht_ft ft Receive Antenna Height
$tx_name    $rx_div_name     $tx_name+$rx_div_name

\n"; } print "

Approximate Omnidirectional ITM Path Loss Coverage at $tx_name
\n"; if ($do_div eq "no") { print "

Approximate Omnidirectional ITM Path Loss Coverage at $rx_name
\n"; } elsif ($do_div eq "yes") { print "

Approximate Omnidirectional ITM Path Loss Coverage at $rx_name
\n"; print "

Approximate Omnidirectional ITM Path Loss Coverage at $rx_div_name
\n"; } print "

Google Earth KML File\n"; print "

Microwave Radio Path Analysis PDF Report\n"; print "

Links to USGS topoView :  $tx_name  -  $rx_name\n"; print "

Links to CapTopo :  $tx_name  -  $rx_name\n"; print "

Links to OpenStreetMap :  $tx_name  -  $rx_name\n"; print "

Links to Google Maps :  $tx_name    $rx_name\n"; print "

GBPPR RadLab $ver
EXPERIMENTAL\n"; print "

\n"; print "
\n"; print "

Knowledge is Power

\n"; print "
\n"; print "
\n"; &flush(STDOUT); ## Print File HTML # open(F, ">", "index1.html") or die "Can't open index1.html: $!\n" ; print F "\n"; print F "\n"; print F "Path Analysis Results\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Microwave Radio Path Analysis Results
\n"; print F "
\n"; print F "

\n"; if ($do_lulc eq "yes" && $country_tx eq "United States") { print F "

\n"; if ($do_template eq "yes") { print F "\n"; #print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print "
Additional Land Clutter Height Template
Additional Land Clutter Height Template
Open Water$ht_water_ft feet  ($ht_water_m meters)
Perennial Ice/Snow$ht_ice_ft feet  ($ht_ice_m meters)
Developed, Low Intensity$ht_devlow_ft feet  ($ht_devlow_m meters)
Developed, Medium Intensity$ht_devmed_ft feet  ($ht_devmed_m meters)
Developed, High Intensity$ht_devhgh_ft feet  ($ht_devhgh_m meters)
Developed, Open Space$ht_devspc_ft feet  ($ht_devspc_m meters)
Barren Land (Rock/Sand/Clay)$ht_barrn_ft feet  ($ht_barrn_m meters)
Deciduous Forest$ht_dedfor_ft feet  ($ht_dedfor_m meters)
Evergreen Forest$ht_evrfor_ft feet  ($ht_evrfor_m meters)
Mixed Forest$ht_mxdfor_ft feet  ($ht_mxdfor_m meters)
Grassland/Herbaceous$ht_grass_ft feet  ($ht_grass_m meters)
Shrub/Scrub$ht_shrub_ft feet  ($ht_shrub_m meters)
Pasture/Hay$ht_hay_ft feet  ($ht_hay_m meters)
Cultivated Crops$ht_crop_ft feet  ($ht_crop_m meters)
Woody Wetlands$ht_wood_ft feet  ($ht_wood_m meters)
Emergent Herbaceous Wetland$ht_hrbwet_ft feet  ($ht_hrbwet_ft meters)
\n"; } } print F "

\n"; if ($do_div eq "yes") { print F "

\n"; } print F "

\n"; open(F, ">", "index2.html") or die "Can't open index2.html: $!\n" ; print F "\n"; print F "Path Profile Report\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Path Profile Report: $project
Specifications$tx_name  (TX)$rx_name  (RX)
Site Equipment Notes$tx_notes$rx_notes
(WGS84)  Latitude$LAT1_D° $LAT1_M' $LAT1_S" $LAT1_val  ($LAT1°)$LAT2_D° $LAT2_M' $LAT2_S" $LAT2_val  ($LAT2°)
(WGS84)  Longitude$LON1_D° $LON1_M' $LON1_S" $LON1_val  ($LON1_geo°)$LON2_D° $LON2_M' $LON2_S" $LON2_val  ($LON2_geo°)
Land Cover$tx_land$rx_land
UTM Zone / Easting / Northing Coordinates$utm_zone_tx / $easting_tx / $northing_tx kilometers$utm_zone_rx / $easting_rx / $northing_rx kilometers
Local Ground Elevation (AMSL)$tx_elv_ft feet  ($tx_elv_m meters)$rx_elv_ft feet  ($rx_elv_m meters)
Antenna Height (Center-of-Radiation)$tx_ant_ht_ft feet  ($tx_ant_ht_m meters)$rx_ant_ht_ft feet  ($rx_ant_ht_m meters)
Overall Antenna Height (AMSL)$tx_ant_ht_ov_ft feet  ($tx_ant_ht_ov_m meters)$rx_ant_ht_ov_ft feet  ($rx_ant_ht_ov_m meters)
True North Azimuth$AZSP° to RX$AZLP° to TX
Magnetic North Azimuth$AZSP_MN° to RX$AZLP_MN° to TX
Magnetic Declination$magdec_tx° $magdir_tx$magdec_rx° $magdir_rx
Transmission Line Type$tx_cab_desc2$rx_cab_desc2
Transmission Line Length$tx_length_ft feet  ($tx_length_m meters)$rx_length_ft feet  ($rx_length_m meters)
Transmission Line Loss Specification$tx_loss_per_100f dB/100 feet  ($tx_loss_per_100m dB/100 meters)$rx_loss_per_100f dB/100 feet  ($rx_loss_per_100m dB/100 meters)
Transmission Line Loss Specification$tx_loss_per_foot dB/foot    ($tx_loss_per_meter dB/meter)$rx_loss_per_foot dB/foot  ($rx_loss_per_meter dB/meter)
Calculated Transmission Line Loss$tx_cab_loss dB$rx_cab_loss dB
Transmission Line Efficiency$tx_eff%  ($tx_eff_message)$rx_eff%  ($rx_eff_message)
Transmission Line Miscellaneous Loss$tx_misc_cab_loss dB$rx_misc_cab_loss dB
Total Transmission Line Loss$tx_total_cable_loss dB$rx_total_cable_loss dB
Miscellaneous Gain$tx_misc_gain dB$rx_misc_gain dB
Antenna Model / Notes$tx_ant_notes$rx_ant_notes
Antenna Gain$tx_ant_gain_dbi dBi
Radome Loss: $tx_ant_gain_radome dB
$rx_ant_gain_dbi dBi
Radome Loss: $rx_ant_gain_radome dB
Antenna Mechanical Tilt$tilt_tr°$tilt_rt°
Antenna (Parabolic) 3 dB Beamwidth$tx_ant_bw°$rx_ant_bw°
Antenna Coverage 3 dB RadiusInner: $inner_mi miles    Outer: $outer_mi miles
Highest Transmitted Frequency$frq_ghz GHz  ($frq_mhz MHz)
RF Power Output - dBx$pwr_out_dbm dBm  ($pwr_out_dbw dBW)  ($pwr_out_dbk dBk)
RF Power Output - Watts$pwr_out_mw mW  ($pwr_out_w W)  ($pwr_out_kw kW)
Wavelength$wav_in inches  ($wav_cm cm)  ($wav_ft feet)  ($wav_m m)
Effective Isotropic Radiated Power$eirp dBm  ($eirp_dbw dBW)  ($eirp_dbk dBk)
Effective Isotropic Radiated Power$eirp_mw mW  ($eirp_w W)  ($eirp_kw kW)













\n"; print F "\n"; print F "\n"; print F "\n"; if ($check3 eq "no") { print F "\n"; } if ($check3 eq "yes") { print F "\n"; } print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; printf F "\n", $earcon; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Terrain & Atmospheric Conditions
Specifications
Effective Earth Radius (K-Factor)$k_str  ($k_dec - $k_val)
Effective Earth Radius (K-Factor)$k_str  ($k_val)    (Local Elevation: $k_ht_ft feet / $k_ht_m m)
Grazing Angle$graze_dg°  ($graze_mr milliradians)
Approximate Distance to Reflection Point$grazing_dis_mi miles  ($grazing_dis_km kilometers)  (Phase Change: $phase_delta°)
Land Cover: $graze_land
Terrain RoughnessSupplied: $rough_ft feet  ($rough_m meters)
Calculated: $rough_calc_ft feet  ($rough_calc_m meters)
Average Annual Temperature$temp_f° F  ($temp_c° C)
Atmospheric Pressure (Sea Level Corrected)$atmos_p millibars
Saturation Vapor Pressure$es millibars
Partial Vapor Pressure$vapor_p millibars
Ground Dielectric Constant$diecon  ($diecon_desc)
Ground Conductivity%.3f Siemens/meter
Vigants-Barnett Climate FactorSupplied: $cli_vig  ($vig_val)
Calculated: $cli_vig_calc
Longley-Rice Climate Type$climate
Crane Rain Region$region
Local Area Humidity Type$rough_hum
Index of Surface Refraction$nunits N-units (parts per million)
Antenna Polarization$polar
Longley-Rice Situation Variability$sit% Confidence
Longley-Rice Time Variability$time% Reliability


\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Terrain Plotting Parameters
Specifications$tx_name  (TX)$rx_name  (RX)
Region for Terrain Plotting$city_tx, $state_tx
($country_tx)
$city_tx, $state_rx
($country_rx)
Distance to the Radio Horizon$tx_rad_hor_mi miles  ($tx_rad_hor_km km)$rx_rad_hor_mi miles  ($rx_rad_hor_km km)
Path Minimum Elevation$min_elev_ft feet  ($min_elev_m meters)
Path Average Elevation$avg_ht_ft feet  ($avg_ht_m meters)
Path Maximum Elevation$max_elev_ft feet  ($max_elev_m meters)
Earth Bulge at Path Midpoint$bulge_ft feet  ($bulge_m meters)
Maximum Fresnel Zone Radius$max_fres_ft feet  ($max_fres_m meters)
Additional Ground Clutter$gc_ft feet  ($gc_m meters)
Ideal Distance With These Antenna Heights$distance_max_mi miles  ($distance_max_km km)
Total Path Distance$dist_mi miles  ($dist_km km)











\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Free-Space, ITM, Atmospheric, Rain, Misc. Losses
Specifications$tx_name  (TX)$rx_name  (RX)
Temperate Climate Foliage Loss$foli_ft dB/foot  ($foli_m dB/meter)  (Dense, Dry, In-Leaf)
(Rain Rate: $rate mm/hr)  Crane Rain Model Attenuation$crane_rain_att_total dB  ($crane_rain_att_mi dB/mile)  ($crane_rain_att_km dB/km)
NASA Simplified Rain Model Attenuation$nasa_rain_att_total dB
Effective Rain Path Distance$rain_eff_mi miles  ($rain_eff_km km)
Estimated Attenuation Due to Water Vapor$water_att_total dB  ($water_att_mi dB/mile)  ($water_att_km dB/km)
Estimated Attenuation Due to Oxygen Loss$oxy_att_total dB  ($oxy_att_mi dB/mile)  ($oxy_att_km dB/km)
Miscellaneous Path Losses$tx_misc_loss dB
Potential Smooth Earth Diffraction Loss$diff_loss dB
Potential Depth of Fade$fade_depth dB  $Arx_mess
Potential Additional Land Cover Loss$tx_land_loss dB$rx_land_loss dB
Ideal vs. Realistic ExpectationsWithout Rain LossWith Rain Loss (Crane)
Friis Free-Space Path Loss$fs dB$fs_rain dB
ITWOMv3 Primary Path Loss$itm dB$itm_rain dB
ITWOMv3 Diversity Path Loss$div_itm dB$div_itm_rain dB
Total Atmospheric + Rain Path Losses$atmos_norain dB$atmos_rain dB
Free-Space + Atmospheric + Misc. Losses$fs_pl dB$fs_pl_rain dB
(Primary Path)  ITWOMv3 + Atmospheric + Misc. Losses$itm_pl dB$itm_pl_rain dB
(Diversity Path)  ITWOMv3 + Atmospheric + Misc. Losses$div_itm_pl dB$div_itm_pl_rain dB


\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Calculated Fade Margins
Specifications$tx_name  (TX)$rx_name  (RX)
Receiver Threshold$BER_dbm dBm  ($BER_uvolt µV)    ($BER_crit)
Dispersive Fade Margin$dfm_fs dB
External Interference Fade Margin$eifm_fs dB
Adjacent Channel Interference Fade Margin$aifm_fs dB
Minimum Composite Fade Margin for This Climate$min_fade dB
Potential Upfade$upfade dB
Path Mean Time Delay$time_delay nanoseconds
Unfaded ValuesWithout Rain LossWith Rain Loss (Crane)
Free-Space Loss Received Signal Level$rx_pwr dBm  ($rx_pwr_uvolt µV)$rx_pwr_rain dBm  ($rx_pwr_rain_uvolt µV)
Free-Space Thermal Fade Margin$tfm dB$tfm_rain dB
ITWOMv3 Loss Received Signal Level$rx_pwr_itm dBm  ($rx_pwr_itm_uvolt µV)$rx_pwr_itm_rain dBm  ($rx_pwr_itm_rain_uvolt µV)
ITWOMv3 Thermal Fade Margin$tfm_itm dB$tfm_itm_rain dB
Space Diversity ITWOMv3 Received Signal Level$rx_div_pwr_itm dBm  ($rx_div_pwr_itm_uvolt µV)$rx_div_pwr_itm_rain dBm  ($rx_div_pwr_itm_rain_uvolt µV)
Space Diversity ITWOMv3 Thermal Fade Margin$div_tfm_itm dB$div_tfm_itm_rain dB
Free-Space Loss Composite Fade Margin$cmp_fs dB$cmp_fs_rain dB
Non-Diverstiy ITWOMv3 Loss Composite Fade Margin$cmp_itm dB$cmp_itm_rain dB
Space Diversity ITWOMv3 Loss Composite Fade Margin$cmp_div_itm dB$cmp_div_itm_rain dB\








\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Transmitter Site RF Safety
SpecificationsGeneralOccupational
Maximum Permissible Exposure$std1 mW/cm2$std2 mW/cm2
Distance to RF Safety Compliance$dx1_ft feet  ($dx1_m meters)$dx2_ft feet  ($dx2_m meters)
(FCC OET Bulletin 65)  Estimated RF Power Density$rf_safe_pwrdens mW/cm2    (Directly Below the Radiating Antenna)
Total RF Input Power to the Antenna$tx_ant_input dBm  ($tx_ant_input_mw mW)
(FCC Part 15.247)  Allowed RF Input Power to Antenna$max_ant_pwr dBm  ($max_ant_pwr_mw mW)
(FCC Part 74.644)  Maximum Allowable EIRP$fcc_eirp_dbm dBm  $fcc_check

\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Vertical Space Diversity Antenna Parameters
Specifications$rx_name  (RX-DIV)
Local Ground Elevation (AMSL)$rx_elv_ft feet  ($rx_elv_m meters)
User Supplied Spacing for Diversity Antenna$div_ft feet  ($div_m meters)    $div_ft_check
Adjusted Spacing for Diversity Antenna$div_calc_ft feet  ($div_calc_m meters)    (Odd Multiple 1/2 wav.)
Calculated Ideal Spacing for Diversity Antenna$div_space_ft feet  ($div_space_m meters)
Diversity Antenna Height (AGL)$div_ant_ht_ft feet  ($div_ant_ht_m meters)
Overall Diversity Receiver Antenna Height (AMSL)$div_rx_ant_ht_ov_ft feet  ($div_rx_ant_ht_ov_m meters)
Diversity Antenna Gain$div_ant_dbi dBi  ($div_ant_dbd dBd)  $div_gain_check
Radome Loss: $rx_div_ant_gain_radome dB
Diversity Antenna Mechanical Tilt$tilt_rtd° to TX


\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Target Outage Objectives & Probabilities
SpecificationsOutage ObjectiveReliabilityRequired Composite Fade Margin
One-Way Bell System Short-Haul$obj_nodiv_fs SES/year$obj_nodiv_fs_per%$obj_nodiv_fs_cfm dB
One-Way Bell System Long-Haul$obj1_nodiv_fs SES/year$obj1_nodiv_fs_per%$obj1_nodiv_fs_cfm dB
One-Way ITU-R High-Grade$obj2_nodiv_fs SES/year$obj2_nodiv_fs_per%$obj2_nodiv_fs_cfm dB
Two-Way Bell System Short-Haul$obj_nodiv_fs_two SES/year$obj_nodiv_fs_per_two%$obj_nodiv_fs_cfm_two dB
Two-Way Bell System Long-Haul$obj1_nodiv_fs_two SES/year$obj1_nodiv_fs_per_two%$obj1_nodiv_fs_cfm_two dB
Two-Way ITU-R High-Grade$obj2_nodiv_fs_two SES/year$obj2_nodiv_fs_per_two%$obj2_nodiv_fs_cfm_two dB


\n"; close F; open(F, ">", "index3.html") or die "Can't open index3.html: $!\n" ; print F "\n"; print F "Reliability Report\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "\n"; print F "
Calculated Outage Objectives & Probabilities
Without Spaced Vertical Antenna Diversity (Vigants/Free-Space)Without Rain LossWith Rain Loss (Crane)
One-Way Multipath Probability of Outage$SES_nodiv_fs_yr SES/year$SES_nodiv_fs_yr_rain SES/year
One-Way Multipath Reliability$SES_nodiv_fs_per%$SES_nodiv_fs_per_rain%
Annual Multipath Severely Errored Seconds$worst_nodiv_fs_yr  $worst_nodiv_fs_yr_val$worst_nodiv_fs_yr_rain  $worst_nodiv_fs_yr_val_rain
Annual Amplitude Dispersion Fading Outage$worst_amp_fade_fs $worst_amp_fade_fs_val$worst_amp_fade_fs_rain $worst_amp_fade_fs_val
Without Spaced Vertical Antenna Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
One-Way Multipath Probability of Outage$SES_nodiv_itm_yr SES/year$SES_nodiv_itm_yr_rain SES/year
One-Way Multipath Reliability$SES_nodiv_itm_per%$SES_nodiv_itm_per_rain%
Annual Multipath Severely Errored Seconds$worst_nodiv_itm_yr  $worst_nodiv_itm_yr_val$worst_nodiv_itm_yr_rain  $worst_nodiv_itm_yr_val_rain
Annual Amplitude Dispersion Fading Outage$worst_amp_fade $worst_amp_fade_val$worst_amp_fade_rain $worst_amp_fade_rain_val
With Spaced Vertical Antenna Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
Space Diversity Improvement Factor$Isd_itm  ($Isd_itm_db dB)$Isd_itm_rain  ($Isd_itm_db_rain dB)
One-Way Multipath Probability of Outage$SES_div_itm_yr SES/year$SES_div_itm_yr_rain SES/year
One-Way Multipath Reliability$SES_div_itm_per%$SES_div_itm_per_rain%
Annual Multipath Severely Errored Seconds$worst_div_itm_yr  $worst_div_itm_yr_val$worst_div_itm_yr_rain  $worst_div_itm_yr_val_rain
With Frequency Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
Diversity Frequency$frq_ghz_div GHz    (ΔF: $df_mhz MHz)
Frequency Diversity Improvement Factor$Ifd_itm    $Ifd_message_itm$Ifd_itm_rain    $Ifd_message_itm_rain
One-Way Multipath Probability of Outage$SES_frq_div_yr_itm SES/year$SES_frq_div_yr_itm_rain SES/year
One-Way Multipath Reliability$SES_frq_div_itm_per%$SES_frq_div_itm_per_rain%
Annual Multipath Severely Errored Seconds$worst_frq_div_mo_itm  $worst_frq_div_mo_itm_val$worst_frq_div_mo_itm_rain  $worst_frq_div_mo_itm_val_rain
With Hybrid Diversity (Vigants/ITWOMv3)Without Rain LossWith Rain Loss (Crane)
Hybrid (Space + Frequency) Diversity Improvement Factor$Ihd_itm    $Ihd_message 
One-Way Multipath Probability of Outage$SES_hyb_div_yr_itm SES/year 
One-Way Multipath Reliability$SES_hyb_div_itm_per% 
Annual Multipath Severely Errored Seconds$worst_hyb_div_yr_itm  $worst_hyb_div_yr_itm_val 


\n"; close F; open(F, ">", "haat.html") or die "Can't open haat.html: $!\n" ; print F "\n"; print F "HAAT Calculations\n"; print F "\n"; print F "\n"; print F "
Terrain Analysis Reports

\n"; print F "
SPLAT! HAAT Calculation\n\n";

  open(F1, "<", "$tx_name-site_report.txt") or die "Can't open file $tx_name-site_report.txt: $!\n";
    while () {
      chomp;
      print F "$_\n";
    }
  close F1;

  print F "\nSPLAT! HAAT Calculation\n\n";

  open(F1, "<", "$rx_name-site_report.txt") or die "Can't open file $rx_name-site_report.txt: $!\n";
    while () {
      chomp;
      print F "$_\n";
   }
  close F1;

  if ($do_div eq "yes") {
    print F "SPLAT! HAAT Calculation\n\n";

    open(F1, "<", "$rx_div_name-site_report.txt") or die "Can't open file $rx_div_name-site_report.txt: $!\n";
      while () {
        chomp;
        print F "$_\n";
      }
    close F1;
  }

  print F "
\n"; close F; open(F, ">", "splat.html") or die "Can't open splat.html: $!\n" ; print F "\n"; print F "SPLAT! Calculations\n"; print F "\n"; print F "\n"; print F "
Terrain Analysis Reports

\n"; print F "\n
SPLAT! Path Profile Calculations\n\n";

  $found = 0;
  open(F1, "<", "$rx_name-to-$tx_name.txt") or die "Can't open file $rx_name-to-$tx_name.txt: $!\n";
    while ($line = ) {
      chomp $line;
      if ($line =~ /Site Name/) {
        $found = 1;
      }
      if ($found) {
        print F "$line\n";
      }
    }
  close F1;

  if ($do_div eq "yes") {
    print F "\nSPLAT! Path Profile Calculations\n\n";

    $found = 0;
    open(F1, "<", "$rx_div_name-to-$tx_name.txt") or die "Can't open file $rx_div_name-to-$tx_name.txt: $!\n";
      while ($line = ) {
        chomp $line;
        if ($line =~ /Site Name/) {
          $found = 1;
        }
        if ($found) {
          print F "$line\n";
        }
      }
    close F1;
  }

  print F "\nSPLAT! Path Profile Calculations\n\n";

  $found = 0;
  open(F1, "<", "$tx_name-to-$rx_name.txt") or die "Can't open file $tx_name-to-$rx_name.txt: $!\n";
    while ($line = ) {
      chomp $line;
      if ($line =~ /Site Name/) {
        $found = 1;
      }
      if ($found) {
        print F "$line\n";
      }
    }
  close F1;

  print F "
\n"; close F; open(F, ">", "index5.html") or die "Can't open index5.html: $!\n" ; print F "\n"; print F "Coverage Reports\n"; print F "\n"; print F "\n"; print F "
Coverage Reports

\n"; print F "
\n"; print F "


General Coverage Topographical Map
$country_tx ($city_tx, $state_tx)

\n"; if ($do_div eq "no") { print F "


Approximate Line-of Sight Radio Coverage with a $tx_ant_ht_ft ft Receive Antenna Height
$tx_name    $rx_name     $tx_name+$rx_name

\n"; } elsif ($do_div eq "yes") { print F "


Approximate Line-of Sight Radio Coverage with a $tx_ant_ht_ft ft Receive Antenna Height
$tx_name    $rx_name     $tx_name+$rx_name

\n"; print F "


Approximate Line-of Sight Radio Coverage with a $tx_ant_ht_ft ft Receive Antenna Height
$tx_name    $rx_div_name     $tx_name+$rx_div_name

\n"; } print F "


Approximate Omnidirectional ITM Path Loss Coverage at $tx_name

\n"; if ($do_div eq "no") { print F "


Approximate Omnidirectional ITM Path Loss Coverage at $rx_name

\n"; } elsif ($do_div eq "yes") { print F "


Approximate Omnidirectional ITM Path Loss Coverage at $rx_name

\n"; print F "


Approximate Omnidirectional ITM Path Loss Coverage at $rx_div_name

\n"; } print F "

\n"; print F "
\n"; print F "These calculations are only estimates based on the provided data.
There is no guarantee that a microwave link is possible, even if it \"looks\" O.K.
This is mostly just for fun and I have no idea if it's accurate.
GBPPR RadLab $ver
EXPERIMENTAL
\n"; print F "\n"; close F; ## Make PDF output # $ENV{HTMLDOC_NOCGI}=1; &System($args = "$htmldoc --links --header ... --linkcolor blue --linkstyle plain --left 0.25in --footer ..1 --quiet --webpage -f $outpdf index1.html index2.html index3.html haat.html splat.html index5.html"); ## Done # if ($DEBUG == 1) { unlink "curvature.gp", "elev1", "elev.gp", "fresnel.gp", "fresnel_pt_6.gp", "loss.png"; unlink "loss-profile.gp", "profile2.gp", "profile.gp", "pro.png", "reference.gp"; unlink "rx.lrp", "rx.qth", "RX-site_report.txt", "RX-to-TX.txt", "splat2.gp"; unlink "splat3.gp", "splat.gp", "tx.lcf", "tx.lrp", "tx.qth", "TX-site_report.txt"; } exit 0;