You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the axis of differentiation has units (equivalent to) radians, the differential operators curl_xy, div_xy, grad_xy, and laplacian_xy display an inapproriate radian-1 or radian-2 component to the returned Field units. E.g.
>>>importcf>>>f=cf.example_field(0)
>>>f.grad_xy(radius='earth') # WRONG
[<CFField: long_name=Xgradientofspecific_humidity(latitude(5), longitude(8)) m-1.rad-1>,
<CFField: long_name=Ygradientofspecific_humidity(latitude(5), longitude(8)) m-1.rad-1>]
>>># SHOULD BE#[<CF Field: long_name=X gradient of specific_humidity(latitude(5), longitude(8)) m-1>,# <CF Field: long_name=Y gradient of specific_humidity(latitude(5), longitude(8)) m-1>]
Units of radian are dimensionless, and in the context of these operators it is misleading for them to appear in the output. For instance, the curl of the horizontal wind fields in spherical polar corodinates should have units of s-1 (i.e. relative vorticity), not "s-1.radian-1".
The agreed solution is to provide an option to Field.derivative that just pretends that the coordinates along the axis of differentiation are dimensionless (i.e. have units of 1) when instructed to do so with a keyword argument.
The text was updated successfully, but these errors were encountered:
The agreed solution is to provide an option to Field.derivative that just pretends that the coordinates along the axis of differentiation are dimensionless (i.e. have units of 1) when instructed to do so with a keyword argument.
Good write up thanks and yes, this is how I interpreted our agreed solution.
When the axis of differentiation has units (equivalent to) radians, the differential operators
curl_xy
,div_xy
,grad_xy
, andlaplacian_xy
display an inapproriateradian-1
orradian-2
component to the returned Field units. E.g.Units of
radian
are dimensionless, and in the context of these operators it is misleading for them to appear in the output. For instance, the curl of the horizontal wind fields in spherical polar corodinates should have units ofs-1
(i.e. relative vorticity), not "s-1.radian-1".The agreed solution is to provide an option to
Field.derivative
that just pretends that the coordinates along the axis of differentiation are dimensionless (i.e. have units of1
) when instructed to do so with a keyword argument.The text was updated successfully, but these errors were encountered: