SpotGenerator¶
- class vspec_vsm.SpotGenerator(dist_area_mean: ~astropy.units.quantity.Quantity, dist_area_logsigma: float, umbra_teff: ~astropy.units.quantity.Quantity, penumbra_teff: ~astropy.units.quantity.Quantity, growth_rate: ~astropy.units.quantity.Quantity = <Quantity 0.52 1 / d>, decay_rate: ~astropy.units.quantity.Quantity = <Quantity 10.89 msh / d>, init_area: ~astropy.units.quantity.Quantity = <Quantity 10. msh>, distribution='solar', coverage: float = 0.2, grid_params: int | ~typing.Tuple[int, int] = (500, 1000), gridmaker: ~vspec_vsm.coordinate_grid.CoordinateGrid = None, rng: ~numpy.random._generator.Generator = Generator(PCG64) at 0x7F5F71E15EE0)¶
Bases:
objectSpot Generator
Class controling the birth rates and properties of new spots. This class is based on various studies, but since in general starspots cannot be resolved, lots of gaps are filled in with studies of sunspots.
- Parameters:
average_area (astropy.units.Quantity) – The average peak spot area.
area_spread (float) – The standard deviation, in dex, of the lognormal peak spot area distribution
umbra_teff (astropy.units.Quantity) – Effective temperature of umbra.
penumbra_teff (astropy.units.Quantity) – Effective temperature of penumbra.
growth_rate (astropy.units.Quantity , default=0.52/u.day) – The spot growth rate.
decay_rate (astropy.units.Quantity [area/time], default = 10.89 * MSH/u.day) – The spot decay rate.
starting_size (astropy.units.Quantity , default=10*MSH) – The area of each spot at birth.
distribution (str, default='solar') – The spot distribution method. ‘iso’ or ‘solar’.
coverage (float, default=0.2) – The factional coverage of surface by spots in growth-decay equillibrium.
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.
rng (numpy.random.generator, default = numpy.random.default_rng()) – The random number generator to use.
- average_spot_area¶
The average peak spot area.
- Type:
- spot_area_spread¶
The standard deviation, in dex, of the lognormal peak spot area distribution.
- Type:
- umbra_teff¶
Effective temperature of umbra.
- Type:
- penumbra_teff¶
Effective temperature of penumbra.
- Type:
- growth_rate¶
The spot growth rate.
- Type:
- decay_rate¶
The spot decay rate.
- Type:
- starting_size¶
The area of each spot at birth.
- Type:
- gridmaker¶
A CoordinateGrid object to create the stellar surface grid.
- Type:
CoordinateGrid or subclass
- rng¶
The random number generator to use.
- Type:
numpy.random.generator
- is_static¶
- mean_lifetime¶
- mean_area¶
Notes
The distribution parameter can have values of ‘iso’ of ‘solar’. The ‘iso’ keyword distributes spots evenly across the surface. The ‘solar’ keyword, on the other hand, distributes spots according to their know clustering around +/- 15 degrees solar latitude [1].
References
[1]Mandal, S., Karak, B. B., & Banerjee, D. 2017, ApJ, 851, 70
- Attributes:
is_staticTrue if the spots do not decay.
mean_areaThe time-averaged area of a typical spot.
mean_lifetimeThe mean lifetime of the spots.
Methods
birth_spots(time, rad_star)Generate new StarSpot objects to be birthed over a given time duration.
generate_mature_spots(coverage, r_star)Generate mature StarSpot objects to cover a given fraction of the star's surface.
generate_spots(n_spots)Create a specified number of StarSpot objects.
get_coordinates(n_spots)Get coordinates for a StarSpot distribution.
get_n_spots_to_birth(time, rad_star)Calculate how many new StarSpot objects to birth over a given time duration (expectation value).
off([grid_params, gridmaker, rng])Create an instance that does not generate anything.
Attributes Summary
True if the spots do not decay.
The time-averaged area of a typical spot.
The mean lifetime of the spots.
Methods Summary
birth_spots(time, rad_star)Generate new StarSpot objects to be birthed over a given time duration.
generate_mature_spots(coverage, r_star)Generate mature StarSpot objects to cover a given fraction of the star's surface.
generate_spots(n_spots)Create a specified number of StarSpot objects.
get_coordinates(n_spots)Get coordinates for a StarSpot distribution.
get_n_spots_to_birth(time, rad_star)Calculate how many new StarSpot objects to birth over a given time duration (expectation value).
off([grid_params, gridmaker, rng])Create an instance that does not generate anything.
Attributes Documentation
- is_static¶
True if the spots do not decay.
- Returns:
is_static – True if the spots do not decay.
- Return type:
- mean_area¶
The time-averaged area of a typical spot.
- Returns:
mean_area – The time-averaged area of a typical spot.
- Return type:
- mean_lifetime¶
The mean lifetime of the spots.
- Returns:
mean_lifetime – The mean lifetime of spots.
- Return type:
Methods Documentation
-
birth_spots(time:
astropy.units.Quantity, rad_star:astropy.units.Quantity) tuple[StarSpot]¶ Generate new StarSpot objects to be birthed over a given time duration.
- Parameters:
time (astropy.units.Quantity) – Amount of time in which to birth spots. The total number of new spots will consider this time and the birthrate.
rad_star (astropy.units.Quantity) – The radius of the star.
- Returns:
New StarSpot objects.
- Return type:
Tuple[StarSpot]
-
generate_mature_spots(coverage: float, r_star:
astropy.units.Quantity) List[StarSpot]¶ Generate mature StarSpot objects to cover a given fraction of the star’s surface.
This method generates mature spots such that the total solid angle subtended by the spots covers a specified fraction of the star’s surface.
- Parameters:
coverage (float) – The fraction of the star’s surface to be covered by the spots.
r_star (astropy.units.Quantity) – The radius of the star.
Returns – List[StarSpot]: A list of mature spots generated by this method.
Raises – ValueError: If the coverage is greater than 1 or less than 0.
- generate_spots(n_spots: int) tuple[StarSpot]¶
Create a specified number of StarSpot objects.
- Parameters:
n_spots (int) – Number of spots to create.
- Returns:
Tuple of new StarSpot objects.
- Return type:
- Raises:
ValueError – If an unknown value is given for distribution.
- get_coordinates(n_spots: int)¶
Get coordinates for a StarSpot distribution.
- Parameters:
n_spots (int) – Number of spots to create.
- Returns:
lat (astropy.units.Quantity) – Latitude coordinates of the new spots
lon (astropy.units.Quantity) – Longitude coordinates of the new spots
Notes
In order to draw latitude points for the isotropic case, we use inverse transform sampling to account for the jacobian.
-
get_n_spots_to_birth(time:
astropy.units.Quantity, rad_star:astropy.units.Quantity) float¶ Calculate how many new StarSpot objects to birth over a given time duration (expectation value).
- Parameters:
time (astropy.units.Quantity) – Amount of time in which to birth spots. The total number of new spots will consider this time and the birthrate.
rad_star (astropy.units.Quantity) – The radius of the star.
- Returns:
N_exp – Expected number of new StarSpot objects.
- Return type:
- classmethod off(grid_params: int | ~typing.Tuple[int, int] = 1000, gridmaker: ~vspec_vsm.coordinate_grid.CoordinateGrid = None, rng: ~numpy.random._generator.Generator = Generator(PCG64) at 0x7F5F71E16A40)¶
Create an instance that does not generate anything.
- Parameters:
grid_params (int or tuple) – The number of latitude and longitude points on the stellar surface.
gridmaker (CoordinateGrid) – A CoordinateGrid object to create the stellar surface grid.
rng (numpy.random.generator) – The random number generator to use.