simpunch.stars#

Functions for starfield generation.

Attributes#

Functions#

load_catalog(, url)

Load the Hipparcos catalog.

load_raw_hipparcos_catalog(, url)

Download hipparcos catalog from website.

filter_for_visible_stars(→ pandas.DataFrame)

Filter to only include stars brighter than a given magnitude.

find_catalog_in_image(, mode)

Convert the RA/DEC catalog into pixel coordinates using the provided WCS.

Module Contents#

simpunch.stars.THIS_DIR#
simpunch.stars.HIPPARCOS_URL = 'https://cdsarc.cds.unistra.fr/ftp/cats/I/239/hip_main.dat'#
simpunch.stars.load_catalog(catalog_path: str = os.path.join(THIS_DIR, 'data/hip_main.dat'), url: str = HIPPARCOS_URL) pandas.DataFrame[source]#

Load the Hipparcos catalog.

simpunch.stars.load_raw_hipparcos_catalog(catalog_path: str = os.path.join(THIS_DIR, 'data/hip_main.dat'), url: str = HIPPARCOS_URL) pandas.DataFrame[source]#

Download hipparcos catalog from website.

Parameters:
  • catalog_path (str) – path to the Hipparcos catalog

  • url (str) – url to the Hipparcos catalog for retrieval

Returns:

loaded catalog with selected columns

Return type:

pd.DataFrame

simpunch.stars.filter_for_visible_stars(catalog: pandas.DataFrame, dimmest_magnitude: float = 6) pandas.DataFrame[source]#

Filter to only include stars brighter than a given magnitude.

Parameters:
  • catalog (pd.DataFrame) – a catalog data frame

  • dimmest_magnitude (float) – the dimmest magnitude to keep

Returns:

a catalog with stars dimmer than the dimmest_magnitude removed

Return type:

pd.DataFrame

simpunch.stars.find_catalog_in_image(catalog: pandas.DataFrame, wcs: astropy.wcs.WCS, image_shape: int, int, mode: str = 'all') numpy.ndarray[source]#

Convert the RA/DEC catalog into pixel coordinates using the provided WCS.

Parameters:
Returns:

pixel coordinates of stars in catalog that are present in the image

Return type:

np.ndarray