Skip to content

glamod/mdf_reader

Repository files navigation

Model Data Format reader: mdf_reader toolbox

Versions Python Package Index Build Supported Python Versions Tag Release
Documentation and Support Documentation Status
Open Source License zenodo
Coding Standards Python Black Ruff pre-commit.ci status FOSSA
Development Status Project Status: WIP: Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Build Status Coveralls
Funding Funding

The mdf_reader is a python tool designed to read data files compliant with a user specified data model. It was developed to read the IMMA (International Maritime Meteorological Archive) data format, but it has been enhanced to account for meteorological data formats in the case of:

  • Data that is stored in a human-readable manner: “ASCII” format.
  • Data that is organized in single line reports
  • Reports that have a coherent internal structure and can be modelised.
  • Reports that have a fixed width or field delimited types
  • Reports that can be organized in sections, in which case each section can be of different types (fixed width of delimited)

Installation

You can install the package directly with pip:

pip install  mdf_reader

If you want to contribute, I recommend cloning the repository and installing the package in development mode, e.g.

git clone https://github.com/glamod/mdf_reader
cd mdf_reader
pip install -e .

This will install the package but you can still edit it and you don't need the package in your PYTHONPATH

Run a test

import mdf_reader
import matplotlib.pyplot as plt

data = mdf_reader.tests.read_imma1_buoys_nosupp()

imma_data = mdf_reader.read(filepath, data_model = 'imma1',sections = ['core','c1','c98'])

For more details on how to use the mdf_reader tool see the following jupyter notebooks.