This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi David-
> Hi Don, I was out in the UAE, and was trying to
> use a Jython script to change all the positive
> valuesp in a grid to be a single (radar reflectivity) value.
>
> Do I need to loop over the grid, or can
> I use an if statement on the whole grid? I was just
> using the simple dBz2R function as an example, but
> am getting an error.. Thanks for any help with this.DAve
>
> def constantdbz(DBZ,a=20):
> a = float(a)
> r=DBZ
> if DBZ > a:
> r=DBZ
> return r
You do have to loop over all the values. A better example is in
the temperature anomaly function:
for i in range(len(DBZ)):
if DBZ[i] > a:
DBZ[i]= a
Don
Ticket Details
===================
Ticket ID: YVH-626973
Department: Support IDV
Priority: Normal
Status: Open