Hi!
I started using GMT lately, so I am absolutely a beginner. I was thinking about using GMT for visualizing our modelled, gridded datasets, which have netCDF format.
I ran into a problem referring to wrong grid spacing recognition of GMT. However I guess the problem is rather with the definition of the dimension of the netCDF variables I’d like to draw. My dataset has a spatial resolution of 0.1°.
In the netCDF file the dimension of the variable is given in number of gridcells (in west_east and south_north directions), and I have the longitude and latitude information as separate variables.
The domain is: 14E-25E, 45N-50N. I am looking for some kind of help, maybe somebody knows how to “tell” GMT that my netCDF file has 110x51 cells but with resolution of 0.1° on the given domain. I copy ncdump -h and grdinfo -F
informations about an example file.
Informations: this file (out.2019123100_2020010100_eves.nc) here is a raw CHIMERE model output, we usually select the first level, and perform some time averaging and are interested in the air pollutants like CO, NO2 and so on.
ncdump -h out.2019123100_2020010100_eves.nc
netcdf out.2019123100_2020010100_eves {
dimensions:
Time = UNLIMITED ; // (25 currently)
DateStrLen = 19 ;
west_east = 111 ;
south_north = 51 ;
bottom_top = 10 ;
vcoord_dim = 10 ;
wavelength_dim = 5 ;
nbins = 10 ;
ninterv = 11 ;
variables:
double lon(south_north, west_east) ;
lon:units = “degrees_east” ;
lon:long_name = “Longitude” ;
double lat(south_north, west_east) ;
lat:units = “degrees_north” ;
lat:long_name = “Latitude” ;
double a_vcoord(vcoord_dim) ;
a_vcoord:units = “no_units” ;
a_vcoord:long_name = “A_sigma_coefficient” ;
double b_vcoord(vcoord_dim) ;
b_vcoord:units = “no_units” ;
b_vcoord:long_name = “B_sigma_coefficient” ;
double cut_off_diameters(ninterv) ;
cut_off_diameters:units = “meters” ;
cut_off_diameters:long_name = “cut_off_diameters” ;
double mmd(nbins) ;
mmd:units = “meters” ;
mmd:long_name = “Mean_Mass_Median_Diameters” ;
float wavelength(wavelength_dim) ;
wavelength:units = “nm” ;
wavelength:long_name = “Wavelength” ;
char Times(Time, DateStrLen) ;
Times:units = “Date string” ;
Times:long_name = “WRF-style Times” ;
float O3(Time, bottom_top, south_north, west_east) ;
O3:units = “ug/m3” ;
O3:long_name = “O3 Concentration” ;
float NO2(Time, bottom_top, south_north, west_east) ;
NO2:units = “ug/m3” ;
NO2:long_name = “NO2 Concentration” ;
float NO(Time, bottom_top, south_north, west_east) ;
NO:units = “ppb vol” ;
NO:long_name = “NO Concentration” ;
float PAN(Time, bottom_top, south_north, west_east) ;
PAN:units = “ppb vol” ;
PAN:long_name = “PAN Concentration” ;
float HNO3(Time, bottom_top, south_north, west_east) ;
HNO3:units = “ppb vol” ;
HNO3:long_name = “HNO3 Concentration” ;
float H2O2(Time, bottom_top, south_north, west_east) ;
H2O2:units = “ppb vol” ;
H2O2:long_name = “H2O2 Concentration” ;
float HONO(Time, bottom_top, south_north, west_east) ;
HONO:units = “ppb vol” ;
HONO:long_name = “HONO Concentration” ;
float SO2(Time, bottom_top, south_north, west_east) ;
SO2:units = “ug/m3” ;
SO2:long_name = “SO2 Concentration” ;
float CO(Time, bottom_top, south_north, west_east) ;
CO:units = “ppb vol” ;
CO:long_name = “CO Concentration” ;
…
grdinfo -F out.2019123100_2020010100_eves.nc?PM10
out.2019123100_2020010100_eves.nc: Title: PM10 Concentration
out.2019123100_2020010100_eves.nc: Command: File /vol4/home/lazar_k/chimere2017/BIGFILES/OUTPUTS/changed_emission/eves/rundir/out.2019123100_2020010100_eves.nc was generated on Wed Sep 23 07:42:49 2020 by lazar_k on ucs02.met.hu
out.2019123100_2020010100_eves.nc: Remark:
out.2019123100_2020010100_eves.nc: Gridline node registration used
out.2019123100_2020010100_eves.nc: Grid file format: nf (# 18) GMT netCDF format (float) (COARDS-compliant) [DEFAULT]
out.2019123100_2020010100_eves.nc: x_min: 0.0000000
out.2019123100_2020010100_eves.nc: x_max: 110.0000000
out.2019123100_2020010100_eves.nc: x_inc: 1.0000000
out.2019123100_2020010100_eves.nc: name: ▒▒
out.2019123100_2020010100_eves.nc: nx: 111
out.2019123100_2020010100_eves.nc: y_min: 0.0000000
out.2019123100_2020010100_eves.nc: y_max: 50.0000000
out.2019123100_2020010100_eves.nc: y_inc: 1.0000000
out.2019123100_2020010100_eves.nc: name: ▒▒
out.2019123100_2020010100_eves.nc: ny: 51
out.2019123100_2020010100_eves.nc: zmin: -nan
out.2019123100_2020010100_eves.nc: zmax: -nan
out.2019123100_2020010100_eves.nc: name: PM10 Concentration [ug/m3]
out.2019123100_2020010100_eves.nc: scale_factor: 1 add_offset: 0
I could plot a variable with grdimage on a nice map, but it looks like the grid spacing is 1° and not 0.1°. Is there a way, without interpolation, to change the grid spacing with/within GMT commands?
I use GMT version 4.5.15. (I know it is not the most up-to-date version, but that is what we have at my workplace at the moment.)
Thanks in advance for your help, ideas.
Regards,
Anita