Closed trotsiuk closed 3 years ago
Hi Volodymyr, I made a separate branch with a nead wrtier: https://github.com/GEUS-PROMICE/pyNEAD/tree/write At the moment it asks for what it should put in the header in form of a "ini" text file: https://github.com/GEUS-PROMICE/pyNEAD/blob/write/sample_header.ini
Here is how I use it at the moment:
import pytest
import numpy as np
import nead
fname = "sample.csv"
def test_write():
ds = nead.read(fname, index_col=0, MKS=True)
df = ds.to_dataframe()
df = df.reset_index()
nead.write(df, nead_config = 'sample_header.ini', output_path = 'sample_out.csv')
ds2 = nead.read('sample_out.csv', index_col=0, MKS=True)
print(ds2)
Soon we should make a function that builds the header from the metadata contained in an xarray. Maybe you have been working on it in the meantime?
Sorry for the silence @trotsiuk. I did not get notified of this issue. @BaptisteVandecrux has just implemented this, it should be pushed to main soon.
Cool, thank you both @BaptisteVandecrux and @mankoff! I haven't been working yet with nead
format, but planning to use it in collaboration with @EnviDat.
More as a question.
Is there an interest and plan also to have a
nead.write
function?