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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bolognastrospectra-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 c4e5ab200bffc1c66e8df30de3f51bc89464ca18418c5ece65ca34982124becd
MD5 40260ff118a42a348a1a8bee6fe28ffd
BLAKE2b-256 026ed154848c050989196af2a0cc9c9e4c734ff22d5871cbd47e88dccb335b3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bolognastrospectra-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6bafdb5abc311764d707e4636824e7b52c0e1ebcbd0ee69ab1d32917ca450c2b
MD5 b8c5d7bac9c082c8d65705c925d1e53a
BLAKE2b-256 43ab8bb086e235e502644dc20a87f66a49d103f6d9caed1d55a5b8300a857c23

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