ENTER CONDUCTOR VOLTAGES, MAGNITUDE AND ANGLE.
MAGNITUDE MUST BE RMS KV LINE-TO-GROUND.
I.E., A 69 KV LINE IMPLIES 69/SQRT(3)=39.8.
ANGLES SHOULD BE IN DEGEES, TYPICALLY 0,120,-120.
{magnitude_angles_table : ENTER MAGNITUDE AND ANGLE.}
ENTER COORDINATES WHERE E FIELD IS DESIRED.
ENTER DISTANCE DATA IN FEET, NUMBER OF DATA POINTS AS AN INTEGER.
For example, if xstart is 0, xstop is 10 and the number of data points is 3, then the program will calculate noise at ground level at the following distances away from the distribution line: 0 feet, 5 feet, 10 feet.
{xstart: first x coordinate}
{xstop : last x coordinate}
{y: height above ground}
{npnts : number of points}
# Click the Blue Plane to preview this as a CrossCompute tool
phase_table_path = 'phases.csv'
shield_table_path = 'shields.csv'
span_table_path = 'spans.csv'
magnitude_angles_table_path = 'magnitude_angles.csv'
xstart = 12
xstop = 35
y = 10
npnts = 1
target_folder = '/tmp'
from os.path import join
output_text_path = join(target_folder, 'electric_field.log')
target_text_path = join(target_folder, 'electric_field.txt')
from pandas import read_csv
df = read_csv(magnitude_angles_table_path)
df
mag_angles = [','.join((str(x), str(y))) for x,y in zip(df['magnitudes'], df['angles'])]
pylon_text_path = ''
from subprocess import run
executable = '1.out'
script = '1.f'
output_text = run([
'gfortran',
'-o',
executable,
script,])
from itertools import chain
from os.path import expanduser
cmd = list(chain([
join('.', executable),
pylon_text_path,
expanduser(target_text_path)
],
mag_angles,
[str(xstart),
str(xstop),
str(y),
str(npnts)]))
from subprocess import check_output, STDOUT
output_text = check_output(cmd, stderr=STDOUT)
with open(output_text_path, 'wb') as output_file:
output_file.write(output_text)
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)