-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
29 lines (23 loc) · 766 Bytes
/
Copy pathexample.py
File metadata and controls
29 lines (23 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from astrodonut.donut import Donut
from astrodonut.donut_List import DonutList
from matplotlib import pyplot as plt
from astrodonut.donut_exporter import DonutExporter
# Create individual donuts
d1 = Donut(56, 40, 0.3, 40, 0.97, 200, 200)
d2 = Donut(44, 31, 0.3, 40, 0.8, 200, 200)
d3 = Donut(20, 15, 0.3, 40, 0.45, 200, 200)
# Generate rings
d1.ring()
d2.ring()
d3.ring()
# Combine them in a DonutList
dl = DonutList([d1, d2, d3])
combined_model = dl.get_combined()
# Plot the combined donut disk
plt.imshow(combined_model, origin='lower', cmap='hot')
plt.title("Combined Donut Disk")
plt.colorbar(label="Intensity")
plt.show()
# Save the combined donut to a FITS file
exporter = DonutExporter(dl)
exporter.save_to_fits("combined_donut.fits", overwrite=True)