Commit d7d3f91d authored by Russell Luke's avatar Russell Luke
Browse files

Merge branch 'master' into 'NoLips'

# Conflicts:
#   env.nix
parents 46b1ca50 0d065e28
......@@ -6,4 +6,5 @@ build
dist
.vscode/launch.json
.vscode/settings.json
tests/orb_tomog_regression_tests.py
\ No newline at end of file
tests/orb_tomog_regression_tests.py
/env
......@@ -18,9 +18,9 @@ Institute for Numerical and Applied Mathematics at the University of Göttingen.
## Python version
**1.0.4**:
* [Sources](https://gitlab.gwdg.de/nam/ProxPython/-/releases/1.0.4)
* [Documentation](https://num.math.uni-goettingen.de/proxtoolbox/versions/1.0.4)
**1.0.5**:
* [Sources](https://gitlab.gwdg.de/nam/ProxPython/-/releases/1.0.5)
* [Documentation](https://num.math.uni-goettingen.de/proxtoolbox/versions/1.0.5)
The documentation includes a tutorial.
......
import pdb
import SetProxPythonPath
from proxtoolbox.experiments.phase.Elser_Experiment import Elser_Experiment
Elser = Elser_Experiment(Atoms=400, category='H', algorithm='RRR', lambda_0=0.95, lambda_max=0.95, anim=True)
Elser.run()
Elser.show()
......@@ -2,6 +2,6 @@
import SetProxPythonPath
from proxtoolbox.experiments.phase.JWST_Experiment import JWST_Experiment
JWST = JWST_Experiment(algorithm='ADMM', lambda_0=3.0, lambda_max=3.0)
JWST = JWST_Experiment(algorithm='ADMM', lambda_0=4.0, lambda_max=4.0, anim=True)
JWST.run()
JWST.show()
......@@ -3,6 +3,6 @@ import SetProxPythonPath
from proxtoolbox.experiments.phase.JWST_Experiment import JWST_Experiment
JWST = JWST_Experiment(algorithm='ADMM', lambda_0=3.0, lambda_max=3.0,
MAXIT=300, noise = True, rotate = True)
MAXIT=300, noise = True, rotate = True, anim=True)
JWST.run()
JWST.show()
import pdb
import SetProxPythonPath
from proxtoolbox.experiments.phase.JWST_Experiment import JWST_Experiment
......
......@@ -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
......
......@@ -30,4 +30,3 @@ poetry2nix.mkPoetryEnv {
});
});
}
This diff is collapsed.
......@@ -36,6 +36,7 @@ from .experiments import *
from .proxoperators import *
from .utils import *
__all__ = ["algorithms",
"experiments",
"proxoperators",
......
......@@ -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
#for downloading data
import proxtoolbox.utils.GetData as GetData
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
......@@ -59,6 +61,10 @@ class DegenerateOrbital(PlanarMolecule):
- threshold_for_support: float, in range [0,1], fraction of the maximum at which to threshold when
determining support or support for sparsity
"""
# make sure input data can be found, otherwise download it
GetData.getData('OrbitalTomog')
super(DegenerateOrbital, self).loadData()
def createRandomGuess(self):
......
......@@ -7,6 +7,9 @@ from proxtoolbox.experiments.orbitaltomography.orbitExperiment import OrbitalTom
from proxtoolbox.utils.visualization.stack_viewer import XYZStackViewer
from proxtoolbox.utils.orbitaltomog import shifted_fft
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
class Molecule3D(OrbitalTomographyExperiment):
@staticmethod
......@@ -56,6 +59,9 @@ class Molecule3D(OrbitalTomographyExperiment):
"""
Load data and set in the correct format for reconstruction
"""
# make sure input data can be found, otherwise download it
GetData.getData('OrbitalTomog')
# TODO: copy from data processor
raise NotImplementedError
......
......@@ -6,6 +6,9 @@ from glob import glob
from proxtoolbox.utils.h5 import write_dict_to_h5
import numpy as np
#for downloading data
import proxtoolbox.utils.GetData as GetData
from proxtoolbox.utils.GetData import datadir
class OrbitalTomographyExperiment(Experiment):
@staticmethod
......@@ -30,6 +33,10 @@ class OrbitalTomographyExperiment(Experiment):
self.output_ignore_keys = ['u1', 'u2', 'plots']
def loadData(self):
# make sure input data can be found, otherwise download it
GetData.getData('OrbitalTomog')
"""
Load or generate the dataset that will be used for
this experiment. Create the initial iterate.
......
Supports Markdown
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