Files
SPLAT-Parallel-with-Rust/perfiles.sh
T
cescobar 9d7d3bac45 Commit inicial: splat-rs — fork/port a Rust de SPLAT!
Fork de SPLAT! (John A. Magliacane, KD2BD, 2002-2014), bajo GPLv2 heredada
del original. El núcleo de cálculo de propagación (ITWOM v3.0, Sid Shumate)
se mantiene sin modificar en cpp/itwom3.0.cpp, llamado vía FFI. El resto
del pipeline (lectura de formatos SPLAT!, reportes, mapas, KML, gnuplot)
se reescribió en Rust, con paralelización nativa vía rayon reemplazando
el paralelismo por múltiples procesos del original. Validado contra el
corpus golden de SPLAT! con drift < 0.02 dB en cálculos ITWOM.
2026-08-23 01:50:41 -05:00

304 lines
12 KiB
Bash
Executable File

#!/bin/bash
#rm -f *.txt *.txt *.lrp *.ppm *.geo *.scf ./geo/* ./klm/* ./txt/*
#ruta=$HOME/.splat-gui/projects/"$1"/prediccion/perfiles
#if [[ ! -d "$ruta" ]]; then
# mkdir "$ruta"
#fi
ruta="."
cp $HOME/.splat-gui/projects/"$1"/prediccion/tx_sitepred.qth "$ruta"/txprofile.qth
cp $HOME/.splat-gui/projects/"$1"/prediccion/splat.lrp "$ruta"/splat.lrp
dezp=0.53965407
dezpj=`echo "scale=8; $dezp/12"|bc`
dezp=0
#"$ruta"/txprofile.qth
tx_sitepred=`sed -n 1p "$ruta"/txprofile.qth|sed s/" "/"_"/g`
lat=`sed -n 2p "$ruta"/txprofile.qth`
lon=`sed -n 3p "$ruta"/txprofile.qth`
lat_gradopred=`echo $lat|awk -F" " '{ print $1}'`
lat_minutopred=`echo $lat|awk -F" " '{ print $2}'`
lat_segundopred=`echo $lat|awk -F" " '{ print $3}'`
#echo "$lat_gradopred $lat_minutopred $lat_segundopred"
lattx=`echo "scale=8; $lat_gradopred + $lat_minutopred/60 + $lat_segundopred/3600"|bc`
#echo $lattx
long_gradopred=`echo $lon|awk -F" " '{ print $1}'`
long_minutopred=`echo $lon|awk -F" " '{ print $2}'`
long_segundopred=`echo $lon|awk -F" " '{ print $3}'`
longtx=`echo "scale=8; $long_gradopred + $long_minutopred/60 + $long_segundopred/3600"|bc`
#echo "$long_gradopred $long_minutopred $long_segundopred"
#echo $longtx
echo $tx_sitepred > "$ruta"/txprofile.qth
echo $lattx >> "$ruta"/txprofile.qth
echo $longtx >> "$ruta"/txprofile.qth
echo "30 m" >> "$ruta"/txprofile.qth
i=1
echo "0º dBuVm" > atenuaciones0.ttxt
while [ $i -lt "19" ]; do
echo perfil de 0 grados > "$ruta"/rxprofile.qth
latrx0=`echo "scale=8; $lattx+$dezpj*$i" | bc`
longrx0=$longtx
echo $latrx0 >> "$ruta"/rxprofile.qth
echo $longrx0 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -t "$ruta"/txprofile.qth -r "$ruta"/rxprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl0.png
attn=`cat "$tx_sitepred"-to-perfil_de_0_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones0.ttxt
fi
i=$(($i+1))
done
splat -r "$ruta"/txprofile.qth -t "$ruta"/rxprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil0.png
i=1
echo "180º dBuVm" > atenuaciones180.ttxt
while [ $i -lt "19" ]; do
echo perfil de 180 grados > "$ruta"/rxprofile.qth
latrx180=`echo "scale=8; $lattx-$dezpj*$i" | bc`
longrx180=$longtx
echo $latrx180 >> "$ruta"/rxprofile.qth
echo $longrx180 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl180.png
attn=`cat "$tx_sitepred"-to-perfil_de_180_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones180.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil180.png
i=1
echo "90º dBuVm" > atenuaciones90.ttxt
while [ $i -lt "19" ]; do
echo perfil de 90 grados > "$ruta"/rxprofile.qth
latrx90=$lattx
longrx90=`echo "scale=8; $longtx-$dezpj*$i" | bc`
echo $latrx90 >> "$ruta"/rxprofile.qth
echo $longrx90 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl90.png
attn=`cat "$tx_sitepred"-to-perfil_de_90_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones90.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil90.png
i=1
echo "270º dBuVm" > atenuaciones270.ttxt
while [ $i -lt "19" ]; do
echo perfil de 270 grados > "$ruta"/rxprofile.qth
latrx270=$lattx
longrx270=`echo "scale=8; $longtx+$dezpj*$i" | bc`
echo $latrx270 >> "$ruta"/rxprofile.qth
echo $longrx270 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl270.png
attn=`cat "$tx_sitepred"-to-perfil_de_270_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones270.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil270.png
a=0.269827035
b=0.467354134
aj=`echo "scale=8; $a/12"|bc`
bj=`echo "scale=8; $b/12"|bc`
i=1
echo "30º dBuVm" > atenuaciones30.ttxt
while [ $i -lt "19" ]; do
echo perfil de 30 grados > "$ruta"/rxprofile.qth
latrx30=`echo "scale=8; $lattx+$bj*$i" | bc`
longrx30=`echo "scale=8; $longtx-$aj*$i" | bc`
echo $latrx30 >> "$ruta"/rxprofile.qth
echo $longrx30 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -nf -l "$ruta"/attnprfl30.png
attn=`cat "$tx_sitepred"-to-perfil_de_30_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones30.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil30.png
i=1
echo "60º dBuVm" > atenuaciones60.ttxt
while [ $i -lt "19" ]; do
echo perfil de 60 grados > "$ruta"/rxprofile.qth
latrx60=`echo "scale=8; $lattx+$aj*$i" | bc`
longrx60=`echo "scale=8; $longtx-$bj*$i" | bc`
echo $latrx60 >> "$ruta"/rxprofile.qth
echo $longrx60 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl60.png
attn=`cat "$tx_sitepred"-to-perfil_de_60_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones60.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil60.png
i=1
echo "120º dBuVm" > atenuaciones120.ttxt
while [ $i -lt "19" ]; do
echo perfil de 120 grados > "$ruta"/rxprofile.qth
latrx120=`echo "scale=8; $lattx-$aj*$i" | bc`
longrx120=`echo "scale=8; $longtx-$bj*$i" | bc`
echo $latrx120 >> "$ruta"/rxprofile.qth
echo $longrx120 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl120.png
attn=`cat "$tx_sitepred"-to-perfil_de_120_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones120.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil120.png
i=1
echo "150º dBuVm" > atenuaciones150.ttxt
while [ $i -lt "19" ]; do
echo perfil de 150 grados > "$ruta"/rxprofile.qth
latrx150=`echo "scale=8; $lattx-$bj*$i" | bc`
longrx150=`echo "scale=8; $longtx-$aj*$i" | bc`
echo $latrx150 >> "$ruta"/rxprofile.qth
echo $longrx150 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl150.png
attn=`cat "$tx_sitepred"-to-perfil_de_150_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones150.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil150.png
i=1
echo "210º dBuVm" > atenuaciones210.ttxt
while [ $i -lt "19" ]; do
echo perfil de 210 grados > "$ruta"/rxprofile.qth
latrx210=`echo "scale=8; $lattx-$bj*$i" | bc`
longrx210=`echo "scale=8; $longtx+$aj*$i" | bc`
echo $latrx210 >> "$ruta"/rxprofile.qth
echo $longrx210 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl210.png
attn=`cat "$tx_sitepred"-to-perfil_de_210_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones210.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil210.png
i=1
echo "240º dBuVm" > atenuaciones240.ttxt
while [ $i -lt "19" ]; do
echo perfil de 240 grados > "$ruta"/rxprofile.qth
latrx240=`echo "scale=8; $lattx-$aj*$i" | bc`
longrx240=`echo "scale=8; $longtx+$bj*$i" | bc`
echo $latrx240 >> "$ruta"/rxprofile.qth
echo $longrx240 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl240.png
attn=`cat "$tx_sitepred"-to-perfil_de_240_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones240.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil240.png
i=1
echo "300º dBuVm" > atenuaciones300.ttxt
while [ $i -lt "19" ]; do
echo perfil de 300 grados > "$ruta"/rxprofile.qth
latrx300=`echo "scale=8; $lattx+$aj*$i" | bc`
longrx300=`echo "scale=8; $longtx+$bj*$i" | bc`
echo $latrx300 >> "$ruta"/rxprofile.qth
echo $longrx300 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl300.png
attn=`cat "$tx_sitepred"-to-perfil_de_300_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones300.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil300.png
i=1
echo "330º dBuVm" > atenuaciones330.ttxt
while [ $i -lt "19" ]; do
echo perfil de 330 grados > "$ruta"/rxprofile.qth
latrx330=`echo "scale=8; $lattx+$bj*$i" | bc`
longrx330=`echo "scale=8; $longtx+$aj*$i" | bc`
echo $latrx330 >> "$ruta"/rxprofile.qth
echo $longrx330 >> "$ruta"/rxprofile.qth
echo 10 m >> "$ruta"/rxprofile.qth
dist=$(($i*5))
if [[ $dist -le 40 || $dist -eq 50 || $dist -eq 60 || $dist -eq 70 || $dist -eq 80 || $dist -eq 90 ]]; then
timeout 10 splat -r "$ruta"/rxprofile.qth -t "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -l "$ruta"/attnprfl330.png
attn=`cat "$tx_sitepred"-to-perfil_de_330_grados.txt|grep "Field strength"|cut -d " " -f 8|sed s/"\."/","/g`
echo "$attn" >> atenuaciones330.ttxt
fi
i=$(($i+1))
done
splat -t "$ruta"/rxprofile.qth -r "$ruta"/txprofile.qth -d /opt/splat/sdf -olditm -metric -n -H "$ruta"/perfil330.png
cat atenuaciones0.ttxt > atenuaciones.ttxt
cat atenuaciones30.ttxt >> atenuaciones.ttxt
cat atenuaciones60.ttxt >> atenuaciones.ttxt
cat atenuaciones90.ttxt >> atenuaciones.ttxt
cat atenuaciones120.ttxt >> atenuaciones.ttxt
cat atenuaciones150.ttxt >> atenuaciones.ttxt
cat atenuaciones180.ttxt >> atenuaciones.ttxt
cat atenuaciones210.ttxt >> atenuaciones.ttxt
cat atenuaciones240.ttxt >> atenuaciones.ttxt
cat atenuaciones270.ttxt >> atenuaciones.ttxt
cat atenuaciones300.ttxt >> atenuaciones.ttxt
cat atenuaciones330.ttxt >> atenuaciones.ttxt