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

Home » Public Forums » archive » ION script - true colour
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
ION script - true colour [message #48300] Mon, 10 April 2006 10:15 Go to next message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
Is it possible to use true colour with ION script? My program make an
RGB output which ION handles like this...

IDL> set_plot, 'Z'
IDL> device, SET_RESOLUTION=[320,256]

...code...

IDL> ion__img = tvrd()
IDL> tvlct, ion__r, ion__g, ion__b, /GET
IDL> ion__tmp = bytarr(3, 320, 256)
IDL> ion__tmp[0, *, *] = ion__r[ion__img]
IDL> ion__tmp[1, *, *] = ion__g[ion__img]
IDL> ion__tmp[2, *, *] = ion__b[ion__img]
IDL> ion__img = ion__tmp
IDL> !QUIET = 1
IDL> write_jpeg, 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ion1452.jpg',
ion__img, TRUE=1

which is assuming that I'm using a colour table. Comes out b/w. You can
choose between png8, png24 and jpeg24, but they all do the same. Don't
seem to be any true options for the ION_IMAGE tag.

regards,
Greg
Re: ION script [message #48301 is a reply to message #48300] Mon, 10 April 2006 09:07 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Haje Korth wrote:

> I hope the slap on the forehead did not hurt too bad. :-)

The redness has mostly worn off. :)


> Note that I did not say that there aren't any trade-offs using ION. But for
> me as a science guy it is the quickest way to get my applications up and
> runnig on the web.

Agreed. While somewhat limited in it's application, ION Script is easy
to learn and does get you up and running quickly. That, more often than
not, is worth the shortcomings. That said, if *I* needed to do this
again, I would explore my alternatives.

Has anyone tried the free "alternatives" to build a web app with IDL?
PERL? Python (pyIDL, python-IDL)? Any luck?

-Rick
Re: ION script [message #48308 is a reply to message #48300] Sat, 08 April 2006 06:45 Go to previous messageGo to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Rick,
I hope the slap on the forehead did not hurt too bad. :-)

Note that I did not say that there aren't any trade-offs using ION. But for
me as a science guy it is the quickest way to get my applications up and
runnig on the web.

Cheers,
Haje


"Rick Towler" <rick.towler@nomail.noaa.gov> wrote in message
news:e16n72$laf$1@news.nems.noaa.gov...
>
>
> Haje Korth wrote:
>> Greg,
>> I precompile my routines into an IDL save set which is restored in the
>> ion script. Works fine for me....
>
> <slaps hand to forehead> Pure genius, Haje...
>
> You still have to deal with the startup time which can be significant
> depending on hardware and load. This was the factor in my ION script
> applications and it drove me a bit nuts. My application responded like
> RSI's website.
>
> -Rick
>
>
>> "greg michael" wrote in message
>> news:1144417776.152571.312170@i39g2000cwa.googlegroups.com.. .
>>> I'm looking into writing an ION script web front-end for a program I've
>>> developed which currently uses widgets and the virtual machine. The
>>> program is an interactive image viewer for an an image database on the
>>> server side, and depends on quite a lot of IDL code. As far as I can
>>> see, it looks to me like each time you make a page request, ION script
>>> starts up, compiles all the necessary IDL code, runs the script, and
>>> exits. This means that for every interaction, all my IDL libraries need
>>> to be compiled. Is this really so? Is there any way to avoid that?
Re: ION script [message #48312 is a reply to message #48300] Fri, 07 April 2006 15:51 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
David Fanning wrote:
> Rick Towler writes:
>
>> My application responded like RSI's website.
>
> You guys are getting mean (and a whole lot funnier).

Yeah, that was unfair. I just visited their site today and it was quite
snappy. Maybe they got a new ISP recently. Or stopped using ION script
to generate their dynamic content.

<Dr. Nick> I'm kidding. I'm kidding. </Dr. Nick>

I think it is time to go home....

-Rick
Re: ION script [message #48313 is a reply to message #48300] Fri, 07 April 2006 14:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rick Towler writes:

> My application responded like RSI's website.

You guys are getting mean (and a whole lot funnier).
I'd hate to see where this newsgroup ends up, five
years from now. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: ION script [message #48314 is a reply to message #48300] Fri, 07 April 2006 14:11 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Haje Korth wrote:
> Greg,
> I precompile my routines into an IDL save set which is restored in the ion
> script. Works fine for me....

<slaps hand to forehead> Pure genius, Haje...

You still have to deal with the startup time which can be significant
depending on hardware and load. This was the factor in my ION script
applications and it drove me a bit nuts. My application responded like
RSI's website.

-Rick


> "greg michael" wrote in message
> news:1144417776.152571.312170@i39g2000cwa.googlegroups.com.. .
>> I'm looking into writing an ION script web front-end for a program I've
>> developed which currently uses widgets and the virtual machine. The
>> program is an interactive image viewer for an an image database on the
>> server side, and depends on quite a lot of IDL code. As far as I can
>> see, it looks to me like each time you make a page request, ION script
>> starts up, compiles all the necessary IDL code, runs the script, and
>> exits. This means that for every interaction, all my IDL libraries need
>> to be compiled. Is this really so? Is there any way to avoid that?
Re: ION script [message #48316 is a reply to message #48300] Fri, 07 April 2006 13:43 Go to previous messageGo to next message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
A-ha - of course! Perfect solution. Thanks very much.

Greg
Re: ION script [message #48319 is a reply to message #48300] Fri, 07 April 2006 13:20 Go to previous messageGo to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Greg,
I precompile my routines into an IDL save set which is restored in the ion
script. Works fine for me....

Haje


"greg michael" <greg.michael@gmail.com> wrote in message
news:1144417776.152571.312170@i39g2000cwa.googlegroups.com.. .
> I'm looking into writing an ION script web front-end for a program I've
> developed which currently uses widgets and the virtual machine. The
> program is an interactive image viewer for an an image database on the
> server side, and depends on quite a lot of IDL code. As far as I can
> see, it looks to me like each time you make a page request, ION script
> starts up, compiles all the necessary IDL code, runs the script, and
> exits. This means that for every interaction, all my IDL libraries need
> to be compiled. Is this really so? Is there any way to avoid that?
>
Re: ION script [message #48328 is a reply to message #48300] Fri, 07 April 2006 07:44 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
greg michael wrote:
> I'm looking into writing an ION script web front-end for a program I've
> developed which currently uses widgets and the virtual machine. The
> program is an interactive image viewer for an an image database on the
> server side, and depends on quite a lot of IDL code. As far as I can
> see, it looks to me like each time you make a page request, ION script
> starts up, compiles all the necessary IDL code, runs the script, and
> exits. This means that for every interaction, all my IDL libraries need
> to be compiled. Is this really so? Is there any way to avoid that?

Yes and... No. Yes they are compiled and no you can't avoid it. If you
use ION script.

ION Java may be more appropriate, or something completely different
where your back end is written in IDL and you implement a front end in
php or asp or Java and communicate via sockets. It really depends on
what you are doing.

-Rick
Re: ION script - true colour [message #48378 is a reply to message #48300] Tue, 11 April 2006 22:55 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Kenneth Bowman <k-bowman@null.tamu.edu> writes:
> In article <e1g669$sml$1@aplcore.jhuapl.edu>,
> "Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote:
>
>> Ken,
>> While my server runs on unix, I do the development under Windows, where the
>> work around is unfortunately no good. However, as the code has grown I
>> actually appreciate some other features of object graphics, such as alpha
>> blending which I use frequently. While alpha blending is only a simple line
>> of code, the keyword solution is pretty slick.
>>
>> Haje
>
> Not that anyone in their right mind would want to do this ;-), but is it
> possible to run IDL on Windows and use the X device?

One can use the "virtual frame buffer" X server (Xvfb), which emulates
an X head without actually needing a display. We use it some for this
kind of thing where an unattended task needs to make X graphical
output. It's not always installed with Linux, but my recent installs
of Mac OS X and Fedora had them.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: ION script - true colour [message #48381 is a reply to message #48300] Tue, 11 April 2006 07:15 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
X device is not available on Windows, so it's impossible to go totally
crazy! :-)


"Kenneth Bowman" <k-bowman@null.tamu.edu> wrote in message
news:k-bowman-A4652C.08525011042006@news.tamu.edu...
> In article <e1g669$sml$1@aplcore.jhuapl.edu>,
> "Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote:
>
>> Ken,
>> While my server runs on unix, I do the development under Windows, where
>> the
>> work around is unfortunately no good. However, as the code has grown I
>> actually appreciate some other features of object graphics, such as alpha
>> blending which I use frequently. While alpha blending is only a simple
>> line
>> of code, the keyword solution is pretty slick.
>>
>> Haje
>
> Not that anyone in their right mind would want to do this ;-), but is it
> possible to run IDL on Windows and use the X device?
>
> Ken
Re: ION script - true colour [message #48382 is a reply to message #48300] Tue, 11 April 2006 06:52 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <e1g669$sml$1@aplcore.jhuapl.edu>,
"Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote:

> Ken,
> While my server runs on unix, I do the development under Windows, where the
> work around is unfortunately no good. However, as the code has grown I
> actually appreciate some other features of object graphics, such as alpha
> blending which I use frequently. While alpha blending is only a simple line
> of code, the keyword solution is pretty slick.
>
> Haje

Not that anyone in their right mind would want to do this ;-), but is it
possible to run IDL on Windows and use the X device?

Ken
Re: ION script - true colour [message #48384 is a reply to message #48300] Tue, 11 April 2006 05:07 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Ken,
While my server runs on unix, I do the development under Windows, where the
work around is unfortunately no good. However, as the code has grown I
actually appreciate some other features of object graphics, such as alpha
blending which I use frequently. While alpha blending is only a simple line
of code, the keyword solution is pretty slick.

Haje


"Kenneth Bowman" <k-bowman@null.tamu.edu> wrote in message
news:k-bowman-A5D402.16484610042006@news.tamu.edu...
> In article <e1e5mj$j5t$1@aplcore.jhuapl.edu>,
> "Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote:
>
>> Greg,
>> from the manual:
>> "Direct Graphics
>> Images created using the IDL Direct Graphics commands are drawn to the
>> IDL
>> Z-Buffer. The Z-Buffer is an 8-bit device that stores intensity values
>> for
>> each pixel. These values are combined with the current color map to
>> produce
>> the final output image. If you change the device in any IDL code that is
>> executed in an <ION_IMAGE> tag, you must make sure to change the device
>> back
>> to the Z-Buffer and TV the final image to it."
>>
>> I use object graphics to avoid this limitation. For the record: I learned
>> object graphics specifically for this one task and it is probably the
>> only
>> time it ever shoes up in my codes! :-)
>>
>> Haje
>
> There is also the X-windows virtual frame buffer (Xvfb).
>
> http://www.rsinc.com/services/techtip.asp?ttid=2382
>
> I just tried this on my Mac (OS X 10.4.6). Xvfb apparently comes with the
> X
> distribution, and it worked just as advertised. Very slick. I'm going to
> start
> converting some background jobs I have to use it.
>
> Ken Bowman
Re: ION script [message #48391 is a reply to message #48301] Mon, 10 April 2006 14:18 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Rick Towler wrote:
> Agreed. While somewhat limited in it's application, ION Script is easy
> to learn and does get you up and running quickly. That, more often than
> not, is worth the shortcomings. That said, if *I* needed to do this
> again, I would explore my alternatives.
>
> Has anyone tried the free "alternatives" to build a web app with IDL?
> PERL? Python (pyIDL, python-IDL)? Any luck?
>
> -Rick

I've written Perl scripts that call IDL on a web server. It's no worse
than writing any other Perl script (I'm not a fan). IDL 6.2 has the
capability to pass command line arguments when you invoke IDL which
makes this type of thing much nicer.

-Mike
michaelgalloy.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: power law fitting for errors on both coordinates
Next Topic: Re: IDL routine to calculate slope and aspect from elevation grid?

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

Current Time: Wed Oct 08 13:45:59 PDT 2025

Total time taken to generate the page: 0.00517 seconds