Reading individual data columns with ifeffit
Hello all, When reading data files using the read_data command in ifeffit is there a way to specify which columns of data will be read? I have very long data files and run into array size problems when I try and read the entire file. However, if I could read only columns 1, 2, and 3 rather than all 5 data columns I think my problem would be solved. I think narray may be the command to use, but I'm not sure how to implement it and couldn't find anything in the ifeffit manual. Thanks! Matt -- ******************************************* Matthew Ginder-Vogel Post Doctoral Researcher Center for Critical Zone Research Environmental Soil Chemistry University of Delaware http://ag.udel.edu/SoilChem/gindervogel.html (302) 831-0608 mattgv@udel.edu *******************************************
On Friday 04 April 2008 10:41:27 Matthew Ginder-Vogel wrote:
Hello all,
When reading data files using the read_data command in ifeffit is there a way to specify which columns of data will be read? I have very long data files and run into array size problems when I try and read the entire file. However, if I could read only columns 1, 2, and 3 rather than all 5 data columns I think my problem would be solved.
I think narray may be the command to use, but I'm not sure how to implement it and couldn't find anything in the ifeffit manual.
Hey Matt, To my knowledge, no. You might consider pre-processing the file using your favorite programming language. B -- Bruce Ravel ------------------------------------ bravel@bnl.gov National Institute of Standards and Technology Synchrotron Methods Group at NSLS --- Beamlines U7A, X24A, X23A2 Building 535A Upton NY, 11973 My homepage: http://xafs.org/BruceRavel EXAFS software: http://cars9.uchicago.edu/~ravel/software/exafs/
Hi Matt, Like Bruce said, ifeffit always reads in the whole data file into data arrays. We could change that.... If you're running out of data space, you can remove temporary arrays: macro readbigfile file group read_data($1, group=_tmp_, label='c1 c2 c3 c4') set $2.energy = _tmp_.c1 set $2.i0 = _tmp_.c2 set $2.fe_01 = _tmp_.c3 # etc erase @group _tmp_ end macro readbigfile 'mydatafile.dat' 'mygroup' (which will read everything and save what you want). This will potentially use up a lot of space, which should then be freed. I think that athena does this sort of trick (read to temporary variables, then erase most of it) when reading in data for multi-element detectors. (If you work hard at this and have large enough data sets, you'll eventually bring ifeffit's crude data management to its knees). For what it's worth, the 'narrays' argument is for weirdly formatted datafiles where 1 line / row does not correspond to 1 data point. Oddly enough, it happens that data sometimes gets written to ASCII files like this: energy1 i01 it2 energy2 i02 it2 energy3 i03 it3 energy4 i04 it4 energy5 i05 it5 energy5 i05 it5 Apparently, that's from back in the days when newline characters were considered wasteful. --Matt
participants (3)
-
Bruce Ravel
-
Matt Newville
-
Matthew Ginder-Vogel