Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
hiddentrue

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

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:

Code Block
languagepython
#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)


Content by Label
showLabelsfalse
max5
spaces~usa
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-articlemetview-faqs" and label = "computation" and type = "page" and space = "UDOC"
labelskb-how-to-article

...