Re: extract of an image (array)
- From: christina.goerner@xxxxxx (Crissy)
- Date: 5 Apr 2005 08:47:49 -0700
I´m writing my diploma thesis. The subject is the analysis and
interpretation of satellite data. These data have the form of 10 bit
gray scale image (.pgm). But I need only a sector of each image
(sector=Europe). So I want to extract this sector from each image and
store it in a new file. Unfortunately I have never done somthing like
that before. These are my first steps in programming...
My tutor helped me a little and gave me something like a framework or
starting point for the final program. Here it is:
----------------------------------------------------------------------------
program test
character(256) :: name_IN =
"C:\MSG-1\Images\HRIT\200407161200-msg-ch02.pgm"
integer :: pixels = 3712
integer :: lines = 3712
integer :: stat, stato
integer(2), Dimension (:,:), Allocatable :: test_array
character(120) :: header
allocate (test_array(1:pixels,1:lines))
open(1, file=name_IN, RECL=120, FORM='BINARY', ACCESS='DIRECT',
CONVERT='BIG_ENDIAN', iostat=stato)
read (1,REC=1,iostat=stat) header
read (1,REC=2,iostat=stat) test_array
close (1)
! --> do something...
deallocate (test_array)
end program test
------------------------------------------------------------------------------
That´s why I´m quite sure that the access is direct.
So far my program (as described in the first message) creats a new
file (thanks to the command "open(2, ...)" :-)) but the file is still
empty.:-(
Does anyone have a good solution for my problem?
Thanks a lot!
Crissy
P.S.: Mike, if you would like to I could send you per e-mail a file
containing such an image (as an example).
I didn´t understand what you meant with "show the way it was
written.
.
- Follow-Ups:
- Re: extract of an image (array)
- From: Ken Fairfield
- Re: extract of an image (array)
- From: Michael Metcalf
- Re: extract of an image (array)
- References:
- extract of an image (array)
- From: Crissy
- Re: extract of an image (array)
- From: Michael Metcalf
- extract of an image (array)
- Prev by Date: Re: Automatic testing of numerical output
- Next by Date: Re: extract of an image (array)
- Previous by thread: Re: extract of an image (array)
- Next by thread: Re: extract of an image (array)
- Index(es):