[Met_help] [rt.rap.ucar.edu #94492] History for wrong latitude/longitude coordinates after running grid_stat

John Halley Gotway via RT met_help at ucar.edu
Fri Mar 13 11:45:33 MDT 2020


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

MET help,

I am getting incorrect latitude and longitude coordinates in my pairs.nc files after running grid_stat (see additional description below). I suspect the issue might have to do with the model domain I'm working with crossing the 180 W longitude. Might this be a bug, or is there a method to preserve the lat/lon data when running grid_stat for a domain that crosses the 180 W longitude?

My data is shared on the FTP site in /blaylock_data

*         pre_2016052000_f12.grib2 : the COAMPS model 12-hr forecast valid at 2016-05-10 1200 UTC

*         pre_2016052012_f00.grib2 : the COAMPS model analysis valid at 2026-05-10 1200 UTC

*         GridStatConfig : my grid_stat config file

When I run grid_stat, the latitude and longitude values get rotated...

grid_stat \
./pre_2016052000_f12.grib2 \
./pre_2016052012_f00.grib2 \
./GridStatConfig \
-v 1

To better illustrate what happens, below shows the TMP:1000 mb from the original grib2 file...

[cid:image004.png at 01D5F7B7.D8F81330]

Next is the OBS_TMP_P1000_FULL variable from the pairs.nc file.
[cid:image005.png at 01D5F7B7.D8F81330]

As you can see, the data is all there, but the lat/lon values are rotated and translated to a place over Europe.

On the other hand, when I perform the same grid_stat for another domain off the California coast, there doesn't seem to be any lat/lon errors.
Below is a `OBS_TMP_P1000_FULL` from the .pairs.nc file for a domain over California.
[cid:image003.png at 01D5F7AB.7862D930]


Thanks for your looking into this and any assistance you can provide.

FYI: I'm using MET version is 8.1.2


Dr. Brian K. Blaylock
NRC Postdoctoral Research Associate
Marine Meteorology Division
U.S. Naval Research Laboratory



----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: wrong latitude/longitude coordinates after running grid_stat
From: George McCabe
Time: Wed Mar 11 16:22:01 2020

Hi Brian,

I see you are having issues processing files with GridStat when the
domain crosses the 180 W longitude line. I am assigning this ticket to
John, as he would know if this is a bug that has been fixed since
8.1.2.

Thanks,
George

On Wed Mar 11 16:15:16 2020, brian.blaylock.ctr at nrlmry.navy.mil wrote:
> MET help,
>
> I am getting incorrect latitude and longitude coordinates in my
> pairs.nc files after running grid_stat (see additional description
> below). I suspect the issue might have to do with the model domain
I'm
> working with crossing the 180 W longitude. Might this be a bug, or
is
> there a method to preserve the lat/lon data when running grid_stat
for
> a domain that crosses the 180 W longitude?
>
> My data is shared on the FTP site in /blaylock_data
>
> *         pre_2016052000_f12.grib2 : the COAMPS model 12-hr forecast
> valid at 2016-05-10 1200 UTC
>
> *         pre_2016052012_f00.grib2 : the COAMPS model analysis valid
> at 2026-05-10 1200 UTC
>
> *         GridStatConfig : my grid_stat config file
>
> When I run grid_stat, the latitude and longitude values get
rotated...
>
> grid_stat \
> ./pre_2016052000_f12.grib2 \
> ./pre_2016052012_f00.grib2 \
> ./GridStatConfig \
> -v 1
>
> To better illustrate what happens, below shows the TMP:1000 mb from
> the original grib2 file...
>
> [cid:image004.png at 01D5F7B7.D8F81330]
>
> Next is the OBS_TMP_P1000_FULL variable from the pairs.nc file.
> [cid:image005.png at 01D5F7B7.D8F81330]
>
> As you can see, the data is all there, but the lat/lon values are
> rotated and translated to a place over Europe.
>
> On the other hand, when I perform the same grid_stat for another
> domain off the California coast, there doesn't seem to be any
lat/lon
> errors.
> Below is a `OBS_TMP_P1000_FULL` from the .pairs.nc file for a domain
> over California.
> [cid:image003.png at 01D5F7AB.7862D930]
>
>
> Thanks for your looking into this and any assistance you can
provide.
>
> FYI: I'm using MET version is 8.1.2
>
>
> Dr. Brian K. Blaylock
> NRC Postdoctoral Research Associate
> Marine Meteorology Division
> U.S. Naval Research Laboratory



------------------------------------------------
Subject: wrong latitude/longitude coordinates after running grid_stat
From: John Halley Gotway
Time: Thu Mar 12 15:11:07 2020

Hi Brian,

Thanks for sending us sample data.  I pulled it down and started
testing
with it.

My first step was to plot 500mb temperature using MET's
plot_data_plane
utility:
*/usr/local/met-8.1.1/bin/plot_data_plane \*
*pre_2016052000_f12.grib2 \*
*pre_2016052000_f12_TMP_P500.ps \*
*'name="TMP"; level="P500";'*

But the resulting image was to small for me to figure out where on
earth it
resides.  So then I used regrid_data_plane to regrid it to a global
1/4
degree grid (NCEP Grid #4 from
https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):



*/usr/local/met-8.1.1/bin/regrid_data_plane \pre_2016052000_f12.grib2
G004
\pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";
level="P500";'*

And then I plotted the result (see attached png version):

*/usr/local/met-8.1.1/bin/plot_data_plane
\pre_2016052000_f12_TMP_P500_G004.nc \*
*pre_2016052000_f12_TMP_P500_G004.ps \*
*'name="TMP_P500"; level="(*,*)";'*

So MET places this data in the Western Bering Sea.  But is that
correct?

To answer that question, I used Unidata's IDV tool to plot this same
data
from the GRIB2 file directly.  The attached image (
pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the Aleutian
Islands, just as you describe.

IDV seems to line up very well with the plot you sent to me.  So I
agree,
this is a bug in MET's handling of this grid.  I'll run it through the
debugger and let you know what I find.

Thanks,
John Halley Gotway

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #94492] wrong latitude/longitude coordinates after running grid_stat
From: Blaylock, Dr. Brian, Contractor, Code 7531
Time: Thu Mar 12 15:21:15 2020

Yep, all those details are correct. Thanks for looking into it.

-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Thursday, March 12, 2020 2:11 PM
To: Blaylock, Dr. Brian, Contractor, Code 7531
<brian.blaylock.ctr at nrlmry.navy.mil>
Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
coordinates after running grid_stat

Hi Brian,

Thanks for sending us sample data.  I pulled it down and started
testing with it.

My first step was to plot 500mb temperature using MET's
plot_data_plane
utility:
*/usr/local/met-8.1.1/bin/plot_data_plane \*
*pre_2016052000_f12.grib2 \*
*pre_2016052000_f12_TMP_P500.ps \*
*'name="TMP"; level="P500";'*

But the resulting image was to small for me to figure out where on
earth it resides.  So then I used regrid_data_plane to regrid it to a
global 1/4 degree grid (NCEP Grid #4 from
https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):



*/usr/local/met-8.1.1/bin/regrid_data_plane \pre_2016052000_f12.grib2
G004 \pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";
level="P500";'*

And then I plotted the result (see attached png version):

*/usr/local/met-8.1.1/bin/plot_data_plane
\pre_2016052000_f12_TMP_P500_G004.nc \*
*pre_2016052000_f12_TMP_P500_G004.ps \*
*'name="TMP_P500"; level="(*,*)";'*

So MET places this data in the Western Bering Sea.  But is that
correct?

To answer that question, I used Unidata's IDV tool to plot this same
data from the GRIB2 file directly.  The attached image (
pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the Aleutian
Islands, just as you describe.

IDV seems to line up very well with the plot you sent to me.  So I
agree, this is a bug in MET's handling of this grid.  I'll run it
through the debugger and let you know what I find.

Thanks,
John Halley Gotway



------------------------------------------------
Subject: wrong latitude/longitude coordinates after running grid_stat
From: John Halley Gotway
Time: Thu Mar 12 16:37:29 2020

Brian,

I think I have it fixed but just want to double-check my result with
you.
Can you confirm that attached data is in the correct spot on the earth
and
oriented in the correct direction?

We are doing the met-9.0 release tomorrow, and I'll include this fix
in
there... assuming our nightly regression test doesn't uncover any
issues
with it.

FYI, it's a one-line fix in src/libcode/vx_grid/lc_grid.cc.
OLD: theta_pin = H*Cone*(Lon_orient - data.lon_pin);
NEW: theta_pin = H*Cone*(rescale_deg(Lon_orient - data.lon_pin,
-180.0,
180.0));

You were right on in your assessment of the issue.  Since the lower-
left
corner and center longitudes were on opposite sides of the
international
date line, the OLD line computed an angle difference of around 350
degrees.  The fix in the NEW line rescales the resulting difference to
the
range of (-180, 180).  And that makes for a much happier grid.

Thanks,
John

On Thu, Mar 12, 2020 at 3:21 PM Blaylock, Dr. Brian, Contractor, Code
7531
via RT <met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
>
> Yep, all those details are correct. Thanks for looking into it.
>
> -----Original Message-----
> From: John Halley Gotway via RT <met_help at ucar.edu>
> Sent: Thursday, March 12, 2020 2:11 PM
> To: Blaylock, Dr. Brian, Contractor, Code 7531 <
> brian.blaylock.ctr at nrlmry.navy.mil>
> Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
> coordinates after running grid_stat
>
> Hi Brian,
>
> Thanks for sending us sample data.  I pulled it down and started
testing
> with it.
>
> My first step was to plot 500mb temperature using MET's
plot_data_plane
> utility:
> */usr/local/met-8.1.1/bin/plot_data_plane \*
> *pre_2016052000_f12.grib2 \*
> *pre_2016052000_f12_TMP_P500.ps \*
> *'name="TMP"; level="P500";'*
>
> But the resulting image was to small for me to figure out where on
earth
> it resides.  So then I used regrid_data_plane to regrid it to a
global 1/4
> degree grid (NCEP Grid #4 from
> https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):
>
>
>
> */usr/local/met-8.1.1/bin/regrid_data_plane
\pre_2016052000_f12.grib2 G004
> \pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";
level="P500";'*
>
> And then I plotted the result (see attached png version):
>
> */usr/local/met-8.1.1/bin/plot_data_plane
> \pre_2016052000_f12_TMP_P500_G004.nc \*
> *pre_2016052000_f12_TMP_P500_G004.ps \*
> *'name="TMP_P500"; level="(*,*)";'*
>
> So MET places this data in the Western Bering Sea.  But is that
correct?
>
> To answer that question, I used Unidata's IDV tool to plot this same
data
> from the GRIB2 file directly.  The attached image (
> pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the
Aleutian
> Islands, just as you describe.
>
> IDV seems to line up very well with the plot you sent to me.  So I
agree,
> this is a bug in MET's handling of this grid.  I'll run it through
the
> debugger and let you know what I find.
>
> Thanks,
> John Halley Gotway
>
>
>
>

------------------------------------------------
Subject: wrong latitude/longitude coordinates after running grid_stat
From: Blaylock, Dr. Brian, Contractor, Code 7531
Time: Thu Mar 12 17:00:17 2020

Awesome! Yep, I roughly reproduced your image plotting with python
(attached)

I'm excited for version 9.0 to come out. In the meantime...I'll fix
that one line and rebuild. Thank you!

-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Thursday, March 12, 2020 3:37 PM
To: Blaylock, Dr. Brian, Contractor, Code 7531
<brian.blaylock.ctr at nrlmry.navy.mil>
Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
coordinates after running grid_stat

Brian,

I think I have it fixed but just want to double-check my result with
you.
Can you confirm that attached data is in the correct spot on the earth
and oriented in the correct direction?

We are doing the met-9.0 release tomorrow, and I'll include this fix
in there... assuming our nightly regression test doesn't uncover any
issues with it.

FYI, it's a one-line fix in src/libcode/vx_grid/lc_grid.cc.
OLD: theta_pin = H*Cone*(Lon_orient - data.lon_pin);
NEW: theta_pin = H*Cone*(rescale_deg(Lon_orient - data.lon_pin,
-180.0, 180.0));

You were right on in your assessment of the issue.  Since the lower-
left corner and center longitudes were on opposite sides of the
international date line, the OLD line computed an angle difference of
around 350 degrees.  The fix in the NEW line rescales the resulting
difference to the range of (-180, 180).  And that makes for a much
happier grid.

Thanks,
John

On Thu, Mar 12, 2020 at 3:21 PM Blaylock, Dr. Brian, Contractor, Code
7531 via RT <met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
>
> Yep, all those details are correct. Thanks for looking into it.
>
> -----Original Message-----
> From: John Halley Gotway via RT <met_help at ucar.edu>
> Sent: Thursday, March 12, 2020 2:11 PM
> To: Blaylock, Dr. Brian, Contractor, Code 7531 <
> brian.blaylock.ctr at nrlmry.navy.mil>
> Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
> coordinates after running grid_stat
>
> Hi Brian,
>
> Thanks for sending us sample data.  I pulled it down and started
> testing with it.
>
> My first step was to plot 500mb temperature using MET's
> plot_data_plane
> utility:
> */usr/local/met-8.1.1/bin/plot_data_plane \*
> *pre_2016052000_f12.grib2 \*
> *pre_2016052000_f12_TMP_P500.ps \*
> *'name="TMP"; level="P500";'*
>
> But the resulting image was to small for me to figure out where on
> earth it resides.  So then I used regrid_data_plane to regrid it to
a
> global 1/4 degree grid (NCEP Grid #4 from
> https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):
>
>
>
> */usr/local/met-8.1.1/bin/regrid_data_plane
\pre_2016052000_f12.grib2
> G004 \pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";
> level="P500";'*
>
> And then I plotted the result (see attached png version):
>
> */usr/local/met-8.1.1/bin/plot_data_plane
> \pre_2016052000_f12_TMP_P500_G004.nc \*
> *pre_2016052000_f12_TMP_P500_G004.ps \* *'name="TMP_P500";
> level="(*,*)";'*
>
> So MET places this data in the Western Bering Sea.  But is that
correct?
>
> To answer that question, I used Unidata's IDV tool to plot this same
> data from the GRIB2 file directly.  The attached image (
> pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the
Aleutian
> Islands, just as you describe.
>
> IDV seems to line up very well with the plot you sent to me.  So I
> agree, this is a bug in MET's handling of this grid.  I'll run it
> through the debugger and let you know what I find.
>
> Thanks,
> John Halley Gotway
>
>
>
>


------------------------------------------------
Subject: wrong latitude/longitude coordinates after running grid_stat
From: John Halley Gotway
Time: Thu Mar 12 17:24:57 2020

Great, thanks for confirming.  FYI, here's the GitHub issue I
created/resolved to track this issue:
https://github.com/NCAR/MET/issues/1276

Thanks for finding this problem and pointing us in the right
direction!

John

On Thu, Mar 12, 2020 at 5:00 PM Blaylock, Dr. Brian, Contractor, Code
7531
via RT <met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
>
> Awesome! Yep, I roughly reproduced your image plotting with python
> (attached)
>
> I'm excited for version 9.0 to come out. In the meantime...I'll fix
that
> one line and rebuild. Thank you!
>
> -----Original Message-----
> From: John Halley Gotway via RT <met_help at ucar.edu>
> Sent: Thursday, March 12, 2020 3:37 PM
> To: Blaylock, Dr. Brian, Contractor, Code 7531 <
> brian.blaylock.ctr at nrlmry.navy.mil>
> Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
> coordinates after running grid_stat
>
> Brian,
>
> I think I have it fixed but just want to double-check my result with
you.
> Can you confirm that attached data is in the correct spot on the
earth and
> oriented in the correct direction?
>
> We are doing the met-9.0 release tomorrow, and I'll include this fix
in
> there... assuming our nightly regression test doesn't uncover any
issues
> with it.
>
> FYI, it's a one-line fix in src/libcode/vx_grid/lc_grid.cc.
> OLD: theta_pin = H*Cone*(Lon_orient - data.lon_pin);
> NEW: theta_pin = H*Cone*(rescale_deg(Lon_orient - data.lon_pin,
-180.0,
> 180.0));
>
> You were right on in your assessment of the issue.  Since the lower-
left
> corner and center longitudes were on opposite sides of the
international
> date line, the OLD line computed an angle difference of around 350
> degrees.  The fix in the NEW line rescales the resulting difference
to the
> range of (-180, 180).  And that makes for a much happier grid.
>
> Thanks,
> John
>
> On Thu, Mar 12, 2020 at 3:21 PM Blaylock, Dr. Brian, Contractor,
Code 7531
> via RT <met_help at ucar.edu> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
> >
> > Yep, all those details are correct. Thanks for looking into it.
> >
> > -----Original Message-----
> > From: John Halley Gotway via RT <met_help at ucar.edu>
> > Sent: Thursday, March 12, 2020 2:11 PM
> > To: Blaylock, Dr. Brian, Contractor, Code 7531 <
> > brian.blaylock.ctr at nrlmry.navy.mil>
> > Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
> > coordinates after running grid_stat
> >
> > Hi Brian,
> >
> > Thanks for sending us sample data.  I pulled it down and started
> > testing with it.
> >
> > My first step was to plot 500mb temperature using MET's
> > plot_data_plane
> > utility:
> > */usr/local/met-8.1.1/bin/plot_data_plane \*
> > *pre_2016052000_f12.grib2 \*
> > *pre_2016052000_f12_TMP_P500.ps \*
> > *'name="TMP"; level="P500";'*
> >
> > But the resulting image was to small for me to figure out where on
> > earth it resides.  So then I used regrid_data_plane to regrid it
to a
> > global 1/4 degree grid (NCEP Grid #4 from
> > https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):
> >
> >
> >
> > */usr/local/met-8.1.1/bin/regrid_data_plane
\pre_2016052000_f12.grib2
> > G004 \pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";
> > level="P500";'*
> >
> > And then I plotted the result (see attached png version):
> >
> > */usr/local/met-8.1.1/bin/plot_data_plane
> > \pre_2016052000_f12_TMP_P500_G004.nc \*
> > *pre_2016052000_f12_TMP_P500_G004.ps \* *'name="TMP_P500";
> > level="(*,*)";'*
> >
> > So MET places this data in the Western Bering Sea.  But is that
correct?
> >
> > To answer that question, I used Unidata's IDV tool to plot this
same
> > data from the GRIB2 file directly.  The attached image (
> > pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the
Aleutian
> > Islands, just as you describe.
> >
> > IDV seems to line up very well with the plot you sent to me.  So I
> > agree, this is a bug in MET's handling of this grid.  I'll run it
> > through the debugger and let you know what I find.
> >
> > Thanks,
> > John Halley Gotway
> >
> >
> >
> >
>
>
>

------------------------------------------------
Subject: wrong latitude/longitude coordinates after running grid_stat
From: Blaylock, Dr. Brian, Contractor, Code 7531
Time: Fri Mar 13 11:43:34 2020

I just changed that one line, recompiled, and ran grid_stat. It
worked!

(this image has the old and the new results)

[cid:image001.png at 01D5F924.38BA73E0]



Thanks again!

Brian





-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Thursday, March 12, 2020 4:25 PM
To: Blaylock, Dr. Brian, Contractor, Code 7531
<brian.blaylock.ctr at nrlmry.navy.mil>
Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
coordinates after running grid_stat



Great, thanks for confirming.  FYI, here's the GitHub issue I
created/resolved to track this issue:

https://github.com/NCAR/MET/issues/1276



Thanks for finding this problem and pointing us in the right
direction!



John



On Thu, Mar 12, 2020 at 5:00 PM Blaylock, Dr. Brian, Contractor, Code
7531 via RT <met_help at ucar.edu<mailto:met_help at ucar.edu>> wrote:



>

> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >

>

> Awesome! Yep, I roughly reproduced your image plotting with python

> (attached)

>

> I'm excited for version 9.0 to come out. In the meantime...I'll fix

> that one line and rebuild. Thank you!

>

> -----Original Message-----

> From: John Halley Gotway via RT
<met_help at ucar.edu<mailto:met_help at ucar.edu>>

> Sent: Thursday, March 12, 2020 3:37 PM

> To: Blaylock, Dr. Brian, Contractor, Code 7531 <

>
brian.blaylock.ctr at nrlmry.navy.mil<mailto:brian.blaylock.ctr at nrlmry.navy.mil>>

> Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude

> coordinates after running grid_stat

>

> Brian,

>

> I think I have it fixed but just want to double-check my result with
you.

> Can you confirm that attached data is in the correct spot on the
earth

> and oriented in the correct direction?

>

> We are doing the met-9.0 release tomorrow, and I'll include this fix

> in there... assuming our nightly regression test doesn't uncover any

> issues with it.

>

> FYI, it's a one-line fix in src/libcode/vx_grid/lc_grid.cc.

> OLD: theta_pin = H*Cone*(Lon_orient - data.lon_pin);

> NEW: theta_pin = H*Cone*(rescale_deg(Lon_orient - data.lon_pin,

> -180.0, 180.0));

>

> You were right on in your assessment of the issue.  Since the

> lower-left corner and center longitudes were on opposite sides of
the

> international date line, the OLD line computed an angle difference
of

> around 350 degrees.  The fix in the NEW line rescales the resulting

> difference to the range of (-180, 180).  And that makes for a much
happier grid.

>

> Thanks,

> John

>

> On Thu, Mar 12, 2020 at 3:21 PM Blaylock, Dr. Brian, Contractor,
Code

> 7531 via RT <met_help at ucar.edu<mailto:met_help at ucar.edu>> wrote:

>

> >

> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >

> >

> > Yep, all those details are correct. Thanks for looking into it.

> >

> > -----Original Message-----

> > From: John Halley Gotway via RT
<met_help at ucar.edu<mailto:met_help at ucar.edu>>

> > Sent: Thursday, March 12, 2020 2:11 PM

> > To: Blaylock, Dr. Brian, Contractor, Code 7531 <

> >
brian.blaylock.ctr at nrlmry.navy.mil<mailto:brian.blaylock.ctr at nrlmry.navy.mil>>

> > Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude

> > coordinates after running grid_stat

> >

> > Hi Brian,

> >

> > Thanks for sending us sample data.  I pulled it down and started

> > testing with it.

> >

> > My first step was to plot 500mb temperature using MET's

> > plot_data_plane

> > utility:

> > */usr/local/met-8.1.1/bin/plot_data_plane \*

> > *pre_2016052000_f12.grib2 \*

> > *pre_2016052000_f12_TMP_P500.ps \*

> > *'name="TMP"; level="P500";'*

> >

> > But the resulting image was to small for me to figure out where on

> > earth it resides.  So then I used regrid_data_plane to regrid it
to

> > a global 1/4 degree grid (NCEP Grid #4 from

> > https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):

> >

> >

> >

> > */usr/local/met-8.1.1/bin/regrid_data_plane

> > \pre_2016052000_f12.grib2

> > G004 \pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";

> > level="P500";'*

> >

> > And then I plotted the result (see attached png version):

> >

> > */usr/local/met-8.1.1/bin/plot_data_plane

> > \pre_2016052000_f12_TMP_P500_G004.nc \*

> > *pre_2016052000_f12_TMP_P500_G004.ps \* *'name="TMP_P500";

> > level="(*,*)";'*

> >

> > So MET places this data in the Western Bering Sea.  But is that
correct?

> >

> > To answer that question, I used Unidata's IDV tool to plot this
same

> > data from the GRIB2 file directly.  The attached image (

> > pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the

> > Aleutian Islands, just as you describe.

> >

> > IDV seems to line up very well with the plot you sent to me.  So I

> > agree, this is a bug in MET's handling of this grid.  I'll run it

> > through the debugger and let you know what I find.

> >

> > Thanks,

> > John Halley Gotway

> >

> >

> >

> >

>

>

>



------------------------------------------------
Subject: wrong latitude/longitude coordinates after running grid_stat
From: John Halley Gotway
Time: Fri Mar 13 11:45:06 2020

Great, thanks for confirming!  I'll resolve this ticket.

John

On Fri, Mar 13, 2020 at 11:44 AM Blaylock, Dr. Brian, Contractor, Code
7531
via RT <met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
>
> I just changed that one line, recompiled, and ran grid_stat. It
worked!
>
> (this image has the old and the new results)
>
> [cid:image001.png at 01D5F924.38BA73E0]
>
>
>
> Thanks again!
>
> Brian
>
>
>
>
>
> -----Original Message-----
> From: John Halley Gotway via RT <met_help at ucar.edu>
> Sent: Thursday, March 12, 2020 4:25 PM
> To: Blaylock, Dr. Brian, Contractor, Code 7531 <
> brian.blaylock.ctr at nrlmry.navy.mil>
> Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
> coordinates after running grid_stat
>
>
>
> Great, thanks for confirming.  FYI, here's the GitHub issue I
> created/resolved to track this issue:
>
> https://github.com/NCAR/MET/issues/1276
>
>
>
> Thanks for finding this problem and pointing us in the right
direction!
>
>
>
> John
>
>
>
> On Thu, Mar 12, 2020 at 5:00 PM Blaylock, Dr. Brian, Contractor,
Code 7531
> via RT <met_help at ucar.edu<mailto:met_help at ucar.edu>> wrote:
>
>
>
> >
>
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
>
> >
>
> > Awesome! Yep, I roughly reproduced your image plotting with python
>
> > (attached)
>
> >
>
> > I'm excited for version 9.0 to come out. In the meantime...I'll
fix
>
> > that one line and rebuild. Thank you!
>
> >
>
> > -----Original Message-----
>
> > From: John Halley Gotway via RT <met_help at ucar.edu<mailto:
> met_help at ucar.edu>>
>
> > Sent: Thursday, March 12, 2020 3:37 PM
>
> > To: Blaylock, Dr. Brian, Contractor, Code 7531 <
>
> > brian.blaylock.ctr at nrlmry.navy.mil<mailto:
> brian.blaylock.ctr at nrlmry.navy.mil>>
>
> > Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
>
> > coordinates after running grid_stat
>
> >
>
> > Brian,
>
> >
>
> > I think I have it fixed but just want to double-check my result
with you.
>
> > Can you confirm that attached data is in the correct spot on the
earth
>
> > and oriented in the correct direction?
>
> >
>
> > We are doing the met-9.0 release tomorrow, and I'll include this
fix
>
> > in there... assuming our nightly regression test doesn't uncover
any
>
> > issues with it.
>
> >
>
> > FYI, it's a one-line fix in src/libcode/vx_grid/lc_grid.cc.
>
> > OLD: theta_pin = H*Cone*(Lon_orient - data.lon_pin);
>
> > NEW: theta_pin = H*Cone*(rescale_deg(Lon_orient - data.lon_pin,
>
> > -180.0, 180.0));
>
> >
>
> > You were right on in your assessment of the issue.  Since the
>
> > lower-left corner and center longitudes were on opposite sides of
the
>
> > international date line, the OLD line computed an angle difference
of
>
> > around 350 degrees.  The fix in the NEW line rescales the
resulting
>
> > difference to the range of (-180, 180).  And that makes for a much
> happier grid.
>
> >
>
> > Thanks,
>
> > John
>
> >
>
> > On Thu, Mar 12, 2020 at 3:21 PM Blaylock, Dr. Brian, Contractor,
Code
>
> > 7531 via RT <met_help at ucar.edu<mailto:met_help at ucar.edu>> wrote:
>
> >
>
> > >
>
> > > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=94492 >
>
> > >
>
> > > Yep, all those details are correct. Thanks for looking into it.
>
> > >
>
> > > -----Original Message-----
>
> > > From: John Halley Gotway via RT <met_help at ucar.edu<mailto:
> met_help at ucar.edu>>
>
> > > Sent: Thursday, March 12, 2020 2:11 PM
>
> > > To: Blaylock, Dr. Brian, Contractor, Code 7531 <
>
> > > brian.blaylock.ctr at nrlmry.navy.mil<mailto:
> brian.blaylock.ctr at nrlmry.navy.mil>>
>
> > > Subject: Re: [rt.rap.ucar.edu #94492] wrong latitude/longitude
>
> > > coordinates after running grid_stat
>
> > >
>
> > > Hi Brian,
>
> > >
>
> > > Thanks for sending us sample data.  I pulled it down and started
>
> > > testing with it.
>
> > >
>
> > > My first step was to plot 500mb temperature using MET's
>
> > > plot_data_plane
>
> > > utility:
>
> > > */usr/local/met-8.1.1/bin/plot_data_plane \*
>
> > > *pre_2016052000_f12.grib2 \*
>
> > > *pre_2016052000_f12_TMP_P500.ps \*
>
> > > *'name="TMP"; level="P500";'*
>
> > >
>
> > > But the resulting image was to small for me to figure out where
on
>
> > > earth it resides.  So then I used regrid_data_plane to regrid it
to
>
> > > a global 1/4 degree grid (NCEP Grid #4 from
>
> > > https://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html):
>
> > >
>
> > >
>
> > >
>
> > > */usr/local/met-8.1.1/bin/regrid_data_plane
>
> > > \pre_2016052000_f12.grib2
>
> > > G004 \pre_2016052000_f12_TMP_P500_G004.nc \-field 'name="TMP";
>
> > > level="P500";'*
>
> > >
>
> > > And then I plotted the result (see attached png version):
>
> > >
>
> > > */usr/local/met-8.1.1/bin/plot_data_plane
>
> > > \pre_2016052000_f12_TMP_P500_G004.nc \*
>
> > > *pre_2016052000_f12_TMP_P500_G004.ps \* *'name="TMP_P500";
>
> > > level="(*,*)";'*
>
> > >
>
> > > So MET places this data in the Western Bering Sea.  But is that
> correct?
>
> > >
>
> > > To answer that question, I used Unidata's IDV tool to plot this
same
>
> > > data from the GRIB2 file directly.  The attached image (
>
> > > pre_2016052000_f12_TMP_P500_IDV.png) shows this data over the
>
> > > Aleutian Islands, just as you describe.
>
> > >
>
> > > IDV seems to line up very well with the plot you sent to me.  So
I
>
> > > agree, this is a bug in MET's handling of this grid.  I'll run
it
>
> > > through the debugger and let you know what I find.
>
> > >
>
> > > Thanks,
>
> > > John Halley Gotway
>
> > >
>
> > >
>
> > >
>
> > >
>
> >
>
> >
>
> >
>
>
>
>

------------------------------------------------


More information about the Met_help mailing list