0

I'm working with IDL and I have an array like:

intensity[360,13]

containing entries whose values range from 0 to 60. The point is that I want to plot it in with a scale ranging from 0 to 100. However, if I do:

im = IMAGE(intensity, TITLE='Intensity', DIMENSIONS=[1400,400])
im = COLORBAR(TARGET=im)
im.Save, 'intensity.png'

it fixes an arbitrary scale from the minimum to the maximum value of the intensity value. How could I force it? I tried putting:

im = COLORBAR(TARGET=im, RANGE=[0,100])

but it just sets the colorbar values, without changing colors in the image. Is it possible to normalize the scale between 0 and 100, or should I act in a different way? Sorry I'm not used to IDL and I'm a little bit in a hurry with that :) Thank you very much!

urgeo
  • 645
  • 1
  • 9
  • 19

2 Answers2

0

Have you tried multiplying your array by some fraction to renormalize it? In your case, you could do the following:

copy_array  = intensity
copy_array *= 100/60

You could also use a routine like BYTSCL.PRO and set the keyword TOP equal to 100. The documentation can be found here.

honeste_vivere
  • 308
  • 5
  • 11
0

You need to:

First get the rgb color scheme and save it to rgb by:

TVLCT, rgb, /get

Then:

1: bytscl the intensity array, setting min and max to the upper and lower bounds of the color bar you want. Eg if you want your color bar to go 10 to 70, then:

copy_array  = bytscl(intensity, min = 10, max = 70).

2: Do the imaging as per normal, but with RGB_table:

im = IMAGE(intensity, TITLE='Intensity', DIMENSIONS=[1400,400], RGB_table = rgb)

3: Put on color bar (but without target), and using min, max, and the rgb color table:

im = COLORBAR(RANGE=[10,70], RGB_table)   (you may also need to supply a position for the bar too).

If you use target in the colorbar command, you won't be able to set the range.

Matteo Baldi
  • 5,613
  • 10
  • 39
  • 51