diff --git a/Scripts/Models/Factory/private/sqw_phon.m b/Scripts/Models/Factory/private/sqw_phon.m index 010c95c5..ee764dde 100644 --- a/Scripts/Models/Factory/private/sqw_phon.m +++ b/Scripts/Models/Factory/private/sqw_phon.m @@ -685,7 +685,7 @@ seconds = floor(remaining-hours*3600-minutes*60); enddate = addtodate(now, ceil(remaining), 'second'); - options.status = [ 'ETA ' sprintf('%i:%02i:%02i', hours, minutes, seconds) ', ending on ' datestr(enddate) ]; + options.status = [ 'ETA ' sprintf('%i:%02i:%02i', hours, minutes, seconds) ', ending on ' datestr(enddate) ' [' num2str(round(move*100.0/size(displacements,1))) '%]' ]; disp([ mfilename ': ' options.status ]); sqw_phonons_htmlreport('', 'status', options); end diff --git a/Scripts/Models/Factory/private/sqw_phonons_get_forces.m b/Scripts/Models/Factory/private/sqw_phonons_get_forces.m index 07257cce..5da8cd06 100644 --- a/Scripts/Models/Factory/private/sqw_phonons_get_forces.m +++ b/Scripts/Models/Factory/private/sqw_phonons_get_forces.m @@ -222,6 +222,11 @@ [st, result] = system([ precmd 'python ' fullfile(target,'sqw_phonons_forces_iterate.py') ]); end disp(result) + % get how many steps have been computed: name is 'phonon.N[xyz][+-].pckl' + move_update = dir(fullfile(target,'phonon.*.pckl')); + if numel(move_update) > move + move = numel(move_update); + end if move <= nb_of_steps % display ETA. There are nb_of_steps steps. % up to now we have done 'move' and it took etime(clock, t) @@ -235,7 +240,7 @@ seconds = floor(remaining-hours*3600-minutes*60); enddate = addtodate(now, ceil(remaining), 'second'); - options.status = [ 'ETA ' sprintf('%i:%02i:%02i', hours, minutes, seconds) ', ending on ' datestr(enddate) '. move ' num2str(move) '/' num2str(nb_of_steps) ]; + options.status = [ 'ETA ' sprintf('%i:%02i:%02i', hours, minutes, seconds) ', ending on ' datestr(enddate) '. move ' num2str(move) '/' num2str(nb_of_steps) ' [' num2str(round(move*100.0/nb_of_steps)) '%]']; disp([ mfilename ': ' options.status ]); sqw_phonons_htmlreport('', 'status', options); end diff --git a/Scripts/Models/Factory/private/sqw_phonons_htmlreport.m b/Scripts/Models/Factory/private/sqw_phonons_htmlreport.m index 7eeaa237..b1900c0c 100644 --- a/Scripts/Models/Factory/private/sqw_phonons_htmlreport.m +++ b/Scripts/Models/Factory/private/sqw_phonons_htmlreport.m @@ -174,16 +174,20 @@ function sqw_phonons_htmlreport_table(fid, options, name) '.vtk Visualization Toolkit (VTK) file which can be viewed with ParaView, Mayavi2, VisIt, Slicer4' ... '.mrc MRC Electron density map, to be visualized with PyMol, VMD, Chimera, Yasara, VEDA' ... '.xhtml Extensible Web page. You can rotate the object (left mouse button), zoom (right mouse button), and pan (middle mouse button).', ... + '.fits Flexible Image Transport System (FITS) image, which can be viewed with e.g. ImageJ, GIMP..', ... + '.tiff TIFF image file, to be viewed with e.g. ImageJ, GIMP..' ... } [index1, index2] = strtok([ name index{1} ]); if ~isempty(dir(fullfile(options.target,index1))) % the file exists if strcmp(index1, [ name '.png' ]) - fprintf(fid, '

\n', index1, index1, index1); + fprintf(fid, '

(try the TIFF file in case the axes are not shown)

\n', index1, index1, index1, [ name '.tiff' ]); elseif strcmp(index1, [ name '.html' ]) + % embed a frame fprintf(fid, '

%s
(open in external window)

\n', index1, index2, index1); elseif strcmp(index1, [ name '.xhtml' ]) + % embed an x3dom frame fprintf(fid, [ '

\n' ... '%s
(open in external window)
\n' ... 'The blue axis is the Energy (meV), the red axis is QK (rlu), the green axis is QL (rlu).
\n' ... @@ -390,7 +394,9 @@ function sqw_phonons_htmlreport_error(fid, options, message) fprintf(fid, '

The dispersion along principal directions

\n'); fprintf(fid, 'The dispersion curves along the principal axes is shown in log10 scale.
\n'); builtin('save', fullfile(options.target, 'Phonon_kpath.mat'), 'Phonon_kpath'); - save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.png'), 'png', 'view2 tight'); + save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.png'), 'png data'); + save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.fits'), 'fits'); + save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.tiff'), 'tiff'); save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.dat'), 'dat data'); save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.svg'), 'svg', 'view2 tight'); save(Phonon_kpath, fullfile(options.target, 'Phonon_kpath.pdf'), 'pdf', 'view2 tight'); @@ -471,7 +477,9 @@ function sqw_phonons_htmlreport_eval_3D(fid, options, object) fprintf(fid, 'The powder average S(q,w) is shown below:
\n'); builtin('save', fullfile(options.target, 'Phonon_powder.mat'), 'Phonon_powder'); - saveas(log_Phonon_powder, fullfile(options.target, 'Phonon_powder.png'),'png','tight view2'); + saveas(log_Phonon_powder, fullfile(options.target, 'Phonon_powder.png'),'png data'); + saveas(log_Phonon_powder, fullfile(options.target, 'Phonon_powder.fits'),'fits'); + saveas(log_Phonon_powder, fullfile(options.target, 'Phonon_powder.tiff'),'tiff'); saveas(log_Phonon_powder, fullfile(options.target, 'Phonon_powder.fig'), 'fig', 'tight'); saveas(Phonon_powder, fullfile(options.target, 'Phonon_powder.dat'), 'dat data'); saveas(log_Phonon_powder, fullfile(options.target, 'Phonon_powder.pdf'), 'pdf', 'tight view2'); diff --git a/Scripts/Models/Factory/sqw_phonons.m b/Scripts/Models/Factory/sqw_phonons.m index 9bc05356..2c747086 100644 --- a/Scripts/Models/Factory/sqw_phonons.m +++ b/Scripts/Models/Factory/sqw_phonons.m @@ -317,6 +317,7 @@ options.duration = 0; end Phonon_Model = signal; + if ~isdir(options.target), mkdir(options.target); end builtin('save', fullfile(options.target, 'Phonon_Model.mat'), 'Phonon_Model'); sqw_phonons_htmlreport('', 'create_atoms', options);