usnistgov / PyHyperScattering

Tools for hyperspectral x-ray and neutron scattering data loading, reduction, slicing, and visualization.
Other
8 stars 9 forks source link

refactor: add RSoXS package to array using register_dataarray_accessor and register_dataset_accessor #13

Open pbeaucage opened 3 years ago

pbeaucage commented 3 years ago

this page details how to register functions as xarray accessors, so that we can just do something to the effect of

import PyHyperScattering.util.RSoXS

array = loader.load(whatever args)

array.rsoxs_ar(chi_width=0)
pbeaucage commented 3 years ago

the syntax is actually array.rsoxs.AR(), but it works.

to-do before closing: update documentation and tutorials to correctly cover this.