nilmtk / nilm_metadata

A schema for modelling meters, measurements, appliances, buildings etc
http://nilm-metadata.readthedocs.org
Apache License 2.0
49 stars 47 forks source link

please how can I import the redd.h5 metadata into Matlab #36

Closed Inousss closed 5 years ago

PMeira commented 5 years ago

If you read want the METAdata, it's easier to process the YAML files at https://github.com/nilmtk/nilmtk/tree/master/nilmtk/dataset_converters/redd/metadata

For the data itself, it should be easier to handle the original CSV files instead of the HDF5 container.

PMeira commented 5 years ago

@Jonas-code An alternative approach: https://medium.com/@nipun_batra/interfacing-nilm-algorithms-written-in-matlab-with-nilmtk-31afbf60ed1e

Inousss commented 5 years ago

Thank you @PMeira but I would like to extract data from metadata in hdf5 format only in Matlab without going through python or Ipython

nipunbatra commented 5 years ago

@Jonas-code I would suggest you to look into reading HDF5 files in Matlab. Also look at https://github.com/nilmtk/nilm_metadata/blob/master/nilm_metadata/convert_yaml_to_hdf5.py

I'm afraid that beyond that we won't be able to support on this thread.

Inousss commented 5 years ago

Thank you @nipunbatra

PMeira commented 5 years ago

@Jonas-code You can easily read the metadata attributes from the HDF, but I'm not sure how useful this is:

h5readatt('redd.h5', '/', 'metadata')
h5readatt('redd.h5', '/building1', 'metadata')
...

If you want to try loading the YAML files directly instead of reading the HDF metadata, there are some projects like https://github.com/ewiger/yamlmatlab that use Java classes (which MATLAB support) to load the files, returning a structure.

Neither options seem ideal but they might real you in your goal. As Nipun said, we probably can't help beyond that.

Inousss commented 5 years ago

Thank you very much for help @PMeira ; I would like to use that data with Matlab algorithms, so I wanted to write functions that can extract that data.