Skip to content
Snippets Groups Projects
Commit 4c806ced authored by Ayush Varshney's avatar Ayush Varshney
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
These are files provided for COMP1204 CW1.
File info:
- al*.kml
These are the kml files containing storm data that you need to process.
We've given you three files to develop your script against.
You should generate a storm map for each one (using create_map_plot.sh).
These map plots should then be added to your report.
- create_map_plot.sh
This script generates plots from csv files.
Your create_csv script should make csv files based on data extracted from the kml files.
You can then run
./create_map_plot.sh storm_data.csv plot.png
to create a map of the storm data.
NOTE: For this script to work correctly, it must be in the same location as plot-locations-on-map.gpi and world-50m.txt.
- plot-locations-on-map.gpi
This is the gnuplot code for creating the storm plots.
It is run by the create_map_plot.sh script, so you shouldn't need to run it yourself or modify it in any way.
- report.tex
This is the Latex report template that you should use for your report.
- world-50m.txt
This contains information used to draw the world map background in your storm plots.
It is used by the plot-locations-on-map.gpi script.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
csv_input_path=$1
image_output_path=$2
tmp_csv_output=tmp_plot.csv
# Create temporary file containing only location data for plotting
cat $csv_input_path | cut -d, -f2,3 | sed '1d' | sed -e 's/\sN//g' -e 's/\sW//g' -e 's/,/ /g' > $tmp_csv_output
# Run gnuplot script
gnuplot -e "line_csv_path='$tmp_csv_output'; image_output_path='$image_output_path'" plot-locations-on-map.gpi
# Remove temporary file
rm $tmp_csv_output
#gnuplot code courtesy of https://github.com/balakrishnanc/gnugeoplot
set terminal pdfcairo transparent enhanced font "Clear Sans, 16" linewidth 2 rounded dashed
set style line 80 lc rgb "#404040" lt 1 lw 1
set border 0 back ls 80
set style line 81 lc rgb "#909090" lt 0 lw 0.4
set style line 82 lc rgb "#a4a4a4" lt 0 lw 0.2
# NOTE: Grid lines can be distracting on a map.
# set grid back xtics ytics ls 81, ls 82
# set grid back ls 81
set tics in
set xtics nomirror
set ytics nomirror
# Colors chosen from colorbrewer; print- and photocopy-friendly.
set style line 1 lt 1 lc rgb "#20808080" lw 0.5 pt 6 ps 0.5
#set style line 2 lt 1 lc rgb "#99cc0000" lw 0.1 pt 5 ps 0.3
set key top left
set tmargin 0.5
set rmargin 1
set bmargin 0.5
set lmargin 1
unset xlabel
unset xtics
unset ylabel
unset ytics
set term png
set output image_output_path
plot 'world-50m.txt' not w l ls 1, \
line_csv_path u 2:1 not w lp ls 2 lc rgb "red" pt 8 ps .3
unset output
% ----
% COMP1204 CW1 Report Document
% ----
\documentclass[]{article}
% Reduce the margin size, as they're quite big by default
\usepackage[margin=1in]{geometry}
\title{COMP1204: Data Management \\ Coursework One: Hurricane Monitoring }
% Update these!
\author{Your Name \\ Your Student ID}
% Actually start the report content
\begin{document}
% Add title, author and date info
\maketitle
\section{Introduction}
\section{Create CSV Script}
\section{Storm Plots}
\end{document}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment