[Thread Prev][Thread Next][Index]

Re: [ferret_users] overlapping netcdf file



I tried what you suggested:

let EMISS_AWB_BC_COMMON = if  EMISS_AWB_BC[d=2] then EMISS_AWB_BC[d=2] else EMISS_AWB_BC[d=1]

But I have the issue that it is not keeping values of global file in the newly created file. I need global values as it is in common file only changing India values.

Sorry to take your time.

--
Regards,
Nitin Patil


On Tue, Aug 5, 2014 at 11:31 AM, Russ Fiedler <russell.fiedler@xxxxxxxx> wrote:

Hi,

Oops, I see I left off the "d=" for the global data set in my definitions. Silly cut and paste...

That's right, you don't need those 2 lines. They are really just there to make the masking clear.

You shouldn't need to specify the time range in your definition of emiss_awb_bc_common

let EMISS_AWB_BC_COMMON = if  EMISS_AWB_BC[d=2] then EMISS_AWB_BC[d=2] else EMISS_AWB_BC[d=1]

It's much cleaner and more general. As a matter of style, I like using the full names of datasets (or a descriptive symbol) rather than numbers since it's often easier to work out what's going on but that's just personal preference.

Russ



On 05/08/14 15:23, Nitin Patil wrote:
Dear Russ,

Many thanks one again. It worked.

As mentioned in your script the following two lines, I think they are not needed (if i am wrong let me know):
let mask = if EMISS_AWB_BC[d=india_T63] then 1
let EMISS_AWB_BC_COMMON = if mask then EMISS_AWB_BC[d=india_T63] else EMISS_AWB_BC[global_T63]

Please find below my script (let me know if I am doing any mistake in below script):
-------------------------------------------------------------------------------------
cancel data/all
use global_T63.nc
use india_T63.nc
let EMISS_AWB_BC_COMMON = if  EMISS_AWB_BC[d=2,l=1:12] then EMISS_AWB_BC[d=2,l=1:12] else EMISS_AWB_BC[d=1,l=1:12]
save/file=common.nc EMISS_AWB_BC_COMMON[l=1:12]
quit
-------------------------------------------------------------------------------------

--
Regards,
Nitin Patil


On Mon, Aug 4, 2014 at 12:51 PM, Russ Fiedler <russell.fiedler@xxxxxxxx> wrote:

Hi,

Just use a mask to select the indian mask as follows

use global_T63.nc
use india_T63.nc

let mask = if EMISS_AWB_BC[d=india_T63] then 1
let EMISS_AWB_BC_COMMON = if mask then EMISS_AWB_BC[d=india_T63] else EMISS_AWB_BC[global_T63]


In fact you even need to create a mask

let EMISS_AWB_BC_COMMON = if  EMISS_AWB_BC[d=india_T63] then EMISS_AWB_BC[d=india_T63] else EMISS_AWB_BC[global_T63]

Cheers,
Russ


On 04/08/14 14:19, Nitin Patil wrote:
Dear ferret users,

I have to do some overlapping using nc files.
I have two netcdf files 1. over global and 2. over India with exactly same grid and same variable name. 
What I want to do is I have to overlab/replace India region values in global_T63.nc file using  india_T63.nc netcdf values. 
Please find the attached files. Any help will be appreciated.
--
Regards,
Nitin Patil





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

Privacy Policy | Disclaimer | Accessibility Statement