Skip to content

Scale gradient and curl by grid sphere radius #1516

@rajeeja

Description

@rajeeja

gradient() and curl() compute derivatives on UXarray's internal unit sphere.

For grids with a physical sphere_radius, returned derivatives should scale back by that radius by default.

Current workaround:

curl_data = u.curl(v)
curl_physical = curl_data / uxds.uxgrid.sphere_radius
curl_physical.attrs["units"] = "1/s"

Proposed:

curl_physical = u.curl(v)  # scales by uxgrid.sphere_radius when present
curl_unit = u.curl(v, scale_by_radius=False)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
📚 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions