For sure, a ncdump/ncgen based procedure should work, but only
for a limited file size.
Best,
Martin
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
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, PhDPost-Doctoral Research FellowAfrican Climate and Development Initiative (ACDI),
Geological Sciences Building, 6th Floor,University of Cape Town, Private Mail Bag X3,Rondebosch, Cape Town, 7701, South Africa.Website: www.acdi.uct.ac.za
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,E-mails: lawal_ka@xxxxxxxxxxx lawal.ka@xxxxxxxxx k.lawal@xxxxxxxxxxxx
Abuja, Nigeria.
Mobile Phone: +234 70 8780 3764 (SMS Only)
Attachment:
mergefiles.sh
Description: Binary data