You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

How can I set the values of a field to zero over a given area?

Step-by-step guide

You need to use the mask() macro function. Let us suppose that the field is stored in fieldset g. Then the macro code goes like this:

  1. #Define a mask for the area (Southern Hemisphere in this case). It contains 
    #1s for the points within the area and 0s for points outside the area.
    
    mask_sh=mask(g,[0,-180,-90,180])
    
    #We take the "inverse" of this mask and multiply the original field with it.
    #Now, r contains the original values from g outside the mask area, and
    #0s inside the mask area.
    
    r=g*(1-mask_sh)


There is no content with the specified labels


  • No labels