comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Contour: difference between IDL 8.0 and IDL 8.4
items: Re: Contour: difference between IDL 8.0 and IDL 8.4

Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: Ciao, I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. Here's a simple test: data = RANDOMU(seed, 9, 9) smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. Thanks, Stefano
creator: burkina
date: 2017-02-16T11:59:36-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Thursday, 16 February 2017 12:59:39 UTC+1, burkina wrote: > Ciao, > > I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. > > Here's a simple test: > > data = RANDOMU(seed, 9, 9) > smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) > > If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). > > On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. > > What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. > > Thanks, > > Stefano Hi, just to be more specific, this is a plot I had in IDL 8.0: https://img42.com/MOnas and this is what I get (exactly with the same code) in IDL 8.4: https://img42.com/KSkRc As you can see, in the latter the background of the reddish contour plot is still visible, because it's indeed a filled contour level, while in IDL 8.0 it is simply background. How can I get rid of it? Something clearly changed after IDL 8.0, I hope there's some kind of switch/parameter that I don't understand that can be set to have the old behaviour. I even thought about reconstructing the contour levels polygons, and then fill them, but, apparently, there's no way to get the polygons in function graphics…
creator: burkina
date: 2017-02-17T09:55:45-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Friday, 17 February 2017 16:30:47 UTC+1, Jim P wrote: > On Friday, February 17, 2017 at 2:55:48 AM UTC-7, burkina wrote: >> On Thursday, 16 February 2017 12:59:39 UTC+1, burkina wrote: >>> Ciao, >>> >>> I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. >>> >>> Here's a simple test: >>> >>> data = RANDOMU(seed, 9, 9) >>> smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) >>> >>> If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). >>> >>> On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. >>> >>> What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. >>> >>> Thanks, >>> >>> Stefano >> >> Hi, >> >> just to be more specific, this is a plot I had in IDL 8.0: >> >> https://img42.com/MOnas >> >> and this is what I get (exactly with the same code) in IDL 8.4: >> >> https://img42.com/KSkRc >> >> As you can see, in the latter the background of the reddish contour plot is still visible, because it's indeed a filled contour level, while in IDL 8.0 it is simply background. How can I get rid of it? >> >> Something clearly changed after IDL 8.0, I hope there's some kind of switch/parameter that I don't unders…
creator: burkina
date: 2017-02-17T16:45:56-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Friday, 17 February 2017 17:45:59 UTC+1, burkina wrote: > On Friday, 17 February 2017 16:30:47 UTC+1, Jim P wrote: >> On Friday, February 17, 2017 at 2:55:48 AM UTC-7, burkina wrote: >>> On Thursday, 16 February 2017 12:59:39 UTC+1, burkina wrote: >>>> Ciao, >>>> >>>> I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. >>>> >>>> Here's a simple test: >>>> >>>> data = RANDOMU(seed, 9, 9) >>>> smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) >>>> >>>> If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). >>>> >>>> On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. >>>> >>>> What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. >>>> >>>> Thanks, >>>> >>>> Stefano >>> >>> Hi, >>> >>> just to be more specific, this is a plot I had in IDL 8.0: >>> >>> https://img42.com/MOnas >>> >>> and this is what I get (exactly with the same code) in IDL 8.4: >>> >>> https://img42.com/KSkRc >>> >>> As you can see, in the latter the background of the reddish contour plot is still visible, because it's indeed a filled contour level, while in IDL 8.0 it is simply background. How can I get rid of it? >>> >>> Something …
creator: burkina
date: 2017-02-17T17:13:46-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Friday, 17 February 2017 17:45:59 UTC+1, burkina wrote: > On Friday, 17 February 2017 16:30:47 UTC+1, Jim P wrote: >> On Friday, February 17, 2017 at 2:55:48 AM UTC-7, burkina wrote: >>> On Thursday, 16 February 2017 12:59:39 UTC+1, burkina wrote: >>>> Ciao, >>>> >>>> I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. >>>> >>>> Here's a simple test: >>>> >>>> data = RANDOMU(seed, 9, 9) >>>> smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) >>>> >>>> If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). >>>> >>>> On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. >>>> >>>> What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. >>>> >>>> Thanks, >>>> >>>> Stefano >>> >>> Hi, >>> >>> just to be more specific, this is a plot I had in IDL 8.0: >>> >>> https://img42.com/MOnas >>> >>> and this is what I get (exactly with the same code) in IDL 8.4: >>> >>> https://img42.com/KSkRc >>> >>> As you can see, in the latter the background of the reddish contour plot is still visible, because it's indeed a filled contour level, while in IDL 8.0 it is simply background. How can I get rid of it? >>> >>> Something …
creator: burkina
date: 2017-02-17T17:14:44-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Friday, February 17, 2017 at 10:14:48 AM UTC-7, burkina wrote: > On Friday, 17 February 2017 17:45:59 UTC+1, burkina wrote: >> On Friday, 17 February 2017 16:30:47 UTC+1, Jim P wrote: >>> On Friday, February 17, 2017 at 2:55:48 AM UTC-7, burkina wrote: >>>> On Thursday, 16 February 2017 12:59:39 UTC+1, burkina wrote: >>>> > Ciao, >>>> > >>>> > I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. >>>> > >>>> > Here's a simple test: >>>> > >>>> > data = RANDOMU(seed, 9, 9) >>>> > smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) >>>> > >>>> > If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). >>>> > >>>> > On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. >>>> > >>>> > What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. >>>> > >>>> > Thanks, >>>> > >>>> > Stefano >>>> >>>> Hi, >>>> >>>> just to be more specific, this is a plot I had in IDL 8.0: >>>> >>>> https://img42.com/MOnas >>>> >>>> and this is what I get (exactly with the same code) in IDL 8.4: >>>> >>>> https://img42.com/KSkRc >>>> >>>> As you can see, in the latter the background of the reddish contour plot is still visible, because it…
creator: Jim Pendleton
date: 2017-02-19T03:55:02-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Sunday, 19 February 2017 04:55:05 UTC+1, Jim P wrote: > On Friday, February 17, 2017 at 10:14:48 AM UTC-7, burkina wrote: >> On Friday, 17 February 2017 17:45:59 UTC+1, burkina wrote: >>> On Friday, 17 February 2017 16:30:47 UTC+1, Jim P wrote: >>>> On Friday, February 17, 2017 at 2:55:48 AM UTC-7, burkina wrote: >>>> > On Thursday, 16 February 2017 12:59:39 UTC+1, burkina wrote: >>>> > > Ciao, >>>> > > >>>> > > I've upgraded from IDL 8.0 to IDL 8.4, and found a strange difference in the behaviour of CONTOUR. >>>> > > >>>> > > Here's a simple test: >>>> > > >>>> > > data = RANDOMU(seed, 9, 9) >>>> > > smooth = CONTOUR(MIN_CURVE_SURF(data), TITLE='Smoothed', RGB_TABLE=1, /FILL, c_value=[0, 0.2, 0.3, 0.5]) >>>> > > >>>> > > If you launch it in IDL 8.0, you get what you (more or less) expect: three filled contours, while the outer part is the white transparent background. I need to include the '0' level, otherwise the inner contour is left blank (BTW, I find it odd, and it is the same for IDL 8.4). >>>> > > >>>> > > On the other hand, if you launch it in IDL 8.4, there's a big difference: also the outer part is filled! Of course, I can give and explicit white color to it, but it's not the same, because it is not treated as a completely transparent background. So, when you put a contour above another, in IDL 8.0 everything is fine, because the outer part is completely transparent, while in IDL 8.4, you see also this outer part. Using 'max_value=0.5' is not an equivalent solution. >>>> > > >>>> > > What changed between 8.0 and 8.4? How can I revert to the 8.0 behaviour? I basically want to draw three filled contours, and leave the white transparent background in the rest of the image. >>>> > > >>>> > > Thanks, >>>> > > >>>> > > Stefano >>>> > >>>> > Hi, >>>> > >>>> > just to be more specific, this is a plot I had in IDL 8.0: >>>> > >>>> > https://img42.com/MOnas >>>> > >>>> > and this is what I get (exactly with the same code) in IDL 8.4: >>>> > >>>> > https://img42.c…
creator: burkina
date: 2017-02-20T10:30:12-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On 02/20/2017 11:30 AM, burkina wrote: > thank you very much! At least now I have a workaround, and can > recover the 'old' results with IDL 8.4, still taking advantages of all the other > updates (of course not those for contour...). By the way, I put the two > old class definition files in my working directory, since I couldn't > find a way to re-compile them from my own procedure (.compile does not > work inside procedures, and resolve_routine does not accept absolute > paths): is there a better way? I don't know whether there is a way without a separate directory, but it needn't be in your working directory. You can use: if !PATH.contains('/path/to/files') then begin pathSplit=strsplit(!PATH,':',/extract) wp=where(pathSplit eq '/path/to/files',/null,complement=wpc) !PATH=strjoin(pathSplitwp,wpc,':') endif else !PATH='/path/to/files:'+!PATH to make sure the files in '/path/to/files' are selected first. I hope that helps, Markus
creator: Markus Schmassmann
date: 2017-02-20T11:41:48-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: Hi Stefano, Here's what happened - as soon as we released IDL 8.0, users started complaining that the fill behavior was different than the direct graphics contour procedure. So we changed the default behavior to make it easier for people to transition from direct to function graphics. Unfortunately, that broke backwards compatibility for your case. However, there is a better workaround that avoids having to patch old code (which would break again if you upgrade). You can actually specify a "transparency" value for the c_color values by giving them 4 values ("RGBA" instead of "RGB"). The "A" (or alpha) ranges from 0 (transparent) to 255 (opaque). The documentation doesn't mention this, and I'll fix that for the next version. Here's a sample program where I do the contour plot, get the color values back out, then set the transparency for one contour. To try out this program you'll need to revert to your unmodified 8.4 code. I'm sorry about breaking your code, and I hope this workaround helps. Cheers, Chris IDL Project Lead Harris Geospatial Sample code: h = hanning(30,30) x = findgen(30) c = contour(1-h, x, x, rgb_table=1, /fill, c_value=[0,0.25,0.5,0.75]) colors = c.c_color dim = size(colors,/dim) colors = [colors, 255b+bytarr(1,dim[1])] ; change to RGBA colors[3,3] = 0 ; make transparent c.c_color = colors c1 = contour(1-h, x+10, x+10, rgb_table=2, /fill, $ c_value=[0,0.25,0.5,0.75], /overplot) colors = c1.c_color dim = size(colors,/dim) colors = [colors, 255b+bytarr(1,dim[1])] ; change to RGBA colors[3,3] = 0 ; make transparent c1.c_color = colors
creator: chris_torrence@NOSPAM
date: 2017-02-21T16:25:30-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Tuesday, 21 February 2017 17:25:34 UTC+1, Chris Torrence wrote: > Hi Stefano, > > Here's what happened - as soon as we released IDL 8.0, users started complaining that the fill behavior was different than the direct graphics contour procedure. So we changed the default behavior to make it easier for people to transition from direct to function graphics. Unfortunately, that broke backwards compatibility for your case. > > However, there is a better workaround that avoids having to patch old code (which would break again if you upgrade). You can actually specify a "transparency" value for the c_color values by giving them 4 values ("RGBA" instead of "RGB"). The "A" (or alpha) ranges from 0 (transparent) to 255 (opaque). The documentation doesn't mention this, and I'll fix that for the next version. > > Here's a sample program where I do the contour plot, get the color values back out, then set the transparency for one contour. To try out this program you'll need to revert to your unmodified 8.4 code. > > I'm sorry about breaking your code, and I hope this workaround helps. > Cheers, > Chris > IDL Project Lead > Harris Geospatial > > Sample code: > > h = hanning(30,30) > x = findgen(30) > c = contour(1-h, x, x, rgb_table=1, /fill, c_value=[0,0.25,0.5,0.75]) > colors = c.c_color > dim = size(colors,/dim) [color=blue]> colors = [colors, 255b+bytarr(1,dim[1])] ; change to RGBA[/color] > colors[3,3] = 0 ; make transparent > c.c_color = colors > > c1 = contour(1-h, x+10, x+10, rgb_table=2, /fill, $ > c_value=[0,0.25,0.5,0.75], /overplot) > colors = c1.c_color > dim = size(colors,/dim) [color=blue]> colors = [colors, 255b+bytarr(1,dim[1])] ; change to RGBA[/color] > colors[3,3] = 0 ; make transparent > c1.c_color = colors Hi Chris, thanks! This is a great solution. However, it obviously overrides any 'transparency' set in the contour command. To preserve it, I have to define it for all the colors, like this: colors[3,0]=150 colors[3,1]=150 colors[3,2]=150 With this other …
creator: burkina
date: 2017-02-22T07:57:46-00:00

Re: Contour: difference between IDL 8.0 and IDL 8.4
type: item
description: On Wednesday, February 22, 2017 at 12:57:52 AM UTC-7, burkina wrote: > On Tuesday, 21 February 2017 17:25:34 UTC+1, Chris Torrence wrote: >> Hi Stefano, >> >> Here's what happened - as soon as we released IDL 8.0, users started complaining that the fill behavior was different than the direct graphics contour procedure. So we changed the default behavior to make it easier for people to transition from direct to function graphics. Unfortunately, that broke backwards compatibility for your case. >> >> However, there is a better workaround that avoids having to patch old code (which would break again if you upgrade). You can actually specify a "transparency" value for the c_color values by giving them 4 values ("RGBA" instead of "RGB"). The "A" (or alpha) ranges from 0 (transparent) to 255 (opaque). The documentation doesn't mention this, and I'll fix that for the next version. >> >> Here's a sample program where I do the contour plot, get the color values back out, then set the transparency for one contour. To try out this program you'll need to revert to your unmodified 8.4 code. >> >> I'm sorry about breaking your code, and I hope this workaround helps. >> Cheers, >> Chris >> IDL Project Lead >> Harris Geospatial >> >> Sample code: >> >> h = hanning(30,30) >> x = findgen(30) >> c = contour(1-h, x, x, rgb_table=1, /fill, c_value=[0,0.25,0.5,0.75]) >> colors = c.c_color >> dim = size(colors,/dim) [color=teal]>> colors = [colors, 255b+bytarr(1,dim[1])] ; change to RGBA[/color] >> colors[3,3] = 0 ; make transparent >> c.c_color = colors >> >> c1 = contour(1-h, x+10, x+10, rgb_table=2, /fill, $ >> c_value=[0,0.25,0.5,0.75], /overplot) >> colors = c1.c_color >> dim = size(colors,/dim) [color=teal]>> colors = [colors, 255b+bytarr(1,dim[1])] ; change to RGBA[/color] >> colors[3,3] = 0 ; make transparent >> c1.c_color = colors > > Hi Chris, > > thanks! > > This is a great solution. However, it obviously overrides any 'transparency' set in the contour command. To preserve it, …
creator: chris_torrence@NOSPAM
date: 2017-02-23T19:39:25-00:00