simpunch.stars#
Functions for starfield generation.
Attributes#
Functions#
|
Load the Hipparcos catalog. |
|
Download hipparcos catalog from website. |
|
Filter to only include stars brighter than a given magnitude. |
|
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:
catalog (pd.DataFrame) – a catalog dataframe
wcs (WCS) – the world coordinate system of a given image
image_shape ((int, int)) – the shape of the image array associated with the WCS, used to only consider stars with coordinates in image
mode (str) – either “all” or “wcs”, see <https://docs.astropy.org/en/stable/api/astropy.coordinates.SkyCoord.html#astropy.coordinates.SkyCoord.to_pixel>
- Returns:
pixel coordinates of stars in catalog that are present in the image
- Return type:
np.ndarray