X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 29 Jun 2018 03:13 PM by  David Starbuck
contour version 8.7
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Ted Allen



New Member


Posts:1
New Member


--
25 Jun 2018 04:55 PM
    I am having trouble contouring a 2D mapped lat lon variable[ 320,152] in version 8.7. When I apply the ,/FILL option the contours are all given a single color despite defining my levels (LEVS1 = 400-(findgen(41)*20)).
    I noticed in the Harris updates that there is a contour bug in IDL version 8.7, but details are sparse. Can anyone elaborate on what the bug details are and if they would affect my contouring commands where I specify c_values for a filled contour? Unfortunately, I can't get this answer directly from Harris since I use an academic license...

    my simple code is:

    ct = COLORTABLE(70)
    LEVS1 = 400-(findgen(41)*20)

    nlon=320
    nlat=152
    lon=(120-findgen(nlon)*0.25)*(-1)
    lat=33-findgen(nlat)*0.25
    m = Map('Mercator', /BOX_AXES, LABEL_POSITION=0,LIMIT=[-5,-120,33,-40],THICK=0.5)
    c2 = contour(reverse(raindiff[*,*],2),lon,lat,grid_units=2,overplot=1,min_value=10,color='red')
    c3 = contour(reverse(raindiff[*,*],2),lon,lat,grid_units=2,overplot=1,color='blue',max_value=0);,C_value=LEVS3)
    m1 = MapContinents(THICK=0.5,/hires)


    Ted Allen



    New Member


    Posts:1
    New Member


    --
    26 Jun 2018 08:12 AM
    Apologies....I pasted the wrong code snippet above. Please refer to the below:


    ct = COLORTABLE(70)
    LEVS1 = 400-(findgen(41)*20)

    nlon=320
    nlat=152
    lon=(120-findgen(nlon)*0.25)*(-1)
    lat=33-findgen(nlat)*0.25
    m = Map('Mercator', /BOX_AXES, LABEL_POSITION=0,LIMIT=[-5,-120,33,-40],THICK=0.5)
    c2 = contour(reverse(raindiff[*,*],2),lon,lat,grid_units=2,overplot=1,min_value=10,C_value=LEVS1,rgb_table=ct,/fill)
    m1 = MapContinents(THICK=0.5,/hires

    David Starbuck



    Basic Member


    Posts:143
    Basic Member


    --
    28 Jun 2018 10:15 AM
    When I try to run the code that you posted, I am encountering an error that says "Varaible is undefined: RAINDIFF".

    There is a bug in our system (IDL-69900) about some of the polygons within a contour not being filled properly when CONTOUR is applied on top of a map. This bug should be fixed in the next release of IDL.

    I am afraid I cannot say for certain that this is the bug you are encountering. If you send a ".sav" file with the RAINDIFF variable to support@harris.com, I can test the code on my system to confirm whether or not this is the bug you are encountering.

    David
    -HGS

    David Starbuck



    Basic Member


    Posts:143
    Basic Member


    --
    29 Jun 2018 03:13 PM
    I think that this issue is that the C_VALUE parameter seems to expect the contours values to be in order from smallest value to largest. If you reverse your levs2 variable, then the contour appears to be produced correctly. For example:

    restore, 'raindiff.sav'
    ct = COLORTABLE(70,/reverse)
    rdmin = min(raindiff[*,*], max=rdmax)
    LEVS2 = reverse(1000-(findgen(21)*100))
    nlon=320
    nlat=152
    lon=(120-findgen(nlon)*0.25)*(-1)
    lat=33-findgen(nlat)*0.25
    m = Map('Mercator', /BOX_AXES, LABEL_POSITION=0,LIMIT=[-5,-120,33,-40],THICK=0.5)
    c2 = contour(reverse(raindiff[*,*],2),lon,lat,grid_units=2,overplot=1,rgb_table=ct, /fill, C_VALUE=levs2)
    m1 = MapContinents(THICK=0.5,/hires)

    David
    -HGS
    You are not authorized to post a reply.