comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: envi_setup_head for TIFF
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: envi_setup_head for TIFF [message #56150] Fri, 05 October 2007 12:45
Leonardo R. Sbaraini is currently offline  Leonardo R. Sbaraini
Messages: 26
Registered: October 2007
Junior Member
OMG....was it !

Very thx... ^.^
Re: envi_setup_head for TIFF [message #56152 is a reply to message #56150] Fri, 05 October 2007 11:54 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Leonardo R. Sbaraini wrote:
> I read one single value (float) and
> it returned a value different from that ought to be.

> IDL prints:
> 1.2748951e-310
>
> Real value in SRF file created before: 0.000000

Leonardo,

A float can be up to +- 10^38, with 7 significant digits.... so your
value is likely not a float!

Have you created the data on the same computer you are trying to read
it? ... it might be a little / big endian issue..

IDL> print, swap_endian(1.2748951e-310)
0.000000

Jean
Re: envi_setup_head for TIFF [message #56153 is a reply to message #56152] Fri, 05 October 2007 11:33 Go to previous message
Leonardo R. Sbaraini is currently offline  Leonardo R. Sbaraini
Messages: 26
Registered: October 2007
Junior Member
Jeff, I tried ENVI_OPEN_FILE plus ENVI_FILE_QUERY but it did no
reuturn the header size that is my goal.
By other way, I had success in reading some labels using the IFD
offset in the header (field #3), but after byte 8 (after header) the
data was supposed to be there....I read one single value (float) and
it returned a value different from that ought to be.

Well let me explain better:
TIFF Header :

Byte Order | TIFF Identificator | IFD Offset
(2bytes) (2bytes) = 42 (4 bytes)

Normally the image values will be the next data.


; ************************************
; Piece of code to read a single value
; ************************************
point_lun, fu, 8
readu, fu, data
print, 'data:', data


IDL prints:
1.2748951e-310

Real value in SRF file created before: 0.000000

This TIFF was generated by Envi Menu (Save as..)

The reason to read by this way (using point_lun) is that I have big
huge images here that cannot be stored in a IDL variable, so I cannot
use READ_TIFF. And other reason is that I need to output rect pieces
into file.

Any help is welcome.
Re: envi_setup_head for TIFF [message #56167 is a reply to message #56153] Fri, 05 October 2007 07:30 Go to previous message
Jeff N. is currently offline  Jeff N.
Messages: 120
Registered: April 2005
Senior Member
On Oct 5, 7:29 am, L Rodrigues <leonardo.computa...@gmail.com> wrote:
> Hi everyone, I'm having a problem to show a TIFF image.
> After this code below, the image is shown with a shift to right in
> each line. (Near 1000 pixel shifted)
>
> envi_setup_head, FNAME = strFullFileName, NS = 4472, NL = 3263, NB =
> 1, $
> DATA_TYPE = self.type, OFFSET = 8,
> INTERLEAVE = 0, $
> BYTE_ORDER = 0, DATA_IGNORE_VALUE =
> -9999.0, $
> R_FID = fid, /OPEN, /NO_REALIZE
>
> envi_display_bands, [fid],[0]
>
> Someone had this problem ?
>
> Thx in advance.

My first thought was that you're setting the offset value incorrectly,
but its going to be hard to help you with this b/c there's no way we
can tell if those keywords are set to the correct value, since we know
nothing of the image you're opening. Here are two general suggestions
though:

1) Try opening the image using the GUI, maybe saving it out to a
temporary file, and seeing what kind of header ENVI creates for it.
Then you'll have an idea what the header values should be, assuming
ENVI opens it correctly.

2) Instead of using ENVI_SETUP_HEAD, use ENVI_OPEN_FILE. You won't
need to know all the header values with that command, and in fact
after you open the file you can use ENVI_FILE_QUERY to get the header
values.

Cheers,
Jeff
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Is there a way to undo a plot?
Next Topic: read data from sql

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:30:06 PDT 2025

Total time taken to generate the page: 0.00616 seconds