Re: New IDL User Questions [message #24979] |
Thu, 10 May 2001 08:05 |
Jaco van Gorkom
Messages: 97 Registered: November 2000
|
Member |
|
|
JD Smith wrote in message <3AF85085.7E5696AD@astro.cornell.edu>...
> John Piccirillo wrote:
...
>> 1. Editor Screen
>> a. Is there a way to make the Editor full screen or extend
>> over some of the other windows? Using resize doesn't do it.
>> Does everyone confine themselves to this small window on
their
>> code?
>> b. My scrolling mouse will scroll in the Output Log and Variable
>> Watch
>> windows, but not in the Editor Window. Que pasa?
>
> One word. IDLWAVE.
>
> http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/
...
For those who know, or are prepared to learn, emacs. In the IDLDE it
helps to use the 'multiple window' setting, or 'separate editor window'
under
Preferences. This works on Unix, but somehow I cannot find how to do this
in the Windows version...
Jaco
|
|
|
Re: New IDL User Questions [message #24986 is a reply to message #24979] |
Wed, 09 May 2001 10:05  |
John Piccirillo
Messages: 3 Registered: May 2001
|
Junior Member |
|
|
Thanks to all for the concise and helpful answers to my questions.
I appreciate the help.
John Piccirillo, Ph.D.
Radiance Technologies Inc.
Huntsville, AL 35816
jpicciri@radiancetech.com
John Piccirillo <jpicciri@radiancetech.com> wrote in message
news:f6WJ6.8403$2B6.790502@e420r-chi2.usenetserver.com...
> Hello,
>
> I'm new to IDL, but not new to programming. I have
> the IDL manuals and Dr. Fanning's excellent book, nevertheless,
> I have a few basic questions:
>
> 1. Editor Screen
> a. Is there a way to make the Editor full screen or extend
> over some of the other windows? Using resize doesn't do it.
> Does everyone confine themselves to this small window on their
> code?
> b. My scrolling mouse will scroll in the Output Log and Variable
> Watch
> windows, but not in the Editor Window. Que pasa?
>
> 2. Array Operations - Not being used to IDL type of array operations,
> is there a simpler way to do the following?
> a.
> For I = 0, 199 Do Begin
> For J = 0, 84 Do Begin
> If (ImageMask[I,J] EQ 1) Then ImageROI[I,J,*] =
> ImageS[I,J,*]
> Else ImageROI[I,J,*] = 0
> EndFor
> EndFor
> I thought of using the WHERE function as in,
> ROI = Where(ImageMask EQ 1)
> but ImageROI[ROI} = ImageS{ROI} leaves out the third dimension.
>
> b. ;blow-up image X 9 For Screen Display
> For j = 0,84 Do Begin
> For i = 0,199 Do Begin
> JImage[3*i,3*j] = ImageS[i,j,[4]]
> JImage[3*i,3*j+1] = ImageS[i,j,[4]]
> JImage[3*i,3*j+2] = ImageS[i,j,[4]]
> JImage[3*i+1,3*j] = ImageS[i,j,[4]]
> JImage[3*i+1,3*j+1] = ImageS[i,j,[4]]
> JImage[3*i+1,3*j+2] = ImageS[i,j,[4]]
> JImage[3*i+2,3*j] = ImageS[i,j,[4]]
> JImage[3*i+2,3*j+1] = ImageS[i,j,[4]]
> JImage[3*i+2,3*j+2] = ImageS[i,j,[4]]
> EndFor
> EndFor
>
> I don't use the EXPAND function because I don't want to interpolate
> the data.
>
> 3. PLOT
> I have a couple of plots I want on the same Y Scale, the larger
of
> the two
> data sets. Presently, I use plot to generate the scale to !y.range, and
> then test
> the two ranges and re-plot, as in.
>
> Window, 0, Title = ' P Target; NPix = ' + string(Fix(NumOnes)), $
> XSize = 350, YSize = 350, XPos = 0, YPos = 0
> Plot, WavL, MeanPT, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1
> PTYRange = !y.crange
> Window, 1, Title = ' P BkGnd; NPix = ' + string(Fix(17000 - NumOnes)),
$
> XSize = 350, YSize = 350, XPos = 0, YPos = 375
> Plot, WavL, MeanPB, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1
> PBYRange = !y.crange
> SPRange = Max([PTYRange[1], PBYRange[1]])
> MaxY = [0,SPRange]
>
> ; replot all with new, uniform Y scale
> Window, 0, Title = 'P Target; NPix = ' + string(Fix(NumOnes)), $
> XSize = 350, YSize = 375, XPos = 0, YPos = 0
> Plot, WavL, MeanPT, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1, YRange =
> MaxY
> Window, 1, Title = 'P BkGnd ; NPix = ' + string(Fix(17000 - NumOnes)), $
> XSize = 350, YSize = 350, XPos = 0, YPos = 375
> Plot, WavL, MeanPB, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1, YRange =
> MaxY
>
> this seems inefficient, what is a better way?
>
> Thanks,
>
> John Piccirillo
>
>
>
>
|
|
|
Re: New IDL User Questions [message #25000 is a reply to message #24986] |
Tue, 08 May 2001 20:30  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"John Piccirillo" <jpicciri@radiancetech.com> writes:
> 2. Array Operations - Not being used to IDL type of array operations,
> is there a simpler way to do the following?
> a.
> For I = 0, 199 Do Begin
> For J = 0, 84 Do Begin
> If (ImageMask[I,J] EQ 1) Then ImageROI[I,J,*] =
> ImageS[I,J,*]
> Else ImageROI[I,J,*] = 0
> EndFor
> EndFor
> I thought of using the WHERE function as in,
> ROI = Where(ImageMask EQ 1)
> but ImageROI[ROI} = ImageS{ROI} leaves out the third dimension.
JD may have been thinking of a different question here. I believe you
want only a slight modification to your code:
ROI = Where(ImageMask EQ 1)
ImageROI[ROI,*] = ImageS[ROI,*]
This will include the third dimension.
> b. ;blow-up image X 9 For Screen Display
> For j = 0,84 Do Begin
> For i = 0,199 Do Begin
> JImage[3*i,3*j] = ImageS[i,j,[4]]
...
> EndFor
> EndFor
Liam plugged IMDISP so I will plug PLOTIMAGE on my web page. If you
really just want to expand an image then it is very straightforward to
use the REBIN function. Otherwise either Liam or my image display
program will be quite easy.
JImage = rebin(ImageS[*,*,4], 200*3, 85*3, 1)
The extra "1" is because ImageS[*,*,4] is really a 200x85x1 array.
Craig
http://cow.physics.wisc.edu/~craigm/idl/idl.html (PLOTIMAGE is under Graphics)
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: New IDL User Questions [message #25001 is a reply to message #25000] |
Tue, 08 May 2001 20:31  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
JD Smith <jdsmith@astro.cornell.edu> writes:
> assuming the full dimensions are 200x84xnz. Once IDL 5.5 comes out, you
> should also be able to use a single vector of dimensions:
>
> rebin(imagemask eq 0, [size(imagemask,/DIMENSIONS),nz])
>
> and so on. (Craig, they have committed to adding this overlooked
> feature).
Cool!
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: New IDL User Questions [message #25002 is a reply to message #25000] |
Tue, 08 May 2001 17:31  |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
"John Piccirillo" <jpicciri@radiancetech.com> wrote in message
news:<f6WJ6.8403$2B6.790502@e420r-chi2.usenetserver.com>...
> b. ;blow-up image X 9 For Screen Display
> For j = 0,84 Do Begin
> For i = 0,199 Do Begin
> JImage[3*i,3*j] = ImageS[i,j,[4]]
> JImage[3*i,3*j+1] = ImageS[i,j,[4]]
> JImage[3*i,3*j+2] = ImageS[i,j,[4]]
> JImage[3*i+1,3*j] = ImageS[i,j,[4]]
> JImage[3*i+1,3*j+1] = ImageS[i,j,[4]]
> JImage[3*i+1,3*j+2] = ImageS[i,j,[4]]
> JImage[3*i+2,3*j] = ImageS[i,j,[4]]
> JImage[3*i+2,3*j+1] = ImageS[i,j,[4]]
> JImage[3*i+2,3*j+2] = ImageS[i,j,[4]]
> EndFor
> EndFor
>
> I don't use the EXPAND function because I don't want to interpolate
> the data.
Let IMDISP do the work:
http://cimss.ssec.wisc.edu/~gumley/imdisp.html
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley/
|
|
|
Re: New IDL User Questions [message #25005 is a reply to message #25002] |
Tue, 08 May 2001 13:01  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
John Piccirillo wrote:
>
> Hello,
>
> I'm new to IDL, but not new to programming. I have
> the IDL manuals and Dr. Fanning's excellent book, nevertheless,
> I have a few basic questions:
This is a perfectly natural phenomenon. I'd write to David asking him
to expand his book to cover the answers to every possible question. And
also add his favorite recipes. And secrets of an effective backswing.
>
> 1. Editor Screen
> a. Is there a way to make the Editor full screen or extend
> over some of the other windows? Using resize doesn't do it.
> Does everyone confine themselves to this small window on their
> code?
> b. My scrolling mouse will scroll in the Output Log and Variable
> Watch
> windows, but not in the Editor Window. Que pasa?
One word. IDLWAVE.
http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/
> 2. Array Operations - Not being used to IDL type of array operations,
> is there a simpler way to do the following?
> a.
> For I = 0, 199 Do Begin
> For J = 0, 84 Do Begin
> If (ImageMask[I,J] EQ 1) Then ImageROI[I,J,*] =
> ImageS[I,J,*]
> Else ImageROI[I,J,*] = 0
> EndFor
> EndFor
> I thought of using the WHERE function as in,
> ROI = Where(ImageMask EQ 1)
> but ImageROI[ROI} = ImageS{ROI} leaves out the third dimension.
Yes, there are many. Here is one:
IDL> imageroi=rebin(imagemask eq 0,200,84,nz)
assuming the full dimensions are 200x84xnz. Once IDL 5.5 comes out, you
should also be able to use a single vector of dimensions:
rebin(imagemask eq 0, [size(imagemask,/DIMENSIONS),nz])
and so on. (Craig, they have committed to adding this overlooked
feature).
>
> b. ;blow-up image X 9 For Screen Display
> I don't use the EXPAND function because I don't want to interpolate
> the data.
Almost everyone (except RSI, apparently) has a nice image viewer routine
which does this for you, based on your window size. I wrote my own
myself long ago, but you'd be better off starting with one of theirs.
Hint: they often start with "im" or "tv", or and in "disp". Hint2:
rebin() is again your friend, with SAMPLE=1 set.
>
> 3. PLOT
> I have a couple of plots I want on the same Y Scale, the larger of
> the two
> data sets. Presently, I use plot to generate the scale to !y.range, and
> then test
> the two ranges and re-plot, as in.
>
> Window, 0, Title = ' P Target; NPix = ' + string(Fix(NumOnes)), $
> XSize = 350, YSize = 350, XPos = 0, YPos = 0
> Plot, WavL, MeanPT, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1
> PTYRange = !y.crange
> Window, 1, Title = ' P BkGnd; NPix = ' + string(Fix(17000 - NumOnes)), $
> XSize = 350, YSize = 350, XPos = 0, YPos = 375
> Plot, WavL, MeanPB, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1
> PBYRange = !y.crange
> SPRange = Max([PTYRange[1], PBYRange[1]])
> MaxY = [0,SPRange]
>
> ; replot all with new, uniform Y scale
> Window, 0, Title = 'P Target; NPix = ' + string(Fix(NumOnes)), $
> XSize = 350, YSize = 375, XPos = 0, YPos = 0
> Plot, WavL, MeanPT, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1, YRange =
> MaxY
> Window, 1, Title = 'P BkGnd ; NPix = ' + string(Fix(17000 - NumOnes)), $
> XSize = 350, YSize = 350, XPos = 0, YPos = 375
> Plot, WavL, MeanPB, PSYM = 2, TickLen = 1, XGrid = 1, YGrid = 1, YRange =
> MaxY
>
Examine that data itself, find the min/max you'd like, and then set them
for plotting directly with YRANGE, not forgetting YSTYLE=1 if you want
to force the *exact* range (note the use of the < and > operators...
very handy):
yr=[min(b1)<min(b2),max(b1)>max(b2)]
plot,a1,b1,YRANGE=yr,/YSTYLE
plot,a2,b2,YRANGE=yr,/YSTYLE
Good luck,
JD
|
|
|