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

Home » Public Forums » archive » Write 3dimensional array as bsq-file without using ENVI Methods
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
Write 3dimensional array as bsq-file without using ENVI Methods [message #91713] Fri, 14 August 2015 01:22 Go to next message
Ina is currently offline  Ina
Messages: 2
Registered: August 2015
Junior Member
Hey guys,

I have to replace all ENVI-Methods in my IDL-Code. Actually I am trying to write several 2- and 3-dimensional integer- and float-arrays as bsq-files without using ENVI-Methods such as "ENVI_WRITE_ENVI_FILE". More precisely the file type should be "ENVI Classification", "ENVI Standard" or "ENVI Spectral Library", if it is possible. Is there a way to do this? Thanks in advance.

Actually my IDL Code (including the ENVI Method: ENVI_WRITE_ENVI_FILE) is looking like this:

> mask_unclassified_urban = intarr(no_columnsX_org, no_linesY_org)
>
> file_type_standard = ENVI_FILE_TYPE('ENVI Standard')
>
> ENVI_WRITE_ENVI_FILE, mask_unclassified_urban, file_type = file_type_standard, map_info=map_info_output, out_name=out_name_unclassified_mask_urban
Re: Write 3dimensional array as bsq-file without using ENVI Methods [message #91714 is a reply to message #91713] Fri, 14 August 2015 02:17 Go to previous messageGo to next message
Puneeth Shankar is currently offline  Puneeth Shankar
Messages: 21
Registered: June 2015
Junior Member
I assume you solely have an IDL licence and trying to convert all envi functionalities to IDL alone. So I suggest you to take a look at WRITE_TIFF in IDL. You are free to write it the way you want. Hope this is what you were trying to do

BEST,
Puneeth
Re: Write 3dimensional array as bsq-file without using ENVI Methods [message #91730 is a reply to message #91714] Mon, 17 August 2015 00:52 Go to previous messageGo to next message
Ina is currently offline  Ina
Messages: 2
Registered: August 2015
Junior Member
Hi thanks for your suggestion. However, I need bsq-files as output... is there no possibility for that? I have both licences, ENVI and IDL but it should run without opening ENVI, so that is applicable without ENVI and therefore everywhere... :/.
best regards,
Ina
Re: Write 3dimensional array as bsq-file without using ENVI Methods [message #91731 is a reply to message #91730] Mon, 17 August 2015 01:41 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Monday, 17 August 2015 09:52:46 UTC+2, jil...@googlemail.com wrote:
> Hi thanks for your suggestion. However, I need bsq-files as output... is there no possibility for that? I have both licences, ENVI and IDL but it should run without opening ENVI, so that is applicable without ENVI and therefore everywhere... :/.
> best regards,
> Ina

To write the binary (bsq) file itself is no problem. Just make sure that your array has the band dimension last (using TRANSPOSE if necessary), and write to disk:

A = fltarr(npixels, nlines, nbands)
openw, unit, 'myfile.bsq', /get_lun
writeu, unit, A
free_lun, unit

However, you must write code to dump the corresponding ENVI header file yourself. In simple cases this is rather easy, but a general solution is a lot of work.

--
Yngvar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Has anyone used stippling in contour plot ?
Next Topic: Help with pointers

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

Current Time: Wed Oct 08 11:32:32 PDT 2025

Total time taken to generate the page: 0.00411 seconds