[ncl-talk] smops interpolation
Ehsan Taghizadeh
ehsantaghizadeh at yahoo.com
Wed Sep 12 05:15:53 MDT 2018
Hi,Again Thank you so much for your helpful comments.
Unfortunately after a few days I still have problem with interpolating data on station points. In spite of using "poisson_grid_fill" and "linmsg" to avoid getting Fill_Value on unstructured points, these don't work; all values for all dates and all points are Fill_value (-0.099900) (attached file: 20_SMOPS_Interp.txt). Could I have any suggestion to get interpolated values other than "-0.099900". I've used this script for some data set and it helps me a lot. But for some data set, like SMOPS data, it gives me just Fill_Value.I know using "knnsearch" in matlab gives values except "-0.099900", however I want to interpolate with ncl.I've attached the script (20_SMOPS_Interp.ncl) and also station points (2_stations.dat) and output file (20_SMOPS_Interp.txt). I've also put zipped input data (SMOPS_Data.tgz) on ftp.
I'll be thankful for any help.
SincerelyEhsan
On Friday, September 7, 2018, 8:25:16 PM GMT+4:30, Dennis Shea <shea at ucar.edu> wrote:
[1] No[2] Yes
nlat = 720
latitude = fspan(-49.875, 49.875, nlat)
latitude at units = "degrees_north"
latitude at long_name = "latitude"
latitude!0 = "latitude"
latitude&latitude = latitude
printVarSummary(latitude)
printMinMax(latitude,0)
mlon = 1440
longitude = lonGlobeFo(mlon, "longitude", "longitude", "degrees_east") ; 0->360
longitude = (/ longitude - 180. /) ; subtract 180 from all values
longitude&longitude = longitude ; update coordinates printVarSummary(lon)
printVarSummary(longitude)
printMinMax(longitude,0)
f = addfile("NPR_SMOPS_CMAP_D20170 410.nc","r")
x = short2flt( f->Blended_SM )
x&latitude = latitude
x&longitude = longitude
printVarSummary(x)
[3]/[4]
xo = .... longitudes of land points...
yo = ... latitudes ....
xpts = linint2_points(x&longitude,x&latitude,x, False, xo,yo, 0)
printVarSummary(xpts)
printMinMax(xpts,0)
On Tue, Sep 4, 2018 at 5:50 AM, Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com> wrote:
Thank you so much for your nice reply, as always.
I did your comments, however I encountered some difficulties and I'll be thankful if I could have any help about them, too.
1. Should I changelatitude = fspan(-49.875, 49.875, nlat)tolatitude = fspan(-89.875, 89.875, nlat)or like longitude, uselat = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
2. Should I changelatitude at units = "degrees_east"tolatitude at units = "degrees_north"
3. How should I control FillValue (-999s), because after running ncl script, it writes -0.1 for Nan value of the data, both in grided and interpolated output files.4. However the most difficulty is the interpolating part, because all interpolated values for all station points got -0.1, means Nan. There is no value except -0.1 for any station points. Could anybody help me about this?I've attached the output of interpolated file. I'll be thankful for any help.
Sincerely
Ehsan
On Friday, August 31, 2018, 6:14:53 PM GMT+4:30, Dennis Shea <shea at ucar.edu> wrote:
Sometimes, you have to read documentation associated with the file(s)
Soil Moisture Operational Products System (SMOPS)
The file has:
netcdf NPR_SMOPS_CMAP_D20170410 {
dimensions:
Longitude = 1440 ;
Latitude = 720 ;
variables:
short Blended_SM(Latitude, Longitude) ;
Blended_SM:long_name = "Blended Soil Moisture" ;
Blended_SM:units = "m^3/m^3" ;
Blended_SM:FillValue = -999s ;
Blended_SM:valid_range = 0s, 10000s ;
Blended_SM:scale_factor = 0.0001f ;
Blended_SM:add_offset = 0.f ;
[SNIP]
:Product_Resolution = "0.25 degree" ;
:Date_Start = "20170410" ;
:Date_End = "20170410" ;
[SNIP]
====
It does not have Latitude[*] and Longitude[*] coordinates. However, *you* can create them. Then, use ESMF or (say) linint2_Wrap or linint2_points_Wrap to perform the interpolation.
====
nlat = 720
latitude = fspan(-49.875, 49.875, nlat)
latitude at units = "degrees_east"
latitude at long_name = "latitude"
latitude!0 = "latitude"
latitude&latitude = latitude
printVarSummary(latitude)
printMinMax(latitude,0)
mlon = 1440
longitude = lonGlobeFo(mlon, "longitude", "longitude", "degrees_east") ; 0->360
longitude = (/ longitude - 180. /) ; subtract 180 from all values
longitude&longitude = longitude ; update coordinates printVarSummary(lon)
printVarSummary(longitude)
printMinMax(longitude,0)
f = addfile("NPR_SMOPS_CMAP_D20170 410.nc","r")
x = short2flt( f->Blended_SM )
x&latitude = latitude
x&longitude = longitude
printVarSummary(x)
On Fri, Aug 31, 2018 at 5:45 AM, Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com> wrote:
Hi,Until now I've asked some questions related to interpolating some dataset on some unstructured points (synoptic stations). Now I have a new data set which I'm not sure about appropriate method to interpolating. I put one of my data (NPR_SMOPS_CMAP_D20170410.nc) in ftp.cgd.ucar.edu. I'll be thankful if some one could refer me to correct script, like on (https://www.ncl.ucar.edu/ Applications/ESMF.shtml) or (https://www.ncl.ucar.edu/ Applications/regrid.shtml), which interpolates my data on some special unstructured points.However the printVarSummary(Blended_SM) result is as below:
Variable: Blended_SMType: floatTotal Size: 4147200 bytes 1036800 valuesNumber of Dimensions: 2Dimensions and sizes: [Latitude | 720] x [Longitude | 1440]Coordinates:Number Of Attributes: 5 _FillValue : 1e+20 long_name : Blended Soil Moisture units : m^3/m^3 FillValue : -999 valid_range : ( 0, 1 )
Sincerely
Ehsan
______________________________ _________________
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/20180912/52c0a162/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_stations.dat
Type: application/octet-stream
Size: 16222 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180912/52c0a162/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20_SMOPS_Interp.ncl
Type: application/octet-stream
Size: 5583 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180912/52c0a162/attachment-0003.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20_SMOPS_Interp.txt
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180912/52c0a162/attachment-0001.txt>
More information about the ncl-talk
mailing list