[ncl-talk] Regridding OMI NO2 to WRF domain

Dennis Shea shea at ucar.edu
Tue Oct 8 16:07:52 MDT 2019


The golden rule of data processing is: Look at your data.

Plot_OMI_WRF.ncl strips out non-valid [negative] values and selects only
swath values within the WRF grid domain.
OMI_WRF.png shows the distribution.
-----
Regridding_OMI_NO2.ncl  performs assorted data processing tasks and the
regridding.

 ;Opt at InterpMethod      = "neareststod"    ; <=== does not return what you
think it might
  Opt at InterpMethod      = "bilinear"           ; works BUT some extra data
editing is required

The extra 'singular swath' had to be manually eliiminated ...

On Tue, Oct 8, 2019 at 2:38 AM <markus.mingel at libero.it> wrote:

> Dear Dennis,
> Thanks for the help. Indeed, the values are reasonable, just data below 0
> should be masked out (see figure attached). The main issue when regridding
> is related to the coordinanates, which NCL does not recognize correctly. In
> particular, latitude and longitude are given in this way:
>
> float latitude(time, scanline, ground_pixel) ;
> float longitude(time, scanline, ground_pixel) ;
>
> where scanline and ground_pixel are:
>
> int scanline(scanline) ;
> scanline:units = "1" ;
> scanline:long_name = "along-track dimension index" ;
> scanline:comment = "This coordinate variable defines the indices along
> track; index starts at 0." ;
> scanline:axis = "Y" ;
> scanline:_FillValue = -2147483647 ;
>
> int ground_pixel(ground_pixel) ;
> ground_pixel:units = "1" ;
> ground_pixel:long_name = "across-track dimension index" ;
> ground_pixel:comment = "This coordinate variable defines the indices
> across track, from west to east; index starts at 0." ;
> ground_pixel:axis = "X" ;
> ground_pixel:_FillValue = -2147483647 ;
>
> Reading these variable into NCL and printing for instance the longitude
> produces this output:
>
> Variable: OMI_lon
> Dimensions and sizes: [scanline | 1643] x [ground_pixel | 60]
> Coordinates:
> scanline: [0..1642]
> ground_pixel: [0..59]
>
> Thus, even if the variables longitude and latitude contain the correct
> grid values NCL get stuck with the coordinates and the regridding fails.
> I hope it makes sense; I have uploaded on ftp the geo_em.d01.nc file for
> further checks.
> Thanks again for support,
> Best,
> Markus
>
>
> Il 8 ottobre 2019 alle 6.02 Dennis Shea <shea at ucar.edu> ha scritto:
>
> The data look 'funny'. Do these values look reasonable?
>
> *%>* ncdump -v tropospheric_no2_vertical_column
> QA4ECV_L2_NO2_OMI_20150101T062700_o55658_fitB_v1.nc | less
> ---
> *[SNIP]*
>      _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
> _,
>       _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
>   2.406383e+15, 3.050731e+15, 3.672694e+15, 3.0601e+15, 3.516629e+15,
>       3.88749e+15, 3.47379e+15, 3.176642e+15, 4.139261e+15, 2.407606e+15,
>       5.561115e+15, -2.654418e+15, -2.636171e+15, -2.361623e+15,
>       -2.782675e+15, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
> _,
>       _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
> _,
> *[SNIP]*
> ---
> Or use NCL's *stat_dispersion*
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml>?
>
>
> ;************************************************
> ; READ OMI DATA AND INTERPOLATE TO WRF GRID
> ;************************************************
>   varname            = "tropospheric_no2_vertical_column"
>
>   in                       = *addfile*("QA4ECV_L2_NO2_OMI_20150101T062700_o55658_fitB_v1.nc","r")
>
>   OMI_lon            = *rm_single_dims*(in->longitude)
>   OMI_lat             = rm_single_dims(in->latitude)
>   OMI_NO2          = rm_single_dims(in->$varname$)
>   *printVarSummary*(OMI_lat)
>   *printMinMax*(OMI_lat,0)
>   print("---")
>   printVarSummary(OMI_lon)
>   printMinMax(OMI_lon,0)
>   print("---")
>   printVarSummary(OMI_NO2)
>
>   opt_omi  = True                      ; examine variable distribution
>   opt_omi at PrintStat = True
>   stat_omi = *stat_dispersion*
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml>(OMI_NO2,
> opt_omi )
>   ========================================
> (0)   ===> Robust Dispersion Statistics: tropospheric vertical column of
> nitrogen dioxide <===
> (0) [0]            Mean=3.99524e+14
> (0) [1]          StdDev=1.62554e+15
> (0) [2]             Min=-3.25332e+16
> (0) [3]          LowDec=-3.55504e+14
> (0) [4]          LowOct=-2.91703e+14
> (0) [5]          LowSex=-2.08708e+14
> (0) [6]     LowQuartile=-9.12487e+13
> (0) [7]          LowTri=-8.76374e+12
> (0) [8]          Median=1.38802e+14
> (0) [9]         HighTri=3.4987e+14
> (0) [10]   HighQuartile=5.1836e+14
> (0) [11]        HighSex=7.89394e+14
> (0) [12]        HighOct=1.06466e+15
> (0) [13]        HighDec=1.38607e+15
> (0) [14]            Max=2.98652e+16
> (0) [15]          Range=6.23984e+16
> (0) [16]     Dispersion=38.3862
> (0) [17]    RMS Anomaly=1.62552e+15
> (0) [18]      #   Total=98580
> (0) [19]      #    Used=52804
> (0) [20]      # Missing=45776
> (0) [21]      % Missing=46.4354
> (0) [22]     Lower 0.1%=-8.99725e+15
> (0) [23]     Lower 1.0%=-3.74242e+15
> (0) [24]     Lower 5.0%=-5.91249e+14
> (0) [25]     Upper 5.0%=2.88608e+15
> (0) [26]     Upper 1.0%=5.98719e+15
> (0) [27]     Upper 0.1%=1.58778e+16
> (0) [28]       Skewness=2.15761
> (0) [29]       Kurtosis=51.6109
>
> ===
> Also: Please ftp the ' geo_em.d01.nc' file.
>
> Cheers
>
> On Mon, Oct 7, 2019 at 1:13 PM Rick Brownrigg via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Did you get the proper/expected lat/lon grid otherwise, despite the result
> being 3D. What is that 3ed dimension? From the long_name, it sounds like
> elevation/altitude/level, Do you need to sum, or average, or slice that
> dimension to reduce to a 2D grid?
>
> Rick
>
>
> On Mon, Oct 7, 2019 at 6:40 AM markus mingel via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Hi All,
>
> I am trying to regrid OMI NO2 data to WRF grid using ESMF, but without
> success; in particular, the result of ESMF_regrid has 3 dimensions while I
> expect data on a LON-LAT grid:
>
>
> Dimensions and sizes: [scanline | 1644] x [290] x [380]
> Coordinates:
> scanline: [0..1643]
> Number Of Attributes: 9
> missing_value : -1e+20
> remap : remapped via ESMF_regrid_with_weights: Nearest source to
> destination
> lon2d : <ARRAY of 538200 elements>
> lat2d : <ARRAY of 538200 elements>
> _FillValue : -1e+20
> time : 631152006
> units : molecules cm-2
> long_name : tropospheric vertical column of nitrogen dioxide
>
>
> Does anyone know how to regrid these data? I attached my script, while a
> sample input file (QA4ECV_L2_NO2_OMI_20150101T062700_o55658_fitB_v1.nc) can
> be found on ftp.
>
> Thanks into advance for help,
>
> Markus
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191008/c01bc566/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Plot_OMI_WRF.ncl
Type: application/octet-stream
Size: 3819 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191008/c01bc566/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Regridding_OMI_NO2.ncl
Type: application/octet-stream
Size: 6135 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191008/c01bc566/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ESMF_regrid_OMI.png
Type: image/png
Size: 166031 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191008/c01bc566/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OMI_WRF.png
Type: image/png
Size: 218200 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191008/c01bc566/attachment-0003.png>


More information about the ncl-talk mailing list