VMD-L Mailing List
From: Ashar Malik (asharjm_at_gmail.com)
Date: Tue Aug 18 2015 - 22:44:28 CDT
- Next message: Andrea Spitaleri: "Re: nvidia cuda mismatch"
- Previous message: sunyeping: "Python.h error when compile VMD-1.9.2"
- In reply to: Ern Seang Ong: "How to extract data from NAMD log file for viscosity calculation"
- Next in thread: Pawel Kedzierski: "Re: How to extract data from NAMD log file for viscosity calculation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi there,
If you are looking to just extract data from the log I have something I
wrote a while back in MATLAB. The code is:
####################################################################
% This is going to be based on NAMD2.0's log file.
fid = fopen('e.log'); % File holding data
fid1 = fopen('e_m.txt', 'w'); % File to which data is written
tline = fgets(fid);
header_ = 0;
dat_ = [];
while ischar(tline)
if ((header_==0) && (size(tline,2)> 6) && strcmp(tline(1:6),'ETITLE'))
header_=1;
fprintf(fid1, '%s',tline(8:end));
end
if ((size(tline,2)> 6) && strcmp(tline(1:6),'ENERGY'))
dat_ = [dat_;tline(8:end)];
fprintf(fid1, '%s',tline(8:end));
end
tline = fgets(fid);
end
fclose(fid);
fclose(fid1);
clear;
str_ = importdata('e_m.txt');
data_ = str_.data;
header_ = str_.colheaders;
clear('str_');
####################################################################
You should be able to fairly easily be able to translate it to a python
script if you don't have MATLAB.
As far as I can see is that it should be able to produce a file, the first
row of which would be the column headers and the following rows would be
their values. The code is simple to write down -- if you have trouble
scripting its equivalant in Python - drop an email here again and maybe
someone can help --- or just wait a while and someone might have something
for you.
Hope this helps.
Best,
/A
- Next message: Andrea Spitaleri: "Re: nvidia cuda mismatch"
- Previous message: sunyeping: "Python.h error when compile VMD-1.9.2"
- In reply to: Ern Seang Ong: "How to extract data from NAMD log file for viscosity calculation"
- Next in thread: Pawel Kedzierski: "Re: How to extract data from NAMD log file for viscosity calculation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]