Commit 458c91d7 authored by Alexander Dornheim's avatar Alexander Dornheim
Browse files

Fixed bug in GetData.getData (indent)

Ptychography is now using GetData.getData (automatic download of input data)
parent 879ab4c9
......@@ -23,6 +23,9 @@ from proxtoolbox.ProxOperators import magproj
from proxtoolbox.ProxOperators.proxoperators import ProxOperator
from multiprocessing import Pool
#for downloading input data
import proxtoolbox.Utilities.GetData as GetData
#choose backend
import matplotlib
matplotlib.use('Qt5Agg')
......@@ -1941,6 +1944,10 @@ class Ptychography(Problem):
sample_plane = None;
if self.config['sim_data_type'] == 'gaenseliesel':
#make sure input data can be found, otherwise download it
GetData.getData('Ptychography')
g = pyplot.imread('../InputData/Ptychography/gaenseliesel.png').astype(numpy.float);
g /= numpy.amax(g);
g = 0.8*g + 0.1;
......@@ -2445,6 +2452,9 @@ class Ptychography_NTT_01_26210(Ptychography):
Overloads the corresponding method of :class:`Ptychography`
to create other experiment data
"""
#make sure input data can be found, otherwise download it
GetData.getData('Ptychography')
data = scipy.io.loadmat('../InputData/Ptychography/data_NTT_01_26210_192x192.mat');
d1y = data['d1y'][0][0];
d1x = data['d1x'][0][0];
......
......@@ -36,16 +36,16 @@ def getData(problemFamily):
if not(my_file.is_file()):
print(problemFamily + " input data is missing.")
if query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve(" http://vaopt.math.uni-goettingen.de/data/" + problemFamily + ".tar.gz","../InputData/" + problemFamily + ".tar.gz", reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/" + problemFamily + ".tar.gz", "r:gz")
tar.extractall("../InputData/" + problemFamily)
tar.close()
if not(my_file.is_file()):
print('***************************************************************************************')
print('* Input data still missing. Please try automatic download again or manually download *')
print('* http://vaopt.math.uni-goettingen.de/data/' + problemFamily + '.tar.gz *')
print('* Save and unpack the ' + problemFamily + '.tar.gz datafile in the *')
print('* ProxMatlab/InputData subdirectory *')
print('***************************************************************************************')
if query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve(" http://vaopt.math.uni-goettingen.de/data/" + problemFamily + ".tar.gz","../InputData/" + problemFamily + ".tar.gz", reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/" + problemFamily + ".tar.gz", "r:gz")
tar.extractall("../InputData/" + problemFamily)
tar.close()
if not(my_file.is_file()):
print('***************************************************************************************')
print('* Input data still missing. Please try automatic download again or manually download *')
print('* http://vaopt.math.uni-goettingen.de/data/' + problemFamily + '.tar.gz *')
print('* Save and unpack the ' + problemFamily + '.tar.gz datafile in the *')
print('* ProxMatlab/InputData subdirectory *')
print('***************************************************************************************')
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