diff options
-rw-r--r-- | config/grc_gr_noaa.m4 | 1 | ||||
-rw-r--r-- | gr-noaa/Makefile.am | 2 | ||||
-rw-r--r-- | gr-noaa/oct/.gitignore | 2 | ||||
-rw-r--r-- | gr-noaa/oct/Makefile.am | 26 | ||||
-rwxr-xr-x | gr-noaa/oct/frames-to-png.sh | 9 | ||||
-rw-r--r-- | gr-noaa/oct/frames_to_ppm.m | 85 |
6 files changed, 124 insertions, 1 deletions
diff --git a/config/grc_gr_noaa.m4 b/config/grc_gr_noaa.m4 index b00579ff5..69d0aad55 100644 --- a/config/grc_gr_noaa.m4 +++ b/config/grc_gr_noaa.m4 @@ -30,6 +30,7 @@ AC_DEFUN([GRC_GR_NOAA],[ gr-noaa/apps/Makefile \ gr-noaa/grc/Makefile \ gr-noaa/lib/Makefile \ + gr-noaa/oct/Makefile \ gr-noaa/python/Makefile \ gr-noaa/swig/Makefile \ ]) diff --git a/gr-noaa/Makefile.am b/gr-noaa/Makefile.am index f3f4f6a38..854ce1476 100644 --- a/gr-noaa/Makefile.am +++ b/gr-noaa/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = lib grc +SUBDIRS = lib grc oct if PYTHON SUBDIRS += swig python apps diff --git a/gr-noaa/oct/.gitignore b/gr-noaa/oct/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-noaa/oct/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-noaa/oct/Makefile.am b/gr-noaa/oct/Makefile.am new file mode 100644 index 000000000..2f6e4e575 --- /dev/null +++ b/gr-noaa/oct/Makefile.am @@ -0,0 +1,26 @@ +# +# Copyright 2009 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common + +EXTRA_DIST = \ + frames_to_ppm.m \ + frames-to-png.sh diff --git a/gr-noaa/oct/frames-to-png.sh b/gr-noaa/oct/frames-to-png.sh new file mode 100755 index 000000000..cb3e3fb7d --- /dev/null +++ b/gr-noaa/oct/frames-to-png.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +octave --eval frames_to_ppm + +convert chan1.ppm chan1.png && rm chan1.ppm +convert chan2.ppm chan2.png && rm chan2.ppm +convert chan3.ppm chan3.png && rm chan3.ppm +convert chan4.ppm chan4.png && rm chan4.ppm +convert chan5.ppm chan5.png && rm chan5.ppm diff --git a/gr-noaa/oct/frames_to_ppm.m b/gr-noaa/oct/frames_to_ppm.m new file mode 100644 index 000000000..aeb22faac --- /dev/null +++ b/gr-noaa/oct/frames_to_ppm.m @@ -0,0 +1,85 @@ +% -*- octave -*- +% +% Copyright 2009 Free Software Foundation, Inc. +% +% This file is part of GNU Radio +% +% GNU Radio is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3, or (at your option) +% any later version. +% +% GNU Radio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with GNU Radio; see the file COPYING. If not, write to +% the Free Software Foundation, Inc., 51 Franklin Street, +% Boston, MA 02110-1301, USA. +% + +% Extract AVHRR images from HRPT frames.dat +clear + +fid = fopen('frames.dat'); +dat = fread(fid, 'uint16'); + +frame_len = 11090; + +len = floor(length(dat) / frame_len); + +chan1 = zeros(len, 2048); + +start = 751; +stop = 10986; + +for line = 1:len + chan1(line, 1:2048) = dat(start:5:stop)'; + start = start + frame_len; + stop = stop + frame_len; +end + +start = 752; +stop = 10987; + +for line = 1:len + chan2(line, 1:2048) = dat(start:5:stop)'; +start = start + frame_len; +stop = stop + frame_len; +end + +start = 753; +stop = 10988; + +for line = 1:len + chan3(line, 1:2048) = dat(start:5:stop)'; + start = start + frame_len; + stop = stop + frame_len; +end + +start = 754; +stop = 10989; + +for line = 1:len + chan4(line, 1:2048) = dat(start:5:stop)'; +start = start + frame_len; +stop = stop + frame_len; +end + +start = 755; +stop = 10990; + +for line = 1:len + chan5(line, 1:2048) = dat(start:5:stop)'; + start = start + frame_len; + stop = stop + frame_len; +end + +colormap(gray) +saveimage("chan1.ppm", chan1/4, 'ppm') +saveimage("chan2.ppm", chan2/4, 'ppm') +saveimage("chan3.ppm", chan3/4, 'ppm') +saveimage("chan4.ppm", chan4/4, 'ppm') +saveimage("chan5.ppm", chan5/4, 'ppm') |