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

Home » Public Forums » archive » BSQ to BIL
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: BSQ to BIL [message #69864 is a reply to message #69587] Mon, 15 February 2010 09:04 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 15, 2:42 pm, Hawaiianite <jtmcah...@gmail.com> wrote:
> I'm having trouble getting your code to run.  Why are the .pro files
> labeled "_define.pro"?  Do I need to remove that and put them in the
> IDL library to run.  Because right now it isn't recognizing them and
> keeps giving me a syntax error.  IDL appears to not like the "::"
> before init before I try to run pp_readcube.pro.

No, do not change the file names. Those with __define in their name
are files that define classes. The routines with :: in their names are
methods of those classes, and that is the way they should be.

First, make sure you have in your IDL path all the source code files:

http://www.ppenteado.net/idl/pp_editablecube__define.pro
http://www.ppenteado.net/idl/pp_readcube__define.pro
http://www.ppenteado.net/idl/pp_setcubeheadervalue.pro
http://www.ppenteado.net/idl/pp_extractfields.pro
http://www.ppenteado.net/idl/pp_getcubeheadervalue.pro
http://www.ppenteado.net/idl/pp_buffered_vector__define.pro

Then, what exactly were you trying to do?

This (copied from the file pp_editablecube__define.html) is one
example of how to use it to read, edit and write a cube:

To initialize from the cube CM_1553510065_1_ir.cub:

a=obj_new('pp_editablecube',file='CM_1553510065_1_ir.cub')

To add a dummy backplane:

a-
> getproperty,backplanes=back,backnames=bnames,lines=lines,sam ples=samples
backplanes=[[[backplanes]],[[findgen(lines,samples)]]]
backnames=[backnames,'DUMMY']
a->setproperty,backplanes=back,backnames=bnames

To remove the first core band:

a->getproperty,core=core,wavelengths=wavs
core=core[*,*,1:*] & wavs=wavs[1:*]
a->setproperty,core=core,wavelengths=wavs

To add lines to the history part of the header:

app=['GROUP = testedit','date = '+strcompress(systime(),/
remove),'END_GROUP = testdate']
a->headerset,append=app

To write the edited cube to 'testedit.cub':
a->write,'testedit.cub'

Destroy the object when done with it:

obj_destroy,a

There are more examples, for reading thing from a cube, in the file
pp_readcube__define.html.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Segfault when smoothing image
Next Topic: Window or Widget to front?

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

Current Time: Sun Oct 12 19:25:52 PDT 2025

Total time taken to generate the page: 1.12114 seconds