I have two files in NetCDF4 (latlon and other file without latlon).
I open the two files in the same code and I choose one variable and the two variable lon and lat.
When I write lon I have the value nan
and I don't know why.
The two files have same dimensions (size) and same dimensions for variables all I need is to show the value of lat&lon when I open the two files. How can I do it?
In [54]: import numpy as np
...: import netCDF4
...:
...:
...: fic1='/data/latlon_+000.0_globe.nc'
...:
...: nc1 = netCDF4.Dataset(fic1,'r')
...:
...: lon = nc1.variables['lon'][:]
...: lat = nc1.variables['lat'][:]
...:
...: fic='/data/Mmultic3kmNC4_msg04_201905080200
...: .nc'
...:
...:
...: nc = netCDF4.Dataset(fic,'r')
...: IR=nc.variables['IR_108'][:]
...:
...:
In [55]:
In [55]: lon
Out[55]:
masked_array(
data=[[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]],
mask=False,
fill_value=1e+20,
dtype=float32)
In [56]: lat
Out[56]:
masked_array(
data=[[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]],
mask=False,
fill_value=1e+20,
dtype=float32)
In [57]:
How I can get value of lat & lon?