Windows GMT issue-project seismic data and gawk command issue

Dear all,

I am an amateur Windows GMT user. I use it frequently to plot the focal mechanisms, GPS vectors, and especially project seismic data using profiles. Previously, I had some problem with my scripts, but trying different troubleshooting (which I don’t recall at the moment) I managed to run the scripts easily within last months. Last week I learned the scripts do not run properly again, and the issue is again the “gawk” command line (the old issue). Furthermore, the “project” script strangely project a dataset but yields nothing on another dataset with a similar format.

Thank you for your helps in advance.
Aram Fathian

Since you only informed us about your problem but didn’t provide any details (e.g. example code), there is nothing anyone can do to help you :slight_smile:

Sorry for not being informative. Here are the scripts:

psbasemap -R44.75/46.6/34/35.5 -JM10 -P2 -B0.5g10:."":WSen -K2 -Uc >
pscoast -R -J -O -K -W2 -Df -Na/1/0/0/255 -C151/219/242 -Ia/0/100/255 -Lf46.7/34.1/0.95/20+lkm >>

makecpt -Crainbow -T0/30/10 -Z > seis.cpt

rem plot earthquake epicenters:
gawk ‘{print $1,$2,$3,$4*0.05}’ Dataset-1.txt | psxy -R -J -Sc -W100/100/100 -Cseis.cpt -P -V -K -O >>

rem Project earthquake data:
project -C45.29/34.74 -E46.06/34.73 -G0.001 -N > track1.txt
psxy track1.txt -R -J -W2/100/100/100 -O -K >>
project dataset-1.txt -C45.29/34.74 -E46.06/34.73 -W-30/30 -Q > epi_profile.txt

project focal_CMT.txt -C45.29/34.74 -E46.06/34.73 -W-30/30 -Q > profile_CMT.txt

echo 45.29 34.74 > tmp
echo 46.06 34.73 >> tmp

psxy tmp -R -J -W2,- -K -O >>
echo 45.29 34.74 A | pstext -R -J -F+f16p,1,darkgreen -G230 -K -O >>
echo 46.06 34.73 A’| pstext -R -J -F+f16p,1,darkgreen -G230 -K -O >>

rem plot cross section of the earthquakes:
psbasemap -R0/90/0/25 -JX15/-5 -BWeSn -Bxa+l"Distance (km)" -Bya+l"Depth (km)" -Y15 -K -O >>
gawk ‘{print $5,$3,$4*0.05}’ epi_profile.txt | psxy -R -JX -Sc -G0/100/255 -K -O >>
pscoupe profile_CMT.txt -R -JX13.56/-8 -Sc0.5 -Gblack -Aa45.29/34.74/46.06/34.73/90/60/0/30 -K -O >>

and the dataset format is as below:



Running the script at the moment yields only this output:

I assume you don’t actually have vertical bars between each column (since that would require awk’s -F option to deal with). You also seem to have a header record not starting with # and hence you need to skip that record with -hi1.

The column are separated by tabs. The problem is that previously the script were working perfectly with these data. but now the codes run until the “gawk” line. I guess something is missing with the software on my PC. I tried to run it on my laptop as well by installing the GMT, but still dealing with this issue. I had this issue earlier but I can’t remember how I could manage to solve it.
Last week, the codes gave provide me this plot:

Now, the same codes give me only the basemap.

If data is separated by tabs you don’t need to use awk, use -i option.
Note also that you only have 4 columns in the data but access to $5 in awk.

True, but using the “project” command to calculate the “epi_profile.txt”, the result would be more than 4 columns and to plot the cross section I need to select the 5th column (distance).
I just learned that the problem might be due to the Gnuwin32 which I couldn’t manage to install on my laptop. it was previously fixed on my PC, but to unknown reason it is now the issue again. This the error I found after running the .bat file:
“ gawk is not recognized as an internal or external”

Clear error message.

As I said, you don’t even need to use awk in this particular case. But the recommended unix environment is the one that comes with Git. I think this one

Perfect! Thanks! Now I am getting the expected results again.