NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 20 forks source link

ensemble of all user-defined variables from files #1921

Open AndrewWittenberg opened 5 years ago

AndrewWittenberg commented 5 years ago

The documentation for ENSEMBLE says that

"At least one file must contain each of the variables being aggregated in the ensemble, as a file variable not a LET/D variable. "

I'm wondering if it'd be possible to relax that restriction. I have files from different models that I'd like to regrid to a new common grid (not an existing grid in one of the files), and then form an ensemble. Here's an example of what I'd like to do:

    NOAA/PMEL TMAP
    FERRET v7.44 (optimized)
    Linux 2.6.32-696.30.1.el6.x86_64 64-bit - 12/10/18
    29-Mar-19 13:47     

yes? use coads_climatology
yes? use monthly_navy_winds
yes? def ax/edge/x=0:360:5/unit=degrees_east/modulo=360 xax
yes? def ax/edge/y=-90:90:5/unit=degrees_north yax
yes? let/d=1 uwnd_ave = uwnd[d=1,gx=xax,gy=yax,l=1:12@ave]
yes? let/d=2 uwnd_ave = uwnd[d=2,gx=xax,gy=yax,l=1:132@ave]
yes? ensemble/hide my_ens = 1,2
 **ERROR: error defining aggregate dataset: No valid datasets or datasets share no variables that can be aggregated.

Here we get an error. Instead, I'd like to get an ensemble dataset containing one variable, uwnd_ave, consisting of the regridded time-average from each dataset.

I suppose a workaround would be to save out one of the LET/D variables to a new file, cancel the original file, and use the new file instead. So continuing the above example:

yes? save/clobber/file="new.nc" uwnd_ave[d=1]; can dat 1; use new.nc
yes? ensemble/hide my_ens = 1,2
yes? show dat
     currently SET data sets:
    3> my_ens  (default)  Ensemble aggregation
 name     title                             I         J         K         L         M         N
 UWND_AVE UWND[D=1,GX=XAX,GY=YAX,L=1:12@A  1:72      1:36      ...       ...       1:2       ...
 ------------------------------
 MEMBER_DSET
          Member dataset names in Ensembl  ...       ...       ...       ...       1:2       ...
 HISTORY  Global Att *history* in Ensembl  ...       ...       ...       ...       1:2       ...
 CONVENTIONS
          Global Att *Conventions* in Ens  ...       ...       ...       ...       1:2       ...

But is this something that Ferret could do on-the-fly in memory, without the user having to save out a new temporary file?

AnsleyManke commented 5 years ago

It's probably possible to remove that restriction, but was simpler in the programming to root the ensemble using a file variable. I recall talking about doing this and certainly understand the issue.

Meanwhile that error message could probably be improved.