Trying to append values to a dataset I need to create a blank xarray dataset with two+ dimensions where one is fixed and the other is incrementing to two+ output sets
The code example is something like
import numpy as np
import xarray as xr
#fixed coordinte diminsion
time=np.linspace(0, 4*np.pi)
#dummy data to insert
#ith is the moving coordainte
amp={i:i*np.sin(time) for i in range(0, 10)}
phase={i:i*np.cos(time) for i in range(0, 10)}
#create the xr dataset
Data=xr.Dataset(coords={'time':time, 'ith':0})
#create the holding loctions to incoming data
Data['amp']=None; Data['phase']=None
#now need to increase i in the dataset and append data
#and this is where I am stuck
for i in range(0, 10):
Data['amp'].loc[dict(ith=i)]=amp[i]
Data['phase'].loc[dict(ith=i)]=phase[i]
This would be useful for taking data from a weather sensor over 24hours each day of the year and appending to the dataset