Commit 6ea90fb4 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

removed matlab function due to ticket:106

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3925
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 445b8ea4
%{
* ========================================================================
*
* Filename: any2kasop.m
*
* Description: Conversion of a MATLAB-struct which had been created by any2matlab.mexa64
* any2matlab.mexa64 supports the import of seismic data from Thomas
* Forbriger's software library.
* For further information:
* http://www.rz.uni-karlsruhe.de/~bi77/txt/mycode.html
*
* Version: 1.0
* Created: 10.06.2010 20:02:02
* Revision: none
*
* Author: Daniel Armbruster (HiWi of Joern ;-)
* Usage: kasopstruct = any2kasop(tfstruct)
*
* ========================================================================
%}
function [outstruct]=any2kasop(instruct)
% checking input data
if (nargin==0 || ~isstruct(instruct))
error('ERROR: No struct given!')
outstruct=0;
return
end
if (~isfield(instruct,'date') && ~isfield(instruct,'time') && ~isfield(instruct,'tdate') && ~isfield(instruct,'station') && ~isfield(instruct,'channel') && ~isfield(instruct,'auxid') && ~isfield(instruct,'dt') && ~isfield(instruct,'calper') && ~isfield(instruct,'instype'))
outstruct=0;
error('ERROR: input data is not a valid struct!')
return
end
% copy data from instruct to kasop-struct
for i=1:length(instruct)
% create outstruct
outstruct(i) = gettimeseriesdatastruct;
% set tsn-field
outstruct(i).tsn = datenum(instruct(i).tdate);
% set staname-field
outstruct(i).staname = strtrim(instruct(i).station);
% set channel-field
channel = strtrim(instruct(i).channel);
outstruct(i).channel = channel;
% set comp-field
outstruct(i).comp = channel(3);
% set npts-field
outstruct(i).npts = instruct(i).samps;
% set delta-field
outstruct(i).delta = instruct(i).dt;
% set trace-field
outstruct(i).trace = instruct(i).trace;
end
clear(channel);
outstruct = checktimeseriesdatastruct(outstruct);
return
% EOF any2kasop.m
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment