cngi.image.moments

moments(xds, dv='IMAGE', moment=None, axis='chan')[source]

Collapse an n-dimensional image cube into a moment by taking a linear combination of individual planes

Note

This implementation still needs to implement additional moment codes, and verify behavior of implemented moment codes.

Parameters
  • xds (xarray.core.dataset.Dataset) – input Image Dataset

  • dv (str) – image data variable. Default is ‘IMAGE’

  • moment (int or list of ints) – number that selects which moment to calculate from the following list -1 - mean value of the spectrum (default) 0 - integrated value of the spectrum 1 - intensity weighted coordinate; traditionally used to get ’velocity fields’ 2 - intensity weighted dispersion of the coordinate; traditionally used to get ’velocity dispersion’ 3 - median of I 4 - median coordinate 5 - standard deviation about the mean of the spectrum 6 - root mean square of the spectrum 7 - absolute mean deviation of the spectrum 8 - maximum value of the spectrum 9 - coordinate of the maximum value of the spectrum 10 - minimum value of the spectrum 11 - coordinate of the minimum value of the spectrum

  • axis (str) – specified axis along which to reduce for moment generation, Default=’chan’

Returns

output Image

Return type

xarray.core.dataset.Dataset