Intro:
i am working with the GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc file which has 192 levels (z_levels) each for monthly solution (indicated as days since 01-01-2002). Important: NOT all month all included.
My problem:
I managed to get a map. On it I indicate the layer number but I would like to plot the date instead (month-year). How can I do it? Thanks in advance.
What I try:
1. gdalinfo
I run
gdalinfo NETCDF:"GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc":lwe_thickness
An I get the info of all the bands (below an extract of band 1).
Band 1 Block=720x1 Type=Float64, ColorInterp=Undefined
NoData Value=-99999
Unit Type: cm
Metadata:
comment=Coastline Resolution Improvement (CRI) filter is applied
coordinates=time lat lon
grid_mapping=WGS84
long_name=Liquid_Water_Equivalent_Thickness
NETCDF_DIM_time=106.5
NETCDF_VARNAME=lwe_thickness
standard_name=Liquid_Water_Equivalent_Thickness
units=cm
valid_max=778.7073956181606
valid_min=-1719.85936245136
_FillValue=-99999
There is a field with the information of time that I need (NETCDF_DIM_time). How can I get that value (106.5)?
2. grdinfo:
I try using grdinfo to extract the info. If I run
gmt grdinfo GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc?lwe_thickness -Q
I get all the z-levels (but I can find a way to get only the value corresponding to the layer that I want to plot).
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Title: JPL GRACE and GRACE-FO MASCON RL06Mv2 CRI
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Command: GRACE and GRACE-FO JPL RL06Mv2-CRI
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Remark:
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Gridline node registration used [Geographic grid]
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Grid file format: nd = GMT netCDF format (64-bit float), CF-1.7
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: x_min: 0.25 x_max: 359.75 x_inc: 0.5 (30 min) name: longitude n_columns: 720
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: y_min: -89.75 y_max: 89.75 y_inc: 0.5 (30 min) name: latitude n_rows: 360
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: z_min: 106.5 z_max: 6924.5 z_inc: (variable) name: time [days since 2002-01-01T00:00:00Z] n_levels: 192
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: z_levels: 106.5, 129.5, 227.5, 258, 288.5, 319, 349.5, 380.5, 410, 439.5, 470, 495.5, 561.5, 592.5, 623, 653, 684, 714.5, 736.5, 777, 805.5, 836, 866.5, 897, 927.5, 958.5, 989, 1019.5, 1050, 1080.5, 1111.5, 1141, 1170.5, 1201, 1231.5, 1262, 1292.5, 1323.5, 1354, 1384.5, 1415, 1445.5, 1476.5, 1506, 1535.5, 1566, 1596.5, 1627, 1657.5, 1688.5, 1719, 1749.5, 1780, 1810.5, 1841.5, 1871, 1900.5, 1931, 1961.5, 1992, 2022.5, 2053.5, 2084, 2114.5, 2145, 2175.5, 2206.5, 2236.5, 2266.5, 2297, 2327.5, 2358, 2388.5, 2419.5, 2450, 2480.5, 2511, 2541.5, 2572.5, 2602, 2631.5, 2662, 2692.5, 2723, 2753.5, 2784.5, 2815, 2845.5, 2876, 2906.5, 2937.5, 2967, 2996.5, 3027, 3057.5, 3088, 3118.5, 3149.5, 3180, 3210.5, 3241, 3269.5, 3335.5, 3361.5, 3392, 3422.5, 3485.5, 3514.5, 3545, 3575.5, 3591.5, 3652, 3667.5, 3697.5, 3727.5, 3746.5, 3819, 3849.5, 3880.5, 3908, 3974.5, 4002.5, 4033.5, 4062, 4128, 4153.5, 4184, 4214.5, 4306.5, 4337, 4367.5, 4391.5, 4457.5, 4488, 4518.5, 4546, 4610.5, 4641, 4671.5, 4703, 4769.5, 4793, 4822.5, 4853, 4864, 4943.5, 4975.5, 5004.5, 5104.5, 5128.5, 5157, 5188.5, 5253, 5280, 5309.5, 5346.5, 5444.5, 5471.5, 5499, 5568.5, 5592.5, 5610.5, 5640, 6010, 6034, 6147.5, 6163, 6193.5, 6224.5, 6253, 6283.5, 6314, 6344.5, 6375, 6405.5, 6436.5, 6467, 6497.5, 6528, 6558.5, 6589.5, 6619.5, 6649.5, 6680, 6710.5, 6741, 6771.5, 6802.5, 6833, 6863.5, 6894, 6924.5
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: v_min: -89.75 v_max: 89.75 name: Liquid_Water_Equivalent_Thickness [cm]
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: scale_factor: 1 add_offset: 0
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: format: classic
3. grdinfo on layer
However. f I run grdinfo on a paritcular layer there is NO information about the date:
gmt grdinfo GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc?lwe_thickness[1]
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Title: JPL GRACE and GRACE-FO MASCON RL06Mv2 CRI
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Command: GRACE and GRACE-FO JPL RL06Mv2-CRI
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Remark:
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Gridline node registration used [Geographic grid]
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: Grid file format: nd = GMT netCDF format (64-bit float), CF-1.7
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: x_min: 0.25 x_max: 359.75 x_inc: 0.5 (30 min) name: longitude n_columns: 720
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: y_min: -89.75 y_max: 89.75 y_inc: 0.5 (30 min) name: latitude n_rows: 360
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: v_min: -89.75 v_max: 89.75 name: Liquid_Water_Equivalent_Thickness [cm]
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: scale_factor: 1 add_offset: 0
GRCTellus.JPL.200204_202012.GLO.RL06M.MSCNv02CRI.nc: format: classic