Skip to content

Invalid Pole Cells for ne30x8 SCRIP Grid  #1190

@lantaosun

Description

@lantaosun

Version

v2025.03.0

How did you install UXarray?

Conda

What happened?

I’m testing the Uxarray zonal mean function using an Arctic-refined SE grid (ne30x8). After calling the zonal mean function, the output contains 19 values corresponding to latitudes from -90° to 90° at 5-degree intervals. However, the zonal mean values for surface air temperature at both the North and South Poles are zero, which seems odd. At other latitudes, the values are all above 250 K, which are reasonable for a temperature field.

Image

What did you expect to happen?

I was expecting values above 250 K. However, I understand that since the grid does not extend all the way to 90°N and 90°S, there may be no data at the poles, which could explain the zero values. One way to address this is to manually specify the latitude range—for example, using .zonal_mean(lat=(-85, 85, 5))—to avoid including the poles. That said, it might be helpful if the default behavior started slightly below 90°N/S to avoid this issue altogether.

Can you provide a MCVE to repoduce the bug?

# Recognition of unstructured grids and data handling
import uxarray as ux

# General Plotting
import cartopy.crs as ccrs

# Plotting with HoloViz
import holoviews as hv

# import hvplot.pandas
import geoviews.feature as gf

import numpy as np

file_dir = "/glade/derecho/scratch/lantao/Uxarray/"

grid_dir = "/glade/derecho/scratch/lantao/Uxarray/"

grid_file = "PAMIP_ne30x8_np4_SCRIP.nc"

data_file = "f.e22.F2000climo.ne30x8_mt12.preindustrial.100.cam.h1.0002-01.nc"

ds = ux.open_dataset(grid_dir + grid_file, file_dir + data_file)

zonal_mean_trefht = ds["TREFHT"][0].zonal_mean()

(zonal_mean_trefht.plot.line() * zonal_mean_trefht.plot.scatter(color="red")).opts(
    title="Zonal Average Plot (Default)", xticks=np.arange(-90, 100, 20), xlim=(-95, 95)
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions