You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As it stands, the file sasdata/data_util/manipulations.py is in a very disorderly state. Many of the variables are badly named, large parts of code duplicates functionality, and several bits of code are either obsolete or are not reached in runtime.
The biggest problem however is that each of the averagers goes about its job in a slightly unique way. This makes any future overhauls (such as fractional binning) exponentially more difficult to implement. The abstract methodology behind each of the slicers is fairly universal however, so there should be plenty of opportunity for generalisation and simplification with some restructuring of the classes.
Describe the solution you'd like
Broadly speaking, the data processors in manipulations.py fit into two categories: the whole-region type and the directional type. The whole-region type includes Boxsum and Boxavg currently, but with a successfully generalised method it should be easy to add more of this type with various shaped ROIs (regions of interest). Once it has been determined what data is inside the ROI, the process for calculating sums and averages should be universal. The directional type includes all of the others, which return a Data1D object instead of a numerical result. These have the common feature of averaging the intensity along one coordinate axis, returning data to be plotted against the other. This type can be sub-categorised into ones which specify the ROI limits using Cartesian coordinates (SlabX and SlabY) and ones which use polar coordinates (all the rest). There is further subdivision of the polar kind into Q averagers and Phi averagers, as well as those which use the whole range of a given coordinate axis, or a user-specified region.
The aim is a class structure which reflects the hierarchy described above, using methods which are common between subclasses wherever possible. The rewrite should keep future overhauls to binning in mind, as binning depends heavily on the ROI geometry.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
As it stands, the file
sasdata/data_util/manipulations.py
is in a very disorderly state. Many of the variables are badly named, large parts of code duplicates functionality, and several bits of code are either obsolete or are not reached in runtime.The biggest problem however is that each of the averagers goes about its job in a slightly unique way. This makes any future overhauls (such as fractional binning) exponentially more difficult to implement. The abstract methodology behind each of the slicers is fairly universal however, so there should be plenty of opportunity for generalisation and simplification with some restructuring of the classes.
Describe the solution you'd like
Broadly speaking, the data processors in
manipulations.py
fit into two categories: the whole-region type and the directional type. The whole-region type includesBoxsum
andBoxavg
currently, but with a successfully generalised method it should be easy to add more of this type with various shaped ROIs (regions of interest). Once it has been determined what data is inside the ROI, the process for calculating sums and averages should be universal. The directional type includes all of the others, which return a Data1D object instead of a numerical result. These have the common feature of averaging the intensity along one coordinate axis, returning data to be plotted against the other. This type can be sub-categorised into ones which specify the ROI limits using Cartesian coordinates (SlabX
andSlabY
) and ones which use polar coordinates (all the rest). There is further subdivision of the polar kind into Q averagers and Phi averagers, as well as those which use the whole range of a given coordinate axis, or a user-specified region.The aim is a class structure which reflects the hierarchy described above, using methods which are common between subclasses wherever possible. The rewrite should keep future overhauls to binning in mind, as binning depends heavily on the ROI geometry.
The text was updated successfully, but these errors were encountered: