Changeset 9434


Ignore:
Timestamp:
08/25/11 16:04:46 (14 years ago)
Author:
jschierm
Message:

Flaim: Added renaming of output kml file and creation of output log file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/solutions/flaim.m

    r9421 r9434  
    4141ext='.log';
    4242filelog=fullfile(pathstr,[name ext versn]);
    43 filesol='solution_best.kml';
     43if ~isempty(md.fm_solution)
     44        [pathstr,name,ext,versn] = fileparts(md.fm_solution);
     45        filesol=fullfile('',[name '' '']);
     46else
     47        filesol='solution_best';
     48end
    4449
    4550%  calculate latitude and longitude, if necessary
     
    97102
    98103display(['Post-processing the flaim output in the ''' options.fmdir ''' sub-directory.']);
    99 if exist(filesol,'file')
     104if exist('solution_best.kml','file')
     105        if ~strcmp(filesol,'solution_best')
     106                system(['mv solution_best.kml ' filesol '.kml']);
     107        end
    100108        md.results.FlaimSolution.solution=[options.fmdir '/' filesol];
     109else
     110        md.results.FlaimSolution.solution='';
    101111end
    102112if exist(filelog,'file')
     
    109119                md.results.FlaimSolution.quality =NaN;
    110120        end
    111 end
    112 if ~exist(md.results.FlaimSolution.solution,'file')
    113         md.results.FlaimSolution.solution='';
     121        fidi=fopen(filelog,'r');
     122        while true
     123                fline=fgetl(fidi);
     124                if ~ischar(fline) || strncmp(fline,'........',8)
     125                        break
     126                end
     127        end
     128        fido=fopen([filesol '.log'],'w');
     129        while true
     130                fline=fgetl(fidi);
     131                if ~ischar(fline)
     132                        break
     133                end
     134                fprintf(fido,'%s\n',fline);
     135        end
     136        fclose(fidi);
     137        fclose(fido);
    114138end
    115139display(md.results.FlaimSolution);
     
    117141cd ..
    118142if ~strncmpi(options.keep,'y',1)
     143        system(['mv ' options.fmdir '/' filesol '.kml .']);
     144        system(['mv ' options.fmdir '/' filesol '.log .']);
    119145        system(['rm -rf ' options.fmdir]);
    120146end
Note: See TracChangeset for help on using the changeset viewer.