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

Home » Public Forums » archive » Problem regarding ENVI file opening
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
Problem regarding ENVI file opening [message #93599] Thu, 01 September 2016 03:02 Go to next message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
I can't open file in IDL if it is tiff file of ENVY
I used this----
file = FILEPATH ('cal.tiff', SUBDIRECTORY = ['examples', 'data'])
even if it reads it shows no of band =3 and says it is a jpeg file.
Also tried read_tiff but same problem. Also blank window appears when try to display it.
Kindly Help.

Is there any way to get complete band details.
Re: Problem regarding ENVI file opening [message #93600 is a reply to message #93599] Thu, 01 September 2016 03:13 Go to previous messageGo to next message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Thursday, September 1, 2016 at 3:32:17 PM UTC+5:30, Suresh Negi wrote:
> I can't open file in IDL if it is tiff file of ENVY
> I used this----
> file = FILEPATH ('cal.tiff', SUBDIRECTORY = ['examples', 'data'])
> even if it reads it shows no of band =3 and says it is a jpeg file.
> Also tried read_tiff but same problem. Also blank window appears when try to display it.
> Kindly Help.
>
> Is there any way to get complete band details.

also i tried this but besides r,g,b,it is not taking arguments for my 5 band data.
image = READ_TIFF('Composite_image1.tif', R, G,B)

If I am writing this image = READ_TIFF('Composite_image1.tif', R, G,B,X,V) then showing error.
Re: Problem regarding ENVI file opening [message #93601 is a reply to message #93599] Thu, 01 September 2016 03:20 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, September 1, 2016 at 12:02:17 PM UTC+2, Suresh Negi wrote:
> I can't open file in IDL if it is tiff file of ENVY
> I used this----
> file = FILEPATH ('cal.tiff', SUBDIRECTORY = ['examples', 'data'])
> even if it reads it shows no of band =3 and says it is a jpeg file.
> Also tried read_tiff but same problem. Also blank window appears when try to display it.
> Kindly Help.
>
> Is there any way to get complete band details.

Type this in the command line:
IDL> query_tiff(file)
or
IDL> query_tiff('Composite_image1.tif')

What does it show?

Cheers
Re: Problem regarding ENVI file opening [message #93605 is a reply to message #93601] Thu, 01 September 2016 22:08 Go to previous messageGo to next message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Thursday, September 1, 2016 at 3:50:10 PM UTC+5:30, Helder wrote:
> On Thursday, September 1, 2016 at 12:02:17 PM UTC+2, Suresh Negi wrote:
>> I can't open file in IDL if it is tiff file of ENVY
>> I used this----
>> file = FILEPATH ('cal.tiff', SUBDIRECTORY = ['examples', 'data'])
>> even if it reads it shows no of band =3 and says it is a jpeg file.
>> Also tried read_tiff but same problem. Also blank window appears when try to display it.
>> Kindly Help.
>>
>> Is there any way to get complete band details.
>
> Type this in the command line:
> IDL> query_tiff(file)
> or
> IDL> query_tiff('Composite_image1.tif')
>
> What does it show?
>
> Cheers

Showing syntax error. can you please give me the script to open ENVI tiff file with full band information.
Thank You
Re: Problem regarding ENVI file opening [message #93607 is a reply to message #93599] Sun, 04 September 2016 06:29 Go to previous messageGo to next message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Friday, September 2, 2016 at 6:47:00 PM UTC+5:30, wlandsman wrote:
> On Friday, September 2, 2016 at 1:08:31 AM UTC-4, Suresh Negi wrote:
>> On Thursday, September 1, 2016 at 3:50:10 PM UTC+5:30, Helder wrote:
> .
>>>
>>> Type this in the command line:
>>> IDL> query_tiff(file)
>>> or
>>> IDL> query_tiff('Composite_image1.tif')
>>>
>>> What does it show?
>>>
>>> Cheers
>>
>> Showing syntax error. can you please give me the script to open ENVI tiff file with full band information.
>> Thank You
>
> What version of IDL do you have? If you have an old version (prior to V8.0 I think) you have to type
>
> IDL> print, query_tiff('Composite_image1.tif')
>
> so you don't get a syntax error
Re: Problem regarding ENVI file opening [message #93608 is a reply to message #93599] Sun, 04 September 2016 06:30 Go to previous messageGo to next message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Friday, September 2, 2016 at 6:47:00 PM UTC+5:30, wlandsman wrote:
> On Friday, September 2, 2016 at 1:08:31 AM UTC-4, Suresh Negi wrote:
>> On Thursday, September 1, 2016 at 3:50:10 PM UTC+5:30, Helder wrote:
> .
>>>
>>> Type this in the command line:
>>> IDL> query_tiff(file)
>>> or
>>> IDL> query_tiff('Composite_image1.tif')
>>>
>>> What does it show?
>>>
>>> Cheers
>>
>> Showing syntax error. can you please give me the script to open ENVI tiff file with full band information.
>> Thank You
>
> What version of IDL do you have? If you have an old version (prior to V8.0 I think) you have to type
>
> IDL> print, query_tiff('Composite_image1.tif')
>
> so you don't get a syntax error

It is showing 0
Re: Problem regarding ENVI file opening [message #93611 is a reply to message #93608] Mon, 05 September 2016 01:08 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Sunday, September 4, 2016 at 3:30:13 PM UTC+2, Suresh Negi wrote:
> On Friday, September 2, 2016 at 6:47:00 PM UTC+5:30, wlandsman wrote:
>> On Friday, September 2, 2016 at 1:08:31 AM UTC-4, Suresh Negi wrote:
>>> On Thursday, September 1, 2016 at 3:50:10 PM UTC+5:30, Helder wrote:
>> .
>>>>
>>>> Type this in the command line:
>>>> IDL> query_tiff(file)
>>>> or
>>>> IDL> query_tiff('Composite_image1.tif')
>>>>
>>>> What does it show?
>>>>
>>>> Cheers
>>>
>>> Showing syntax error. can you please give me the script to open ENVI tiff file with full band information.
>>> Thank You
>>
>> What version of IDL do you have? If you have an old version (prior to V8.0 I think) you have to type
>>
>> IDL> print, query_tiff('Composite_image1.tif')
>>
>> so you don't get a syntax error
>
> It is showing 0

Ok, that's something to start with.
You see, if you type this:

IDL> print, query_tiff('thisFileDoesNotExist.tif')
0

You will always get zero. If the file exists, then you get something like this:
IDL> print, query_tiff('E:\aRealDirectory\thisFileExists.tif')
1

Now here is the catch. This is all described here:
http://www.harrisgeospatial.com/docs/QUERY_TIFF.html
and here:
http://www.harrisgeospatial.com/docs/query___routines.html

And you can do more... once you get a 1 as a response (the file exists!) then you can try this:

IDL> print, query_tiff('E:\aRealDirectory\thisFileExists.tif', moreInfo)
1
IDL> help, moreInfo
** Structure <16c13620>, 19 tags, length=152, data length=136, refs=1:
CHANNELS LONG 1
DIMENSIONS LONG Array[2]
HAS_PALETTE INT 0
IMAGE_INDEX LONG 0
NUM_IMAGES LONG 1
PIXEL_TYPE INT 12
TYPE STRING 'TIFF'
BITS_PER_SAMPLE LONG 16
ORIENTATION LONG 1
PLANAR_CONFIG LONG 1
PHOTOMETRIC LONG 1
POSITION FLOAT Array[2]
RESOLUTION FLOAT Array[2]
UNITS LONG 2
TILE_SIZE LONG Array[2]
DESCRIPTION STRING ''
DOCUMENT_NAME STRING ''
DATE_TIME STRING ''
VERSION LONG 42

You see what happened? He got a lot of information from the tiff header! If you want to know what the dimensions are, then type:
IDL> print, moreInfo.dimensions
1024 1024
My file has 1024 rows and 1024 columns.

See how it works?

Try the above and see what happens. Remember to put the full path ('E:\aRealDirectory\') before the file name (an alternative would be to use the CD command, but one thing at a time...).

Try reading the documentation. It IS helpful.

Good luck!
Re: Problem regarding ENVI file opening [message #93612 is a reply to message #93611] Tue, 06 September 2016 00:57 Go to previous message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Monday, September 5, 2016 at 1:38:04 PM UTC+5:30, Helder wrote:
> On Sunday, September 4, 2016 at 3:30:13 PM UTC+2, Suresh Negi wrote:
>> On Friday, September 2, 2016 at 6:47:00 PM UTC+5:30, wlandsman wrote:
>>> On Friday, September 2, 2016 at 1:08:31 AM UTC-4, Suresh Negi wrote:
>>>> On Thursday, September 1, 2016 at 3:50:10 PM UTC+5:30, Helder wrote:
>>> .
>>>> >
>>>> > Type this in the command line:
>>>> > IDL> query_tiff(file)
>>>> > or
>>>> > IDL> query_tiff('Composite_image1.tif')
>>>> >
>>>> > What does it show?
>>>> >
>>>> > Cheers
>>>>
>>>> Showing syntax error. can you please give me the script to open ENVI tiff file with full band information.
>>>> Thank You
>>>
>>> What version of IDL do you have? If you have an old version (prior to V8.0 I think) you have to type
>>>
>>> IDL> print, query_tiff('Composite_image1.tif')
>>>
>>> so you don't get a syntax error
>>
>> It is showing 0
>
> Ok, that's something to start with.
> You see, if you type this:
>
> IDL> print, query_tiff('thisFileDoesNotExist.tif')
> 0
>
> You will always get zero. If the file exists, then you get something like this:
> IDL> print, query_tiff('E:\aRealDirectory\thisFileExists.tif')
> 1
>
> Now here is the catch. This is all described here:
> http://www.harrisgeospatial.com/docs/QUERY_TIFF.html
> and here:
> http://www.harrisgeospatial.com/docs/query___routines.html
>
> And you can do more... once you get a 1 as a response (the file exists!) then you can try this:
>
> IDL> print, query_tiff('E:\aRealDirectory\thisFileExists.tif', moreInfo)
> 1
> IDL> help, moreInfo
> ** Structure <16c13620>, 19 tags, length=152, data length=136, refs=1:
> CHANNELS LONG 1
> DIMENSIONS LONG Array[2]
> HAS_PALETTE INT 0
> IMAGE_INDEX LONG 0
> NUM_IMAGES LONG 1
> PIXEL_TYPE INT 12
> TYPE STRING 'TIFF'
> BITS_PER_SAMPLE LONG 16
> ORIENTATION LONG 1
> PLANAR_CONFIG LONG 1
> PHOTOMETRIC LONG 1
> POSITION FLOAT Array[2]
> RESOLUTION FLOAT Array[2]
> UNITS LONG 2
> TILE_SIZE LONG Array[2]
> DESCRIPTION STRING ''
> DOCUMENT_NAME STRING ''
> DATE_TIME STRING ''
> VERSION LONG 42
>
> You see what happened? He got a lot of information from the tiff header! If you want to know what the dimensions are, then type:
> IDL> print, moreInfo.dimensions
> 1024 1024
> My file has 1024 rows and 1024 columns.
>
> See how it works?
>
> Try the above and see what happens. Remember to put the full path ('E:\aRealDirectory\') before the file name (an alternative would be to use the CD command, but one thing at a time...).
>
> Try reading the documentation. It IS helpful.
>
> Good luck!

Thank you very much.Now I can read 3 band tiff in it, but one thing i want to know that is there any difference in reading ENVI COMPOSITE TIFF file in IDL.From that command it is showing 0 but it is opening in ENVY.Please help.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem regarding ENVI tiff file opening and display
Next Topic: Why interleaving in image??

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

Current Time: Wed Oct 08 13:27:43 PDT 2025

Total time taken to generate the page: 0.00615 seconds