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

Home » Public Forums » archive » How do I get the path for a UNIT of a file?
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
How do I get the path for a UNIT of a file? [message #33404] Fri, 20 December 2002 11:17
Jonathan Greenberg is currently offline  Jonathan Greenberg
Messages: 91
Registered: November 2002
Member
Andrew:

Once again, thou art a genius, the ASSOC was exactly what I needed --
the last question I have is, when I do an "openu,unit,filename,/GET_LUN", is
there any way to extract just the directory path for that particular file?

--j

On 12/19/02 6:10 PM, in article 3E027C04.FBC18808@dsto.defence.gov.au,
"Andrew Cool" <andrew.cool@dsto.defence.gov.au> wrote:

> Jonathan Greenberg wrote:
>>
>> (thanks Andrew for your answer to my ASCII file question)
>>
>> I now want to know, using IDL and/or ENVI function, how do I write data to a
>> specific LINE of a BIP or BIL file? Its easy to read it (envi_get_slice),
>> but not easy to write that slice. The brute force is to load the entire
>> image into memory, assign that specific line the new values, and then
>> rewrite the entire image back to disk. This is EXTREMELY slow. Even using
>> ENVI's spectral tiling routines (which at least minimize the memory used,
>> and allow me to know what line I'm on), I still have to parse an entire BIP
>> or BIL file and rewrite it, when all I want to do is write to a specific
>> line and leave the rest of them as is. Anyone have any suggestions for how
>> to do this?
>>
>> --j
>
> Hi Jonathon,
>
> Looks like the rest of the World's gone to sleep, so I'll hazard a
> guess.
>
> Firstly though, I don't use ENVI, and hadn't even heard of BIP/BIL
> files
> until now... ;-)
>
> But I gather that they're bitmap image files from ArcView.
>
> What using ASSOC? ASSOC reads records as defined by you directly from
> the file. In the code below, c:\image.dat was crated with :-
>
> loadct,5
> image = dist(400,400)
> openw,lun,'c:\image.dat',/get
> writeu,lun,image
> free_lun,lun
>
> Now you can read back in any line or block of lines using ASSOC, and
> change
> it too! The ASSOC variable is *not* held in memory, but read from the
> disk
> every time it is referenced.
>
> PRO assoc_test
> loadct,5
> OpenU,lun,'c:\image.dat',/get
> line = ASSOC(lun,bytarr(400))
> print,line(199)
> line(199) = BYTARR(400)
> print,'=========================================='
> print,line(199)
> Free_lun,lun
> END
>
>
> And now you can independently read in image.dat and confirm the change.
> Hardest part is defining the structure and any offset peculiar to your
> file.
>
> I hope I'm not woofing at the wrong piece of bark here...
>
>
> Merry Xmas,
>
> Andrew
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Determining window types
Next Topic: Re: How do I get the path for a UNIT of a file?

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

Current Time: Fri Oct 10 16:09:42 PDT 2025

Total time taken to generate the page: 1.19929 seconds