How can I change the data in lat lon and time format so that I can make a spatial map

Usually we make spatial plots by : h=pcolor(LON,LAT,Data); in this format. But in the new data, they have XC and YC, the projections in the x axis and the y axis. I want to plot the ice_conc variable here from the attached datafile. But I cannot use the present code or the pcolor function as the ice_conc has the form XC x YC x time format, not the lat x lon x time format.
How can I change the ice_conc in lat lon and time format so that I can make a spatial map

Answers (1)

The ncfile has lon and lat information.
ncfile = 'ice_conc_nh_ease2-250_icdr-v2p0_202108011200.nc';
lon = ncread(ncfile,'lon') ;
lat = ncread(ncfile,'lat') ;
xc = ncread(ncfile,'xc') ;
yc = ncread(ncfile,'yc') ;
ice_conc = ncread(ncfile,'ice_conc');
pcolor(lon,lat,ice_conc');
shading interp
colorbar

7 Comments

But the ice concentration is in the form of xc yc and time. So when I make a plot with pcolor(lon,lat,ice_conc'), it is not giving actual result.
Then how about
pcolor(xc,yc,ice_conc');
shading interp
colorbar
I want to plot it in geoshow. So I want the ice_conc should change into lat x lon x time. Not the xc x yx x time.
time
Size: 1x1
Dimensions: time
Datatype: double
Attributes:
units = 'seconds since 1978-01-01 00:00:00'
long_name = 'reference time of product'
standard_name = 'time'
axis = 'T'
calendar = 'standard'
bounds = 'time_bnds'
xc
Size: 432x1
Dimensions: xc
Datatype: double
Attributes:
units = 'km'
long_name = 'x coordinate of projection (eastings)'
standard_name = 'projection_x_coordinate'
yc
Size: 432x1
Dimensions: yc
Datatype: double
Attributes:
units = 'km'
long_name = 'y coordinate of projection (northings)'
standard_name = 'projection_y_coordinate'
ice_conc
Size: 432x432x1
Dimensions: xc,yc,time
Datatype: int32
Attributes:
_FillValue = -32767
long_name = 'fully filtered concentration of sea ice using atmospheric correction of brightness temperatures and open water filters'
standard_name = 'sea_ice_area_fraction'
units = '%'
valid_min = 0
valid_max = 10000
grid_mapping = 'Lambert_Azimuthal_Grid'
coordinates = 'time lat lon'
ancillary_variables = 'total_standard_error status_flag'
scale_factor = 0.01
comment = 'this field is the primary sea ice concentration estimate for this climate data record'
You can try out the function km2deg to resolve this issue:
https://in.mathworks.com/help/map/ref/km2deg.html

Sign in to comment.

Asked:

on 25 Aug 2022

Commented:

on 22 Sep 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!