I have a regional file with azimuth data. Then I created 18 sub-region of 1x1 degree:
gmt grdinfo -R$REGION -I1 -D0 > SR.txt
and I make a rore diagram for each sub-region (using batch)
gmt begin \${BATCH_NAME} eps
gmt select "Az_Data.txt" \${BATCH_TEXT} -o2,3 -fg > "temp_rumbo" -bi4f -bof
gmt rose "temp_rumbo" -bi2f -Gorange@40 -A3r -S5cn -D -JX10c -R$Dominio -T -F
gmt end
Now, I want to plot each rose diagram on a map in the center of the corresponding sub-region like this:
In the figure, I do it manually with
gmt image Prueba_00.eps -Dg-70.5/-55.5+jcM -W3c
gmt image Prueba_01.eps -Dg-69.5/-55.5+jcM -W3c
gmt image Prueba_02.eps -Dg-68.5/-55.5+jcM -W3c
If there a way to automatically do this?
Full Script:
#!/usr/bin/env bash
# Variables
title=Prueba
DEM="@earth_relief_05m"
Dominio=0/1/0/360
REGION=-71/-65/-56/-53
PROJ=M15c
CUT=Az_Data.nc
# ------------------------------------
gmt grdinfo -R$REGION -I1 -D0 > SR.txt -Ct
# ------------------------------------
cat << EOF > pre.sh
gmt begin
# 1. Preparar Datos
gmt grdgradient $DEM -Dn -G$CUT -R$REGION
gmt grd2xyz $CUT > "Az_Data.txt" -s -Wa -o0,1,3,2 -bof
gmt end
EOF
# ------------------------------------
# 2. Scripts principal para el procesamiento
cat << EOF > main.sh
gmt begin \${BATCH_NAME} eps
gmt select "Az_Data.txt" \${BATCH_TEXT} -o2,3 -fg > "temp_rumbo" -bi4f -bof
gmt rose "temp_rumbo" -bi2f -Gorange@40 -A3r -S5cn -D -JX10c -R$Dominio -T -F
gmt end
EOF
# 3. Scripts posterior
# ------------------------------------
cat << EOF > post.sh
gmt begin Mapa png
gmt basemap -R$REGION -J$PROJ -Bafg1
gmt makecpt -T-11000,0,9000 -Cdodgerblue2,white
gmt grdimage $DEM -C -I+nt1.2 -Q
# Dibujar Diagramas de Rosas Encima
gmt image Prueba_00.eps -Dg-70.5/-55.5+jcM -W3c
gmt image Prueba_01.eps -Dg-69.5/-55.5+jcM -W3c
gmt image Prueba_02.eps -Dg-68.5/-55.5+jcM -W3c
gmt end
EOF
# ----------------------------------------------------------------------------------------------------------
gmt batch main.sh -Sbpre.sh -Sfpost.sh -TSR.txt+w"\t" -N$title