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.6.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.6-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bolognastrospectra-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 99e9691be50409f167242255731692038369cd50f58e175e0176eba083d5a1a8
MD5 5e4df38d7e67b20caf4ff7d661b4a295
BLAKE2b-256 504c73da080648169e66a281cd9fd64f02b210ee665dd13fe30821e8b42bed2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bolognastrospectra-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7d3ff6d1db76a63adee8c01151b2bee62c6a01b1dd4965e7b500e0d9f83be1ee
MD5 a5ffed38bb9a0b97eb915c5e5e717d85
BLAKE2b-256 21865b35438151ccb432b7f1851d86d7d4525e41c7118348e2f06b52735ea999

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