Skip to content

Commit

Permalink
Fix for issue #51. Also NED bugfix for Macro 710/910
Browse files Browse the repository at this point in the history
710 interpolation routine (for calibrating USC>NED) inherited LAP2 time
stamps (which is sparser than LAP1). which caused the interpolation
and associated QVs to give NAN values (which were correctly changed to
-1e9) and the quality value to give NAN

The second bug is from an erroneous NEDFlag (i.e. probe number),
stemming from a Matlab bug (with no error message). when LAP1 LAP2 in
e-field mode, and LAP1 is shadowed.

Bugs confined to NED files in ESC2- EXT3
  • Loading branch information
frejon committed Jan 13, 2020
1 parent 67cab31 commit 75d5243
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions an_downsample.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@




arID = fopen(tabindex{an_ind(i),1},'r');
if arID < 0
fprintf(1,'Error, cannot open file %s\n', tabindex{an_ind(i),1});
Expand Down Expand Up @@ -518,10 +517,12 @@
foutarr_1=foutarr;
tfoutarr_1=tfoutarr;
dark_ind_1=dark_ind;
t_et_1=t_et;

else
foutarr_2=foutarr;
dark_ind_2=dark_ind;
t_et_2=t_et; %maybe I won't need this?

%tfoutarr_2=tfoutarr; %only need this for debug
end
Expand Down Expand Up @@ -573,24 +574,29 @@
data_arr.t_obt=tfoutarr{1,2};
data_arr.qf=foutarr{1,8};
data_arr.printboolean=foutarr{1,7};
data_arr.probe=dark_ind_1;
data_arr.probe(:)=1;%qflag

data_arr.probe=foutarr{1,2}.'; %change probenumberflag
%data_arr.probe(:)=1;%qflag
%%default == probe 1.
%here we went from LAP1 to LAP2,
data_arr.probe(indz)=2; %change probenumberflag
%data_arr.probe(indz)=2; %change probenumberflag
%%the command above does absolutely nothing. I
%%don't understand why.
data_arr.V(indz)=foutarr_2{1,5}(indz);% %this is vf2
data_arr.V_sigma(indz)=foutarr_2{1,6}(indz);% %this is sigma vf2
data_arr.printboolean(indz)=foutarr_2{1,7}(indz); %print boolean
data_arr.qf(indz)=foutarr_2{1,8}(indz); %qflag


%On rare (12) occasions, t_et/t_et_2 (from Lap2) has more
%holes that t_et_1, and this needs to be filled too.
t_et_1(indz)=t_et_2(indz);
t_et=t_et_1;
%print USC special case
an_USCprint(USCfname,USCshort,tfoutarr,foutarr,tabindex{an_ind(i),3},timing,'vfloat');
% an_NEDprint(NEDfname,NEDshort,tfoutarr,foutarr,tabindex{an_ind(i),3},timing,'vfloat');
an_NEDprint(NEDfname,NEDshort,data_arr,t_et,tabindex{an_ind(i),3},timing,'vfloat');

%clear scantemp_1 scantemp_2
clear foutarr_2 tfoutarr_2 foutarr_1 tfoutarr_1 data_arr dark_ind lum_mu t_et %These are important
clear foutarr_2 tfoutarr_2 foutarr_1 tfoutarr_1 data_arr dark_ind lum_mu t_et t_et1 t_et2 %These are important

else% hold_flag
%hold_flag default is 0. So this is 1st iteration
Expand All @@ -599,10 +605,12 @@
foutarr_1=foutarr;
tfoutarr_1=tfoutarr;
dark_ind_1=dark_ind;

t_et_1=t_et;
else
foutarr_2=foutarr;
dark_ind_2=dark_ind;
t_et_2=t_et; %maybe I won't need this?

% tfoutarr_2=tfoutarr; %I only need this to debug
end
hold_flag = 1;
Expand Down Expand Up @@ -650,7 +658,6 @@

clear foutarr tfoutarr %not really needed, will not exist outside of function anyway.


end%for main loop

catch err
Expand Down

0 comments on commit 75d5243

Please sign in to comment.