<div dir="ltr"><div dir="ltr">I checked the data source.  This problem goes all the way back to the data set that is published on the CEDA Archive website.  Their 12 km subset over UK contains the same invalid coordinates in grid_latitude and grid_longitude variables.  I asked them to fix their data set, so let's see what happens there.</div><div dir="ltr"><br></div><div>Note that there is no problem with Iris; they are just copying the invalid coordinates into the file that SBR made.</div><div><br></div><div>Thanks to Karin for the regridding solution.</div><div dir="ltr"><br></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 5, 2021 at 3:29 AM Karin Meier-Fleischer via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I found the solution to regrid OSGB pre-projected data to lonlat grid <br>
with CDO.<br>
<br>
To remap the data to a lonlat grid over GB, first create a grid file <br>
using the topo operator:<br>
<br>
cdo -f nc -sellonlatbox,-14,6,48,62 -remapbil,r1440x720 -topo <a href="http://topo.nc" rel="noreferrer" target="_blank">topo.nc</a><br>
<br>
Get the grid information using the griddes operator. You have to modify <br>
the grid information file (see uploaded grid_OSGB.txt file): delete the <br>
upper curvilinear part, add 'nvertex = 2', and the line<br>
   proj_params = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 <br>
+x_0=400000 +y_0=-100000 +ellps=airy <br>
+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"<br>
<br>
Then remap your data file to the lonlat grid:<br>
<br>
cdo -remapbil,<a href="http://topo.nc" rel="noreferrer" target="_blank">topo.nc</a> -setgrid,grid_OSGB.txt -selname,tas \<br>
      <a href="http://tas_rcp85_land-rcm_uk_12km.nc" rel="noreferrer" target="_blank">tas_rcp85_land-rcm_uk_12km.nc</a> <a href="http://outfile.nc" rel="noreferrer" target="_blank">outfile.nc</a><br>
<br>
It is important to use the setgrid oprator, too.<br>
<br>
-Karin<br>
<br>
Am 01.03.21 um 13:08 schrieb S Br:<br>
> Hi Karin,<br>
> Thanks for trying this. The data is certainly working fine with Python. <br>
> Please find the script here.<br>
> I don't have expertise in Python but took help from one of my colleagues.<br>
> <br>
> import iris<br>
> import iris.analysis<br>
> import iris.plot as iplt<br>
> import matplotlib.pyplot as plt<br>
> import iris.quickplot as qplt<br>
> <br>
> file1 = '<a href="http://tasmax_rcp85_land-rcm_uk_12km_time10.nc" rel="noreferrer" target="_blank">tasmax_rcp85_land-rcm_uk_12km_time10.nc</a> <br>
> <<a href="http://tasmax_rcp85_land-rcm_uk_12km_time10.nc" rel="noreferrer" target="_blank">http://tasmax_rcp85_land-rcm_uk_12km_time10.nc</a>>'<br>
> cubes1 = iris.load(file1)<br>
> print(cubes1)<br>
> #tas1 = cubes1[1]<br>
> #print(tas1)<br>
> <br>
> plt.figure(figsize=(10,10))<br>
> plt.subplot(1, 2, 1)<br>
> iplt.pcolormesh(cubes1[1][0,0,:,:])<br>
> plt.title('Original grid')<br>
> ax = plt.gca()<br>
> ax.coastlines()<br>
> ax.gridlines()<br>
> plt.tight_layout()<br>
> plt.show()<br>
> ax = plt.gca()<br>
> ax.coastlines(resolution='50m')<br>
> ax.gridlines()<br>
> plt.tight_layout()<br>
> plt.show()<br>
> <br>
> Thanks.<br>
> <br>
> On Mon, Mar 1, 2021 at 11:12 AM Karin Meier-Fleischer via ncl-talk <br>
> <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a> <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>>> wrote:<br>
> <br>
>     As Dave and Dennis already wrote there is something wrong with the<br>
>     grid_latitude and grid_longitude values. I was not able to get the<br>
>     correct plot neither with NCL, Python nor CDO.<br>
> <br>
>     How did you create a correct plot with Python? Did you use Iris? It<br>
>     would be very interesting to see your Python script. Is it possible to<br>
>     get it?<br>
> <br>
>     -Karin<br>
> <br>
> <br>
>     Am 26.02.21 um 17:38 schrieb Dave Allured - NOAA Affiliate via ncl-talk:<br>
>      > Progress.  This proves that arrays grid_latitude and<br>
>     grid_longitude are<br>
>      > wrong in the input file.  This is no longer an NCL problem,<br>
>     except for<br>
>      > possibly trying to reproject the data using projection<br>
>     parameters.  I<br>
>      > think Dennis already said this projection is not supported in<br>
>     NCL, so<br>
>      > that would be difficult.<br>
>      ><br>
>      > I recommend asking Iris support for help to generate the correct<br>
>     lat and<br>
>      > lon arrays.  You can show them the invalid coordinates directly,<br>
>     leaving<br>
>      > NCL out of the loop, by sampling the output from:<br>
>      ><br>
>      >      ncdump -v grid_latitude,grid_longitude <a href="http://file.nc" rel="noreferrer" target="_blank">file.nc</a><br>
>     <<a href="http://file.nc" rel="noreferrer" target="_blank">http://file.nc</a>> <<a href="http://file.nc" rel="noreferrer" target="_blank">http://file.nc</a> <<a href="http://file.nc" rel="noreferrer" target="_blank">http://file.nc</a>>><br>
>      ><br>
>      > It may also be possible to get the correct coordinate arrays by some<br>
>      > other method.  You might ask the original data provider if they can<br>
>      > supply the correct lat and lon arrays to match their data.  If<br>
>     you can<br>
>      > get corrected arrays, it would be easy to retrofit them into your<br>
>      > temperature data file.<br>
>      ><br>
>      ><br>
>      > On Fri, Feb 26, 2021 at 2:34 AM S Br <<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>><br>
>      > <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a> <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>>>> wrote:<br>
>      ><br>
>      >     Hi,<br>
>      >     The min and max of f->grid_latitude and f->grid_longitude prints<br>
>      >     wrong information. You can see that the bounding box is not<br>
>      >     surrounding the UK.<br>
>      ><br>
>      >     (0) min=-0.8710618968191547   max=12.94984143216418<br>
>      >     (0) min=-18.24145632530888   max=-6.580251255557555<br>
>      ><br>
>      >     Thanks.<br>
>      ><br>
>      >     On Thu, Feb 25, 2021 at 9:24 PM Dave Allured - NOAA Affiliate<br>
>      >     <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a> <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>><br>
>     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a> <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>>>> wrote:<br>
>      ><br>
>      >         Okay.  We need to evaluate whether the lat and lon<br>
>     coordinates<br>
>      >         in your file are correct.  I see Dennis's other reply,<br>
>     but I am<br>
>      >         suggesting a different approach using only attached<br>
>     coordinates,<br>
>      >         and nothing else.   If the Iris package generated your file<br>
>      >         correctly, then nothing else should be needed.<br>
>      ><br>
>      >         Please show the min and max of f->grid_latitude and<br>
>      >         f->grid_longitude.  Don't show the whole array.  The command<br>
>      >         *printMinMax (var, 0)* is useful for this.  If these<br>
>     coordinate<br>
>      >         sets are correct, then the min and max should be a<br>
>     bounding box<br>
>      >         surrounding the UK.<br>
>      ><br>
>      >         NCL works best with supplied coordinate arrays, which is the<br>
>      >         method I am recommending here.  Python is doing something<br>
>      >         different, perhaps recalculating based on the projection<br>
>      >         information.  I don't really care about that, I just want to<br>
>      >         help you get the normal NCL method working.<br>
>      ><br>
>      ><br>
>      >         On Thu, Feb 25, 2021 at 1:20 PM S Br<br>
>     <<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a> <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>><br>
>      >         <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>>>> wrote:<br>
>      ><br>
>      >             Hi Dave,<br>
>      >             Please see the attached plot, this is how it looks<br>
>     like if<br>
>      >             we use the above statements.<br>
>      >             It obviously doesn't plot over the UK.<br>
>      ><br>
>      ><br>
>      >             On Thu, Feb 25, 2021 at 6:59 PM Dave Allured - NOAA<br>
>      >             Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a><br>
>     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>><br>
>      >             <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a><br>
>     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>>>> wrote:<br>
>      ><br>
>      >                 I see what's going on.  From your other e-mail,<br>
>     the data<br>
>      >                 file contains two different sets of coordinates. <br>
>     There<br>
>      >                 are the projection coordinates in meters.  Those<br>
>     are not<br>
>      >                 latitudes and longitudes, therefore not<br>
>     sufficient for<br>
>      >                 NCL.  But the geographic coordinates are also<br>
>     provided.<br>
>      >                 Double coordinates are frequently encountered in GIS<br>
>      >                 related applications.  Try this:<br>
>      ><br>
>      >                      tas@lat2d=f->grid_latitude<br>
>      >                      tas@lon2d=f->grid_longitude<br>
>      ><br>
>      ><br>
>      >                 On Thu, Feb 25, 2021 at 11:42 AM S Br<br>
>      >                 <<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>> <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>>>><br>
>      >                 wrote:<br>
>      ><br>
>      >                     If I print tas@lat2d and tas@lon2d, they give the<br>
>      >                     following information.<br>
>      ><br>
>      >                     Variable: taslat<br>
>      >                     Type: double<br>
>      >                     Total Size: 896 bytes<br>
>      >                                  112 values<br>
>      >                     Number of Dimensions: 1<br>
>      >                     Dimensions and sizes: [112]<br>
>      >                     Coordinates:<br>
>      >                     (0) -102000<br>
>      >                     (1) -90000<br>
>      >                     (2) -78000<br>
>      >                     (3) -66000<br>
>      >                     (4) -54000<br>
>      >                     (5) -42000<br>
>      >                     (6) -30000<br>
>      >                     (7) -18000<br>
>      >                     (8) -6000<br>
>      >                     (9) 6000<br>
>      >                     (10) 18000<br>
>      >                     (11) 30000<br>
>      >                     (12) 42000<br>
>      >                     (13) 54000<br>
>      >                     (14) 66000<br>
>      >                     (15) 78000<br>
>      >                     (16) 90000<br>
>      >                     (17) 102000<br>
>      >                     (18) 114000<br>
>      >                     (19) 126000<br>
>      >                     (20) 138000<br>
>      >                     (21) 150000<br>
>      >                     (22) 162000<br>
>      >                     (23) 174000<br>
>      >                     (24) 186000<br>
>      >                     (25) 198000<br>
>      >                     (26) 210000<br>
>      >                     (27) 222000<br>
>      >                     (28) 234000<br>
>      >                     (29) 246000<br>
>      >                     (30) 258000<br>
>      >                     (31) 270000<br>
>      >                     (32) 282000<br>
>      >                     (33) 294000<br>
>      >                     (34) 306000<br>
>      >                     (35) 318000<br>
>      >                     (36) 330000<br>
>      >                     (37) 342000<br>
>      >                     (38) 354000<br>
>      >                     (39) 366000<br>
>      >                     (40) 378000<br>
>      >                     (41) 390000<br>
>      >                     (42) 402000<br>
>      >                     (43) 414000<br>
>      >                     (44) 426000<br>
>      >                     (45) 438000<br>
>      >                     (46) 450000<br>
>      >                     (47) 462000<br>
>      >                     (48) 474000<br>
>      >                     (49) 486000<br>
>      >                     (50) 498000<br>
>      >                     (51) 510000<br>
>      >                     (52) 522000<br>
>      >                     (53) 534000<br>
>      >                     (54) 546000<br>
>      >                     (55) 558000<br>
>      >                     (56) 570000<br>
>      >                     (57) 582000<br>
>      >                     (58) 594000<br>
>      >                     (59) 606000<br>
>      >                     (60) 618000<br>
>      >                     (61) 630000<br>
>      >                     (62) 642000<br>
>      >                     (63) 654000<br>
>      >                     (64) 666000<br>
>      >                     (65) 678000<br>
>      >                     (66) 690000<br>
>      >                     (67) 702000<br>
>      >                     (68) 714000<br>
>      >                     (69) 726000<br>
>      >                     (70) 738000<br>
>      >                     (71) 750000<br>
>      >                     (72) 762000<br>
>      >                     (73) 774000<br>
>      >                     (74) 786000<br>
>      >                     (75) 798000<br>
>      >                     (76) 810000<br>
>      >                     (77) 822000<br>
>      >                     (78) 834000<br>
>      >                     (79) 846000<br>
>      >                     (80) 858000<br>
>      >                     (81) 870000<br>
>      >                     (82) 882000<br>
>      >                     (83) 894000<br>
>      >                     (84) 906000<br>
>      >                     (85) 918000<br>
>      >                     (86) 930000<br>
>      >                     (87) 942000<br>
>      >                     (88) 954000<br>
>      >                     (89) 966000<br>
>      >                     (90) 978000<br>
>      >                     (91) 990000<br>
>      >                     (92) 1002000<br>
>      >                     (93) 1014000<br>
>      >                     (94) 1026000<br>
>      >                     (95) 1038000<br>
>      >                     (96) 1050000<br>
>      >                     (97) 1062000<br>
>      >                     (98) 1074000<br>
>      >                     (99) 1086000<br>
>      >                     (100) 1098000<br>
>      >                     (101) 1110000<br>
>      >                     (102) 1122000<br>
>      >                     (103) 1134000<br>
>      >                     (104) 1146000<br>
>      >                     (105) 1158000<br>
>      >                     (106) 1170000<br>
>      >                     (107) 1182000<br>
>      >                     (108) 1194000<br>
>      >                     (109) 1206000<br>
>      >                     (110) 1218000<br>
>      >                     (111) 1230000<br>
>      ><br>
>      ><br>
>      >                     Variable: taslon<br>
>      >                     Type: double<br>
>      >                     Total Size: 656 bytes<br>
>      >                                  82 values<br>
>      >                     Number of Dimensions: 1<br>
>      >                     Dimensions and sizes: [82]<br>
>      >                     Coordinates:<br>
>      >                     (0) -210000<br>
>      >                     (1) -198000<br>
>      >                     (2) -186000<br>
>      >                     (3) -174000<br>
>      >                     (4) -162000<br>
>      >                     (5) -150000<br>
>      >                     (6) -138000<br>
>      >                     (7) -126000<br>
>      >                     (8) -114000<br>
>      >                     (9) -102000<br>
>      >                     (10) -90000<br>
>      >                     (11) -78000<br>
>      >                     (12) -66000<br>
>      >                     (13) -54000<br>
>      >                     (14) -42000<br>
>      >                     (15) -30000<br>
>      >                     (16) -18000<br>
>      >                     (17) -6000<br>
>      >                     (18) 6000<br>
>      >                     (19) 18000<br>
>      >                     (20) 30000<br>
>      >                     (21) 42000<br>
>      >                     (22) 54000<br>
>      >                     (23) 66000<br>
>      >                     (24) 78000<br>
>      >                     (25) 90000<br>
>      >                     (26) 102000<br>
>      >                     (27) 114000<br>
>      >                     (28) 126000<br>
>      >                     (29) 138000<br>
>      >                     (30) 150000<br>
>      >                     (31) 162000<br>
>      >                     (32) 174000<br>
>      >                     (33) 186000<br>
>      >                     (34) 198000<br>
>      >                     (35) 210000<br>
>      >                     (36) 222000<br>
>      >                     (37) 234000<br>
>      >                     (38) 246000<br>
>      >                     (39) 258000<br>
>      >                     (40) 270000<br>
>      >                     (41) 282000<br>
>      >                     (42) 294000<br>
>      >                     (43) 306000<br>
>      >                     (44) 318000<br>
>      >                     (45) 330000<br>
>      >                     (46) 342000<br>
>      >                     (47) 354000<br>
>      >                     (48) 366000<br>
>      >                     (49) 378000<br>
>      >                     (50) 390000<br>
>      >                     (51) 402000<br>
>      >                     (52) 414000<br>
>      >                     (53) 426000<br>
>      >                     (54) 438000<br>
>      >                     (55) 450000<br>
>      >                     (56) 462000<br>
>      >                     (57) 474000<br>
>      >                     (58) 486000<br>
>      >                     (59) 498000<br>
>      >                     (60) 510000<br>
>      >                     (61) 522000<br>
>      >                     (62) 534000<br>
>      >                     (63) 546000<br>
>      >                     (64) 558000<br>
>      >                     (65) 570000<br>
>      >                     (66) 582000<br>
>      >                     (67) 594000<br>
>      >                     (68) 606000<br>
>      >                     (69) 618000<br>
>      >                     (70) 630000<br>
>      >                     (71) 642000<br>
>      >                     (72) 654000<br>
>      >                     (73) 666000<br>
>      >                     (74) 678000<br>
>      >                     (75) 690000<br>
>      >                     (76) 702000<br>
>      >                     (77) 714000<br>
>      >                     (78) 726000<br>
>      >                     (79) 738000<br>
>      >                     (80) 750000<br>
>      >                     (81) 762000<br>
>      ><br>
>      >                     On Thu, Feb 25, 2021 at 6:26 PM Dave Allured<br>
>     - NOAA<br>
>      >                     Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a><br>
>     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>><br>
>      >                     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a><br>
>     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>>>> wrote:<br>
>      ><br>
>      >                         It is starting to look like there is an<br>
>     error in<br>
>      >                         the attached coordinates.  What are the<br>
>     min and<br>
>      >                         max values of tas@lat2d and tas@lon2d?<br>
>      ><br>
>      ><br>
>      >                         On Thu, Feb 25, 2021 at 10:45 AM S Br<br>
>      >                         <<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>><br>
>      >                         <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>>>> wrote:<br>
>      ><br>
>      >                             Hi Dennis,<br>
>      >                             The data draws on a wrong location<br>
>     and the<br>
>      >                             map boundary is not aligning.<br>
>      >                             It should plot over the UK which is about<br>
>      >                             50-60N.<br>
>      ><br>
>      >                             Thanks.<br>
>      ><br>
>      >                             On Thu, Feb 25, 2021 at 5:41 PM<br>
>     Dennis Shea<br>
>      >                             <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a> <mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>><br>
>     <mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a> <mailto:<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>>>> wrote:<br>
>      ><br>
>      >                                 It helps to give NCL the correct<br>
>     lat/lon<br>
>      >                                 array information.<br>
>      ><br>
>      >                                 See attached<br>
>      ><br>
>      >                                 On Thu, Feb 25, 2021 at 10:23 AM Dave<br>
>      >                                 Allured - NOAA Affiliate via ncl-talk<br>
>      >                                 <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
>     <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>><br>
>      >                                 <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
>     <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>>>> wrote:<br>
>      ><br>
>      >                                     That script looks pretty<br>
>     good.  You<br>
>      >                                     can see from the error<br>
>     messages that<br>
>      >                                     NCL is trying to<br>
>     understand @lat2d<br>
>      >                                     and @lon2d, but something is not<br>
>      >                                     quite right with them.  We<br>
>     need to<br>
>      >                                     see printVarSummary for tas,<br>
>      >                                     tas@lat2d, and tas@lon2d.  It is<br>
>      >                                     possible that dimensions are<br>
>      >                                     mismatched between data and<br>
>      >                                     coordinates, for some reason.<br>
>      ><br>
>      >                                     There is also this note in<br>
>     that doc<br>
>      >                                     page:  "If your data variable<br>
>     is a<br>
>      >                                     two-dimensional (2D) array<br>
>     ordered<br>
>      >                                     lon x lat, you will need to<br>
>     reorder<br>
>      >                                     it to be lat x lon."  Please<br>
>     check<br>
>      >                                     and see if this is the problem.<br>
>      ><br>
>      ><br>
>      >                                     On Thu, Feb 25, 2021 at 10:00<br>
>     AM S<br>
>      >                                     Br <<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>><br>
>      >                                     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a><br>
>     <mailto:<a href="mailto:sbr.climate@gmail.com" target="_blank">sbr.climate@gmail.com</a>>>> wrote:<br>
>      ><br>
>      ><br>
>      >                                         Hi Dave,<br>
>      >                                         Many thanks for your reply.<br>
>      >                                         Sorry I missed to provide the<br>
>      >                                         details.<br>
>      >                                         I have run the following NCL<br>
>      >                                         script  and came across the<br>
>      >                                         errors given below.<br>
>      >                                         You can see the attached plot<br>
>      >                                         that it draws value<br>
>     throughout<br>
>      >                                         the globe. It is supposed<br>
>     to be<br>
>      >                                         drawn only over the UK.<br>
>      >                                         Am I doing something wrong?<br>
>      ><br>
>      >                                         ;********<br>
>      >                                       <br>
>       srcFileName="<a href="http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc" rel="noreferrer" target="_blank">tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc</a><br>
>     <<a href="http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc" rel="noreferrer" target="_blank">http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc</a>><br>
>      >                                       <br>
>       <<a href="http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc" rel="noreferrer" target="_blank">http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc</a><br>
>     <<a href="http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc" rel="noreferrer" target="_blank">http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc</a>>>"<br>
>      ><br>
>      >                                         ;---Read File<br>
>      >                                         f=addfile(srcFileName,"r")<br>
>      >                                         print(f)<br>
>      ><br>
>      >                                         ;---Get the source<br>
>     lat/lon grid<br>
>      >                                         tas=f->tas(0,0,:,:)<br>
>      >                                       <br>
>       tas@lat2d=f->projection_y_coordinate<br>
>      >                                       <br>
>       tas@lon2d=f->projection_x_coordinate<br>
>      ><br>
>      >                                         ;---Plot data<br>
>      >                                            wks =<br>
>     gsn_open_wks("x11","map")<br>
>      ><br>
>      >                                            res              = True<br>
>      >                                            res@gsnMaximize  =<br>
>     True     ;<br>
>      >                                         maximize plot in frame<br>
>      >                                            res@cnFillOn     =<br>
>     True     ;<br>
>      >                                         turn on contour fill<br>
>      >                                            res@cnLinesOn    =<br>
>     False    ;<br>
>      >                                         turn off contour fill<br>
>      >                                            res@gsnAddCyclic     =<br>
>     False<br>
>      >                                         ;   res@mpMinLatF    =  48.0<br>
>      >                                                  ; only plot 30S<br>
>     to 30N<br>
>      >                                         ;   res@mpMaxLatF    =  60.0<br>
>      >                                         ;  res@mpMinLonF    =  -15.0<br>
>      >                                               ; only plot 30S to 30N<br>
>      >                                         ;   res@mpMaxLonF    = 6.0<br>
>      >                                           res@mpDataBaseVersion =<br>
>      >                                         "MediumRes"<br>
>      >                                             res@mpLandFillColor =<br>
>     "white"<br>
>      ><br>
>      >                                            plot =<br>
>      >                                       <br>
>       gsn_csm_contour_map(wks,tas(:,:),res)<br>
>      ><br>
>      >                                         ********************<br>
>      >                                         (0) is_valid_latlon2d_attr:<br>
>      >                                         Warning: The 'lat2d'<br>
>     attribute<br>
>      >                                         must either be<br>
>      >                                         (0) the same dimension<br>
>     sizes as<br>
>      >                                         the data, or one element<br>
>     larger<br>
>      >                                         in both directions.<br>
>      >                                         (0) Your data will most<br>
>     likely<br>
>      >                                         not be overlaid on the map<br>
>      >                                         correctly.<br>
>      >                                         (0) check_for_y_lat_coord:<br>
>      >                                         Warning: Data either does not<br>
>      >                                         contain<br>
>      >                                         (0) a valid latitude<br>
>     coordinate<br>
>      >                                         array or doesn't contain<br>
>     one at all.<br>
>      >                                         (0) A valid latitude<br>
>     coordinate<br>
>      >                                         array should have a 'units'<br>
>      >                                         (0) attribute equal to one of<br>
>      >                                         the following values:<br>
>      >                                         (0)    'degrees_north'<br>
>      >                                         'degrees-north'<br>
>     'degree_north'<br>
>      >                                         'degrees north' 'degrees_N'<br>
>      >                                         'Degrees_north' 'degree_N'<br>
>      >                                         'degreeN' 'degreesN' 'deg<br>
>     north'<br>
>      >                                         (0) is_valid_latlon2d_attr:<br>
>      >                                         Warning: The 'lon2d'<br>
>     attribute<br>
>      >                                         must either be<br>
>      >                                         (0) the same dimension<br>
>     sizes as<br>
>      >                                         the data, or one element<br>
>     larger<br>
>      >                                         in both directions.<br>
>      >                                         (0) Your data will most<br>
>     likely<br>
>      >                                         not be overlaid on the map<br>
>      >                                         correctly.<br>
>      >                                         (0) check_for_lon_coord:<br>
>      >                                         Warning: Data either does not<br>
>      >                                         contain<br>
>      >                                         (0) a valid longitude<br>
>     coordinate<br>
>      >                                         array or doesn't contain<br>
>     one at all.<br>
>      >                                         (0) A valid longitude<br>
>     coordinate<br>
>      >                                         array should have a 'units'<br>
>      >                                         (0) attribute equal to one of<br>
>      >                                         the following values:<br>
>      >                                         (0)    'degrees_east'<br>
>      >                                         'degrees-east' 'degree_east'<br>
>      >                                         'degrees east' 'degrees_E'<br>
>      >                                         'Degrees_east' 'degree_E'<br>
>      >                                         'degreeE' 'degreesE' 'deg<br>
>     east'<br>
>      ><br>
>      >                                         On Thu, Feb 25, 2021 at<br>
>     4:17 PM<br>
>      >                                         Dave Allured - NOAA Affiliate<br>
>      >                                         <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a><br>
>     <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>><br>
>      >                                       <br>
>       <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a> <mailto:<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>>>><br>
>      >                                         wrote:<br>
>      ><br>
>      >                                             Does your file<br>
>     contain its<br>
>      >                                             own lat and lon<br>
>     coordinate<br>
>      >                                             arrays?  You will need to<br>
>      >                                             check this yourself with<br>
>      >                                             ncdump or NCL plus print<br>
>      >                                             commands.<br>
>      ><br>
>      >                                             If the file has its own<br>
>      >                                             coordinate arrays,<br>
>     then do<br>
>      >                                             not regrid or reproject.<br>
>      >                                             Doing that will lose<br>
>     detail<br>
>      >                                             and reduce the quality of<br>
>      >                                             the plotted image. <br>
>     NCL is<br>
>      >                                             quite capable of directly<br>
>      >                                             displaying any data with<br>
>      >                                             attached coordinate<br>
>     arrays,<br>
>      >                                             and it does not need<br>
>     to know<br>
>      >                                             anything about the<br>
>      >                                             projection of the data.<br>
>      >                                             Please see<br>
>     documentation for<br>
>      >                                             "Plotting data on a<br>
>     map" for<br>
>      >                                             much more information<br>
>     about<br>
>      >                                             aligning data on a<br>
>     map plot.<br>
>      ><br>
>      > <a href="https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml</a><br>
>     <<a href="https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml</a>><br>
>      >                                           <br>
>       <<a href="https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml</a><br>
>     <<a href="https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml</a>>><br>
>      ><br>
>      >                                             If the coordinate<br>
>     arrays in<br>
>      >                                             the file are two<br>
>      >                                             dimensional, then see<br>
>      >                                             example 3, "Curvilinear<br>
>      >                                             grid".  When you have 2-D<br>
>      >                                             coordinates, they must be<br>
>      >                                             passed to the NCL plot<br>
>      >                                             routine with special<br>
>      >                                             attributes *lat2d* and<br>
>      >                                             *lon2d*, or alternatively<br>
>      >                                             *sfXArray* and<br>
>      >                                             *sfYArray* attached<br>
>     to the<br>
>      >                                             plot resource variable.<br>
>      >                                             Note that 1-D<br>
>     coordinates do<br>
>      >                                             not need this special<br>
>      >                                             treatment because<br>
>     they are<br>
>      >                                             normally attached<br>
>     directly<br>
>      >                                             to the data variable<br>
>     to plot.<br>
>      ><br>
>      ><br>
>      >                                             On Thu, Feb 25, 2021<br>
>     at 8:24<br>
>      >                                             AM S Br via ncl-talk<br>
>      >                                           <br>
>       <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a> <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>><br>
>      >                                           <br>
>       <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a> <mailto:<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>>>><br>
>      >                                             wrote:<br>
>      ><br>
>      >                                                 Hi All,<br>
>      >                                                 I have a set of<br>
>     regional<br>
>      >                                                 gridded data in the<br>
>      >                                                 British National Grid<br>
>      >                                                 (OSGB) spatial<br>
>      >                                                 coordinate<br>
>     system. I am<br>
>      >                                                 looking to use<br>
>     this data<br>
>      >                                                 in NCL but the<br>
>      >                                                 projection is not<br>
>      >                                                 correctly displayed?<br>
>      >                                                 Could it be<br>
>     possible to<br>
>      >                                                 regrid this data to<br>
>      >                                                 Latitude-longitude in<br>
>      >                                                 rotated pole<br>
>     coordinates<br>
>      >                                                 or to a regular<br>
>     lat/lon<br>
>      >                                                 grid.<br>
>      ><br>
>      >                                                 I would like to<br>
>     mention<br>
>      >                                                 that these data<br>
>     sets are<br>
>      >                                                 generated using<br>
>     the Iris<br>
>      >                                                 package in<br>
>     Python. The<br>
>      >                                                 data is correctly<br>
>      >                                                 displayed in<br>
>     Python but<br>
>      >                                                 not in NCL.<br>
>      ><br>
>      >                                                 For your<br>
>     convenience I<br>
>      >                                                 have attached here a<br>
>      >                                                 sample NetCDF file.<br>
>      ><br>
>      >                                                 Thank you.<br>
>      >                                                 SBR<br></blockquote></div></div></div>