[ncl-talk] Problems on Reading Satellite Date

Dennis Shea shea at ucar.edu
Tue Jun 13 09:09:19 MDT 2017


Please do not send offline emails to me. Reply only to ncl-talk.

" Sorry to bother you again. Your reply help me a lot. But my problem have
not solved completely. The problem is that: There is a station(such as lat
:116.1123E, lon: 36.2323N), and I want to extract the wind_speed on this
station, how can I do it ? "

=============================
Well, I am not going to do any interpolation. The following gives you the
value of the closest grid point to the station.

[SNIP]

; read & unpack desired variables
; https://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml

  spd = short2flt( fi->wind_speed )                  ; short
wind_speed(NUMROWS, NUMCELLS)
  printVarSummary(spd)
  printMinMax(spd,0)                                 ; min=0.2      max=19.7
  nspd_msg = num(ismissing(spd))
  print("nspd_msg="+nspd_msg)                        ; nspd_msg=119050
  print("---------")

; 116.1123E, 36.2323N     <==================

  LON = 116.1123
  LAT =  36.2323

  spd1d  = ndtooned(spd)
  lat1d  = ndtooned(lat2d)
  lon1d  = ndtooned(lon2d)
  igood  = ind(.not.ismissing(spd1d))
  gcdist = gc_latlon(LAT,LON,lat1d(igood),lon1d(igood), 2,2)
  printVarSummary(gcdist)

  imin   = minind(gcdist)

  spd_loc = spd1d(imin)
  print(spd_loc)

======================
Variable: spd_loc
Type: float
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:    [1]
Coordinates:
Number Of Attributes: 1
  _FillValue :    -32767
(0)    3.24



On Mon, Jun 12, 2017 at 9:22 PM, 宫明晓 <gongmingxiao1988 at 163.com> wrote:

> Dear Shea,
>    Sorry to bother you again. Your reply help me a lot. But my problem
> have not solved completely. The problem is that: There is a station(such as
> lat :116.1123E, lon: 36.2323N), and I want to extract the wind_speed on
> this station, how can I do it ?
>
>
>
>
>
> At 2017-06-12 11:43:44, "Dennis Shea" <shea at ucar.edu> wrote:
>
> Please *look* at your file dump. In particular, look at the variable types
> (integer, short) and the scale_factor and add_offset attributes.
>
> See attached.
> ===========
> There are numerous satellite swath examples:
>
> https://www.ncl.ucar.edu/Applications/HDF.shtml
>
> Good luck
>
>
> On Sun, Jun 11, 2017 at 1:30 AM, 宫明晓 <gongmingxiao1988 at 163.com> wrote:
>
>> Dear NCL team,
>>
>>    I have read a satellite grid data, but  I want to read the data on the
>> fixed longitude and latitude, so I need to change the data from data(
>> NUMROWS, NUMCELLS) to data(lat,lon), how can I do it?
>> Sorry my English is very poor.
>> Thank you very much!
>>
>>
>> ;;-------------------------------------------------------------
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> ;;----------------------------------------------------------
>> --------------
>>
>> f=addfile("ascat_20130416_134200_metopa_33683_eps_o_coa_2101_ovw.l2.nc
>> ","r")
>> u_speed=f->wind_speed
>> vs = new(dimsizes(f->wind_speed),float,-99999)
>> vs =(f->wind_speed)*0.01
>>
>> lat2d = f->lat
>> lon2d = f->lon
>> lat2d at units = "degrees_north"
>> lon2d at units = "degrees_east"
>>
>> vs at lat2d          = lat2d
>> vs at lon2d        = lon2d
>> vs at units          =    "ms-1"
>> vs at coordinmates      = "lat2d lon2d"
>>
>> print(vs({11},{11}))  ;;;*how can I print the data like this type??????*
>>
>>
>>
>>
>> *;;PrintVarSummary(f)*
>>
>> Variable: f
>> Type: file
>> filename: ascat_20130416_134200_metopa_33683_eps_o_coa_2101_ovw.l2
>> path: ascat_20130416_134200_metopa_33683_eps_o_coa_2101_ovw.l2.nc
>>   file global attributes:
>>      title : MetOp-A ASCAT Level 2 Coastal Ocean Surface Wind Vector
>> Product
>>      title_short_name : ASCAT-L2-Coastal
>>      Conventions : CF-1.4
>>      institution : EUMETSAT/OSI SAF/KNMI
>>      source : MetOp-A ASCAT
>>      software_identification_level_1 : 801
>>      instrument_calibration_version : 0
>>      software_identification_wind : 2101
>>      pixel_size_on_horizontal : 12.5 km
>>      service_type : eps
>>      processing_type : O
>>      contents : ovw
>>      granule_name : ascat_20130416_134200_metopa_3
>> 3683_eps_o_coa_2101_ovw.l2.nc
>>      processing_level : L2
>>      orbit_number : 33683
>>      start_date : 2013-04-16
>>      start_time : 13:42:00
>>      stop_date : 2013-04-16
>>      stop_time : 15:23:58
>>      equator_crossing_longitude :  116.924
>>      equator_crossing_date : 2013-04-16
>>      equator_crossing_time : 13:41:03
>>      rev_orbit_period : 6081.7
>>      orbit_inclination : 98.7
>>      history : N/A
>>      references : ASCAT Wind Product User Manual, http://www.osi-saf.org/,
>> http://www.knmi.nl/scatterometer/
>>      comment : Orbit period and inclination are constant values. All wind
>> directions in oceanographic convention (0 deg. flowing North)
>>      creation_date : 2013-04-16
>>      creation_time : 16:27:43
>>   dimensions:
>>      NUMROWS = 3259
>>      NUMCELLS = 82
>>   variables:
>>      integer time ( NUMROWS, NUMCELLS )
>>         _FillValue : -2147483647 <(214)%20748-3647>
>>         missing_value : -2147483647 <(214)%20748-3647>
>>         valid_min : 0
>>         valid_max : 2147483647 <(214)%20748-3647>
>>         long_name : time
>>         units : seconds since 1990-01-01 00:00:00
>>         coordinates : lat lon
>>
>>      integer lat ( NUMROWS, NUMCELLS )
>>         _FillValue : -2147483647 <(214)%20748-3647>
>>         missing_value : -2147483647 <(214)%20748-3647>
>>         valid_min : -9000000
>>         valid_max : 9000000
>>         long_name : latitude
>>         units : degrees_north
>>         scale_factor : 1e-05
>>         add_offset :   0
>>
>>      integer lon ( NUMROWS, NUMCELLS )
>>         _FillValue : -2147483647 <(214)%20748-3647>
>>         missing_value : -2147483647 <(214)%20748-3647>
>>         valid_min : 0
>>         valid_max : 36000000
>>         long_name : longitude
>>         units : degrees_east
>>         scale_factor : 1e-05
>>         add_offset :   0
>>
>>      short wvc_index ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : 0
>>         valid_max : 999
>>         long_name : cross track wind vector cell number
>>         units : 1
>>         coordinates : lat lon
>>
>>      short model_speed ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : 0
>>         valid_max : 5000
>>         long_name : model wind speed at 10 m
>>         units : m s-1
>>         scale_factor : 0.01
>>         add_offset :   0
>>         coordinates : lat lon
>>
>>      short model_dir ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : 0
>>         valid_max : 3600
>>         long_name : model wind direction at 10 m
>>         units : degree
>>         scale_factor : 0.1
>>         add_offset :   0
>>         coordinates : lat lon
>>
>>      short ice_prob ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : 0
>>         valid_max : 1000
>>         long_name : ice probability
>>         units : 1
>>         scale_factor : 0.001
>>         add_offset :   0
>>         coordinates : lat lon
>>
>>      short ice_age ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : -5000
>>         valid_max : 5000
>>         long_name : ice age (a-parameter)
>>         units : dB
>>         scale_factor : 0.01
>>         add_offset :   0
>>         coordinates : lat lon
>>
>>      integer wvc_quality_flag ( NUMROWS, NUMCELLS )
>>         _FillValue : -2147483647 <(214)%20748-3647>
>>         missing_value : -2147483647 <(214)%20748-3647>
>>         valid_min : 0
>>         valid_max : 8388607
>>         long_name : wind vector cell quality
>>         coordinates : lat lon
>>         flag_masks : <ARRAY of 17 elements>
>>         flag_meanings : distance_to_gmf_too_large data_are_redundant
>> no_meteorological_background_used rain_detected rain_flag_not_usable
>> small_wind_less_than_or_equal_to_3_m_s large_wind_greater_than_30_m_s
>> wind_inversion_not_successful some_portion_of_wvc_is_over_ice
>> some_portion_of_wvc_is_over_land variational_quality_control_fails
>> knmi_quality_control_fails product_monitoring_event_flag
>> product_monitoring_not_used any_beam_noise_content_above_threshold
>> poor_azimuth_diversity not_enough_good_sigma0_for_wind_retrieval
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *      short wind_speed ( NUMROWS, NUMCELLS )         _FillValue : -32767
>>         missing_value : -32767         valid_min : 0         valid_max :
>> 5000         long_name : wind speed at 10 m         units : m s-1
>>         scale_factor : 0.01         add_offset :   0         coordinates :
>> lat lon*
>>
>>      short wind_dir ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : 0
>>         valid_max : 3600
>>         long_name : wind direction at 10 m
>>         units : degree
>>         scale_factor : 0.1
>>         add_offset :   0
>>         coordinates : lat lon
>>
>>      short bs_distance ( NUMROWS, NUMCELLS )
>>         _FillValue : -32767
>>         missing_value : -32767
>>         valid_min : -500
>>         valid_max : 500
>>         long_name : backscatter distance
>>         units : 1
>>         scale_factor : 0.1
>>         add_offset :   0
>>         coordinates : lat lon
>>
>>
>>
>> _______________________________________________
>> 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/20170613/e0190144/attachment.html 


More information about the ncl-talk mailing list