calistar package#
Submodules#
calistar.calistar module#
Module with the calistar
tool.
- class calistar.calistar.CaliStar(gaia_source: int | str, gaia_release: str | None = None)[source]#
Bases:
object
Class for finding calibration stars based on their separation and magnitude difference with the selected
gaia_source
.- find_calib(search_radius: float = 0.1, g_mag_range: Tuple[float, float] | None = None, write_csv: bool = True) DataFrame [source]#
Function for finding calibration stars. The function returns a
DataFrame
with the sources that are queried from the Gaia catalog, but it also (optionally) stores the data in a CSV file in the working folder. The table also contains 2MASS and WISE magnitudes, and data from The Washington Visual Double Star Catalog. It is recommended to open the CSV file in a spreadsheet editor for easy visualization.- Parameters:
search_radius (float) – Radius (in degrees) of the cone that is used to query the GAIA source catalog to search for calibration sources in the vicinity of the selected
gaia_source
(default: 0.1). The data release of the Gaia source catalog that is used for the query can be set with thegaia_release
argument of theCaliStar
instance.g_mag_range (tuple(float, float), None) – Magnitude range relative to the the Gaia $G$ band of the magnitude of the selected
gaia_source
. The magnitude range will be used for querying sources in the Gaia catalog. The argument should be specified, for example, as(-2.0, 5.0)
if source are selected with a $G$ magnitude that is at most 2 mag smaller and 5 mag larger than the magnitudegaia_source
. A range of \(\pm\) 1.0 mag (i.e.g_mag_range=(-1.0, 1.0)
) is used if the argument ofg_mag_range
is set toNone
.write_csv (bool) – Write the table with found source to a CSV file (default: True). The file will be stored in the working folder and starts with
calib_find_
. The filename contains also the Gaia release and the Gaia source ID of the target.
- Returns:
A
DataFrame
with the table of queried sources.- Return type:
pandas.DataFrame
- select_calib(filter_names: List[str] | None = None, mag_diff: float | Dict[str, float] = 0.1, write_csv: bool = True) DataFrame [source]#
Function for selecting the calibration stars. The function returns a
DataFrame
with the selected sources, but it also (optionally) stores the data in a CSV file in the working folder. It is recommended to open the CSV file in a spreadsheet editor for easy visualization.- Parameters:
filter_names (list(str), None) – List with filter names that are used in combination with
mag_diff
for selecting sources. Any of the 2MASS, WISE, and GAIA filter names from the SVO Filter Profile Service can be used. (default:['2MASS/2MASS.J', '2MASS/2MASS.H', '2MASS/2MASS.Ks']
).mag_diff (float, dict(str, float)) – Allowed magnitude difference between the selected target (i.e. the argument of
gaia_source
) and the sources there were found withfind_calib()
(default: 0.1). The argument can be either a float, in which case the same value is used for all filters listed infilter_names
, or a dictionary in which case the keys should be the filter names that are listed infilter_names
and the values are the allowed magnitude differences for each filter.write_csv (bool) – Write the table with found source to a CSV file (default: True). The file will be stored in the working folder and starts with
calib_select_
. The filename contains also the Gaia release and the Gaia source ID of the target.
- Returns:
The
DataFrame
with the selected calibration stars.- Return type:
pandas.DataFrame
- target_star(write_json: bool = True, get_gaiaxp: bool = True, allwise_catalog: bool = True) Dict[str, str | float] [source]#
Function for retrieving the the astrometric and photometric properties of a target star of interest. The function returns a dictionary with the properties, but it also (optionally) stores the data in a JSON file in the working folder.
- Parameters:
write_json (bool) – Write the target properties to a JSON file (default: True). The file will be stored in the working folder and starts with
target_
. The filename contains also the Gaia release and the Gaia source ID of the target.get_gaiaxp (bool) – Retrieve the Gaia XP spectrum if available (default: True). If set to
True
, the spectrum will be written to a data file and a plot will also be created. The spectrum is not retrieved when the argument is set toFalse
.allwise_catalog (bool) – Select the WISE magnitudes from the ALLWISE catalog if set to
True
or select the magnitudes from the earlier WISE catalog if set toFalse
.
- Returns:
Dictionary with the properties of the target star.
- Return type:
dict