data table for larch data group
Matt,
If I read an ascii file with read_ascii() like so:
a = read_ascii(file)
The "a" group has a data attribute which contains the entire data table
as a 2D array. It also has 1D arrays for each column from the data
table. Those 1D arrays have attribute names taken from the column labels.
If I do something to change the data table, is there a function that I
can call that repopulates the 1D arrays with the columns of the altered
data table?
For example:
a = read_ascii(file)
a.data is, say, array
Hi Bruce,
At the moment, No. But that should be easy and a very good idea to
separate reading headers plus the data table from naming of the 1d
arrays... Like, I often run into cases where I want to rename arrays after
reading the file. I'll work on that.
I'd also like to be able to sensibly handle columns of non numeric data.
Maybe that's too separate a topic....
On Dec 22, 2017 11:48, "Bruce Ravel"
Matt,
If I read an ascii file with read_ascii() like so:
a = read_ascii(file)
The "a" group has a data attribute which contains the entire data table as a 2D array. It also has 1D arrays for each column from the data table. Those 1D arrays have attribute names taken from the column labels.
If I do something to change the data table, is there a function that I can call that repopulates the 1D arrays with the columns of the altered data table?
For example:
a = read_ascii(file)
a.data is, say, array
a.data = a.data[:, (0 .. 10)]
now a.data is, say, array
a.repopulate_arrays() # <---- the thing i am looking for....
Now a.energy, a.i0, etc should be array
Hope that's clear.
B
-- Bruce Ravel ------------------------------------ bravel@bnl.gov
National Institute of Standards and Technology Synchrotron Science Group at NSLS-II Building 743, Room 114 Upton NY, 11973
Homepage: http://bruceravel.github.io/home/ Beamline: https://www.bnl.gov/ps/beamlines/beamline.php?r=6-BM Software: https://github.com/bruceravel Demeter: http://bruceravel.github.io/demeter/ _______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
On 12/22/2017 04:53 PM, Matthew Newville wrote:
At the moment, No. But that should be easy and a very good idea to
separate reading headers plus the data table from naming of the 1d arrays... Like, I often run into cases where I want to rename arrays after reading the file. I'll work on that. Cool. I was working on it this morning, but didn't like my solution. Hence the question.
I'd also like to be able to sensibly handle columns of non numeric data. Maybe that's too separate a topic....
Not this topic but a very good idea nonetheless. B -- Bruce Ravel ------------------------------------ bravel@bnl.gov National Institute of Standards and Technology Synchrotron Science Group at NSLS-II Building 743, Room 114 Upton NY, 11973 Homepage: http://bruceravel.github.io/home/ Beamline: https://www.bnl.gov/ps/beamlines/beamline.php?r=6-BM Software: https://github.com/bruceravel Demeter: http://bruceravel.github.io/demeter/
participants (2)
-
Bruce Ravel
-
Matthew Newville