예제 #1
0
def test_Convert_binning():
    subprocess.check_output(['MJOLNIRConvert', dataFiles[0]])
    f = DataFile.DataFile(dataFiles[0].replace('hdf', 'nxs'))
    assert (f.binning == 8)
    subprocess.check_output(['MJOLNIRConvert', dataFiles[0], '-b 1'])
    f = DataFile.DataFile(dataFiles[0].replace('hdf', 'nxs'))
    assert (f.name == dataFiles[0].split('/')[1].replace('hdf', 'nxs'))
    assert (f.binning == 1)
예제 #2
0
def test_Convert_SaveLocation():
    if not os.path.isdir('Data/Data'):
        os.makedirs('Data/Data')
    subprocess.check_output(['MJOLNIRConvert', dataFiles[0], '-s Data/'])
    fileName = dataFiles[0].split('/')[1].replace('hdf', 'nxs')
    f = DataFile.DataFile('Data/' + fileName)

    assert (f.binning == 8)
    print(fileName)
    print(f.name)
    assert (f.name == fileName)
예제 #3
0
def test_Convert_SaveLocation():
    if not os.path.isdir(os.path.join('Data','Data')):
          os.makedirs(os.path.join('Data','Data'))
    subprocess.check_output(['MJOLNIRConvert',dataFiles[0],'-s Data'+os.path.sep])
    fileName = dataFiles[0].split(os.path.sep)[1].replace('hdf','nxs')
    f = DataFile.DataFile('Data'+os.path.sep+fileName)
    
    assert(f.binning == 8)
    print(fileName)
    print(f.name)
    assert(f.name == fileName)
    os.remove('Data'+os.path.sep+fileName.replace('hdf','nxs'))
_tools.updateSetting(settingsName, directory)

plot = args.plotList
binning = args.binning

argsIdx = []

booleanList = np.zeros((len(PlotType)), dtype=bool)
for arg in plot:
    argsIdx.append(switch(arg))

argsIdx = np.unique([x for x in argsIdx if x is not None])

booleanList[np.array(argsIdx)] = True

File = DataFile.DataFile(file)

for id in argsIdx:
    if PlotType[id] == 'A4':

        File.plotA4(binning=binning)

    if PlotType[id] == 'Normalization':
        File.plotNormalization(binning=binning)

    if PlotType[id] == 'Ef':
        File.plotEf(binning=binning)

    if PlotType[id] == 'EfOverview':
        File.plotEfOverview(binning=binning)