Updated README.md with guide for intrument dependent file reader extensions and updated TODO.md with pending tasks.

This commit is contained in:
2024-10-03 11:31:51 +02:00
parent 89e9dd9ab1
commit dc7f156367
2 changed files with 35 additions and 3 deletions

View File

@ -89,6 +89,38 @@ relative_humidity:
```
# How to Extend DIMAs File Reading Capabilities for New Instruments
We now explain how to extend DIMA's file-reading capabilities by adding support for a new instrument. The process involves adding instrument-specific files and registering the new instrument's file reader.
## 1. Create Instrument Files
You need to add two files for the new instrument:
- A **YAML file** that contains the instrument-specific description terms.
- **Location**: `instruments/dictionaries/`
- A **Python file** that reads the instrument's data files (e.g., JSON files).
- **Location**: `instruments/readers/`
**Example:**
- **YAML file**: `ACSM_TOFWARE_flags.yaml`
- **Python file**: `flag_reader.py` (reads `flag.json` files from the new instrument).
## 2. Register the New Instrument Reader
To enable DIMA to recognize the new instrument's file reader, update the **filereader registry**:
1. Open the file: `instruments/readers/filereader_registry.py`.
2. Add an entry to register the new instrument's reader.
**Example:**
```python
# Import the new reader
from instruments.readers.flag_reader import read_jsonflag_as_dict
# Register the new instrument in the registry
file_extensions.append('.json')
file_readers.update({'ACSM_TOFWARE_flags_json' : lambda x: read_jsonflag_as_dict(x)})
```
## -------------------
## Getting started
@ -96,9 +128,6 @@ To make it easy for you to get started with GitLab, here's a list of recommended
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## TODO
* Talk to Thorsten about rga txt files. Example folder contains incosistent rga txt files, there is no unique column separator (, or )
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files