[Met_help] [rt.rap.ucar.edu #96756] History for Regular lonlat-grid in MODE Time Domain Tool

John Halley Gotway via RT met_help at ucar.edu
Thu Oct 1 14:31:20 MDT 2020


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

Dear MET-Team,

I am using the MODE MTD tool, and now I would like to use a regular 
lonlat grid, but I fail to specify it properly. Here I try to document 
the problem:

This is my file:

> smueller at login02 MTD $ cdo sinfov 
> mmhr_remapdis_mymanALP-3_pr_ALP-3_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_CNRM-AROME41t1_fpsconv-x2yn2-v1_1hr_209912000000.nc 
>
>    File format : NetCDF
>     -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : 
> Parameter name
>      1 : unknown  unknown  v instant       1   1    169260 1  F32  : pr
>    Grid coordinates :
>      1 : lonlat                   : points=169260 (455x372)
>                               lon : 1 to 17 by 0.03524229 degrees_east
>                               lat : 40 to 50 by 0.02695418 degrees_north
>    Vertical coordinates :
>      1 : surface                  : levels=1
>    Time coordinate :  744 steps
>      RefTime =  1949-12-01 00:00:00  Units = hours  Calendar = gregorian
>   YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  
> YYYY-MM-DD hh:mm:ss
>   2099-12-01 00:00:00  2099-12-01 01:00:00  2099-12-01 02:00:00  
> 2099-12-01 03:00:00
> ................................................................................
>   2099-12-31 20:00:00  2099-12-31 21:00:00  2099-12-31 22:00:00  
> 2099-12-31 23:00:00
> cdo    sinfon: Processed 1 variable over 744 timesteps [0.10s 16MB].
This is my grid:
> #
> # gridID 16
> #
> gridtype  = lonlat
> gridsize  = 169260
> xname     = lon
> xlongname = longitude
> xunits    = degrees_east
> yname     = lat
> ylongname = latitude
> yunits    = degrees_north
> xsize     = 455
> ysize     = 372
> xfirst    = 1.0
> xinc      = 0.03524229074889868
> yfirst    = 40.0
> yinc      = 0.026954177897574125
This is how I specified the grid in read_pr_timestep....py. As you can 
see I took reference from the documentation of grids in Appendix 2.

> attrs = {
>    'valid': valid_time.strftime("%Y%m%d_%H%M%S"),
>    'init':  valid_time.strftime("%Y%m%d_%H%M%S"),
>    'lead':  '00',
>    'accum': accum_time,
>
>    'name':      'pr',
>    'long_name': var.long_name,
>    'level':     'Surface',
>    'units':     var.units,
>
>    'grid': {
>        'name' : 'lonlat',
>        'type' : 'lonlat',
>        'La1' : float(50),
>        'Lo1' : float(17),
>        'La2' : float(40),
>        'Lo2' : float(1),
>        'Di' : float(0.03524229074889868),
>        'Dj' : float(0.026954177897574125),
>        'r_km' : float(6371.2),
>        'Ni' : 455,
>        'Nj' : 372
>    }
> }
This is what happens, when I let mtd run:

> smueller at login02 MTD $ /opt-ictp/ESMF/201906/bin/mtd -single 0 1 2 3 4 
> 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 
> 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 
> 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 
> 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 
> 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 
> 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 
> 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 
> 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 
> 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 
> 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 
> 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 
> 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 
> 236 237 238 239 -config 
> /home/clima-archive4-b/smueller/MTD/MTDConfig_files/MTDConfig_SKM_pythonmyALP-3_CNRM_AROME_rcp85_prTH05_rsmoo8_minvol100_209912000000
> DEBUG 2: mtd_read_data() -> processing file "0"
> Input File: 
> '/home/clima-archive4-b/smueller/MTD/mmhr_remapdis_mymanALP-3_pr_ALP-3_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_CNRM-AROME41t1_fpsconv-x2yn2-v1_1hr_209912000000.nc'
> Time Index: 0
> Data Shape: (372, 455)
> Data Type:  dtype('float64')
> Valid Time = 2099-12-01 00:00:00
> Accum Time = 000000
> Attributes: {'valid': '20991201_000000', 'init': '20991201_000000', 
> 'lead': '00', 'accum': '000000', 'name': 'pr', 'long_name': 
> 'Precipitation', 'level': 'Surface', 'units': 'kg m-2 s-1', 'grid': 
> {'name': 'lonlat', 'type': 'lonlat', 'La1': 50.0, 'Lo1': 17.0, 'La2': 
> 40.0, 'Lo2': 1.0, 'Di': 0.03524229074889868, 'Dj': 
> 0.026954177897574125, 'r_km': 6371.2, 'Ni': 455, 'Nj': 372}}
> ERROR  :
> ERROR  : grid_from_python_dict() -> bad projection type: "lonlat"
> ERROR  :
So, are regular lonlat grids supported? If yes, how would I correctly 
define them? I would be very thankful if you could help me.

Best regards
Sebastian

-- 
*********************************************************************
Sebastian K. Müller
Earth System Physics Section
The Abdus Salam International Centre for Theoretical Physics
Strada Costiera 11
34100 Trieste, ITALY
phone: + 39 040 2240 438
email: smueller at ictp.it
*********************************************************************



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

Subject: Regular lonlat-grid in MODE Time Domain Tool
From: Minna Win
Time: Thu Sep 17 08:51:00 2020

Hello Sebastian,

It looks like you are having issues getting your grid set up for MODE
MTD.
I'm assigning this ticket to John Halley Gotway.  Please allow a few
days
for a full response.

Regards,
Minna
---------------
Minna Win
National Center for Atmospheric Research
Developmental Testbed Center
Phone: 303-497-8423
Fax:   303-497-8401



On Thu, Sep 17, 2020 at 3:06 AM Sebastian K. Müller via RT <
met_help at ucar.edu> wrote:

>
> Thu Sep 17 03:06:19 2020: Request 96756 was acted upon.
> Transaction: Ticket created by smueller at ictp.it
>        Queue: met_help
>      Subject: Regular lonlat-grid in MODE Time Domain Tool
>        Owner: Nobody
>   Requestors: smueller at ictp.it
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=96756 >
>
>
> Dear MET-Team,
>
> I am using the MODE MTD tool, and now I would like to use a regular
> lonlat grid, but I fail to specify it properly. Here I try to
document
> the problem:
>
> This is my file:
>
> > smueller at login02 MTD $ cdo sinfov
> >
> mmhr_remapdis_mymanALP-3_pr_ALP-3_CNRM-CERFACS-CNRM-
CM5_rcp85_r1i1p1_CNRM-AROME41t1_fpsconv-x2yn2-v1_1hr_
> 209912000000.nc
> >
> >    File format : NetCDF
> >     -1 : Institut Source   T Steptype Levels Num    Points Num
Dtype :
> > Parameter name
> >      1 : unknown  unknown  v instant       1   1    169260 1  F32
: pr
> >    Grid coordinates :
> >      1 : lonlat                   : points=169260 (455x372)
> >                               lon : 1 to 17 by 0.03524229
degrees_east
> >                               lat : 40 to 50 by 0.02695418
degrees_north
> >    Vertical coordinates :
> >      1 : surface                  : levels=1
> >    Time coordinate :  744 steps
> >      RefTime =  1949-12-01 00:00:00  Units = hours  Calendar =
gregorian
> >   YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
> > YYYY-MM-DD hh:mm:ss
> >   2099-12-01 00:00:00  2099-12-01 01:00:00  2099-12-01 02:00:00
> > 2099-12-01 03:00:00
> >
>
................................................................................
> >   2099-12-31 20:00:00  2099-12-31 21:00:00  2099-12-31 22:00:00
> > 2099-12-31 23:00:00
> > cdo    sinfon: Processed 1 variable over 744 timesteps [0.10s
16MB].
> This is my grid:
> > #
> > # gridID 16
> > #
> > gridtype  = lonlat
> > gridsize  = 169260
> > xname     = lon
> > xlongname = longitude
> > xunits    = degrees_east
> > yname     = lat
> > ylongname = latitude
> > yunits    = degrees_north
> > xsize     = 455
> > ysize     = 372
> > xfirst    = 1.0
> > xinc      = 0.03524229074889868
> > yfirst    = 40.0
> > yinc      = 0.026954177897574125
> This is how I specified the grid in read_pr_timestep....py. As you
can
> see I took reference from the documentation of grids in Appendix 2.
>
> > attrs = {
> >    'valid': valid_time.strftime("%Y%m%d_%H%M%S"),
> >    'init':  valid_time.strftime("%Y%m%d_%H%M%S"),
> >    'lead':  '00',
> >    'accum': accum_time,
> >
> >    'name':      'pr',
> >    'long_name': var.long_name,
> >    'level':     'Surface',
> >    'units':     var.units,
> >
> >    'grid': {
> >        'name' : 'lonlat',
> >        'type' : 'lonlat',
> >        'La1' : float(50),
> >        'Lo1' : float(17),
> >        'La2' : float(40),
> >        'Lo2' : float(1),
> >        'Di' : float(0.03524229074889868),
> >        'Dj' : float(0.026954177897574125),
> >        'r_km' : float(6371.2),
> >        'Ni' : 455,
> >        'Nj' : 372
> >    }
> > }
> This is what happens, when I let mtd run:
>
> > smueller at login02 MTD $ /opt-ictp/ESMF/201906/bin/mtd -single 0 1 2
3 4
> > 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
29
> > 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
52
> > 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
75
> > 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
98
> > 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
116
> > 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
133
> > 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
150
> > 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
167
> > 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
184
> > 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
201
> > 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
218
> > 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
235
> > 236 237 238 239 -config
> >
> /home/clima-archive4-
b/smueller/MTD/MTDConfig_files/MTDConfig_SKM_pythonmyALP-
3_CNRM_AROME_rcp85_prTH05_rsmoo8_minvol100_209912000000
> > DEBUG 2: mtd_read_data() -> processing file "0"
> > Input File:
> >
> '/home/clima-archive4-b/smueller/MTD/mmhr_remapdis_mymanALP-
3_pr_ALP-3_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_CNRM-AROME41t1_fpsconv-
x2yn2-
> v1_1hr_209912000000.nc'
> > Time Index: 0
> > Data Shape: (372, 455)
> > Data Type:  dtype('float64')
> > Valid Time = 2099-12-01 00:00:00
> > Accum Time = 000000
> > Attributes: {'valid': '20991201_000000', 'init':
'20991201_000000',
> > 'lead': '00', 'accum': '000000', 'name': 'pr', 'long_name':
> > 'Precipitation', 'level': 'Surface', 'units': 'kg m-2 s-1',
'grid':
> > {'name': 'lonlat', 'type': 'lonlat', 'La1': 50.0, 'Lo1': 17.0,
'La2':
> > 40.0, 'Lo2': 1.0, 'Di': 0.03524229074889868, 'Dj':
> > 0.026954177897574125, 'r_km': 6371.2, 'Ni': 455, 'Nj': 372}}
> > ERROR  :
> > ERROR  : grid_from_python_dict() -> bad projection type: "lonlat"
> > ERROR  :
> So, are regular lonlat grids supported? If yes, how would I
correctly
> define them? I would be very thankful if you could help me.
>
> Best regards
> Sebastian
>
> --
>
*********************************************************************
> Sebastian K. Müller
> Earth System Physics Section
> The Abdus Salam International Centre for Theoretical Physics
> Strada Costiera 11
> 34100 Trieste, ITALY
> phone: + 39 040 2240 438
> email: smueller at ictp.it
>
*********************************************************************
>
>
>

------------------------------------------------
Subject: Regular lonlat-grid in MODE Time Domain Tool
From: John Halley Gotway
Time: Thu Sep 17 09:42:17 2020

Sebastian,

It looks like you're trying to use python-embedding with MTD. Whenever
getting started with a new dataset in MET, including a new python-
embedding
script, I always recommend that users start by running the
plot_data_plane
tool. Do this to confirm that your python-embedding script is running
well
and that MET is reading the data correctly and placing it on the earth
in
the right spot.

So instead of starting with MTD, start with plot_data_plane.

As for how to format the grid specification for LatLon projections,
you can
find several examples of python-embedding scripts on this page:
https://www.dtcenter.org/community-code/model-evaluation-tools-
met/sample-analysis-scripts

In particular, here's an excerpt taken from the first python script on
that
page:
https://www.dtcenter.org/sites/default/files/community-
code/met/python-scripts/read_CPC_binary.py.txt

   'grid': {
       'name': 'Global 1 Degree',
       'type' :   'LatLon',
       'lat_ll' :    -90.0,
       'lon_ll' :   -180.0,
       'delta_lat' :   1.0,
       'delta_lon' :   1.0,
       'Nlat' :      181,
       'Nlon' :      360,
   }


Just substitute in the values for your projection into the example
above.

Hope that helps get you going.

Thanks,

John Halley Gotway


On Thu, Sep 17, 2020 at 8:52 AM Minna Win via RT <met_help at ucar.edu>
wrote:

>
> Thu Sep 17 08:52:28 2020: Request 96756 was acted upon.
> Transaction: Given to johnhg (John Halley Gotway) by minnawin
>        Queue: met_help
>      Subject: Regular lonlat-grid in MODE Time Domain Tool
>        Owner: johnhg
>   Requestors: smueller at ictp.it
>       Status: open
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=96756 >
>
>
> This transaction appears to have no content
>

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


More information about the Met_help mailing list