Skip to content
Snippets Groups Projects
Commit 441e573d authored by Neda Darbehehsti's avatar Neda Darbehehsti
Browse files

read lri was added

parent 4a1f704c
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ function KBR1B = readKBR(file)
%
% cf. GRACE Level 1B Data Product User Handbook
%
% Example: KBR1B = readKBR('KBR1B_2002-12-02_A_02.asc')
% Example: KBR1B = readKBR('KBR1B_2002-12-02_X_02.asc')
% Counts header lines and removes them.
header=0;
......
function LRI1B = readLRI(file)
% Input: ascii file containing GRACE Follow-On LRI1B data
% Output: matrix containing LRI1B data
%
% cf. GRACE Follow-On Level 1B Data Product User Handbook
%
% Example: LRI1B = readLRI('LRI1B_2002-12-02_X_02.asc')
% Counts header lines and removes them.
header=0;
fid = fopen(file);
while 1
line = fgetl(fid);
header = header+1;
if (~isempty(strfind(line,'END OF HEADER')))
break
end
end
% Reads the desired values from LRI1B data.
[gps_time, range, range_rate, range_acc, lighttime_corr, lighttime_rate, lighttime_accl, tma_corr, tma_rate, tma_accl, pitch_A, yaw_A, pitch_B, yaw_B] = textread(file,'%f %f %f %f %*f %f %f %f %f %f %f %f %f %f %f %*f %*f %*f %*f %*f','headerlines',header);
% Produces the matrix containing the desired values.
LRI1B = [gps_time, range, range_rate, range_acc, lighttime_corr, lighttime_rate, lighttime_accl, tma_corr, tma_rate, tma_accl, pitch_A, yaw_A, pitch_B, yaw_B];
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment