Commit 879ab4c9 authored by Alexander Dornheim's avatar Alexander Dornheim
Browse files

ART data processors are now using GetData.getData (reducing redundant code)

parent f6101b4b
......@@ -26,22 +26,8 @@ import tarfile
def ART_data_processor(config):
my_file = Path("../InputData/CT/ART_SheppLogan.mat")
if not(my_file.is_file()):
print("CT input data is missing.")
if GetData.query_yes_no("Do you want to download the CT input data?"):
urllib.request.urlretrieve("http://vaopt.math.uni-goettingen.de/data/CT.tar.gz","../InputData/CT.tar.gz", reporthook=GetData.dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/CT.tar.gz", "r:gz")
tar.extractall("../InputData/CT/")
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/CT.tar.gz *')
print('* Save and unpack the CT.tar.gz datafile in the *')
print('* ProxMatlab/InputData subdirectory *')
print('***************************************************************************************')
#make sure input data can be found, otherwise download it
GetData.getData('CT')
# load toy data
print('Loading data file ART_SheppLogan.mat ')
......
......@@ -30,24 +30,10 @@ from numpy import ceil, zeros, sqrt
def BLOCK_ART_data_processor(config):
my_file = Path("../InputData/CT/ART_SheppLogan.mat")
if not(my_file.is_file()):
print("CT input data is missing.")
if GetData.query_yes_no("Do you want to download the CT input data?"):
urllib.request.urlretrieve("http://vaopt.math.uni-goettingen.de/data/CT.tar.gz","../InputData/CT.tar.gz", reporthook=GetData.dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/CT.tar.gz", "r:gz")
tar.extractall("../InputData/CT/")
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/CT.tar.gz *')
print('* Save and unpack the CT.tar.gz datafile in the *')
print('* ProxMatlab/InputData subdirectory *')
print('***************************************************************************************')
# load toy data
#make sure input data can be found, otherwise download it
GetData.getData('CT')
# load toy data
if config['fanbeam'] != 'yes':
print('Loading data file ART_SheppLogan.mat ')
ART = scipy.io.loadmat('../InputData/CT/ART_SheppLogan.mat')
......
......@@ -31,7 +31,8 @@ import proxtoolbox.Utilities as Utilities
import proxtoolbox.Utilities.GetData as GetData
def JWST_data_processor(config):
#make sure input data can be found, otherwise download it
GetData.getData('Phase')
#moved here from JWST_in since if statements not possible in dictonary
......
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