I have a nc file consisting of temperature data. I want to extract the temperature for a date range of May 30th to August 18th for the years 2001 to 2018. The time variable is in the following format 2001-01-23
. I do not mind if it is in Python
or cdo
. My data overall looks like this:
<xarray.Dataset>
Dimensions: (crs: 1, lat: 9, lon: 35, time: 6574)
Coordinates:
* lat (lat) float64 50.0 52.5 55.0 57.5 60.0 62.5 65.0 67.5 70.0
* lon (lon) float64 177.5 180.0 182.5 185.0 ... 255.0 257.5 260.0 262.5
* crs (crs) uint16 3
Dimensions without coordinates: time
Data variables:
days (time) datetime64[ns] 2001-01-01 2001-01-02 ... 2018-12-31
tmax (time, lat, lon) float32 ...
How can I for every year extract the date range mentioned above?