3 % Copyright 2009 Free Software Foundation, Inc.
5 % This file is part of GNU Radio
7 % GNU Radio is free software; you can redistribute it and/or modify
8 % it under the terms of the GNU General Public License as published by
9 % the Free Software Foundation; either version 3, or (at your option)
12 % GNU Radio is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 % GNU General Public License for more details.
17 % You should have received a copy of the GNU General Public License
18 % along with GNU Radio; see the file COPYING. If not, write to
19 % the Free Software Foundation, Inc., 51 Franklin Street,
20 % Boston, MA 02110-1301, USA.
23 % Extract AVHRR images from HRPT frames.dat
26 fid = fopen('frames.hrpt');
27 dat = fread(fid, 'uint16');
31 len = floor(length(dat) / frame_len);
33 chan1 = zeros(len, 2048);
39 chan1(line, 1:2048) = dat(start:5:stop)';
40 start = start + frame_len;
41 stop = stop + frame_len;
48 chan2(line, 1:2048) = dat(start:5:stop)';
49 start = start + frame_len;
50 stop = stop + frame_len;
57 chan3(line, 1:2048) = dat(start:5:stop)';
58 start = start + frame_len;
59 stop = stop + frame_len;
66 chan4(line, 1:2048) = dat(start:5:stop)';
67 start = start + frame_len;
68 stop = stop + frame_len;
75 chan5(line, 1:2048) = dat(start:5:stop)';
76 start = start + frame_len;
77 stop = stop + frame_len;
81 saveimage("chan1.ppm", chan1/4, 'ppm')
82 saveimage("chan2.ppm", chan2/4, 'ppm')
83 saveimage("chan3.ppm", chan3/4, 'ppm')
84 saveimage("chan4.ppm", chan4/4, 'ppm')
85 saveimage("chan5.ppm", chan5/4, 'ppm')