[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GEMPAK #MJB-537359]: Error in dfgwfs?
- Subject: [GEMPAK #MJB-537359]: Error in dfgwfs?
- Date: Wed, 22 Sep 2010 10:02:22 -0600
Jack,
The definition of sigma in dfgwfs includes the factor of 2 (or sqrt of 2) that
would conventionally be expressed inside the weighting function.
sgma = (float)nwl / ( PI * sqrt ( 2.0 ) );
which results in
sig2 = sgma**2 = nwl**2 / 2 * PI**2
therefore the factor of 2 is included in sig2 the variable aa:
aa = 1. / ( sig2 * PI );
which is expressed in the weighting function (with sig2 rather than 2 * sig2):
w[iw-1][jw-1] = aa * exp ( - ( x*x + y*y ) / sig2 );
if the factor of 2 were not included in sgma, it would be accounted for in aa
and w as:
aa = 1. / ( 2 ** sig2 * PI );
which is expressed in the weighting function:
w[iw-1][jw-1] = aa * exp ( - ( x*x + y*y ) / 2 ** sig2 );
so essentially we're only changing the definition of sgma in dfgwfs.f to
include the factor of 2 so we don't need to account for it in aa and w.
I did a quick napkin run-down of the terms and the math seems correct. Do you
agree?
Michael James
Unidata
> Hi,
>
> I was looking at the code for the Gaussian smoother in GEMPAK called dfgwfs
> and came across what might be an error, but I wanted to run it by you to make
> sure. The weighting function used is:
>
>
>
> Where and N is the number of grid points in a wavelength. I'm wondering if
> ? should be given instead by . This value for sigma seems to be correct
> given your definition of W. Would someone please take a look?
>
>
>
> Thanks,
>
> Jack
>
>
>
> Jack Dostalek
>
> Cooperative Institute for Research in the Atmosphere
>
> Colorado State University
>
> Foothills Campus
>
> 1375 Campus Delivery
>
> Fort Collins, CO 80523-1375
>
> (970) 491-8326
>
> address@hidden
>
>
>
>
>
>
>
>
>
Ticket Details
===================
Ticket ID: MJB-537359
Department: Support GEMPAK
Priority: Normal
Status: Open