Metadata-Version: 2.4
Name: bolognastrospectra
Version: 0.1.2
Summary: A library to plot and get the additional data from the sample of CCs
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.20.0
Requires-Dist: astropy>=5.0
Requires-Dist: matplotlib>=3.5.0

# 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:

```bash
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()`

```python
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()`

```python
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

```python
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.
