# Archive of spectral_database README

## Data Structure of .JSON file

The JSON data provided follows the following structure:

- `id`: (int) The unique identifier for the lamp.
- `name`: (string) The name of the lamp.
- `last_updated_date`: (date) The date of the last update for the lamp.
- `creation_date`: (date) The date of lamp creation.
  
- `captures`: (list) A list of captures for the captures, where each capture contains the following:
  - `id`: (int) The unique identifier for the capture.
  - `power`: (float) The power value.
  - `voltage`: (float) The voltage value.
  - `current`: (float) The current value.
  
  - `batch`: (object) Information about the batch, including:
    - `name`: (string) The name of the batch.
    - `batch_date`: (date) The date of the batch.
    - `user_id`: (int) The user identifier.
   
  - `capture_date`: (date) The date of the capture.
  - `config_id`: (int) The configuration file (calibration) identifier.
  - `spectral_type_id`: (string) The spectral type (type of normalization) identifier.
  - `distance`: (float) The distance value for the capture.
  - `legacy`: (boolean) Legacy status, to know if the capture is coming from the legacy system.
  
  - `spectral_capture`: (object) Information about the spectral capture, including:
    - `id`: (int) The unique identifier for the spectral capture.
    - `vertical_angle`: (float) The vertical angle.
    - `rotationnal_angle`: (float) The rotational angle.
    - `ipi`: (float) The Induced Photosynthesis Index.
    - `msi`: (float) The Melatonin Suppression Index.
    - `sli`: (float) The Star Light Index.
    - `lumen`: (float) The lumen value.
    - `percent_blue`: (float) The Blue Light Index.
    - `cct`: (string) Correlated Color Temperature.
    - `outlier`: (boolean) Outlier status, to know if a value is considered adequate or not.

- `models`: (list) A list of models for the item, where each model contains the following:
  - `voltage`: (float) The voltage value.
  - `current`: (float) The current value.
  - `power`: (float) The power value.
  - `lumen_per_watt`: (float) The lumens per watt value.
  - `reference`: (string) The reference for the model.
  - `cct`: (string) Correlated Color Temperature.
  - `lamp_colors`: (string) The color of the lamp.
  - `uses`: (string) The intended use of the lamp.
  - `brands`: (string) The brand of the lamp.
  - `categories`: (list) The categorie the model belongs to.
  - `lamp_types`: (string) The type of the lamp.
## How to Run the Python Script

To process and extract information from the provided JSON data, you can use the Python script. Here are the steps to run the script:

1. Ensure you have Python installed on your system. You can download it from [Python's official website](https://www.python.org/downloads/).

2. Open a terminal or command prompt and navigate to the directory where the script and `data.json` file are located.

3. Run the Python script by executing the following command: ```python example.py ```
