Metadata-Version: 2.1
Name: open-radar-data
Version: 0.0.4
Summary: Provides utility functions for accessing data repository for Project Pythia examples/notebooks
Home-page: https://github.com/openradar/open-radar-data
Maintainer: Open Radar Team
Maintainer-email: 
License: MIT
Project-URL: Documentation, https://github.com/openradar/open-radar-data
Project-URL: Source, https://github.com/openradar/open-radar-data
Project-URL: Tracker, https://github.com/openradar/open-radar-data/issues
Keywords: Radar,Pooch
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

# Open-Radar-Data

A place to share radar data with the community, shared between the open radar packages

## Sample data sets

These files are used as sample data in Pythia Project examples/notebooks and are downloaded by `open-radar-data` package:

- `0080_20210730_160000_01_02.scn.gz`
- `2006_20220324_000000_000.scnx.gz`
- `2013051000000600dBZ.vol`
- `71_20181220_060628.pvol.h5`
- `DWD-Vol-2_99999_20180601054047_00.h5`
- `SUR210819000227.RAWKPJV`
- `20220628072500_savevol_COSMO_LOOKUP_TEMP.nc`
- `MLA2119412050U.nc`
- `MLL2217907250U.003.nc`
- `T_PAGZ35_C_ENMI_20170421090837.hdf`
- `cfrad.20080604_002217_000_SPOL_v36_SUR.nc`
- `cor-main131125105503.RAW2049`
- `sample_sgp_data.nc`
- `sample_rainbow_5_59.nc`

## Adding new datasets

To add a new dataset file, please follow these steps:

1. Add the dataset file to the `data/` directory
2. From the command line, run `python make_registry.py` script to update the registry file residing in `open_radar_data/registry.txt`
3. Commit and push your changes to GitHub

## Using datasets in notebooks and/or scripts

- Ensure the `open_radar_data` package is installed in your environment

  ```bash
  python -m pip install open-radar-data

  # or

  python -m pip install git+https://github.com/openradar/open-radar-data
  ```

- Import `DATASETS` and inspect the registry to find out which datasets are available

  ```python
  In [1]: from open_radar_data import DATASETS

  In [2]: DATASETS.registry_files
  Out[2]: ['sample_sgp_data.nc`]
  ```

- To fetch a data file of interest, use the `.fetch` method and provide the filename of the data file. This will

  - download and cache the file if it doesn't exist already.
  - retrieve and return the local path

  ```python
  In [4]: filepath = DATASETS.fetch('sample_sgp_data.nc')

  In [5]: filepath
  Out[5]: '/Users/mgrover/Library/Caches/open-radar-data/sample_sgp_data.nc'
  ```

- Once you have access to the local filepath, you can then use it to load your dataset into pandas or xarray or your package of choice:

  ```python
  In [6]: radar = pyart.io.read(filepath)
  ```

## Changing the default data cache location

The default cache location (where the data are saved on your local system) is dependent on the operating system. You can use the `locate()` method to identify it:

```python
from open_radar_data import locate
locate()
```

The location can be overwritten by the `OPEN_RADAR_DATA_DIR` environment
variable to the desired destination.
