Data does not plot.
spd = np.sqrt( iced.uvel.values**2 + iced.vvel.values**2 )
spd[spd>5] = np.nan
P_save = os.path.join(D_save,"0p1","19971001_ice_speed.png")
da = xr.DataArray(data=spd, dims=["y", "x"], coords=dict(lon=(["y","x"], np.abs(ULON)), lat=(["y","x"], ULAT)))
print(da)
print(f"min: {da.min()}")
print(f"max: {da.max()}")
fig = pygmt.Figure()
pygmt.makecpt(cmap="cmocean/speed", series=[0, 1.6, .05])
fig.coast(region=[0,360,-90,-50], projection="S0/-90/12c", frame="ag", land="gray")
fig.grdimage( grid=da, projection="S0/-90/12c", frame=["WSrt+tice speed", "xa0.1", "ya0.1"], cmap=True )
fig.show()
<xarray.DataArray (y: 2700, x: 3600)>
array([[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]])
Coordinates:
lon (y, x) float64 279.9 279.8 279.7 279.6 … 80.0 80.0 80.0 80.0
lat (y, x) float64 -81.09 -81.09 -81.09 -81.09 … 65.08 65.04 64.99
Dimensions without coordinates: y, x
min: <xarray.DataArray ()>
array(0.)
max: <xarray.DataArray ()>
array(1.59320265)
makecpt [WARNING]: cmocean/speed is a discrete CPT. You can stretch it (-T/) but not interpolate it (-T//).
makecpt [WARNING]: Selecting the given range and ignoring the increment setting.
grdimage [WARNING]: Your grid y’s or latitudes appear to be outside the map region and will be skipped.
grdimage [WARNING]: No grid or image inside plot domain