<div dir="ltr"><div>The golden rule of data processing is: Look at your data.</div><div><br></div><div>Plot_OMI_WRF.ncl strips out non-valid [negative] values and selects only swath values within the WRF grid domain.</div><div>OMI_WRF.png shows the distribution.<br></div><div>-----</div><div>Regridding_OMI_NO2.ncl performs assorted data processing tasks and the regridding.<br></div><div><br></div><div> ;Opt@InterpMethod = "neareststod" ; <=== does not return what you think it might<br> Opt@InterpMethod = "bilinear" ; works BUT some extra data editing is required<br></div><div><br></div><div>The extra 'singular swath' had to be manually eliiminated ...<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 8, 2019 at 2:38 AM <<a href="mailto:markus.mingel@libero.it">markus.mingel@libero.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<div>
Dear Dennis,
<br>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:
</div>
<div>
<br>
</div>
<div>
float latitude(time, scanline, ground_pixel) ;
<br> float longitude(time, scanline, ground_pixel) ;
</div>
<div>
<br>
</div>
<div>
where scanline and ground_pixel are:
</div>
<div>
<br>
</div>
<div>
int scanline(scanline) ;
<br> scanline:units = "1" ;
<br> scanline:long_name = "along-track dimension index" ;
<br> scanline:comment = "This coordinate variable defines the indices along track; index starts at 0." ;
<br> scanline:axis = "Y" ;
<br> scanline:_FillValue = -2147483647 ;
</div>
<div>
<br> int ground_pixel(ground_pixel) ;
<br> ground_pixel:units = "1" ;
<br> ground_pixel:long_name = "across-track dimension index" ;
<br> ground_pixel:comment = "This coordinate variable defines the indices across track, from west to east; index starts at 0." ;
<br> ground_pixel:axis = "X" ;
<br> ground_pixel:_FillValue = -2147483647 ;
</div>
<div>
<br>
</div>
<div>
Reading these variable into NCL and printing for instance the longitude produces this output:
</div>
<div>
<br>
</div>
<div>
Variable: OMI_lon
<br>Dimensions and sizes: [scanline | 1643] x [ground_pixel | 60]
<br>Coordinates:
<br> scanline: [0..1642]
<br> ground_pixel: [0..59]
</div>
<div>
<br>
</div>
<div>
Thus, even if the variables longitude and latitude contain the correct grid values NCL get stuck with the coordinates and the regridding fails.
<br>I hope it makes sense; I have uploaded on ftp the <a href="http://geo_em.d01.nc" target="_blank">geo_em.d01.nc</a> file for further checks.
<br>Thanks again for support,
<br>Best,
<br>Markus
<br>
</div>
<div>
<br>
</div>
<p><br></p>
<blockquote type="cite">
Il 8 ottobre 2019 alle 6.02 Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> ha scritto:
<br>
<br>
<div dir="ltr">
<div>
The data look 'funny'. Do these values look reasonable?
<br>
</div>
<div>
<strong><br></strong>
</div>
<div>
<strong>%></strong> ncdump -v tropospheric_no2_vertical_column QA4ECV_L2_NO2_OMI_20150101T062700_o55658_fitB_v1.nc | less
</div>
<div>
---
</div>
<div>
<strong>[SNIP]</strong>
</div>
<div>
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
<br> _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
<br> 2.406383e+15, 3.050731e+15, 3.672694e+15, 3.0601e+15, 3.516629e+15,
<br> 3.88749e+15, 3.47379e+15, 3.176642e+15, 4.139261e+15, 2.407606e+15,
<br> 5.561115e+15, -2.654418e+15, -2.636171e+15, -2.361623e+15,
<br> -2.782675e+15, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
<br> _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
<br>
</div>
<div>
<strong>[SNIP]</strong>
<br>
</div>
<div>
---
</div>
<div>
Or use NCL's
<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml" target="_blank"><strong>stat_dispersion</strong></a>?
</div>
<div>
<br>;************************************************
<br>; READ OMI DATA AND INTERPOLATE TO WRF GRID
<br>;************************************************
<br> varname = "tropospheric_no2_vertical_column"
<br>
<br> in =
<strong>addfile</strong>("QA4ECV_L2_NO2_OMI_20150101T062700_o55658_fitB_v1.nc","r")
<br> OMI_lon =
<strong>rm_single_dims</strong>(in->longitude)
<br> OMI_lat = rm_single_dims(in->latitude)
<br> OMI_NO2 = rm_single_dims(in->$varname$)
<br>
<strong>printVarSummary</strong>(OMI_lat)
<br>
<strong>printMinMax</strong>(OMI_lat,0)
<br> print("---")
<br> printVarSummary(OMI_lon)
<br> printMinMax(OMI_lon,0)
<br> print("---")
<br> printVarSummary(OMI_NO2)
<br>
<br> opt_omi = True ; examine variable distribution
<br> opt_omi@PrintStat = True
<br> stat_omi =
<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml" target="_blank"><strong>stat_dispersion</strong></a>(OMI_NO2, opt_omi )
<br> ========================================
<br>(0) ===> Robust Dispersion Statistics: tropospheric vertical column of nitrogen dioxide <===
<br>(0) [0] Mean=3.99524e+14
<br>(0) [1] StdDev=1.62554e+15
<br>(0) [2] Min=-3.25332e+16
<br>(0) [3] LowDec=-3.55504e+14
<br>(0) [4] LowOct=-2.91703e+14
<br>(0) [5] LowSex=-2.08708e+14
<br>(0) [6] LowQuartile=-9.12487e+13
<br>(0) [7] LowTri=-8.76374e+12
<br>(0) [8] Median=1.38802e+14
<br>(0) [9] HighTri=3.4987e+14
<br>(0) [10] HighQuartile=5.1836e+14
<br>(0) [11] HighSex=7.89394e+14
<br>(0) [12] HighOct=1.06466e+15
<br>(0) [13] HighDec=1.38607e+15
<br>(0) [14] Max=2.98652e+16
<br>(0) [15] Range=6.23984e+16
<br>(0) [16] Dispersion=38.3862
<br>(0) [17] RMS Anomaly=1.62552e+15
<br>(0) [18] # Total=98580
<br>(0) [19] # Used=52804
<br>(0) [20] # Missing=45776
<br>(0) [21] % Missing=46.4354
<br>(0) [22] Lower 0.1%=-8.99725e+15
<br>(0) [23] Lower 1.0%=-3.74242e+15
<br>(0) [24] Lower 5.0%=-5.91249e+14
<br>(0) [25] Upper 5.0%=2.88608e+15
<br>(0) [26] Upper 1.0%=5.98719e+15
<br>(0) [27] Upper 0.1%=1.58778e+16
<br>(0) [28] Skewness=2.15761
<br>(0) [29] Kurtosis=51.6109
</div>
<div>
<br>
</div>
<div>
===
</div>
<div>
Also: Please ftp the '
<a href="http://geo_em.d01.nc" target="_blank">geo_em.d01.nc</a>' file.
</div>
<div>
<br>
</div>
<div>
Cheers
<br>
</div>
</div>
<br>
<div>
<div dir="ltr">
On Mon, Oct 7, 2019 at 1:13 PM Rick Brownrigg via ncl-talk <
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:
<br>
</div>
<blockquote>
<div dir="ltr">
<div>
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?
</div>
<div>
<br>
</div>
<div>
Rick
</div>
<div>
<br>
</div>
</div>
<br>
<div>
<div dir="ltr">
On Mon, Oct 7, 2019 at 6:40 AM markus mingel via ncl-talk <
<a href="mailto:ncl-talk@ucar.edu" rel="noopener" target="_blank">ncl-talk@ucar.edu</a>> wrote:
<br>
</div>
<blockquote>
<u></u>
<div>
<p>Hi All,<br></p>
<p>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:<br></p>
<p><br></p>
<p>Dimensions and sizes: [scanline | 1644] x [290] x [380]<br>Coordinates: <br> scanline: [0..1643]<br>Number Of Attributes: 9<br> missing_value : -1e+20<br> remap : remapped via ESMF_regrid_with_weights: Nearest source to destination<br> lon2d : <ARRAY of 538200 elements><br> lat2d : <ARRAY of 538200 elements><br> _FillValue : -1e+20<br> time : 631152006<br> units : molecules cm-2<br> long_name : tropospheric vertical column of nitrogen dioxide<br></p>
<p><br></p>
<p>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. <br></p>
<p>Thanks into advance for help,<br></p>
<p>Markus<br></p>
<p><br></p>
<p><br></p>
<p><br></p>
</div>_______________________________________________
<br> ncl-talk mailing list
<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noopener" target="_blank">ncl-talk@ucar.edu</a>
<br> List instructions, subscriber options, unsubscribe:
<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noopener" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
<br>
</blockquote>
</div>_______________________________________________
<br> ncl-talk mailing list
<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noopener" target="_blank">ncl-talk@ucar.edu</a>
<br> List instructions, subscriber options, unsubscribe:
<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noopener" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
<br>
</blockquote>
</div>
</blockquote>
<p><br> </p>
</div>
</blockquote></div>