Re: tv with axes routine [message #51606] |
Mon, 04 December 2006 07:40 |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
spectro_plot is a good routine but seems to have a touch of odd
behavior (I didn't know about this routine before)
odd behavior:
;; setup some data
dat = dist(100)
;; x is just 1:100
x = findgen(100)
y = findgen(100)
;; y has a datagap at 49 by 100
y[50:*] += 100
spectro_plot, dat, x, y, /no_ut
END
I would expect the plot to have a 100 unit gap in y but instead I get
oddness.
Have a look,
Cheers,
Brian
Paolo Grigis wrote:
> The solution proposed are useful, but actually sometimes you want
> a behaviour similar to contour even for *not-uniformely* spaced
> data, such that you specify an image z and two axis vectors
> x and y with the coordinates of each horizontal and vertical
> channel. In solarsoft, the routine "spectro_plot" will do that
> for you.
>
> Example:
>
> ;create some data
> nx=800
> ny=600
>
> ;image
> im=dist(nx,ny)
>
> ;log scaled axis
> x=10.^(findgen(nx)/(nx-1)*2)
> y=10.^(findgen(ny)/(ny-1)*2+1)
>
> ;pick color table
> loadct,5
>
> ;linear color scale
> spectro_plot,im,x,y,/xlog,/ylog,/xstyle,/ystyle,/no_ut
>
> ;logarithmic color scale
> spectro_plot,im,x,y,/xlog,/ylog,/zlog,/xstyle,/ystyle,/no_ut
>
> ;linear axis & color
> spectro_plot,im,x,y,/xstyle,/ystyle,/no_ut
>
> Ciao,
> Paolo
>
>
|
|
|
Re: tv with axes routine [message #51608 is a reply to message #51606] |
Mon, 04 December 2006 01:21  |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
The solution proposed are useful, but actually sometimes you want
a behaviour similar to contour even for *not-uniformely* spaced
data, such that you specify an image z and two axis vectors
x and y with the coordinates of each horizontal and vertical
channel. In solarsoft, the routine "spectro_plot" will do that
for you.
Example:
;create some data
nx=800
ny=600
;image
im=dist(nx,ny)
;log scaled axis
x=10.^(findgen(nx)/(nx-1)*2)
y=10.^(findgen(ny)/(ny-1)*2+1)
;pick color table
loadct,5
;linear color scale
spectro_plot,im,x,y,/xlog,/ylog,/xstyle,/ystyle,/no_ut
;logarithmic color scale
spectro_plot,im,x,y,/xlog,/ylog,/zlog,/xstyle,/ystyle,/no_ut
;linear axis & color
spectro_plot,im,x,y,/xstyle,/ystyle,/no_ut
Ciao,
Paolo
Brian Larsen wrote:
> Has anyone out there written a wrapper for tv that makes the output
> look like contour?
>
> By like contour I mean with axes, and in the center of the window,
> scalable zrange, log scales, ability to add a colorbar (using colorbar
> would work separately also so long as position works)
> Contour is great but it inherently smooths and takes forever, I don't
> want either.
>
> This would be a blocky version of
> IDL> contour, dist(100), /fill, nlevels=100
>
> but of course
> IDL> tvscl, dist(100)
> doesn't have any axes, is in the wrong place and all.
>
> This would be the equivalent then of imagesc() in matlab.
>
> Cheers,
>
> -Brian
>
|
|
|
|
|
Re: tv with axes routine [message #51612 is a reply to message #51610] |
Sat, 02 December 2006 17:28  |
mmeron
Messages: 44 Registered: October 2003
|
Member |
|
|
In article <1165104217.422708.91740@n67g2000cwd.googlegroups.com>, "Brian Larsen" <balarsen@gmail.com> writes:
> I tried to send you this with this result, so I will just post here
> ----- The following addresses had permanent fatal errors -----
> <m...@cars3.uchicago.edu> (I added the ...)
> (reason: 550 5.7.1 Unable to relay for m...@cars3.uchicago.edu)
>
Oh, that's a dead mailbox, the proper address is in the sig. But no
matter, got your address, I'll zip the library and email it to you.
>
> ------------
>
> I would love to have the newer version, this could save a bunch
> of time
> of me reinventing a perfectly good wheel.
>
> If you wouldn't mind and its small enough for email
> balarsen@gmail.com
> is as good as any address.
>
> Thanks much,
>
> Brian
>
>
>
>> My Display_mm will do these things. Unfortunately, even though I
>> forwarded ti RSI (sorry, ITT) an updated version of my library (called
>> MIDL_LIB) few months ago, their user contributions page still provides
>> only the older version of the library, from 2002 (which lacks
>> Display_mm). If you want a newer version you'll have to contact me.
>>
>> Mati Meron | "When you argue with a fool,
>> meron@cars.uchicago.edu | chances are he is doing just the same"
>
Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
|
|
|
Re: tv with axes routine [message #51613 is a reply to message #51612] |
Sat, 02 December 2006 16:03  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
I tried to send you this with this result, so I will just post here
----- The following addresses had permanent fatal errors -----
<m...@cars3.uchicago.edu> (I added the ...)
(reason: 550 5.7.1 Unable to relay for m...@cars3.uchicago.edu)
------------
I would love to have the newer version, this could save a bunch
of time
of me reinventing a perfectly good wheel.
If you wouldn't mind and its small enough for email
balarsen@gmail.com
is as good as any address.
Thanks much,
Brian
> My Display_mm will do these things. Unfortunately, even though I
> forwarded ti RSI (sorry, ITT) an updated version of my library (called
> MIDL_LIB) few months ago, their user contributions page still provides
> only the older version of the library, from 2002 (which lacks
> Display_mm). If you want a newer version you'll have to contact me.
>
> Mati Meron | "When you argue with a fool,
> meron@cars.uchicago.edu | chances are he is doing just the same"
|
|
|
Re: tv with axes routine [message #51614 is a reply to message #51613] |
Sat, 02 December 2006 15:53  |
mmeron
Messages: 44 Registered: October 2003
|
Member |
|
|
In article <1165095337.186137.225850@n67g2000cwd.googlegroups.com>, "Brian Larsen" <balarsen@gmail.com> writes:
> Has anyone out there written a wrapper for tv that makes the output
> look like contour?
>
> By like contour I mean with axes, and in the center of the window,
> scalable zrange, log scales, ability to add a colorbar (using colorbar
> would work separately also so long as position works)
> Contour is great but it inherently smooths and takes forever, I don't
> want either.
>
> This would be a blocky version of
> IDL> contour, dist(100), /fill, nlevels=100
>
> but of course
> IDL> tvscl, dist(100)
> doesn't have any axes, is in the wrong place and all.
>
> This would be the equivalent then of imagesc() in matlab.
>
> Cheers,
>
My Display_mm will do these things. Unfortunately, even though I
forwarded ti RSI (sorry, ITT) an updated version of my library (called
MIDL_LIB) few months ago, their user contributions page still provides
only the older version of the library, from 2002 (which lacks
Display_mm). If you want a newer version you'll have to contact me.
Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
|
|
|
Re: tv with axes routine [message #51616 is a reply to message #51614] |
Sat, 02 December 2006 14:33  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
Oops, this being TVIMAGE
Brian Larsen wrote:
> OK,
> fixed there was an ancient version of this hiding on my system that was
> ahead of the version from solarsoft (same version as from your site) in
> my path. Getting rid of the ancient version makes it work.
>
> Thanks much this will greatly speed things up I hope,
>
> Brian
|
|
|
Re: tv with axes routine [message #51617 is a reply to message #51616] |
Sat, 02 December 2006 14:30  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
OK,
fixed there was an ancient version of this hiding on my system that was
ahead of the version from solarsoft (same version as from your site) in
my path. Getting rid of the ancient version makes it work.
Thanks much this will greatly speed things up I hope,
Brian
|
|
|
Re: tv with axes routine [message #51618 is a reply to message #51617] |
Sat, 02 December 2006 14:27  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
Odd enough this doesn't work the first time I call it. I get
non-square axes and a colorbar but nothing in it.
Then I can it again and I get the right thing splattered overtop the
wrong thing...
-Brian
|
|
|
Re: tv with axes routine [message #51619 is a reply to message #51618] |
Sat, 02 December 2006 14:08  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brian Larsen writes:
> Has anyone out there written a wrapper for tv that makes the output
> look like contour?
>
> By like contour I mean with axes, and in the center of the window,
> scalable zrange, log scales, ability to add a colorbar (using colorbar
> would work separately also so long as position works)
> Contour is great but it inherently smooths and takes forever, I don't
> want either.
>
> This would be a blocky version of
> IDL> contour, dist(100), /fill, nlevels=100
>
> but of course
> IDL> tvscl, dist(100)
> doesn't have any axes, is in the wrong place and all.
>
> This would be the equivalent then of imagesc() in matlab.
xrange = [-5, 5]
yrange = [5, 15]
image = Dist(256)
LoadCT, 33, NColors=100, Bottom=1, /Silent
position = [0.1, 0.1, 0.9, 0.75]
TVImage, BytScl(image, Top=99), Position=position, $
/Keep_Aspect, /Erase, /NoInterpolate
Plot, xrange, yrange, XRANGE=xrange, YRANGE=yrange, $
Position=position, XStyle=1, YStyle=1, /NoData, /NoErase
Colorbar, Range=[Min(image), Max(image)], Divisions=10, $
Minor=5, NColors=100, Bottom=1, $
Position=[position[0], 0.88, position[2], 0.95]
You could easily slap this into a wrapper procedure if you
like. Call it IMAGESC. :-)
You can find the relevant programs in the Coyote Library.
http://www.dfanning.com/documents/programs.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|