# Directories
# -----------
$GMT_bin    = "/home/GMT4/bin/";
$GMT_out    = "/home/GPSDATA/REUN/ATM/";

# GMT programs
# ------------
$gmtset     = $GMT_bin."gmtset";
$pscoast    = $GMT_bin."pscoast";
$psxy       = $GMT_bin."psxy";
$pstext     = $GMT_bin."pstext";
$psscale    = $GMT_bin."psscale";
$surface    = $GMT_bin."surface";
$grdimage   = $GMT_bin."grdimage";
$grdcontour = $GMT_bin."grdcontour";

# Input and output files
# ----------------------
$ps         = "${GMT_out}ZTD_2008_086_0.ps";
$TROGMT_file = $GMT_out."GMT_TRO_080860.TXT";
$GRD_file    = $GMT_out."TRO.GRD";
$cpt_file    = "/home/GPSDATA/REUN/STA/ZTD_drywet4.cpt";
$sta_file    = $GMT_out."stations_all.lis";
$sta_file_ok = $GMT_out."stations_ok.lis";

# Setting .gmtdefaults parameters
# -------------------------------
`$gmtset PLOT_DEGREE_FORMAT ddd:mm`;
`$gmtset PAGE_ORIENTATION  portrait`;
`$gmtset PAPER_MEDIA a4+`;
`$gmtset HEADER_FONT_SIZE    = 18p`;
`$gmtset HEADER_FONT = 0`;
`$gmtset ANNOT_FONT_SIZE_PRIMARY 10`;
`$gmtset ANNOT_OFFSET_PRIMARY 0.05c`;
`$gmtset ANNOT_OFFSET_SECONDARY 0.05c`;
`$gmtset LABEL_FONT_SIZE 8`;
`$gmtset CHAR_ENCODING  Standard+`;
`$gmtset FRAME_WIDTH 0.1c`;

# Creating base map
# -----------------
`$pscoast -R15/80/-55/0 -JM16c -B5.0g5.0f5.0 -Df -K -A50/1 -N1 -S220/250/255 -G255/255/255 -W2/0/0/120 -N1/1/255/0/255 -Y4.9c -X1.3c > $ps`;

# Ascii grid => binary grid
# -------------------------
`$surface ${TROGMT_file} -R15/80/-55/0 -G${GRD_file} -I0.1/0.1  -T0.0`;

# Plotting ZTD grid
# -----------------
`$grdimage ${GRD_file} -C${cpt_file} -R15/80/-55/0 -JM  -S5  -K -O   >>  $ps`;

# Plotting coastlines and borders on top of grid
# ----------------------------------------------
`$pscoast -R15/80/-55/0 -JM -N1/1/255/0/255 -Di -B5.0g5.0f5.0WES -A50/1 -W2/0/0/120 -K -O >>  $ps`;

# Plotting contour lines
# ----------------------
`$grdcontour ${GRD_file} -R -JM -C0.01 -A0.05 -S100 -Wa5 -T -O -K >> $ps`;

# Plotting all stations
# ---------------------
`$psxy ${sta_file} -R -JM -SC0.12 -W1.5 -G250/0/0  -O -K >>  $ps`;

# Plotting calculated stations
# ----------------------------
`$psxy ${sta_file_ok} -R -JM -SC0.12 -W1.5 -G0/250/0 -O -K  >>  $ps`;

# Plotting station names
# ----------------------
`$pstext ${sta_file} -R -JM -Y0 -Dj0.12 -G0/0/0 -O -K >>  $ps`;

# Plotting color scale
# --------------------
`$psscale -C${cpt_file} -D8.0c/-1.0c/16c/0.4ch -B:"":/:m: -O -K >>  $ps`;

# Plotting title
# --------------
$tmp2 = "/home/GPSDATA/REUN/ATM/tmp_ztd2.txt";
`$pstext $tmp2 -R -JM -Y0 -N -S6/255/255/255 -G0/0/0 -O -K  >>  $ps`;

# Plotting Unix time stamp
# ------------------------
$tmp3 = "/home/GPSDATA/REUN/ATM/tmp_ztd3.txt";
`$pstext $tmp3 -R -JM -U/0/0/ -O >>  $ps`;
