-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Most of the processing currently consists of functions that take in a xr.DataArray and output a processed xr.DataArray. This process is not very consistent: in some cases the input DataArray is itself is modified and then returned; in other cases a new DataArray is created, filled with modified data from the original DataArray, and then returned. This makes it really difficult to track what is going on at each step of the process.
I recommend we make a child class ctdArray(xr.DataArray) that inherits all of the nice properties of xr.DataArrayss but for which we can define additional methods. Then, each of the processing steps will be a method of that class, e.g. cleanup(self).
A co-benefit of this approach is that all of the meta-data can be directly stored in the data attributes and so the output will contain a record of the exact parameter values and function calls used to produce the output (basically a "log" within the data file itself).
I'll see if I can get some version of this working in the next few days. It will probably be a breaking change but one that is definitely worth it.