SpotCollection

class vspec_vsm.SpotCollection(*spots: StarSpot, grid_params: int | Tuple[int, int] = (500, 1000), gridmaker: CoordinateGrid = None)

Bases: object

Container holding StarSpot objects

Parameters:
  • *spots (tuple of StarSpot objects) – A series of StarSpot objects to be added to the collection.

  • Nlat (int, default=500) – Number of latitude points.

  • Nlon (int, default=1000) – Number of longitude points.

  • gridmaker (CoordinateGrid, default=None) – CoordinateGrid object, probably passed from a Star

Notes

This class is a container for StarSpot objects. It can be used to store a series of spots and to apply operations to the entire collection.

spots

Series of StarSpot objects in the collection.

Type:

tuple of StarSpot objects

gridmaker

CoordinateGrid object used to calculate the grid of the stellar surface.

Type:

CoordinateGrid object

Attributes:
gridmaker

Methods

add_spot(spot)

Add a StarSpot object or a list of StarSpot objects to the collection.

age(time)

Age spots according to its growth timescale and decay rate.

clean_spotlist()

Remove spots that have decayed to 0 area from the spots attribute of the SpotCollection object.

get_coverage(r_star)

Get the fractional coverage of star spots.

map_pixels(star_rad, star_teff)

Map latitude and longitude points containing the umbra and penumbra of each spot.

set_gridmaker(gridmaker)

Set the gridmaker attribute safely.

Attributes Summary

Methods Summary

add_spot(spot)

Add a StarSpot object or a list of StarSpot objects to the collection.

age(time)

Age spots according to its growth timescale and decay rate.

clean_spotlist()

Remove spots that have decayed to 0 area from the spots attribute of the SpotCollection object.

get_coverage(r_star)

Get the fractional coverage of star spots.

map_pixels(star_rad, star_teff)

Map latitude and longitude points containing the umbra and penumbra of each spot.

set_gridmaker(gridmaker)

Set the gridmaker attribute safely.

Attributes Documentation

gridmaker: CoordinateGrid = None

Methods Documentation

add_spot(spot: StarSpot | list[StarSpot])

Add a StarSpot object or a list of StarSpot objects to the collection.

Parameters:

spot (StarSpot or list of StarSpot objects) – StarSpot object(s) to be added to the collection.

Notes

This method adds a StarSpot object or a list of StarSpot objects to the spots attribute of the SpotCollection object.

For every spot added to the spots attribute, each first has it’s own gridmaker attribute set to be identical to the SpotColelction’s own gridmaker attribute.

age(time: astropy.units.Quantity) None

Age spots according to its growth timescale and decay rate.

Remove spots that have decayed.

Parameters:

time (astropy.units.Quantity) – Length of time to age the spot. For most realistic behavior, time should be << spot lifetime.

clean_spotlist()

Remove spots that have decayed to 0 area from the spots attribute of the SpotCollection object.

Notes

This method iterates over the StarSpot objects in the spots attribute of the SpotCollection object and removes those that have decayed to 0 area and are not growing. The remaining StarSpot objects are stored back in the spots attribute of the SpotCollection object.

get_coverage(r_star: astropy.units.Quantity)

Get the fractional coverage of star spots.

Parameters:

r_star (astropy.units.Quantity) – The radius of the star.

Returns:

coverage – The fraction of the stellar surface covered by spots.

Return type:

float

map_pixels(star_rad: astropy.units.Quantity, star_teff: astropy.units.Quantity)

Map latitude and longitude points containing the umbra and penumbra of each spot. For pixels with coverage from multiple spots, assign the coolest Teff to that pixel.

Parameters:
Returns:

surface_map – Map of the stellar surface with Teff assigned to each pixel

Return type:

array of astropy.units.Quantity , shape(M,N)

set_gridmaker(gridmaker: CoordinateGrid)

Set the gridmaker attribute safely.

Parameters:

gridmaker (VSPEC.helpers.CoordinateGrid) – The CoordinateGrid object to set