arsenal_gear.stellar_evolution.popsynth.BPASS_stellar_models

class arsenal_gear.stellar_evolution.popsynth.BPASS_stellar_models(singles: StarPopulation, binaries: BinaryPopulation, metal: str, time: Annotated[Quantity, PhysicalType('time')], bpass_dir: str, force_download: bool = False)[source]

Bases: object

Reads in BPASS stellar model files for use with a discrete stellar population.

data_from_companion_model(data: tuple, time_now: Annotated[Quantity, PhysicalType('time')]) tuple[source]

Extract the stellar properties necessary for feedback from a BPASS stellar model file.

Parameters:
  • data (tuple) – Matrix loaded from the stellar model file

  • time_now (Quantity["time"]) – Current simulation time

Returns:

Feedback properties

data_from_model(data: tuple, time_now: Annotated[Quantity, PhysicalType('time')]) tuple[source]

Extract the stellar properties necessary for feedback from a BPASS stellar model file.

Parameters:
  • data (tuple) – Matrix loaded from the stellar model file

  • time_now (Quantity["time"]) – Current simulation time

Returns:

Feedback properties

data_from_single_model(data: tuple, time_now: Annotated[Quantity, PhysicalType('time')]) tuple[source]

Extract the stellar properties necessary for feedback from a BPASS stellar model file, for a single star.

Parameters:
  • data (tuple) – Matrix loaded from the stellar model file

  • time_now (Quantity["time"]) – Current simulation time

Returns:

Feedback properties

downloader(url='https://www.dropbox.com/scl/fo/mpuas1xh5owmdadu0vpev/h?dl=1&e=1&rlkey=7vlk7ra6kvoztzmae8wr34kmz', message='Downloading stellar models...') None[source]

Method for downloading BPASS stellar models from the web.

Parameters:
  • url (str) – The URL of the BPASS repository.

  • message (str) – Optional message to display before downloading.

Raises:

Exception – If the download fails.

get_stellar_models(tar_name='bpass-v2.2-newmodels.tar.gz', zip_name='bpass_v2.2.zip', url='https://www.dropbox.com/scl/fo/mpuas1xh5owmdadu0vpev/h?dl=1&e=1&rlkey=7vlk7ra6kvoztzmae8wr34kmz') tuple[source]

Look for the stellar models for the stellar population and download/unzip/untar them if they are not available.

read_bpass_data() tuple[source]

Read BPASS data from a stellar model file.

untar(tar_name: str, delete_tar=False) None[source]

Un-compress the tar file extracted from the BPASS zip file.

Parameters:
  • tar_name (str) – Name of expected tar file

  • delete_tar (bool) – Delete the tar file after extracting

unzip(zip_name: str, target_file=None, delete_zip=False, inspect=False) None[source]

Un-compress the zip file downloaded from the BPASS dropbox.

Parameters:
  • zip_name (str) – Name of expected zip file

  • target_file (str) – Name of expected tar file in zip file If none, extract all tar files

  • delete_zip (bool) – Delete the zip file after extracting the tar file

  • inspect (bool) – Print the names of the tar files in the zip file