Commit 94f91052 authored by Martin Reinecke's avatar Martin Reinecke

better imports

parent 140f8695
...@@ -2,11 +2,11 @@ import numpy as np ...@@ -2,11 +2,11 @@ import numpy as np
from astropy.io import fits from astropy.io import fits
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
from starblade.sugar import build_starblade, starblade_iteration import starblade as sb
if __name__ == '__main__': if __name__ == '__main__':
#specifying location of the input file: #specifying location of the input file:
path = 'data/hst_05195_01_wfpc2_f702w_pc_sci.fits' path = 'hst_05195_01_wfpc2_f702w_pc_sci.fits'
data = fits.open(path)[1].data data = fits.open(path)[1].data
data = data.clip(min=0.001) data = data.clip(min=0.001)
...@@ -16,10 +16,10 @@ if __name__ == '__main__': ...@@ -16,10 +16,10 @@ if __name__ == '__main__':
vmax = np.log(data.max()) vmax = np.log(data.max())
alpha = 1.25 alpha = 1.25
Starblade = build_starblade(data, alpha=alpha) Starblade = sb.build_starblade(data, alpha=alpha)
for i in range(10): for i in range(10):
Starblade = starblade_iteration(Starblade) Starblade = sb.starblade_iteration(Starblade)
#plotting on logarithmic scale #plotting on logarithmic scale
plt.imsave('diffuse_component.png', Starblade.s.val, vmin=vmin, vmax=vmax) plt.imsave('diffuse_component.png', Starblade.s.val, vmin=vmin, vmax=vmax)
plt.imsave('pointlike_component.png', Starblade.u.val, vmin=vmin, vmax=vmax) plt.imsave('pointlike_component.png', Starblade.u.val, vmin=vmin, vmax=vmax)
\ No newline at end of file
from .sugar import build_starblade, starblade_iteration
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