Convert CSV in Netcdf4 and grids using minimun curvature methods

“I am a beginner in programming. I would like to write a GMT code that converts a CSV file to NetCDF4 and plots grids using the minimum curvature method. Here is an example of a script I have written.”

gmt xyz2grd Data.csv -Guput.nc -I0.0089/0.0089 -R12.7/15.2988/3/6.5066 -D+x"Long[degree]"+y"Lat[degree]"+z"Bouguer_Anomalies[mGal]" -JU33N/12c
gmt surface ouput.nc -R12.7/15.2988/3/6.5066 -I0.0089/0.0089 -Ghawaii_grd.nc -T0 -C0.1 -Vi

i am issues that my netcf4 is not valid, whta’s wrong

Hello @TFJospin. Welcome to the forum!

gmt surface needs a data table (not a grid). So, you could use the file Data.csv in your second command directly.

gmt surface Data.csv -R12.7/15.2988/3/6.5066 -I0.0089/0.0089 -Ghawaii_grd.nc -T0 -C0.1 -Vi