In [1]:
%matplotlib inline
import os
import sys
sys.path.append(os.path.join('..', '..'))
from matplotlib import pylab
import numpy
from matplotlib import pyplot as plt
from data_models.parameters import arl_path
from wrappers.serial.image.operations import show_image, qa_image, import_image_from_fits
import logging
log = logging.getLogger()
log.setLevel(logging.INFO)
log.addHandler(logging.StreamHandler(sys.stdout))
In [13]:
pylab.rcParams['figure.figsize'] = (12.0, 12.0)
pylab.rcParams['image.cmap'] = 'rainbow'
fits_files = []
results_dir = './results/mpi'
for file in os.listdir(results_dir):
if file.endswith(".fits"):
fits_files.append(file)
fits_files = numpy.sort(fits_files)
empty = list()
for file in fits_files:
im = import_image_from_fits('%s/%s' % (results_dir,file))
if numpy.max(numpy.abs(im.data)) == 0.0:
empty.append(file)
import pprint
p=pprint.PrettyPrinter()
print("The following files are empty:")
p.pprint(empty)
In [14]:
for file in fits_files:
print('******************************************************************')
im = import_image_from_fits('%s/%s' % (results_dir,file))
print(qa_image(im, context=file))
try:
show_image(im, title=file)
plt.show()
except IndexError:
pass
In [ ]: