[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to set Z-axis as elevation



Hi Martin, 
Thanks for the kind suggestion. I did manually from ASCII data; Please find the attachment. 

But yet I'm thinking of saving it in NetCDF format. If we could assign the value of rainfall over each grid to a vertical axis (which will represent the height value on respective grids from topography) then it would be easy to see its horizontal and vertical distribution. Here I got ASCII data (in dat format) suggested by Satyesh.

 currently SET data sets:

     1> ./rainfall.topo.nc  (default)

     name             title                            I          J         K         L

  MEAN_RAINFALL     mean rainfall                    1:360      1:180      ...       ...

  TOPO              etopo                            1:360      1:180      ...       ...


let rain = if mean_rainfall ge 0 then mean_rainfall else (-999)

list/clobber/file=elevation_rain.dat/nohead/form=(f9.3,x,f9.3,x,f9.3,x,f9.3,) topo,m_rain,x[gx=topo],y[gy=topo]


Further, I tried to convert it again to the NetCDF. 

set mem/size=999 
define axis/x=0.5:359.5:1/unit=degrees_east xaxis   
define axis/y=-89.5:89.5:1/unit=degrees_south yaxis   
define axis/z=0:8000:500/unit=meters/DEPTH zaxis  
define grid/x=xaxis/y=yaxis/z=zaxis my_grid 
file/grid=my_grid/var="ele, rain, lon, lat"/column=4 elevation_rain.dat  
set var/title="rainfall"/bad=-999 rain  
save/ORDER=zxy/file=test.nc/clobber rain

Here I missed z-axis during axis extraction (It's only showing for K=1). Please have a look. 

Best Regards
Pratik

On Mon, May 27, 2019 at 8:45 PM Martin Schmidt <martin.schmidt@xxxxxxxxxxxxxxxxx> wrote:

Pratik,

is rainfall a unique function of elevation? Say, in one area you have an elevation of 1000m and 1 kg /m^2/d precipitation. Somewhere else you have the same elevation but no precipitation. How should this be represented in your data set? So you cannot simply define rainfall as function of height. What you could define is the averaged (min, max) rainfall (over some area or globally) averaged for all points in some span of height. 

let rf_ave = rf[x=@ave,y=@ave]

would give the averaged rainfall for a height between 100m - 1000m. If you want to see (and plot) also the rain for other values of elevation, just define more masks. Now indeed, it would be best to edit an ascii table with the results for different height spans and to read this later again with ferret for further analysis or plotting.

Best,

Martin

On 5/27/19 1:21 PM, Pratik Kad wrote:
Thank you Satyesh for your kind approach.
But, I wanted to save rainfall as a function of elevation. I think it would be better if we can take elevation on Z-axis, Right? I tried something like this, 

 currently SET data sets:

     1> ./rainfall.topo.nc  (default)

     name             title                                                   L

  MEAN_RAINFALL     mean rainfall                    1:360     1:180     ...       ...

  TOPO              etopo                            1:360     1:180     ...       ...

 let mask = IF (TOPO GE 100 AND topo LT 1000) THEN 1

 let rf = MEAN_RAINFALL*mask

Here, I got only one level which is from 100 to 1000m. I could not able to define that as a function of K dimension.  

Or Is it any possible way to deal with this situation. Please suggest.


Regards
Pratik


On Mon, May 27, 2019 at 1:40 PM Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:
Hi,
If I am understanding correctly, you should do this manually by listing each coordinates' rain and elevation value to a text file and then reading it later. Following are few steps:
(1) let m_rain=if mean_rainfall ge 0 then mean_rainfall else (-1)
! To make bad values or missing values as -1. Later use -1 as bad
(2) list/clobber/file=Elevation_rain.dat/nohead/form=(f9.3,x,f9.3,x,f9.3,x,f9.3,) topo,m_rain,x[gx=topo],y[gy=topo]
! ^ Last x and y are just to keep track of lat and long in case required in future.
(3) Come out of ferret session and restart new session and read the file by : file/var=ele,m_r,lon,lat Elevation_rain.dat ; sh da ; 

By this you can do rain vs elevation analysis. 

On Mon, May 27, 2019 at 6:49 AM Pratik Kad <pratikkad17@xxxxxxxxx> wrote:
Dear All,
I need to save rainfall with respect to elevation. I tried with masking by elevation (Etopo) data; also I faced rang issue during visualisation. 
How can I take z-axis as elevation topography for rainfall parameter from attached data? 
Thanks in advance.

Regards
Pratik


Regards,
G Satyesh, India.


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

Privacy Policy | Disclaimer | Accessibility Statement