Earth2Studio is now OSS!

earth2studio.statistics.weights.lat_weight#

earth2studio.statistics.weights.lat_weight(lat)[source]#

Compute the cosine-based latitude weighting for a given tensor representing latitude coordinates. The latitude coordinates are assumed to be in degrees.

Uses the formula weights = cos(lat * pi / 180.0)

Parameters:

lat (Union[np.ndarray, torch.Tensor]) – Array of latitude values, in degrees. Should be in the range [-90, 90].

Returns:

weights – Array of latitude weights, formally defined above.

Return type:

Union[np.ndarray, torch.Tensor]