[Thread Prev][Thread Next][Index]

Re: [ferret_users] External function



Hi Serena,
How about if you send the function enough data around the location you want, so that it can compute the result.  Not knowing what it needs, say,

> let radial = my_function(SST[j=190:210])
> plot/j=100 radial

Ferret just loads the data requested in the argument to the function, whether it is all of SST, or SST[j=1:200]. The argument subscripts are computed from the context of the arguments that are sent in.

Possibly you could set up the function to work on only some of the data by passing more arguments,

let radial = my_function(SST, xout, yout)

where xout and yout are the desired output range in two directions (or single values). The function would have access to the full data in SST, but it could use xout and yout to determine the amount of computation it needs to do.

Ansley

On 1/9/2015 8:03 AM, Serena Illig wrote:
Dear all,

I was trying to write an external function that will compute sections perpendicular to the coast.
My function has one argument, let say a map of sea surface temperature along the coasts of Chili from 30°S to 20°S. My function estimates the coasts position using the masked points. It computes the angle of the coast compared to the North direction. Then it estimates the radial perpendicular to the coast in function of the distance to the coast and interpolate the temperature field on it.
It works, I am happy !

But it woks only when I plot a map of all radials from 30°S to 20°S :
> let radial = my_function(SST)
> shade radial

 When I want to plot only one radial, let say at j=100 (~25°S):
> let radial = my_function(SST)
> plot/j=100 radial
 ---> in the external function I am stuck with
arg_lo_ss(Y_AXIS,ARG1) = arg_hi_ss(Y_AXIS,ARG1)=100
I can not have access to the whole matrix of arg_1. I need to use SST values out of the latitude 25°S to compute the radial at 25°S.

If I force the calculous :
> let radial = my_function(SST[j=1:200])
> plot/j=100 radial
----> I works, but the external function does the calculous for all the latitudes.

Is there an easy way to solve this problem.

Thanks,

Serena

.¸. , . .·´¯`·
 ><(((º>     `·.¸.·´¯`·...¸><(((º>¸.¸. , . .·´¯`· ><(((º> .
`·.¸.·´¯`·...¸><(((º>                                              .
                                                                        .
  Serena ILLIG-THEVENIN          LEGOS/IRD      .
                                                                      .
                         14 Av. E. Belin                      .
                         31400 Toulouse                    .
                         FRANCE                              .
                                                                      .
         E-mail : serena.illig@xxxxxx                        .
         Phone : +33 5 61 33 47 13                     .
         Fax     : +33 5 61 25 32 05                  .
                                                              .
                                            <º)))><..·´



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement