[Thread Prev][Thread Next][Index]

Re: [ferret_users] Missing Data Flag



Dear Martin, Kwesi and All,

Thanks for your suggestions............, they all worked fine.
However, what I did was to eliminate the "K" completely while other structures of the file remained intact through the use of a shell script that replaces the header of each netcdf file.

Cheers and please stay safe.

------
Kamoru Abiodun LAWAL, PhD


On Monday, 18 May 2020, 21:35:38 GMT+2, Kwesi A. Quagraine <starskykwesi@xxxxxxxxx> wrote:


Dear Martin, Dear Lawal,

Was also thinking along these lines…please feel free to use any option you want.

yes? use levitus_climatology
yes? sh d
     currently SET data sets:
    1> /Users/kwesi/anaconda3/envs/ferret_notebook/share/fer_dsets/data/levitus_climatology.cdf  (default)
 name     title                             I         J         K         L
 TEMP     TEMPERATURE                      1:360     1:180     1:20      ...
 SALT     SALINITY                         1:360     1:180     1:20      ...

yes? let ntemp = temp[k=1:1@max]
yes? save/clobber/file=temp.nc ntemp
 LISTing to file temp.nc
yes? can dat/all
yes? use temp.nc
yes? sh d
     currently SET data sets:
    1> ./temp.nc  (default)
 name     title                             I         J         K         L
 NTEMP    TEMP[K=1:1@MAX]                  1:360     1:180     ...       ...


On 18 May 2020 at 19:21:27, Martin Schmidt (martin.schmidt@xxxxxxxxxxxxxxxxx) wrote:

Dear Kamoru Abiodun,

the following shows, how it could work. You would need to adjust the method to your file and variable names.

First we produce a test file from levitus_climatology  (I do not have your file, levitus climatology is part of the ferret distribution)

yes? use levitus_climatology
yes? sh data
     currently SET data sets:
    1> /sw/viz/ferret/ferret_dsets_74/data/levitus_climatology.cdf  (default)
 name     title                             I         J         K         L
 TEMP     TEMPERATURE                      1:360     1:180     1:20      ...
 SALT     SALINITY                         1:360     1:180     1:20      ...

! You see, there is a k-index. There is not time, but we want to see the method only. Save one level into a new file.

yes? save/k=1/clobber/file=test.nc temp

yes? quit

Start a new session ...

>ferret

yes? use test.nc
yes? sh data
     currently SET data sets:
    1> ./test.nc  (default)
 name     title                             I         J         K         L
 TEMP     TEMPERATURE                      1:360     1:180     1:1       ...

 !This is like your file, a k-index, but only one level. Now define a new grid "xygrid", taking the axes from "temp", but skip the k-axis. May be, there is a more elegant way, but is shows the principle.

yes? define grid/x=temp/y=temp xygrid

! define a dummy-variable and reshape "temp" to the shape of the dummy variable, namely to a pur xy - grid.

yes? let xy_dummy= 0*(x[gx=xygrid]+y[gy=xygrid])
yes? let temp_xy = reshape(temp,xy_dummy)
yes? shade temp_xy
! You see in the plot (compare with "plot temp") - the k-axis is gone.

Saving now to a new file produces a data set without the k-axis.

Greetings,

Martin


Am 18.05.2020 um 18:15 schrieb 'Dr Kamoru Abiodun Lawal' via _OAR PMEL Ferret Users:
Dear Ferreters,

My data structure looks like:
yes? sh d
     currently SET data sets:
    1> ./precip_HadRM3P_wathome_actual_ens68_2004_2016.nc  (default)
 name     title                                                          I         J         K         L         M         N
 ITEM5216_DAILY_MEAN
          TOTAL PRECIPITATION RATE KG/M2/  1:14    1:14     1:1   1:5040    ...       ...

But I want it to look like:
yes? sh d
     currently SET data sets:
    1> ./precip_HadRM3P_wathome_actual_ens68_2004_2016.nc  (default)
 name     title                                                          I         J         K         L         M         N
 ITEM5216_DAILY_MEAN
          TOTAL PRECIPITATION RATE KG/M2/  1:14   1:14      ...   1:5040    ...       ...

This is because I need the "K" value to be missing in order to append the files on multiple levels.
I will appreciate any help or hint.

------
Kamoru Abiodun LAWAL, PhD
Post-Doctoral Research Fellow
African Climate and Development Initiative (ACDI),
Geological Sciences Building, 6th Floor,
University of Cape Town, Private Mail Bag X3,
Rondebosch, Cape Town, 7701, South Africa.
Phones: +27 78 268 5434 (m); +27 21 650 2902 (o)
E-mails: kamoru.lawal@xxxxxxxxxxxxxxxx  lawal@xxxxxxxxxxxxxx
.........there's no wrong time for doing the right things..........
<<<<----------------------------------------------------------------------------->>>>
G. M. (Numerical Weather Prediction)
Weather and Climate Research Center,
Nigerian Meteorological Agency,
Bill Clinton Drive, Abuja Airport,
Abuja, Nigeria.

Mobile Phone: +234 70 8780 3764 (SMS Only)
E-mails: lawal_ka@xxxxxxxxxxx  lawal.ka@xxxxxxxxx  k.lawal@xxxxxxxxxxxx

------------ 
Try not to become a man of success but rather a man of value- Albert Einstein

Kwesi A. Quagraine
Department of Physics
School of Physical Sciences
College of Agriculture and Natural Sciences
University of Cape Coast
Cape Coast, Ghana

Alt. Email: kwesi@xxxxxxxxxxxxxx 
Office: +27 21 650 1563
Skype: quagraine_cwasi

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

Privacy Policy | Disclaimer | Accessibility Statement