Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agb_star_deprojection_methods-0.0.3.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agb_star_deprojection_methods-0.0.3-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file agb_star_deprojection_methods-0.0.3.tar.gz.

File metadata

File hashes

Hashes for agb_star_deprojection_methods-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2c1f278f9a7525de42e7911feb1525650a6a588d8e84b0e5f631337a932c76d5
MD5 7d508cbda596a43987af8a40740dd351
BLAKE2b-256 c856d2a64bf9168b3791b501ab6d4ebdc39d91e5b1b68d2dd3b5ee0247f760a5

See more details on using hashes here.

File details

Details for the file agb_star_deprojection_methods-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for agb_star_deprojection_methods-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a8f5cd6cf5eb70c7fdd21b0f766e52f380d06ddd29f731f3f59e8fe6f3ea1f2f
MD5 ac0398d2d4300e85ec683a66f264d57b
BLAKE2b-256 5eec96e2a3f71300f461869ed87bb7dd9db28ef46ff44aa1cac3b9ff07483a51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page