usansred package
usansred.reduce
- class usansred.reduce.Experiment(csvFilePath, logbin=False, outputFolder=None)[source]
Bases:
object
- DarwinWidth = 5.1
- logbin = False
- minQ = 1e-06
- primWave = 3.6
- reduce(outputFolder=None)[source]
Reduce the USANS data outputFolder - the result will be dumped to the output folder. If none will just use current folder return
- stepPerDec = 33
- vAngle = 0.042
- class usansred.reduce.Sample(experiment, name, startNumber, numOfScans, thickness=0.1, isBackground=False, exclude=None)[source]
Bases:
object
A scan consists of multiple experiments
- property data
- The main data from detector, stitched and normalized with monitor data,
currently the first bank detector data, scaled with monitor
- property dataReduced
Return the reduced data, this is a wrapper when one decide the stage of reduction
- dumpDataToCSV(filePath, data, title=None)[source]
Dump data to CSV file filePath - the file path to dump data - the data to dump, each key is a column. title - the colume title in list or tuple, if not specified use the key
return
- dumpReducedDataToCSV(detectorData=True, scaledData=True, logBinnedData=True, bgSubtractedData=True)[source]
Dump the data to output folder defined in experiment
- Filenames follow the legacy Igor output file names
"UN_" + sampleName + "_det_1.txt"
"UN_" + sampleName + "_det_1_lb.txt"
"UN_" + sampleName + "_det_1_lbs.txt"
Parameters
- detectorData: bool
dump detector data if True
- scaledData: bool
dump scaling data if True
- logBinnedData: bool
dump log binned data if True
- bgSubtractedData: bool
dump background subtracted data if True
- getFileNamesFromSample(sampleName)[source]
Get the reduced file names from sample name sampleName - sample name return - a list of reduced file names associated with this sample
- isBackground = False
Exclude the bad runs then keep counting
- property isLogBinned
Check if he data is log binned
- property isReduced
Check if the data is reduced
- property numOfBanks
number of banks are defined in experiment class
- property numOfLogBins
Return the size of log binnd data
- property numOfScans
- rescaleData(guess_init=False)[source]
Rescale data with thickness. Fit the I(Q) data with gaussian and calculate the peak area.
guess_init: if guess the initial value with differential_evolution return
- property size
return the length of detector data points
- property sizeReduced
The data size of reduced data
- class usansred.reduce.Scan(experiment, sample, number, isBackground=False)[source]
Bases:
object
Contains sample information
- convertXYToIQData(XYData)[source]
Convert XY data to I(Q)
Parameters
XYData: dict A dictionary of lists, XYData = {“X”: [], “Y”: [], “E”: [], “T”: []}
Returns
Dictionary of lists {“Q”: [], “I”: [], “E”: [], “T”: []}
- isBackground = False
- property numOfBanks
number of banks are defined in Experiment class
- property range
property of q range
- readXYFile(XYFilePath)[source]
Load XY File to data structure XYFilePath - the xy file path return - a dictionary of lists
- property size
Number of data points in this scan
usansred.reduce_USANS
usansred.summary
summary.py: summary of the reduced data.