Re: extract of an image (array)
- From: christina.goerner@xxxxxx (Crissy)
- Date: 7 Apr 2005 02:52:50 -0700
What I added so far to the "framework" program (called 'test') I
posted in my first article. You can´t read it? So here it is again:
******************************************************************************
I´m a bloody beginner concerning programming...
I have an image data file (.pgm) which consits of a header (=record
1) and a gray scale image in 10 bit format (0-1023 values)(=record 2).
The header contains some information about the image size (3712*3712
pixels) and the data source. Now I want to extract a piece (2000*712
pixels) of this image.
This is the program a have so far:
-------------------------------------------------------------------------------
program europa_extrahieren
character(256) :: name_IN =
"C:\MSG-1\Images\HRIT\200407161200-msg-ch01.pgm"
character(256) :: name_OUT =
"C:\MSG-1\Images\Europa\200407161200-msg-ch01.pgm"
integer :: pixels = 3712
integer :: lines = 3712
integer :: x, y
integer :: stat, stato
integer(2), Dimension (:,:), Allocatable :: array_bild, array_europa
character(120) :: header
allocate (array_bild(1:pixels,1:lines))
allocate (array_europa(500:2500, 3000:lines))
open(1, file=name_IN, RECL=120, FORM='BINARY', ACCESS='DIRECT',
CONVERT='BIG_ENDIAN', iostat=stato)
open(2, file=name_OUT, RECL=120, FORM='BINARY', ACCESS='DIRECT',
CONVERT='BIG_ENDIAN', iostat=stato)
read (1,REC=1,iostat=stat) header
read (1,REC=2,iostat=stat) array_bild
write (2, REC=1, FMT='(A)') header
do y=3000,pixels
do x=0,800
write (2, REC=2, FMT='(I4,I4)') x, y
end do
end do
close (1)
close (2)
deallocate (array_europa)
deallocate (array_bild)
end program europa_extrahieren
------------------------------------------------------------------------
************************************************************************
Crissy
.
- Follow-Ups:
- Re: extract of an image (array)
- From: Michael Metcalf
- RE: extract of an image (array)
- From: meek
- Re: extract of an image (array)
- References:
- extract of an image (array)
- From: Crissy
- Re: extract of an image (array)
- From: Michael Metcalf
- Re: extract of an image (array)
- From: Crissy
- Re: extract of an image (array)
- From: Ken Fairfield
- extract of an image (array)
- Prev by Date: Re: Identical code and OS, different behaviour between machines?
- Next by Date: Re: appropriate groups -- Re: Fortran subroutine characters argsand their lengths and C
- Previous by thread: Re: extract of an image (array)
- Next by thread: RE: extract of an image (array)
- Index(es):
Relevant Pages
|
|