nctoolkit.DataSet.centre#
- DataSet.centre(by='latitude', by_area=False)#
centre: Calculate the latitudinal or longitudinal centre for each year/month combination in files.
This applies to each file in an ensemble.
- Parameters:
by (str) – Set to ‘latitude’ if you want the latitudinal centre calculated. ‘longitude’ for longitudinal.
by_area (bool) – If the variable is a value/m2 type variable, set to True, otherwise set to False.
Examples
If you want to calculate the latitudinal centre of a variable, accounting for grid cell area, you can do the following: >>> ds.centre(by=’latitude’, by_area=True)
If you want to calculate the longitudinal centre of a variable, you can do the following: >>> ds.centre(by=’longitude’, by_area=True)