We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Anders Eriksson • 5 years ago

Hi!
What is the syntax of adding attributes to the coordinates in the dict format above?
Thanks,
Anders

Mat • 5 years ago

That's a good question, not sure how to do this all at once. But I usually add attributes to coordinates like time afterwards with:

ds['time'].encoding = { 'units' : 'seconds since 2000-01-01 00:00',
'calendar' : 'standard',
'dtype' : 'i8'
}

Anders Eriksson • 5 years ago

Hi Mat! Thank you for a fast response!
I finally found an example in the documentation;
for
coords = {'time': times},
it can be like this
coords = {'time': ('time',times, {'unit':'[s]'} ) },

But I think your way of adding them is better and easier to understand

I am new to xarray and right now I am trying to understand the best way to organize my measured signals (y(t) oscilloscope signals) for simplified analysis, torque-signal, positional-signal (that can be derivatived to get the speed), electrical signals and internal control signals.

all these signals will be stored for each combination of parameter changes (2 parameters).
For traceability and to be able to "vector-select" ,I think it will be good to have a variable; "capture_time" with the 2 par as coordinates that store the timestamp of when each group of signals where captured.

I have searched for examples but haven't found any for mechanical/electrical engineering.
Only alot of geo-sience examples.
Can you share any of yours or do you know of some good link?
Thanks,
Anders