Skip to content

Commit

Permalink
unify tidal fitting duraionts
Browse files Browse the repository at this point in the history
  • Loading branch information
cliu3 committed Aug 1, 2018
1 parent d119020 commit aad8f11
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions datalik/likelihood_cliu.m
Expand Up @@ -8,11 +8,16 @@ function likelihood_cliu(fish_no,path_to_tags,tagname)
tag_name=[num2str(fish_no),'_raw'];
load([path_to_tags tagname]);
tagno=[num2str(fish_no),'_',tag.tag_id];
global tideLV
global tideLV mod_fit
%tideLV = [0.22 0.85 0.2 2.0];

mean_ampli=[];std_ampli=[];mean_phase=[];std_phase=[];
Twindow = 5; %time window = 13 h
if exist('mod_fit', 'var')
Twindow = mod_fit; %time window = 5 h
else
Twindow = 5;
end

% for Twindow=10:0.5:20
nwindow = floor(Twindow*3600/tag.min_intvl_seconds); % window size in data point numbers

Expand Down
8 changes: 6 additions & 2 deletions datalik/tidal_rmse_cliu.m
Expand Up @@ -8,11 +8,15 @@ function tidal_rmse_cliu(fish_no,path_to_tags,tagname)
tag_name=[num2str(fish_no),'_raw'];
load([path_to_tags tagname]);
tagno=[num2str(fish_no),'_',tag.tag_id];
global tideLV
global tideLV low_fit
%tideLV = [0.42 0.85 0.2 2.0];

mean_ampli=[];std_ampli=[];mean_phase=[];std_phase=[];
Twindow = 13; %time window = 13 h
if exist('low_fit', 'var')
Twindow = low_fit;
else
Twindow = 13; %time window = 13 h
end
% for Twindow=10:0.5:20
nwindow = floor(Twindow*3600/tag.min_intvl_seconds); % window size in data point numbers

Expand Down
6 changes: 4 additions & 2 deletions test/run_tag.m
Expand Up @@ -15,11 +15,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tag-specific paremeters %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global std_temp_offset tag_depth_range tag_depth_accu tag_temp_accu
global std_temp_offset tag_depth_range tag_depth_accu tag_temp_accu low_fit mod_fit
std_temp_offset=2.0; %higher value is more inclusive
tag_depth_range = 250; % in meters
tag_depth_accu = 0.008; % fraction of depth renge
tag_temp_accu = 0.1; % in degree C
low_fit = 13; %tidal fit duration (hours) for low activity
mod_fit = 5; %tidal fit duration (hours) for moderate activity
D_low = 1; % random walk diffusioncoefficient for low activity, in km^2/day
D_high = 10; % random walk diffusioncoefficient for high activity, in km^2/day

Expand Down Expand Up @@ -111,7 +113,7 @@
% dbname - alternate tidal base: def = tidaldb.mat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(do_parts(3)==1)
tidebehavextr(tagid,10,tideLV,16,tideLV); %default
tidebehavextr(tagid,mod_fit,tideLV,low_fit,tideLV); %default
end;
%tidebehavextr(tagid);
% make strict criteria so no tide is found
Expand Down

0 comments on commit aad8f11

Please sign in to comment.