Commit 905ec580 authored by Russell Luke's avatar Russell Luke
Browse files

modified GetData.py to load Elser's data. New problemFamily Elser

parent 6576dd45
......@@ -26,17 +26,28 @@ def query_yes_no(question):
def getData(problemFamily):
if problemFamily == 'Phase':
my_file = Path("../InputData/Phase/pupil.pmod")
elif problemFamily == 'Elser':
my_file = Path("../InputData/Phase/Elser/data100E")
elif problemFamily == 'CT':
my_file = Path("../InputData/CT/ART_SheppLogan.mat")
elif problemFamily == 'Ptychography':
my_file = Path("../InputData/Ptychography/gaenseliesel.png")
else:
print("Invalid input in GetData.GetData. problemFamily has to be Phase, CT or Ptychography")
print("Invalid input in GetData.GetData. problemFamily has to be Phase, Elser, CT or Ptychography")
return -1
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?"):
if problemFamily == 'Elser':
if query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve(" https://github.com/veitelser/phase-retrieval-benchmarks/archive/master.zip","../InputData/Phase/" + problemFamily + ".tar", reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/Phase/" + problemFamily + ".tar", "r")
tar.extractall("../InputData/Phase/" + problemFamily)
tar.close()
os.system("mv ../../../InputData/Phase/Elser/phase-retrieval-benchmarks-master/data/* ../../../InputData/Phase/Elser/")
elif 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")
......@@ -44,8 +55,7 @@ def getData(problemFamily):
tar.close()
if not(my_file.is_file()):
print('***************************************************************************************')
print('* Message from GetData.py: *')
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('* data to the appropriate subfolder of the 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