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:

https://drive.google.com/drive/folders/1UOrLtKDxz4pjyyI9eUT7qi08kH3bAo6g?usp=sharing

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.1.tar.gz (7.6 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.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bolognastrospectra-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 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.1.tar.gz
Algorithm Hash digest
SHA256 3b3b22f16ee785eb02aa522ab124dbefcd9954bd60a93187f11bd6e9c76b87f8
MD5 207365df310815fa436877361f484bfc
BLAKE2b-256 0e234fd42ebd66f7a563fb4b85d0935512b3e4dac6eb7e9338abed82f72a341c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bolognastrospectra-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f005ff6ce7c8dcd554f9daf0fc199d134d6de5b036d37e71b33e134ef7ec4f8e
MD5 5603fbbd3e0e9e4a0978fd5b1d12d152
BLAKE2b-256 348df866b48f8cdb45cd9e412e0a6f78b7942d02821b619e8b0bb18d8f78d339

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