fusion-flap / flap

Fusion Library of Analysis Programs
MIT License
11 stars 5 forks source link

Multiple units in a single dataobject #80

Closed thelampire closed 4 years ago

thelampire commented 4 years ago

I would like to put Thomson data into FLAP which has temperature, pressure and density in it as a function of radial coordinates and time. Also, there is error present for each dataset. Obviously these have different units and I believe it is not supported to put a list of flap.Unit into the units. Is it possible to put these into a single flap.DataObject or do I have to create a separate one for each?

thelampire commented 4 years ago

Another question regarding the Thomson data: If I have error associated with the data and I do some slicing where interpolation is involved, do I get interpolated errors, as well?

sandorzoletnik commented 4 years ago

You have to created multiple data objects as the temperature and density data have different units. You can save multiple data objects in a single save file so as to keep them together in one file.

Concerning handling of error during interpolation, it is indeed interpolated the save way as the data.

thelampire commented 4 years ago

Thank you for the answer. I realized that the error was interpolated, it is working great.

I think this is something which could be implemented. There could already be multiple channels in the data object (e.g. BES data), but since that has the same unit, it doesn't create a problem. The data_unit could be a list of units corresponding to each signal. I think there are several cases where this could be useful, like this Thomson data or EFIT or wherever the coordinates are the same, but some derived units aren't. What do you think?

sandorzoletnik commented 4 years ago

I would rather go for some compound object, which is is a collection (dictionary?) of data objects. The question is what are the common features in these objects? In case of TS only the spatial coordinate. This means these data objects would share some coordinates. If these are all put in one data objects a lot of concepts would fail. Eg. how do you plot then, which one? Maybe one could have a hierarchical structure of objects like data object, coordinate, ... But this all leads to a lot of changes. If we just define a dictionary of data objects it would be relatively easy to change the processing routines.

thelampire commented 4 years ago

I think this should be closed as we discussed it thoroughly and we concluded that no modification is going to be implemented.