#!/bin/bash

dirpng=$1
seas=$2
proj=$3
sim=$4 
ref=$5 
var=$6

din=${dirpng}/${seas}/$ref/MAP/${proj}
cd ${din}
convert ${var}.pdf ${var}.png
convert -size 1500x1000 xc:white ${var}.png -geometry 1440x890+30+30 -composite -trim -gravity North ${var}.png

din=${dirpng}/${seas}/${sim}/MAP/${proj}
cd ${din}
convert ${var}.pdf ${var}.png
convert -size 1500x1000 xc:white ${var}.png -geometry 1440x890+30+30 -composite -trim -gravity North ${var}.png

din=${dirpng}/${seas}/${sim}/DMAP_${ref}/${proj}
cd ${din}
convert ${var}.pdf ${var}.png
convert -size 1500x1000 xc:white ${var}.png -geometry 1440x890+30+30 -composite -trim -gravity North ${var}.png

exit
