[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Support #YVH-626973]: RE:



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