Commit 1007437f authored by Alexander Dornheim's avatar Alexander Dornheim
Browse files

Siemens_data_processor is now using GetData.getdata

parent aaf10810
from pathlib import Path
import numpy as np
from numpy import exp, sqrt, log2,log10, floor, unravel_index, argmax, zeros
from scipy.io import loadmat
......
......@@ -5,12 +5,9 @@ from numpy.linalg import norm
from numpy.fft import fft2, ifft2
from numpy.random import rand
import proxtoolbox.Utilities as Utilities
from pathlib import Path
import os
import proxtoolbox.Utilities.GetData as GetData
import urllib.request
import tarfile
#for downloading input data
import proxtoolbox.Utilities.GetData as GetData
def Siemens_processor(config):
data_ball = config['data_ball']
......@@ -18,22 +15,8 @@ def Siemens_processor(config):
noise = config['noise']
snr = config['data_ball']
my_file = Path("../InputData/Phase/Siemens_star_200px.mat")
if not(my_file.is_file()):
print("Phase input data is missing.")
if GetData.query_yes_no("Do you want to download the phase input data?"):
urllib.request.urlretrieve("http://num.math.uni-goettingen.de/~r.luke/tmp/Phase.tar.gz","../InputData/Phase.tar.gz", reporthook=GetData.dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/Phase.tar.gz", "r:gz")
tar.extractall("../InputData/")
tar.close()
if not(my_file.is_file()):
print('***************************************************************************************')
print('* Input data still missing. Please try automatic download again or manually download *')
print('* http://num.math.uni-goettingen.de/data/Phase.tar.gz *')
print('* Save and unpack the Phase.tar.gz datafile in the *')
print('* ProxMatlab/InputData subdirectory *')
print('***************************************************************************************')
#make sure input data can be found, otherwise download it
GetData.getData('Phase')
print('Loading data file: Siemens_star_200px.mat')
S = np.loadtxt('../InputData/Phase/Siemens_star_200px.mat')
......
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