Star

class vspec_vsm.Star(teff: ~astropy.units.quantity.Quantity, radius: ~astropy.units.quantity.Quantity, period: ~astropy.units.quantity.Quantity, spots: ~vspec_vsm.spots.SpotCollection, faculae: ~vspec_vsm.faculae.FaculaCollection, grid_params: int | ~typing.Tuple[int, int] = 1000, flare_generator: ~vspec_vsm.flares.FlareGenerator = None, spot_generator: ~vspec_vsm.spots.SpotGenerator = None, fac_generator: ~vspec_vsm.faculae.FaculaGenerator = None, granulation: ~vspec_vsm.granules.Granulation = None, u1: float = 0, u2: float = 0, rng: ~numpy.random._generator.Generator = Generator(PCG64) at 0x7F5F70722420)

Bases: object

Star object representing a variable star.

Parameters:
  • Teff (astropy.units.Quantity) – Effective temperature of the stellar photosphere.

  • radius (astropy.units.Quantity) – Stellar radius.

  • period (astropy.units.Quantity) – Stellar rotational period.

  • spots (SpotCollection) – Initial spots on the stellar surface.

  • faculae (FaculaCollection) – Initial faculae on the stellar surface.

  • distance (astropy.units.Quantity , default=1*u.pc) – Distance to the star.

  • Nlat (int, default=500) – The number of latitude points on the stellar sufrace.

  • Nlon (int, default=1000) – The number of longitude points on the stellar surface.

  • gridmaker (CoordinateGrid, default=None) – A CoordinateGrid object to create the stellar sufrace grid.

  • flare_generator (FlareGenerator, default=None) – Flare generator object.

  • spot_generator (SpotGenerator, default=None) – Spot generator object.

  • fac_generator (FaculaGenerator, default=None) – Facula generator object.

  • ld_params (list, default=[0, 1, 0]) – Limb-darkening parameters.

Teff

Effective temperature of the stellar photosphere.

Type:

astropy.units.Quantity

radius

Stellar radius.

Type:

astropy.units.Quantity

distance

Distance to the star.

Type:

astropy.units.Quantity

period

Stellar rotational period.

Type:

astropy.units.Quantity

spots

Spots on the stellar surface.

Type:

SpotCollection

faculae

Faculae on the stellar surface.

Type:

FaculaCollection

gridmaker

Object to create the coordinate grid of the surface.

Type:

CoordinateGrid

map

Pixel map of the stellar surface.

Type:

astropy.units.Quantity

flare_generator

Flare generator object.

Type:

FlareGenerator

spot_generator

Spot generator object.

Type:

SpotGenerator

fac_generator

Facula generator object.

Type:

FaculaGenerator

u1

Limb-darkening parameter u1.

Type:

float

u2

Limb-darkening parameter u2.

Type:

float

Attributes:
map

Create a map of the stellar surface based on spots.

Methods

add_fac(facula)

Add one or more faculae to the stellar surface.

add_faculae_to_map(lat0, lon0)

Add the faculae to the surface map.

add_spot(spot)

Add one or more spots to the stellar surface.

age(time)

Age the spots and faculae on the stellar surface according to their own age methods.

area_projection_coefficient(mu)

Get the area projection coefficient for each point.

average_teff(sub_obs_coords)

Calculate the average Teff of the star given a sub-observation point using the Stephan-Boltzman law.

birth_faculae(time)

Create new faculae from a facula generator.

birth_spots(time)

Create new spots from a spot generator.

calc_coverage(sub_obs_coords[, ...])

Calculate coverage

generate_mature_spots(coverage)

Generate new mature spots with a specified coverage.

get_flare_int_over_timeperiod(tstart, ...)

Compute the total flare integral over a specified time period and sub-observer point.

get_flares_over_observation(time_duration)

Generate a collection of flares over a specified observation period.

get_granulation_coverage(time)

Calculate the coverage by granulation at each point in time.

get_jacobian()

Get the relative area of each point.

get_mu(lat0, lon0)

Get the cosine of the angle from disk center.

get_pl_frac(angle_past_midtransit, ...)

Get planet fraction

get_transit_mask(lat0, lon0, orbit_radius, ...)

Get a mask describing which pixels are covered by a transiting planet.

ld_mask(mu)

Get a translucent mask based on limb darkeining parameters.

ld_mask_for_plotting(mu)

Same as above, but does not add the extra 1 because that is already accounted for by the projection.

plot_surface(lat0, lon0[, ax, orbit_radius, ...])

Add the transit to the surface map and plot.

set_fac_grid()

Set the gridmaker for each facula to be the same.

set_spot_grid()

Set the gridmaker for each spot to be the same.

Attributes Summary

map

Create a map of the stellar surface based on spots.

Methods Summary

add_fac(facula)

Add one or more faculae to the stellar surface.

add_faculae_to_map(lat0, lon0)

Add the faculae to the surface map.

add_spot(spot)

Add one or more spots to the stellar surface.

age(time)

Age the spots and faculae on the stellar surface according to their own age methods.

area_projection_coefficient(mu)

Get the area projection coefficient for each point.

average_teff(sub_obs_coords)

Calculate the average Teff of the star given a sub-observation point using the Stephan-Boltzman law.

birth_faculae(time)

Create new faculae from a facula generator.

birth_spots(time)

Create new spots from a spot generator.

calc_coverage(sub_obs_coords[, ...])

Calculate coverage

generate_mature_spots(coverage)

Generate new mature spots with a specified coverage.

get_flare_int_over_timeperiod(tstart, ...)

Compute the total flare integral over a specified time period and sub-observer point.

get_flares_over_observation(time_duration)

Generate a collection of flares over a specified observation period.

get_granulation_coverage(time)

Calculate the coverage by granulation at each point in time.

get_jacobian()

Get the relative area of each point.

get_mu(lat0, lon0)

Get the cosine of the angle from disk center.

get_pl_frac(angle_past_midtransit, ...)

Get planet fraction

get_transit_mask(lat0, lon0, orbit_radius, ...)

Get a mask describing which pixels are covered by a transiting planet.

ld_mask(mu)

Get a translucent mask based on limb darkeining parameters.

ld_mask_for_plotting(mu)

Same as above, but does not add the extra 1 because that is already accounted for by the projection.

plot_surface(lat0, lon0[, ax, orbit_radius, ...])

Add the transit to the surface map and plot.

set_fac_grid()

Set the gridmaker for each facula to be the same.

set_spot_grid()

Set the gridmaker for each spot to be the same.

Attributes Documentation

map

Create a map of the stellar surface based on spots.

Returns:

pixelmap – Map of stellar surface with effective temperature assigned to each pixel.

Return type:

astropy.units.Quantity , Shape(self.gridmaker.Nlon,self.gridmaker.Nlat)

Methods Documentation

add_fac(facula)

Add one or more faculae to the stellar surface.

Parameters:

facula (Facula or sequence of Facula) – The Facula object(s) to add.

add_faculae_to_map(lat0: astropy.units.Quantity, lon0: astropy.units.Quantity)

Add the faculae to the surface map.

Parameters:
Returns:

teffmap – A temperature map of the surface

Return type:

astropy.units.Quantity

add_spot(spot)

Add one or more spots to the stellar surface.

Parameters:

spot (StarSpot or sequence of StarSpot) – The StarSpot object(s) to add.

age(time)

Age the spots and faculae on the stellar surface according to their own age methods. Remove the spots that have decayed.

Parameters:

time (astropy.units.Quantity) – Length of time to age the features on the stellar surface. For most realistic behavior, time should be much less than spot or faculae lifetime.

area_projection_coefficient(mu) ndarray

Get the area projection coefficient for each point.

Parameters:

mu (np.ndarray) – The cosine of the angle from disk center

Returns:

area – The area projection coefficient for each point

Return type:

np.ndarray

average_teff(sub_obs_coords)

Calculate the average Teff of the star given a sub-observation point using the Stephan-Boltzman law. This can approximate a lightcurve for testing.

Parameters:

sub_obs_coords (dict) – A dictionary containing coordinates of the sub-observation point. This is the point that is at the center of the stellar disk from the view of an observer. Format: {‘lat’:lat,’lon’:lon} where lat and lon are astropy.units.Quantity objects.

Returns:

Bolometric average Teff of stellar disk.

Return type:

astropy.units.Quantity

birth_faculae(time)

Create new faculae from a facula generator.

Parameters:

time (astropy.units.Quantity) – Time over which these faculae should be created.

birth_spots(time)

Create new spots from a spot generator.

Parameters:

time (astropy.units.Quantity) – Time over which these spots should be created.

calc_coverage(sub_obs_coords: dict, granulation_fraction: float = 0.0, orbit_radius: ~astropy.units.quantity.Quantity = <Quantity 1. AU>, planet_radius: ~astropy.units.quantity.Quantity = <Quantity 1. earthRad>, phase: ~astropy.units.quantity.Quantity = <Quantity 90. deg>, inclination: ~astropy.units.quantity.Quantity = <Quantity 0. deg>)

Calculate coverage

Calculate coverage fractions of various Teffs on stellar surface given coordinates of the sub-observation point.

Parameters:
  • sub_obs_coord (dict) – A dictionary giving coordinates of the sub-observation point. This is the point that is at the center of the stellar disk from the view of an observer. Format: {‘lat’:lat,’lon’:lon} where lat and lon are astropy.units.Quantity objects.

  • granulation_fraction (float) – The fraction of the quiet photosphere that has a lower Teff due to granulation

Returns:

  • total_data (dict) – Dictionary with Keys as Teff quantities and Values as surface fraction floats.

  • covered_data (dict) – Dictionary with Keys as Teff quantities and Values as surface fraction floats covered by a transiting planet.

  • pl_frac (float) – The fraction of the planet that is visble. This is in case of an eclipse.

generate_mature_spots(coverage: float)

Generate new mature spots with a specified coverage.

Parameters:

coverage (float) – The coverage of the new spots.

Notes

This method uses the SpotGenerator attribute of the current object to generate a set of new mature spots with the specified coverage. The new spots are added to the object’s spots attribute and the pixel map is updated using the new spots.

get_flare_int_over_timeperiod(tstart: astropy.units.Quantity, tfinish: astropy.units.Quantity, sub_obs_coords)

Compute the total flare integral over a specified time period and sub-observer point.

Parameters:
  • tstart (astropy.units.Quantity) – The start time of the period.

  • tfinish (astropy.units.Quantity) – The end time of the period.

  • sub_obs_coords (dict) – A dictionary containing coordinates of the sub-observation point. This is the point that is at the center of the stellar disk from the view of an observer. Format: {‘lat’:lat,’lon’:lon} where lat and lon are astropy.units.Quantity objects.

Returns:

flare_timeareas – List of dictionaries containing flare temperatures and integrated time-areas. In the format [{‘Teff’:9000*u.K,’timearea’=3000*u.Unit(‘km2 hr)},…]

Return type:

list of dict

Notes

This method computes the total flare integral over each flare in the flares attribute of the Star object that falls within the specified time period and is visible from the sub-observer point defined by sub_obs_coords. The result is returned as a list of dictionaries representing the teff and total flare integral of each flare.

get_flares_over_observation(time_duration: astropy.units.Quantity)

Generate a collection of flares over a specified observation period.

Parameters:

time_duration (astropy.units.Quantity) – The duration of the observation period.

Notes

This method uses the FlareGenerator attribute of the Star object to generate a distribution of flare energies, and then generates a series of flares over the specified observation period using these energies. The resulting collection of flares is stored in the Star’s flares attribute.

get_granulation_coverage(time: astropy.units.Quantity) ndarray

Calculate the coverage by granulation at each point in time.

Parameters:

time (astropy.units.Quantity) – The points on the time axis.

Returns:

The coverage corresponding to each time point.

Return type:

np.ndarray

get_jacobian() ndarray

Get the relative area of each point.

Returns:

jacobian – The area of each point

Return type:

np.ndarray

get_mu(lat0: astropy.units.Quantity, lon0: astropy.units.Quantity) ndarray

Get the cosine of the angle from disk center.

Parameters:
Returns:

mu – An array of cos(x) where x is the angle from disk center.

Return type:

np.ndarray

get_pl_frac(angle_past_midtransit: astropy.units.Quantity, orbit_radius: astropy.units.Quantity, planet_radius: astropy.units.Quantity, inclination: astropy.units.Quantity)

Get planet fraction

Parameters:
get_transit_mask(lat0: astropy.units.Quantity, lon0: astropy.units.Quantity, orbit_radius: astropy.units.Quantity, radius: astropy.units.Quantity, phase: astropy.units.Quantity, inclination: astropy.units.Quantity)

Get a mask describing which pixels are covered by a transiting planet.

Parameters:
Returns:

  • mask (np.ndarray) – The fraction of each pixel that is covered by the planet.

  • pl_frac (float) – The fraction of the planet that is visible to the observer.

ld_mask(mu) ndarray

Get a translucent mask based on limb darkeining parameters.

Parameters:

mu (np.ndarray) – The cosine of the angle from disk center

Returns:

mask – The limb-darkened mask.

Return type:

np.ndarray

Notes

To account for apparent size effect of points on the stellar surface, we add a factor of 1 to u1. This way, in the (Lambertian) case of no-limb darkening, the user can set u1 = 0, u2 = 0

ld_mask_for_plotting(mu) ndarray

Same as above, but does not add the extra 1 because that is already accounted for by the projection.

plot_surface(lat0: ~astropy.units.quantity.Quantity, lon0: ~astropy.units.quantity.Quantity, ax=None, orbit_radius: ~astropy.units.quantity.Quantity = <Quantity 1. AU>, radius: ~astropy.units.quantity.Quantity = <Quantity 1. earthRad>, phase: ~astropy.units.quantity.Quantity = <Quantity 90. deg>, inclination: ~astropy.units.quantity.Quantity = <Quantity 0. deg>, nlon: int = 1000, nlat: int = 500, rasterize: bool = True, vmin: float = None, vmax: float = None)

Add the transit to the surface map and plot.

set_fac_grid()

Set the gridmaker for each facula to be the same.

set_spot_grid()

Set the gridmaker for each spot to be the same.