lanl / fiducia

An open source package for DANTE signal analysis using the cubic spline unfold method.
Other
5 stars 4 forks source link

Dot product behavior in xarray differs from numpy #28

Open pmk-LANL opened 3 years ago

pmk-LANL commented 3 years ago

This is relevant to substituting xarray for certain multi-dimensional array operations instead of using numpy arrays with for-loops. Apparently dot product behavior of xarray is different from that of numpy.

detArrInv.dot(signalsy0), where signalsy0 is a 1D numpy array, returns a different result depending on if detArrInv is a 2D numpy.ndarray or a xarray.DataArray. However, np.dot(detArrInv, signalsy0) returns the same result. I found this while transitioning to xarray, it caused a lot of headache. Will look into this further, but on first pass of the documentation I can't find any indication that there should be a difference when dotting 1D arrays.