Re: subtracting vectors from a netcdf file

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Sep 06 2012 - 13:01:47 MDT

; preserve the metadata
usub = u(95,14,:,:)
vsub = v(95,14,:,:)
; do the subtraction
usub = u(95,9,:,:) - u(95,14,:,:)
vsub = v(95,9,:,:) - v(95,14,:,:)
plot = gsn_csm_vector_map_polar(wks,usub,vsub,res)

I think that is all there is to it.
 -dave

On Sep 6, 2012, at 12:55 PM, Mariangel Fedrizzi wrote:

> Hi,
>
> Is there an easy way to subtract winds at two different pressure levels from a netcdf file, in the ncl script?
>
> I have:
>
> Dimensions and sizes for a: [time | 96] x [plev | 15] x [lat | 90] x [lon | 20]
> a = addfile("file.nc","r")
> t = a->time
> u = a->zonal_wind
> v = a->meridional_wind
>
> I need to subtract:
>
> u(95,14,:,:) from u(95,9,:,:)
>
> and
>
> v(95,14,:,:) from v(95,9,:,:)
>
> and plot the resultant vector on a stereographic polar projection, which is already working for any given pressure level using:
> plot = gsn_csm_vector_map_polar(wks,u(95,9,:,:),v(95,9,:,:),res)
>
> In summary, I need to plot the resulting wind vector from the subtraction between values at two different pressure levels, but same time, lat, lon. These numbers are in the same netcdf file.
>
> Thanks.
>
> Best,
> Mariangel.
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Sep 6 13:02:00 2012

This archive was generated by hypermail 2.1.8 : Tue Sep 11 2012 - 15:30:42 MDT