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

Home » Public Forums » archive » trying to export pixel data from .dat files, based on coordinate loc
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: trying to export pixel data from .dat files, based on coordinate loc [message #71713 is a reply to message #71623] Sat, 10 July 2010 07:16 Go to previous messageGo to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
> file_array=file_search[filepath, '*.dat', count['*.dat']= num_file]


This can not work. You are subscripting a keyword (count), moreover in a
very strange way (IDL is not PHP, you can't really use strings to subset
an array)
try:
file_array=file_search[filepath, '*.dat', count= num_file]


> for i=0, num_file-1 do begin
>
> file=file_array[i]
> print, num_file
>
> ;read ENVI binary file
> read_ENVI_image (file, headerfile= filepath, '*.hdr')
> ;extract pixel information based on lat long coordinates
> b=ENVI_CONVERT_FILE_COORDINATES [106.002, 83.0]


look up the help file for ENVI_CONVERT_FILE_COORDINATES
You are calling it in a totally wrong way... it is a procedure, not a
function. It requires 5 arguments

> v=b
> print, v

this is useless... you can work on b directly (though, once you have
call the ENVI_CONVERT_FILE_COORDINATES procedure the proper way, you
will have 2 variables to handle)

>
> ;open text file to write data to
> OPENU, U, 'pixel_value.txt', /get_lun, /append
> ;write data
> printf, U, v
> ;close LUN
> close, U

For efficiency, you can open the file before the loop, close it after
the loop and simply write your variables within the loop.

>
> endfor
>
> end
>
>

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: trying to export pixel data from .dat files, based on coordinate loc
Next Topic: % POLY_FIT: Warning: Invert detected a small pivot element - help needed

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

Current Time: Sun Oct 12 08:16:48 PDT 2025

Total time taken to generate the page: 1.84266 seconds