Package for visualising radially expanding circumstellar envelopes of AGB stars.
Project description
AGB Star Deprojection
A package for visualising radially expanding circumstellar envelopes of AGB stars.
Quick Start
Installation
python3 -m pip install agb_star_deprojection_methods
Import
from agb_star_deprojection_methods.classes import CondensedData, StarData
Initialise a StarData object
fits_file = "example_fits_file.fits" # relative path to fits file
distance_to_star = 8.04e8 # distance to star in AU
rest_frequency = 2.3e11 # rest frequency in Hz
star = StarData(fits_file, distance_to_star, rest_frequency)
Plot channel maps (opens in matplotlib window)
star.plot_channel_maps() # many optional arguments
Plot 3D deprojection using plotly
star.plot_3D() # many optional arguments
Export to a CondensedData object
data = star.export()
Tweak parameters and create a new StarData object
data.v_exp = 20
new_star = StarData(data)
Expand envelope over time
years = 1000
info = new_star(years) # CondensedData object representing the envelope in 1000 years
expanded_star = StarData(info)
Save animation frame-by-frame to a folder
path_to_folder = "animation/frames"
star.plot_3D(folder = path_to_folder, num_angles = 100)
Creating a Mask
To create a mask manually, use the following script:
from agb_star_deprojection_methods.classes import StarData
fits_file = "example_fits_file.fits"
distance_to_star = 8.04e8
rest_frequency = 2.3e11
star = StarData(fits_file, distance_to_star, rest_frequency)
stds = 3 # number of standard deviations to initially filter by
savefile = "trial_mask.npy" # .npy file to save mask to
# open mask selector
star.create_mask(filter_stds=stds, savefile=savefile)
Running this will open a matplotlib window with a subplot for each velocity channel.
- Double click inside a subplot, then drag to lasso points.
- When you finish dragging, press:
- A to keep only these points in the mask,
- R to remove these points from the mask,
- Enter to do neither.
- Once you have completed the mask, close the matplotlib application.
- The mask will be saved to the location specified by
savefile.
To load the star data with the mask:
from agb_star_deprojection_methods.classes import StarData
fits_file = "example_fits_file.fits"
distance_to_star = 8.04e8
rest_frequency = 2.3e11
maskfile = "trial_mask.npy" # .npy file to load mask from
star = StarData(fits_file, distance_to_star, rest_frequency, maskfile)
# any other operations you want done
# ...
Further Reading
See our report and more detailed documentation at https://psychedelickoala.github.io/agb-star-deprojection-docs/AGB-Star-Deprojection.html.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agb_star_deprojection_methods-0.0.3.tar.gz.
File metadata
- Download URL: agb_star_deprojection_methods-0.0.3.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c1f278f9a7525de42e7911feb1525650a6a588d8e84b0e5f631337a932c76d5
|
|
| MD5 |
7d508cbda596a43987af8a40740dd351
|
|
| BLAKE2b-256 |
c856d2a64bf9168b3791b501ab6d4ebdc39d91e5b1b68d2dd3b5ee0247f760a5
|
File details
Details for the file agb_star_deprojection_methods-0.0.3-py3-none-any.whl.
File metadata
- Download URL: agb_star_deprojection_methods-0.0.3-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8f5cd6cf5eb70c7fdd21b0f766e52f380d06ddd29f731f3f59e8fe6f3ea1f2f
|
|
| MD5 |
ac0398d2d4300e85ec683a66f264d57b
|
|
| BLAKE2b-256 |
5eec96e2a3f71300f461869ed87bb7dd9db28ef46ff44aa1cac3b9ff07483a51
|