Dear Gitlab Users, for our upcoming upgrade to Gitlab v14, Gitlab will be unavailable on Thursday, 05.08.2021 from 5:00 pm to approximately 7:00 pm. Note that with v14, certain breaking changes will be introduced (https://about.gitlab.com/blog/2021/06/04/gitlab-moving-to-14-breaking-changes/).

Commit b0eb94c3 authored by Schellhorn's avatar Schellhorn
Browse files

Elser Data adding

parent 128499cc
......@@ -2,6 +2,7 @@ from pathlib import Path
import sys
import urllib.request
import tarfile
from zipfile import ZipFile
datadir = Path(__file__).parent.parent.parent.parent / 'InputData'
......@@ -35,18 +36,28 @@ def getData(problemFamily):
elif problemFamily == 'OrbitalTomog':
errMsg = 'OrbitalTomog downloader is yet a work in progress'
raise IOError(errMsg)
elif problemFamily == 'Elser':
my_file = datadir/'Elser'/'RRR.c'
else:
print("Invalid input in GetData.GetData. problemFamily has to be Phase, CT or Ptychography")
return -1
if not(my_file.is_file()):
print(problemFamily + " input data is missing.")
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", datadir/(problemFamily + '.tar.gz'), reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open(datadir/(problemFamily + '.tar.gz'), "r:gz")
tar.extractall(datadir/problemFamily)
tar.close()
if problemFamily == 'Elser':
link = 'https://github.com/veitelser/phase-retrieval-benchmarks/archive/master.zip'
urllib.request.urlretrieve(link, datadir/(problemFamily + '.zip'), reporthook=dlProgress)
print("\nExtracting data...")
with ZipFile(datadir/(problemFamily + '.zip'), 'r') as zipObj:
zipObj.extractall(datadir/problemFamily)
else:
link = " http://vaopt.math.uni-goettingen.de/data/" + problemFamily + ".tar.gz"
urllib.request.urlretrieve(link, datadir/(problemFamily + '.tar.gz'), reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open(datadir/(problemFamily + '.tar.gz'), "r:gz")
tar.extractall(datadir/problemFamily)
tar.close()
if not(my_file.is_file()):
print('***************************************************************************************')
print('* Input data still missing. Please try automatic download again or manually download *')
......
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