Skip to main content

A library to plot and get the additional data from the sample of CCs

Project description

BolognAstroSpectra

BolognAstroSpectra is a Python library to visualize spectra and retrieve additional information from the Cosmic Chronometers (CCs) sample.


Installation

Install the package from PyPI:

pip install bolognastrospectra

Download the Sample

Download the "CCs sample" folder from the following link:

[insert link]

After downloading, place the CCs sample folder inside your working directory. Alternatively, you can specify its location using the dir_home argument in the library functions.


Sample Catalog

The complete list of object IDs, surveys, and additional information is available in the accompanying PDF document, which can be downloaded from the same Google Drive folder.

Note: All object IDs are integers except for SNH0pe-NS274, which is a string.


Documentation

give_info()

give_info(ID, survey, dir_home=None)

Returns the metadata associated with a given object.

Parameters

Parameter Type Description
ID int or str Object identifier. All IDs are integers except SNH0pe-NS274.
survey str Name of the survey to which the object belongs.
dir_home str, optional Path to the directory containing the CCs sample folder. If None, the current working directory (os.getcwd()) is used.

Returns

  • A tuple containing the object's information if the request is valid.
  • None if:
    • the ID does not exist,
    • the survey is incorrect,
    • or the CCs sample folder has been modified or cannot be found.

give_spectra()

give_spectra(ID, survey, dir_home=None)

Displays the spectrum (or spectra) of the selected object together with its metadata.

Internally, this function first calls give_info() and then plots all available spectra for the requested object.

Parameters

Parameter Type Description
ID int or str Object identifier. All IDs are integers except SNH0pe-NS274.
survey str Name of the survey to which the object belongs.
dir_home str, optional Path to the directory containing the CCs sample folder. If None, the current working directory (os.getcwd()) is used.

Returns

  • Displays the object information and its spectrum (or spectra).
  • Returns None.
  • If the inputs are invalid or the sample folder is missing or modified, the function returns None without displaying any spectrum.

Example

import bolognastrospectra as bas

# Retrieve object information
info = bas.give_info(101, "LEGA-C")
print(info)

# Display the corresponding spectrum
bas.give_spectra(101, "LEGA-C")

Notes

  • Make sure the CCs sample folder has not been renamed or modified.
  • If the sample is stored elsewhere, specify its location with the dir_home parameter.
  • The catalog PDF contains the complete list of supported IDs and survey names.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bolognastrospectra-0.1.4.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bolognastrospectra-0.1.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file bolognastrospectra-0.1.4.tar.gz.

File metadata

  • Download URL: bolognastrospectra-0.1.4.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for bolognastrospectra-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f4fa90842c47904eb701f73cabc74ac8efbec25349d5be75e819489363f34dec
MD5 368734f86fbda518bebb7acec80384a0
BLAKE2b-256 5ba4a7bc2dda998e22e083dc122622c66208b9b9a48443808c7605113c42f2f3

See more details on using hashes here.

File details

Details for the file bolognastrospectra-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for bolognastrospectra-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0911a579343827328f96f01273c2f6f4a22b31cf562aebcd34cb6dd899df6e25
MD5 a69e0a0cc1e5ade4c72dbdde318d0e9b
BLAKE2b-256 4417d9603bbaa12f1eb0a40eb0808cb30b3164a9e85407727dd84b3fa22818aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page