[ncl-talk] Data projected in a Wrong Location on Map

Mansur Ali Jisan jisan.mansur at gmail.com
Sun Dec 2 21:27:49 MST 2018


Dear NCL Community,

I'm facing some problems in projecting my data properly on a map. I'm
working with a NetCDF file from a parametric wind model for the case of
Hurricane Irma. The variable that I'm trying to plot is u10. The problem is
that it doesn't have any coordinate values attached to it. But from the
input data, I know the extent of latitude and longitude. So, I defined that
in the NCL script but from the visualization, the location of the center
position was shown in a wrong position.

Following is the script that I tried:

*load *"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
*load* "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
;---Read data
  f1    = addfile("boundary_parametric.nc","r")
  u = f1->u10   ; 97 x 1202 x 1202
  lat2d   = fspan(13,47,1202)
  lon2d   = fspan(-95,-58,1202)
 printVarSummary(u)
 printVarSummary(lat2d)
 printVarSummary(lon2d)
  u!1="lat2d"
  u!2="lon2d"

  u at lat2d=lat2d
  u at lon2d=lon2d

  u&lat2d at units = "degrees_north"
  u&lon2d at units = "degrees_east"

  printVarSummary(u)


;---Start the graphics
  wks = gsn_open_wks("png","irma-u10")
  gsn_define_colormap(wks,"matlab_jet")
;---Set some resources
  res                = True
  res at gsnMaximize    = True     ; maximize plot in frame
  res at gsnAddCyclic   = False
  res at cnFillOn       = True     ; turn on contour fill
  res at cnLinesOn      = False    ; turn off contour lines
  res at cnLineLabelsOn = False    ; turn off contour line labels
  res at gsnScalarContour            = True          ; contours desired
  res at tiMainString   = "Hurricane Irma"
  res at trGridType           = "TriangularMesh"
  res at gsnScalarContour = True
  res at cnLevelSelectionMode = "AutomaticLevels"
  res at mpProjection                = "CylindricalEquidistant"      ;
projection
  res at mpDataBaseVersion           = "MediumRes"          ; use more
detailed maps
  res at mpLimitMode = "LatLon"
  res at mpMinLatF = 13.0
  res at mpMaxLatF = 47.0
  res at mpMinLonF = -95.0
  res at mpMaxLonF = -58.0
  res at tfDoNDCOverlay              = True                 ; do not transform
data

  plot = gsn_csm_contour_map(wks,u(3,:,:),res)

end

*NCL_Filedump* for the input file is the following:

Variable: f
Type: file
filename:       boundary_parametric
path:   boundary_parametric.nc
   file global attributes:
      time-units : start time: 2017-09-10 00:06:00 +00:00
   dimensions:
      y_axis = 1202
      x_axis = 1202
      time = 97  // unlimited
   variables:
      double y_axis ( y_axis )
         units :        unit-less

      double x_axis ( x_axis )
         units :        unit-less

      float time ( time )
         units :        hours

        float utx ( time )
         units :

      float uty ( time )
         units :

      float rmax ( time )
         units :

      float wsmax ( time )
         units :

      float u10 ( time, y_axis, x_axis )
         units :        m/s

      float v10 ( time, y_axis, x_axis )
         units :        m/s

      float utop ( time, y_axis, x_axis )
         units :        m/s

      float vtop ( time, y_axis, x_axis )
         units :        m/s

Please let me know if any additional information needed.

Thanks in advance!

Mansur

-- 
*Mansur Ali Jisan*
Ph.D. Student
URI Graduate School of Oceanography, RI 02882

<hasancee at iut-dhaka.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181202/f5a9545f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: irma-u10.png
Type: image/png
Size: 90737 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181202/f5a9545f/attachment.png>


More information about the ncl-talk mailing list