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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bolognastrospectra-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e8bfcd7426029e27153018d6b7032ea8c1cbb3b197bdba2d52eae047359553cc
MD5 837082054369f21ccb5350df4e348dfc
BLAKE2b-256 569a7de90997eb6985d0c4b90f3762ba9219ae40b07b1ee1e749c690b4da2ba3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bolognastrospectra-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e5354ff472fc7f8f940d03345ecded3915a379866941d6b1888526362d9baf8
MD5 c8f243edfbf85f94fd8d2aafdb0e7bcc
BLAKE2b-256 74f7388abbd8a2fa58a9f116a4ca6f1fc5c4b2aa77c922b8dd0778d3f3f25df9

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