My time serries data is a xarray' DataArray object called da_output_halfyearly:
<xarray.DataArray '__xarray_dataarray_variable__' (time: 10, latitude: 106, longitude: 193)>
dask.array<shape=(4, 106, 193), dtype=int32, chunksize=(2, 106, 193)>
Coordinates:
* latitude (latitude) float32 -39.2 -39.149525 ... -33.950478 -33.9
* longitude (longitude) float32 140.8 140.84792 140.89584 ... 149.95209 150.0
* time (time) datetime64[ns] 1972-01-01 1972-07-01 1973-01-01 1973-07-01 ... 1981-01-01 1981-07-01
I will need to group/resample the data into two time groups "yyyy-01-01" and "yyyy-07-01" and take std() off the data in each group.
I was able to use index selecting to split the data into two separate DataArray objects:
da_all_jan_jun = da_output_halfyearly[::2]
da_all_jul_dec = da_output_halfyearly[1::2]
da_jan_jun_std = da_all_jan_jun.std(dim='time')
da_jul_dec_std = da_all_jul_dec.std(dim='time')
However, the output DataArray objects lost the time dimension.