[Thread Prev][Thread Next][Index]

Re: [ferret_users] Randomly distributed time series plots



Fabio,

On Fri, Jul 17, 2020 at 11:35 PM 'Fabio' via _OAR PMEL Ferret Users <ferret_users@xxxxxxxx> wrote:
Sometimes I need to do a 'quick check' across a large area and visualize
the time series of a particular variable at random locations to get an
idea of the general trend through time.
[ . . . ]
 
Additionally, I want to use the maximum allowed by multi_view, which I
think is 15 windows, and do it multiple times in a loop if I need to
sample a large region.

Is there anyway to make this more automatic? Such as sampling randomly
lat and long from the available range?

I'm sure that this is doable in Ferret, but that doesn't mean that Ferret is the best tool for it.

My recommendation would be to use a general scripting language to do the looping and call ferret within it.  In a pseudo-code

is = random_samples(1, imax, samples=5)
js = random_samples(1, jmax, samples=7)

fignum = 0
for j in js
    for i in is
       fignum = fignum + 1
       system("pyferret -nodisplay -script plot_one_panel.jnl #{i} #{j} panel#{fignum}")
   endfor
endfor

system("montage panel*.png -geometry 5x7+1+1 combined.png")

In this pseudo scripting language, "system" is the command to call an external program.  The "montage" command is in the imagemagick suite, which tiles multiple images into a single image.

I suppose that R can call Ferret from within it.  If so, you can use R to do the looping.

If you need a simple algorithm to select a set of random indices (random_samples in my pseudo code above), I can provide one.

In general, to use a general scripting language for the "control logic" and use Ferret as an "engine" is flexible and versatile.

Ryo


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

Privacy Policy | Disclaimer | Accessibility Statement