ION script - true colour [message #48300] |
Mon, 10 April 2006 10:15  |
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 #48308 is a reply to message #48300] |
Sat, 08 April 2006 06:45   |
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 #48314 is a reply to message #48300] |
Fri, 07 April 2006 14:11   |
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 - true colour [message #48378 is a reply to message #48300] |
Tue, 11 April 2006 22:55  |
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  |
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  |
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  |
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  |
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
|
|
|