pmb399 / H5Analysis

This is a library to analyse, plot, and export HDF5 data
https://h5analysis.readthedocs.io/latest/index.html
MIT License
1 stars 0 forks source link

[Feature] Do math of 1D object resulting from Object2dReduce #14

Closed boykocls closed 8 months ago

boykocls commented 8 months ago

Currently, it is not possible do math on the 1D object directly. kwargs are also not possible.

pmb399 commented 8 months ago

We can now apply math through keyword arguments to the reduced 1d object. Let me know if we need to also work on a parser but this may be a little more challenging when trying to maintain syntax. I will close this for now but feel free to reopen.

    def apply_kwargs(self,norm=False, xoffset=None, xcoffset=None, yoffset=None, ycoffset=None, grid_x=[None, None, None], savgol=None, binsize=None):
        """ Apply math to 1d reduced objects

            kwargs:
                norm: boolean
                    normalizes to [0,1]
                xoffset: list
                    fitting offset (x-stream)
                xcoffset: float
                    constant offset (x-stream)
                yoffset: list
                    fitting offset (y-stream)
                ycoffset: float
                    constant offset (y-stream)
                grid_x: list
                    grid data evenly with [start,stop,delta]
                savgol: tuple
                    (window length, polynomial order, derivative)
                binsize: int
                    puts data in bins of specified size
        """