X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 Feb 2017 09:08 AM by  anon
rebin
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:8
New Member


--
24 Feb 2017 09:08 AM
    I am rebinning from a 0.25 degree lon/lat grid (1440 x 720) to a half degree (720 x 360), using vu_regrid = rebin(vu,720,360,1165, /SAMPLE). In the original, bad (i.e. ocean) values are indicated by 1e20. After rebinning, these values are 2e20. It's supposed to be averaging them - why is it doubling those large values? Hard to tell what it's doing with the other values, but just doing quick sum, seems to be ok as the sum is about 4 times less than summing the higher resolution grid.

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    24 Feb 2017 10:23 AM
    What is the typical range of the other values? As a sanity check, I re-binned a 1440x720 data set with all the values set to 1e20 to a 720x360 data set. All the values returned were 1e20. David -Harris GS

    Deleted User



    New Member


    Posts:8
    New Member


    --
    24 Feb 2017 11:14 AM
    The other values are all between 0 and 1 - in the particular example year and variable I'm looking at, mostly they are 0. I am getting values 2e20, 1.5e20, 1e20 and 5e19 (other then the expected values in the 0 range).

    Deleted User



    New Member


    Posts:8
    New Member


    --
    24 Feb 2017 12:57 PM
    Ok, I see what happened - my mistake, was regridding an array that I had added to another. On another note - is there a way to do the rebinning without including the 1e20 values? For example, if a grid point is half or more land, I would rather not discount that value just because the rebinning is including the large ocean value. But I don't see any way to do that with rebin, and no simple nearest neighbor average with griddata - which, in any case, was taking a really long execution time, which is why I went to rebin in the first place.

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    24 Feb 2017 03:54 PM
    Perhaps you can replace the 1e20 values with !Values.fnan and then use MEAN to treat the values as missing data using the technique mentioned in the following article: http://www.idlcoyote.com/...ips/rebinmissing.php
    You are not authorized to post a reply.