ysoisochrone.isochrone

Module Contents

Classes

Isochrone

Isochrone class for setting up log_age, masses, and logtlogl attributes now it works for Baraffe and Feiden tracks.

API

class ysoisochrone.isochrone.Isochrone(data_dir=None)

Isochrone class for setting up log_age, masses, and logtlogl attributes now it works for Baraffe and Feiden tracks.

Args:

data_dir: [str, optional]

Directory where the isochrone data files are stored. Default is a folder called ‘isochrone_data’ under where you are running the code.

Attributes:

log_age: [array]

Array of log(age) values.

masses: [array]

Array of mass values.

logtlogl: [array]

Array of log(T) and log(L) values for the evolutionary tracks.

Initialization

Initialize Isochrone object.

Args:
data_dir: [str or None]
  • None → use the built-in isochrone matrices packaged

    inside ysoisochrone/data.

  • path → load isochrone matrices from this directory

    (user-supplied custom matrices).

prepare_baraffe_tracks()

Prepares the Baraffe BHAC15 tracks file by downloading it if necessary, reading the data, interpolating it into a meshgrid, and saving it as a .mat file.

The method: 1. Checks if the BHAC15 tracks file exists in the data directory. 2. Downloads the file if it doesn’t exist. 3. Reads the file, creates a meshgrid for log_age and masses, and interpolates logtlogl data. 4. Saves the resulting grid data to a .mat file.

Args:

None.

Output:

Saves the .mat file to the data directory.

prepare_feiden_tracks()

Prepares the Feiden 2016 tracks file by downloading it if necessary, reading the data, interpolating it into a meshgrid, and saving it as a .mat file.

The method: 1. Checks if the Feiden2016_trk tracks file exists in the data directory. 2. Downloads the file if it doesn’t exist. 3. Reads the file, creates a meshgrid for log_age and masses, and interpolates logtlogl data. 4. Saves the resulting grid data to a .mat file.

Args:

None.

Output:

Saves the .mat file to the data directory.

prepare_parsecv1p2_tracks()

Prepares the PARSEC v1.2 tracks file by downloading it if necessary, reading the data, interpolating it into a meshgrid, and saving it as a .mat file.

The method: 1. Checks if the PARSEC v1.2 tracks file exists in the data directory. 2. Downloads the file if it doesn’t exist. 3. Reads the file, creates a meshgrid for log_age and masses, and interpolates logtlogl data. 4. Saves the resulting grid data to a .mat file.

Args:

None.

Output:

Saves the .mat file to the data directory.

prepare_parsecv2p0_tracks()

Prepares the PARSEC v2.0 tracks file by downloading it if necessary, reading the data, interpolating it into a meshgrid, and saving it as a .mat file.

The method: 1. Checks if the PARSEC v2.0 tracks file exists in the data directory. 2. Downloads the file if it doesn’t exist. 3. Reads the file, creates a meshgrid for log_age and masses, and interpolates logtlogl data. 4. Saves the resulting grid data to a .mat file.

Args:

None.

Output:

Saves the .mat file to the data directory.

prepare_mistv1p2_tracks()

Prepares the MIST v1.2 tracks file by downloading it if necessary, reading the data, interpolating it into a meshgrid, and saving it as a .mat file.

The method: 1. Checks if the MIST v1.2 tracks file exists in the data directory. 2. Downloads the file if it doesn’t exist. 3. Reads the file, creates a meshgrid for log_age and masses, and interpolates logtlogl data. 4. Saves the resulting grid data to a .mat file.

Args:

None.

Output:

Saves the .mat file to the data directory.

load_baraffe2015_tracks()

Load Baraffe isochrone tracks from .sav file and set log_age, masses, and logtlogl. Uses packaged built-in matrix by default, unless user provides a custom data_dir.

Output:

Sets:

log_age: [array]

Log age values from the Baraffe tracks.

masses: [array]

Mass values from the Baraffe tracks.

logtlogl: [array]

Log T and Log L values from the Baraffe tracks.

load_feiden2016_tracks()

Load Feiden isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Output:

Sets:

log_age: [array]

Log age values from the Feiden tracks.

masses: [array]

Mass values from the Feiden tracks.

logtlogl: [array]

Log T and Log L values from the Feiden tracks.

load_feiden2016_magnetic_tracks()

Load Feiden isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported. The original Feiden magnetic grids contain known issues at ages < 10 Myr, and a corrected version is provided in the ysoisochrone built-in matrices.

Output:

Sets:

log_age: [array]

Log age values from the Feiden tracks.

masses: [array]

Mass values from the Feiden tracks.

logtlogl: [array]

Log T and Log L values from the Feiden tracks.

load_parsecv1p2_tracks()

Load PARSEC v1.2 isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Output:

Sets:

log_age: [array]

Log age values from the PARSEC v1.2 tracks.

masses: [array]

Mass values from the PARSEC v1.2 tracks.

logtlogl: [array]

Log T and Log L values from the PARSEC v1.2 tracks.

load_parsecv2p0_tracks()

Load PARSEC v2.0 isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Output:

Sets:

log_age: [array]

Log age values from the PARSEC v2.0 tracks.

masses: [array]

Mass values from the PARSEC v2.0 tracks.

logtlogl: [array]

Log T and Log L values from the PARSEC v2.0 tracks.

load_mistv1p2_tracks()

Load MIST v1.2 isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Output:

Sets:

log_age: [array]

Log age values from the MIST v1.2 tracks.

masses: [array]

Mass values from the MIST v1.2 tracks.

logtlogl: [array]

Log T and Log L values from the MIST v1.2 tracks.

load_siess2000_tracks()

Load Siess2000 isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the Siess2000 tracks.

masses: [array]

Mass values from the Siess2000 tracks.

logtlogl: [array]

Log T and Log L values from the Siess2000 tracks.

load_spots0000_tracks()

Load SPOTS isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the SPOTS tracks.

masses: [array]

Mass values from the SPOTS tracks.

logtlogl: [array]

Log T and Log L values from the SPOTS tracks.

load_spots0169_tracks()

Load SPOTS isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the SPOTS tracks.

masses: [array]

Mass values from the SPOTS tracks.

logtlogl: [array]

Log T and Log L values from the SPOTS tracks.

load_spots0339_tracks()

Load SPOTS isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the SPOTS tracks.

masses: [array]

Mass values from the SPOTS tracks.

logtlogl: [array]

Log T and Log L values from the SPOTS tracks.

load_spots0508_tracks()

Load SPOTS isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the SPOTS tracks.

masses: [array]

Mass values from the SPOTS tracks.

logtlogl: [array]

Log T and Log L values from the SPOTS tracks.

load_spots0847_tracks()

Load SPOTS isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the SPOTS tracks.

masses: [array]

Mass values from the SPOTS tracks.

logtlogl: [array]

Log T and Log L values from the SPOTS tracks.

load_pisa_tracks()

Load Pisa isochrone tracks from .sav file and set log_age, masses, and logtlogl.

Only the built-in corrected matrix is supported.

Output:

Sets:

log_age: [array]

Log age values from the Pisa tracks.

masses: [array]

Mass values from the Pisa tracks.

logtlogl: [array]

Log T and Log L values from the Pisa tracks.

load_tracks_from_customize_matrix(load_file)

Load the isochromes from any customized matrix

Args:

load_file: [str]

the .mat file that contains mass grid, log_age grid, and logt_logl grid

Sets:

log_age: [array]

Log age values from the Feiden tracks.

masses: [array]

Mass values from the Feiden tracks.

logtlogl: [array]

Log T and Log L values from the Feiden tracks.

set_tracks_legacy(track_type, load_file='')

Set the isochrone tracks based on track_type.

Args:

track_type: [str]

Type of the tracks to use (‘baraffe2015’ or ‘feiden2016’ or ‘customize’).

load_file: [str]

the .mat file that contains mass grid, log_age grid, and logt_logl grid Default is ‘’, so if you want to read in the customized datafile, remember to set up this parameter

Output:

Loads the corresponding track (Baraffe or Feiden) and sets the appropriate attributes.

set_tracks(track_type, load_file='', verbose=False)

Set the isochrone tracks based on track_type.

Args:

track_type: [str]

Type of the tracks to use (‘baraffe2015’ or ‘feiden2016’ or ‘customize’).

load_file: [str]

the .mat file that contains mass grid, log_age grid, and logt_logl grid Default is ‘’, so if you want to read in the customized datafile, remember to set up this parameter

verbose: [bool]

If True, print additional information during track loading. Default is False.

Output:

Loads the corresponding track (Baraffe or Feiden) and sets the appropriate attributes.

get_tracks()

Get the current isochrone tracks (log_age, masses, logtlogl).

Output:

Returns:

log_age: [array]

Array of log(age) values.

masses: [array]

Array of mass values.

logtlogl: [array]

Array of log(T) and log(L) values.