cheminfo / isotherm-analysis

JS tools to convert isotherms to jcamp and to analyze them
https://cheminfo.github.io/isotherm-analysis/
MIT License
0 stars 0 forks source link

implement rubotherm parser #18

Open kjappelbaum opened 3 years ago

kjappelbaum commented 3 years ago

this is an excel file

8Rubotherm gravimetric (Single gas_high pressure).xls.zip

lpatiny commented 3 years ago

When we are parsing this kind of specific file I would always make the difference between the parser that tries to extract ALL the data as close as possible to the original data and then to pickup what we need to be close to our requirements. (practically 2 variables, meta and spectra).

We can export this parser that is very close to the original file as well so that it could be reused by other packages.

kjappelbaum commented 3 years ago

ok, in this approach the parsers directly tried to map to our metadata schema but moving forward the approach you mention certainly makes more sense.

lpatiny commented 3 years ago

Couple of tips:

export function getMatrixFromXLSX(blob) { const workbook = XLSX.read(blob, { type: 'array' }); return XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]], { header: 1, }); }



In this case the result contain something like
meta: {}  // key / value with all the information in the header
variables: [] // array of object (variable)

variable will have as property: label, units, data:[]