On Friday 12 January 2007 15:20, Aaron Slowey wrote:
I'm running IFEFFIT, Athena, etc. on my Intel Mac after using the the recent installer provided by MRCAT. I've opened Athena successfully and was able to load a GSECARS data file, but I am unable to load SSRL binary data files (original file from a VMS beamline computer).
Would it help to convert the SSRL binaries to ASCII files? If so, how can I do that?
Aaron, There are enough people in the Ifeffit-using community who are SSRL users and who might be interested in this question. SO I am CCing my answer to the mailing list. Question 3 at this FAQ page: http://cars9.uchicago.edu/iffwiki/FAQ/HoraeQuestions explains in some detail what kind of data Athena is able to read. Obviously SSRL's binary format cannot be imported without the use of a plugin. It would be possible, in principle, to write a plugin that is capable of reading the SSRL binary format. However, to my knowledge (which certainly may be faulty) the technical details of the SSRL format are not published any place where I can find them. That's something of an impediment. ;-) It would most certainly help to convert to an ascii format. Not having worked at SSRL since my grad school days, I don't really know how to do so. Your beamline scientist should be able to help you with that. Perhaps someone on the list will know the details. B -- Bruce Ravel ---------------------------------------------- bravel@anl.gov Molecular Environmental Science Group, Building 203, Room E-165 MRCAT, Sector 10, Advance Photon Source, Building 433, Room B007 Argonne National Laboratory phone and voice mail: (1) 630 252 5033 Argonne IL 60439, USA fax: (1) 630 252 9793 My homepage: http://cars9.uchicago.edu/~ravel EXAFS software: http://cars9.uchicago.edu/~ravel/software/
Hi, Bruce, I have written codes in MATLAB to convert ASCII data into SSRL's binary data in order to use EXAFSPAK. The binary format is guessed by dumping the data. Maybe someone can use it as a start and come up with a plugin for Athena. Bruce Ravel wrote:
Question 3 at this FAQ page: http://cars9.uchicago.edu/iffwiki/FAQ/HoraeQuestions explains in some detail what kind of data Athena is able to read. Obviously SSRL's binary format cannot be imported without the use of a plugin.
It would be possible, in principle, to write a plugin that is capable of reading the SSRL binary format. However, to my knowledge (which certainly may be faulty) the technical details of the SSRL format are not published any place where I can find them. That's something of an impediment. ;-)
It would most certainly help to convert to an ascii format. Not having worked at SSRL since my grad school days, I don't really know how to do so. Your beamline scientist should be able to help you with that. Perhaps someone on the list will know the details.
B
-- Tsu-Chien WENG European Synchrotron Radiation Facility 6, rue Jules Horowitz, EXPH Sect-26 38043 Grenoble, FRANCE Tel: +33(0)438.88.19.82 Fax: +33(0)476.88.27.84 function writeSSRL(immigrant) %WRITESSRL save struct data in SSRL binary format and % allow MVIEW, MCALIB, MAVE to read % % The input struct data should contain the following fields % froot: char array (the root name of the data file) % fext: char array (the extension of the data file) % beamline: char array (beamline infomation) % comments: cell array {6x1} (user comments) % recTime: char array (data recording time) % labels: cell array {Ncolx1} (labels for each columns) % offsets: double array [Ncolx1] (offset for each channels) % data: double array [NcolxNpts] (data) % % The converted file has a prefix of 'ssrl_' to the original file name % and can be read by MVIEW, MCALIB, and MAVE. % %************* % SSRL format %************* % 1. 800 bytes = 40 bytes (title MUST start with 'SSRL -') '\n' '0' % + 40 bytes (recording date:time) '\n' '0' % + 40 bytes (scaler_file) '\n' '0' % + 40 bytes (region_file) '\n' '0' % + 80 bytes (mirror_info) '\n' '0' % + 40 bytes (mirror param) '\n' '0' % + 80 bytes x 6 (User comments) '\n' '0' % % 2. NCOL*4 bytes (offsets) % NCOL*4 bytes (weights) % % 3. NCOL*20 bytes (labels for each column) % % 4. 4 bytes integer (npts) % % 5. mysterious 12 bytes starting w/ char(8),char(0), char(1), char(0) % probably it's not important. % % 6. NCOL*NPTS*4 bytes (data) % % % Tsu-Chien Weng, 2002-07-24 % Copyleft(c), by the Penner-Hahn research group % 2004-12-01: add truncateOrFillBlanks() to clean up the codes fname=['ssrl_' immigrant.froot '.' immigrant.fext]; fid=fopen(fname,'w','vaxd'); [numDataColumns,numDataPoints]=size(immigrant.data); % char([10 0])=['\n', '0'] % Hallelujah ... % Tricks: 'SSRL - EXAFS Data Collector 1.3 '; % 1. 800 bytes of char (headers) fwrite(fid,[truncateOrFillBlanks('SSRL - EXAFS Data Collector 1.3 ',38), 10 0],'char'); fwrite(fid,[truncateOrFillBlanks(immigrant.recTime,38), 10 0],'char'); fwrite(fid,[truncateOrFillBlanks(['PTS: ' num2str(numDataPoints) ' COLS: ' num2str(numDataColumns)],38), 10 0],'char'); fwrite(fid,[truncateOrFillBlanks('UNKNOWN.DET',38), 10 0],'char'); fwrite(fid,[truncateOrFillBlanks('UNKNOWN.RGN',38), 10 0],'char'); fwrite(fid,[truncateOrFillBlanks(immigrant.beamline,78), 10 0],'char'); fwrite(fid,[truncateOrFillBlanks(' ',38), 10 0],'char'); for n=1:6, fwrite(fid,[truncateOrFillBlanks(immigrant.comments{n},78), 10 0], 'char'); end % 2. NCOL*8 bytes of float (channel offsets and weightings) fwrite(fid,immigrant.offsets,'float'); fwrite(fid,ones(numDataColumns,1),'float'); % 3. NCOL*20 bytes of char (column labels) for n=1:length(immigrant.labels) fwrite(fid,[truncateOrFillBlanks(immigrant.labels{n},18), 10 0],'char'); end % 4. 4 bytes of integer (numbers of energy points) fwrite(fid,numDataPoints,'int'); % 5. 12 bytes of mysterious char fwrite(fid,[8 0 1 0 33 71 24 40 -117 68 11 0],'char'); % 6. NCOL*NPTS*4 bytes of floats (data) fwrite(fid,immigrant.data,'float'); fclose(fid); return %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function textString=truncateOrFillBlanks(textString,maxLengthOfString) lengthOfString=length(textString); if lengthOfString > maxLengthOfString, textString=textString(1:maxLengthOfString); else textString=[textString repmat(' ',1,maxLengthOfString-lengthOfString)]; end return function [data, hdr]=readssrl(ssrlfile) %READSSRL Read SSRL binary data % % 1. 800 bytes = 40 bytes (title MUST start with 'SSRL -') '\n' '0' % + 40 bytes (recording date:time) '\n' '0' % + 40 bytes (data info) '\n' '0' % + 40 bytes (scaler_file) '\n' '0' % + 40 bytes (region_file) '\n' '0' % + 80 bytes (mirror_info) '\n' '0' % + 40 bytes (mirror param) '\n' '0' % + 80 bytes X 6 (User comments) '\n' '0' % % 2. NCOL*4 bytes (offsets) % NCOL*4 bytes (weights) % % 3. NCOL*20 bytes (labels for each column) % % 4. 4 bytes integer (npts) % % 5. myterious 12 bytes starting w/ char(8),char(0), char(1), char(0) % probably it's not important. % % 6. NCOL*NPTS*4 bytes (data) % % % Tsu-Chien Weng, 2002-04-17 % Copyleft(c), by the Penner-Hahn research group % 2002-07-01: output the header info eval(['fid=fopen(''' ssrlfile ''',''r'',''vaxd'');']) title=fgetl(fid);fread(fid,1,'char'); recdate=fgetl(fid);fread(fid,1,'char'); info=fgetl(fid);fread(fid,1,'char'); numbers=str2num(strrep(strrep(info,'PTS:',''),'COLS:','')); numpts=numbers(1);numcols=numbers(2); detfile=fgetl(fid);fread(fid,1,'char'); rgnfile=fgetl(fid);fread(fid,1,'char'); beamline=fgetl(fid);fread(fid,1,'char'); mirror=fgetl(fid);fread(fid,1,'char'); comments=repmat(' ',6,78); for i=1:6 comments(i,:)=fgetl(fid);fread(fid,1,'char'); end offsets=fread(fid,[1,numcols],'float'); weights=fread(fid,[1,numcols],'float'); labels=char(fread(fid,[20,numcols],'char')'); npts=fread(fid,1,'int'); fread(fid,12,'char'); data=fread(fid,[numcols,numpts],'float')'; if nargout > 1, hdr.title=title; hdr.recdate=recdate; hdr.info=info; % hdr.numpts=numpts; % hdr.numcols=numcols; hdr.detfile=detfile; hdr.rgnfile=rgnfile; hdr.beamline=beamline; hdr.mirror=mirror; hdr.comments=comments; hdr.offsets=offsets; hdr.weights=weights; hdr.labels=labels; end fclose(fid);
On Wednesday 17 January 2007 02:57, Tsu-Chien Weng wrote:
I have written codes in MATLAB to convert ASCII data into SSRL's binary data in order to use EXAFSPAK. The binary format is guessed by dumping the data. Maybe someone can use it as a start and come up with a plugin for Athena.
Tsu-Chien, Very helpful! Thanks. If someone can supply me with a few files of test data in the SSRL binary format, I will can put an SSRL plugin on my list of things do do. B -- Bruce Ravel ---------------------------------------------- bravel@anl.gov Molecular Environmental Science Group, Building 203, Room E-165 MRCAT, Sector 10, Advanced Photon Source, Building 433, Room B007 Argonne National Laboratory phone and voice mail: (1) 630 252 5033 Argonne IL 60439, USA fax: (1) 630 252 9793 My homepage: http://cars9.uchicago.edu/~ravel EXAFS software: http://cars9.uchicago.edu/~ravel/software/exafs/
participants (2)
-
Bruce Ravel
-
Tsu-Chien Weng