R-Lum/rxylib

Implement support for metadata

RLumSK opened this issue · 8 comments

So far metadata are not supported and not exposed in R ... implemented on request, maybe for version 0.2.0

The code to get the metadata is clear, but how to store them? Also in a list, in an additional object?

The problem is not that the code is not clear, the problem is that we cannot grep a list with allowed keywords. Means: We either parse the CPP files to search for keywords or enter them manually. I did I overlook something and we can have access to the keywords like we have access to the format information? For the storage: I may suggest a list which contains two objects: The metadata and the measurement data. Something like object <- list(METADATA = list(), DATA = matrix())
In this case we could also write a short show method (only S3) to summarise the import.

I think you overlook something:

  DataSet* dataset = load_file(path, format_name, options);

    size_t meta_size = dataset ->meta.size();
    std::string value;
    std::string key;

    for(int i =0; i < meta_size; i++){    
      key = dataset ->meta.get_key(i); 
      value = dataset ->meta.get(key);
      std::cout <<  key << value << std::endl;    
    }

we can loop over all available keys (in this case for the dataset, not for a block) and get the key and the value.

Ok, right, I've overlooked it indeed (where did you find it). Anyway, sure in this case we can just use this code and return what we get. It should become part of the internal function read_data.cpp.

Storing metadata for the blocks might become, however, challenging. Since it would mean that we have to think of a structure like:

object <- list(metadata = list(), dataset = list(block = list(metadata_block = list(), data_block = m())))

Using S3 methods to access the values should smooth the structure.

Just read the code ;-)
Ok, I try to implement this in the function, add an extra argument metaData = TRUE in read_xyData.R.
Nevertheless storing the results is not that easy, because you have Block and Dataset meta data.

Ok, as written above, go ahead.

Thanks Johannes