Due to maintenance reasons, gitlab.gwdg.de will not be available on Saturday 2021-07-24 from 10:30 to approximately 11:30 CEST.

Commit a897a375 authored by Schellhorn's avatar Schellhorn
Browse files

changed reference to the Data Folder globally

parent e1f59dbb
......@@ -69,7 +69,7 @@ A concrete experiment class needs to override the
GetData.getData('Phase')
print('Loading data file CDI_intensity')
f = loadmat('../InputData/Phase/CDI_intensity.mat')
f = loadmat(datadir/'Phase'/'CDI_intensity.mat')
# diffraction pattern
dp = f['intensity']['img'][0, 0]
orig_res = max(dp.shape[0], dp.shape[1]) # actual data size
......
......@@ -6,6 +6,7 @@ from proxtoolbox.utils.graphics import addColorbar
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
import numpy as np
from scipy.io import loadmat
......@@ -74,7 +75,7 @@ class ART_Experiment(Experiment):
# load data
if not self.silent:
print('Loading data file ART_SheppLogan.mat ')
data_Shepp = loadmat('../InputData/CT/ART_SheppLogan.mat')
data_Shepp = loadmat(datadir/'CT'/'ART_SheppLogan.mat')
N = data_Shepp['N'].item()
p = data_Shepp['p'].item()
theta = data_Shepp['theta']
......
......@@ -5,14 +5,16 @@ from proxtoolbox.experiments.orbitaltomography.planar_molecule import PlanarMole
from proxtoolbox.utils.orbitaltomog import shifted_fft, fourier_interpolate
from proxtoolbox.utils.visualization.complex_field_visualization import complex_to_rgb
from proxtoolbox.utils.GetData import datadir
class DegenerateOrbital(PlanarMolecule):
@staticmethod
def getDefaultParameters():
defaultParams = {
'experiment_name': '2D ARPES',
'data_filename': '..\\Inputdata\\OrbitalTomog'
+ '\\2020_10_27_coronene_Homo1+2_ARPES_2e6counts_corrected_80x80.tif',
'data_filename': datadir
+ '\OrbitalTomog'
+ '\\2020_10_27_coronene_Homo1+2_ARPES_2e6counts_corrected_80x80.tif',
'from_intensity_data': True,
'object': 'real',
'degeneracy': 2, # Number of degenerate states to reconstruct
......
......@@ -7,6 +7,8 @@ from proxtoolbox.experiments.orbitaltomography.planar_molecule import PlanarMole
from proxtoolbox.utils.orbitaltomog import shifted_fft, fourier_interpolate, bin_array, shifted_ifft
from proxtoolbox.utils.visualization.complex_field_visualization import complex_to_rgb
from proxtoolbox.utils.GetData import datadir
class OrbitalMomentumMicroscope(PlanarMolecule):
"""
......@@ -17,8 +19,9 @@ class OrbitalMomentumMicroscope(PlanarMolecule):
def getDefaultParameters():
defaultParams = {
'experiment_name': 'Momentum microscopy',
'data_filename': '..\\Inputdata\\OrbitalTomog'
+ '\\2020_11_05_Coronene_HOMO_near_degenerate_noisefree.tif',
'data_filename': datadir
+ '\OrbitalTomog'
+ '\\2020_11_05_Coronene_HOMO_near_degenerate_noisefree.tif',
'from_intensity_data': False,
'object': 'real',
'constraint': 'sparse real',
......
......@@ -7,13 +7,16 @@ from proxtoolbox.experiments.orbitaltomography.planar_molecule import PlanarMole
from proxtoolbox.utils.orbitaltomog import shifted_fft, fourier_interpolate, bin_array, shifted_ifft
from proxtoolbox.utils.visualization.complex_field_visualization import complex_to_rgb
from proxtoolbox.utils.GetData import datadir
class OrthogonalOrbitals(PlanarMolecule):
@staticmethod
def getDefaultParameters():
defaultParams = {
'experiment_name': '2D ARPES',
'data_filename': '..\\Inputdata\\OrbitalTomog'
'data_filename': datadir
+ '\OrbitalTomog'
+ '\\2020_10_27_coronene_Homo_stack_ARPES_2e6counts_corrected_80x80.tif',
'from_intensity_data': False,
'object': 'real',
......
......@@ -7,6 +7,7 @@ from proxtoolbox.experiments.orbitaltomography.orbitExperiment import OrbitalTom
from proxtoolbox.utils.visualization.complex_field_visualization import complex_to_rgb
from proxtoolbox.utils.orbitaltomog import bin_array, shifted_fft, shifted_ifft, fourier_interpolate, roll_to_pos
from proxtoolbox.utils.GetData import datadir
class PlanarMolecule(OrbitalTomographyExperiment):
@staticmethod
......@@ -14,7 +15,7 @@ class PlanarMolecule(OrbitalTomographyExperiment):
# TODO: optimize parameters and proxoperators to get good & consistent phase retrieval using the demo
defaultParams = {
'experiment_name': 'noisy 2D ARPES', # '2D ARPES', #
'data_filename': '../InputData/OrbitalTomog/coronene_homo1.tif',
'data_filename': datadir/'OrbitalTomog'/'coronene_homo1.tif',
'from_intensity_data': False,
'object': 'real',
'constraint': 'sparse real',
......
......@@ -7,6 +7,7 @@ from proxtoolbox.utils.graphics import addColorbar
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
import numpy as np
from numpy import exp, sqrt, log2, log10, ceil, floor, unravel_index, argmax, zeros
......@@ -77,7 +78,7 @@ class CDI_Experiment(PhaseExperiment):
GetData.getData('Phase')
if not self.silent:
print('Loading data file CDI_intensity')
f = loadmat('../InputData/Phase/CDI_intensity.mat')
f = loadmat(datadir/'Phase'/'CDI_intensity.mat')
# diffraction pattern
dp = f['intensity']['img'][0, 0]
orig_res = max(dp.shape[0], dp.shape[1]) # actual data size
......
......@@ -13,6 +13,8 @@ from numpy.linalg import norm
from numpy.fft import fft2, ifft2
import time
from proxtoolbox.utils.GetData import datadir
class CDP_Experiment(PhaseExperiment):
"""
......@@ -91,18 +93,18 @@ class CDP_Experiment(PhaseExperiment):
# make image
if debug:
if n2 == 1:
x_dict = loadMatFile('../InputData/Phase/CDP_1D_x.mat')
x_dict = loadMatFile(datadir/'Phase'/'CDP_1D_x.mat')
debug_image = x_dict['x']
masks_dict = loadMatFile('../InputData/Phase/CDP_1D_Masks.mat')
masks_dict = loadMatFile(datadir/'Phase'/'CDP_1D_Masks.mat')
debug_masks = masks_dict['Masks']
z0_dict = loadMatFile('../InputData/Phase/CDP_1D_z0.mat')
z0_dict = loadMatFile(datadir/'Phase'/'CDP_1D_z0.mat')
debug_z0 = z0_dict['z0']
elif n2 == 256:
x_dict = loadMatFile('../InputData/Phase/CDP_2D_x.mat')
x_dict = loadMatFile(datadir/'Phase'/'CDP_2D_x.mat')
debug_image = x_dict['x']
masks_dict = loadMatFile('../InputData/Phase/CDP_2D_Masks.mat')
masks_dict = loadMatFile(datadir/'Phase'/'CDP_2D_Masks.mat')
debug_masks = masks_dict['Masks']
z0_dict = loadMatFile('../InputData/Phase/CDP_2D_z0.mat')
z0_dict = loadMatFile(datadir/'Phase'/'CDP_2D_z0.mat')
debug_z0 = z0_dict['z0']
x = debug_image
else:
......
......@@ -12,6 +12,7 @@ from proxtoolbox.utils.cell import Cell, isCell
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
import matplotlib
import matplotlib.pyplot as plt
......@@ -91,7 +92,7 @@ class JWST_Experiment(PhaseExperiment):
if not self.silent:
print('Loading data.')
with open('../InputData/Phase/pupil.pmod','r') as fid:
with open(datadir/'Phase'/'pupil.pmod','r') as fid:
# read lower endian float <f
Xi_A = np.fromfile(fid, dtype='<f')
Xi_A = Xi_A.astype(np.float64)
......@@ -99,13 +100,13 @@ class JWST_Experiment(PhaseExperiment):
diversity = 3
with open('../InputData/Phase/phase_p37.pmod','r') as fid:
with open(datadir/'Phase'/'phase_p37.pmod','r') as fid:
# read lower endian float <f
temp1 = np.fromfile(fid, dtype='<f')
temp1 = temp1.astype(np.float64)
temp1 = temp1.reshape(512,512).T
with open('../InputData/Phase/phase_m37.pmod','r') as fid:
with open(datadir/'Phase'/'phase_m37.pmod','r') as fid:
# read lower endian float <f
temp2 = np.fromfile(fid, dtype='<f')
temp2 = temp2.astype(np.float64)
......
......@@ -6,6 +6,7 @@ from proxtoolbox.utils.graphics import addColorbar
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
import numpy as np
from numpy import exp, sqrt, log2, log10, ceil, floor, unravel_index, argmax, zeros
......@@ -81,13 +82,13 @@ class Krueger_Experiment(PhaseExperiment):
# parameters see below
# empty waveguide (WG) beam
WG = loadmat('../InputData/Phase/WG_beam.mat')
WG = loadmat(datadir/'Phase'/'WG_beam.mat')
WG = WG['WG']
# hologram
if not self.silent:
print('Loading data hologram_not-normalized.mat')
I_exp = loadmat('../InputData/Phase/hologram_not-normalized.mat')
I_exp = loadmat(datadir/'Phase'/'hologram_not-normalized.mat')
I_exp = I_exp['I_exp']
I_exp[np.isnan(I_exp)] = 1
......
......@@ -17,6 +17,7 @@ from matplotlib.pyplot import subplots, show, figure
import os.path
import time
from proxtoolbox.utils.GetData import datadir
class Phasepack_Experiment(PhaseExperiment):
'''
......@@ -70,7 +71,7 @@ class Phasepack_Experiment(PhaseExperiment):
# so that we can use the automatic data loading feature (i.e., GetData.getData("Phasepack")).
# Another possibility is to write code that downloads the data files directly from
# the original website (https://rice.app.box.com/v/TransmissionMatrices)
data_dir = "../InputData/Phase/" + self.dataset + '/'
data_dir = datadir/'Phase' + self.dataset
filenames = ['A_GS.mat', 'YH_squared_test.mat', 'XH_test.mat']
for filename in filenames:
data_path = data_dir + filename
......
......@@ -11,6 +11,7 @@ from proxtoolbox.experiments.ptychography.ptychographyUtils import circ, \
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
import numpy as np
from numpy import exp, sqrt, log2, log10, ceil, floor, unravel_index, argmax, zeros
......@@ -44,7 +45,7 @@ class PtychographyExperiment(Experiment):
'experiment_name' : 'Ptychography',
'object': 'complex',
'constraint': 'amplitude only',
'data_dir': '../InputData/Ptychography/',
'data_dir': datadir/'Ptychography',
'datafile': 'data_NTT_01_26210_192x192',
'farfield': True,
'noise': None,
......@@ -93,7 +94,7 @@ class PtychographyExperiment(Experiment):
def __init__(self,
data_dir = '../InputData/Ptychography/',
data_dir = datadir/'Ptychography',
datafile = 'data_NTT_01_26210_192x192',
farfield = True,
poissonfactor = 5,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment