- 👋 Hi, I’m @Rakeshx609
- 👀 I’m interested in ...
- 🌱 I’m currently learning ...
- 💞️ I’m looking to collaborate on ...
- 📫 How to reach me ...
#!/usr/bin/env bash LOGDIR=/home/superkuh/bob/radio # rtl_power output OUTPUTDIR=/home/superkuh/bob/radio/www # temp dir WEBDIR=/home/superkuh/limbo/www/radio/ # put the finished dir here PANOJSLIB=/home/superkuh/bob/radio/panojs # contains folders: extjs,images,panojs,styles
cd $LOGDIR
args=("$@") COUNTER=1 while test $# -gt 0 do case "$1" in --tick) TIMETICKS=${args[$COUNTER]} ;; --file) LOGFILE=${args[$COUNTER]};FILENAME="${LOGFILE%.*}" ;; esac ((COUNTER++)) shift done if ! [ -n "$TIMETICKS" ] ; then TIMETICKS=3600; fi
if ! [ -n "$LOGFILE" ] ; then LOGFILE=$(ls -Art | grep ".csv" | tail -n 1)
FILENAME="${LOGFILE%.*}"
fi
#FILEDATE=$(date +%Y-%m-%d_%H-%M --utc --reference=$(ls -Art | tail -n 1)) #FILEDATE=$(date +%Y-%m-%d_%H-%M --utc --reference=$LOGFILE)
#echo "Copying logfile to temp."; #time cp $LOGFILE run.csv
echo "Running heatmap.py on [$LOGFILE]"
#time ./heatmap.py run.csv spectrum_$FILEDATE.png time ./heatmap.py --ytick $TIMETICKS $LOGFILE spectrum_$FILENAME.png
#DIRECTORY="$OUTPUTDIR/$FILEDATE" DIRECTORY="$OUTPUTDIR/$FILENAME" echo "Checking if output [$DIRECTORY] exists already..." if [[ -d "${DIRECTORY}" && ! -L "${DIRECTORY}" ]] ; then echo "Dir already exists. Deleting old [$DIRECTORY]." rm -rf $DIRECTORY else echo "Output dir doesn't exist. Creating it." fi mkdir $DIRECTORY
PNGIMAGE=$(ls -Art | grep ".png" | tail -n 1)
WIDTH=$(identify -format "%w"
echo "Slicing images..."
time imgcnv -i $PNGIMAGE -o $DIRECTORY/spectrum.png -t png -tile 256
echo "Done, [$DIRECTORY] full of tiles."
echo "Copying PanoJS stuff..." cp -R $PANOJSLIB/* $DIRECTORY/
echo "Generating HTML index ... [$DIRECTORY/index.html]"
cat >$DIRECTORY/index.html << EOF
<title>radio spectrogram</title><style type="text/css">
@import url(styles/panojs.css);
</style>
<script type="text/javascript" src="extjs/ext-core.js"></script>
<script type="text/javascript" src="panojs/utils.js"></script>
<script type="text/javascript" src="panojs/PanoJS.js"></script>
<script type="text/javascript" src="panojs/controls.js"></script>
<script type="text/javascript" src="panojs/pyramid_imgcnv.js"></script>
<script type="text/javascript" src="panojs/control_thumbnail.js"></script>
<script type="text/javascript" src="panojs/control_info.js"></script>
<script type="text/javascript" src="panojs/control_svg.js"></script>
echo "Copying everything to [$WEBDIR] ..." time cp -R $DIRECTORY/ $WEBDIR/
cd $DIRECTORY; time tar cf - $FILENAME/ | time ssh [email protected] 'cd /home/user/www/radio && tar xf -'
#echo "Deleting tmp image [$PNGIMAGE]: Disabled." #rm $PNGIMAGE echo "Done."