X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 Mar 2020 03:02 PM by  Ben Castellani
Visualization of data stored in array on a map
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Laurence Hu



New Member


Posts:
New Member


--
29 Jan 2020 07:15 PM
    Recently I got some gridded data to visualize on a map. However, I found that the array storing the gridded data cannot be shown normally on the map. The first column and bottom row are ignored when plotted on the map. I wrote a demo to show the problem.

    ;This is a test code;
    data=[[1,15,48,1],[45,34,38,34],[78,1,25,13],[34,21,36,57]]

    ;Plot the map;
    m = MAP('Geographic',limit=[0,-10,20,10])
    m.mapgrid.LABEL_POSITION = 0
    m.mapgrid.LINESTYLE = '-.'
    m.mapgrid.GRID_LATITUDE = 5
    m.mapgrid.GRID_LONGITUDE = 5
    m.mapgrid.FONT_SIZE = 6
    m['Latitudes'].LABEL_ANGLE = 0
    m['Longitudes'].LABEL_ANGLE = 0

    ;Visulize the array;
    im = IMAGE(data,
    IMAGE_DIMENSIONS=[20,20],
    IMAGE_LOCATION=[-10,0],
    grid_units='degrees',
    transparency=30,
    rgb_table=13,
    order=1,
    margin=0,
    POSITION=[0.1,0.1,0.75,0.75],
    overplot=m)

    continent = MAPCONTINENTS()

    c = COLORBAR(target=im,/BORDER,orientation=1,TEXTPOS=1,position=[0.7,0.1,0.73,0.75],TITLE='data (unit)')
    c.FONT_SIZE = 6

    In theory, the 4*4 grids should be shown with a spatial resolution of 5 deg from lon: -10, lat: 0. However, the plotted result just showed 3*3 grids, with the first column and bottom row not shown in the plot.

    Could someone help with this problem? Thanks!!


    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    02 Mar 2020 03:02 PM
    There appears to be a bug here that will need further investigation from the IDL Team.

    However, removing GRID_UNITS='DEGREES' from your call to IMAGE fixes the issue. It's not clear to me why that is, but hopefully that helps.
    You are not authorized to post a reply.