Skip to content
Snippets Groups Projects
Select Git revision
  • b6d1cb551a47e420d015946455288ab5506b611d
  • master default protected
2 results

test_map.py

Blame
  • readLRI.m 983 B
    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