<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Adv,<br>
    <br>
    have you read the warning messages NCL returned? Your latitude and
    longitude arrays do not have the correct units like degrees_north or
    degrees_east. The solution is to add the units attribute to lat and
    lon, so NCL will know how to handle them.<br>
    <br>
    lat@units = "degrees_north"<br>
    lon@units = "degrees_east"<br>
    <br>
    Bye,<br>
    Karin<br>
    <br>
    <div class="moz-cite-prefix">Am 18.12.15 um 08:24 schrieb Adv:<br>
    </div>
    <blockquote
cite="mid:CAHfbfHvbuND03ZZn6PYSOcvcs6FACEbDUqc38vMaMnPAb7cHRg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Hi,<br>
          </div>
          I have been trying to do objective analysis only over the
          region of longitude from -116 to -90.35 and latitude of  40.01
          to 49. While plotting the output, the values are spreaded over
          the global region. I don't understand where is wrong. It's
          been long I am kinda stuck with this objective analysis. I
          have attached here the output figure and code too. Could
          someone please help me to fix this? <br>
          <br>
          begin<br>
           strll  = asciiread("stationmac.txt", -1, "string") ;<br>
            print(strll)   ; STATION","STATION_NAME", "LAT", "LON"<br>
            print("=====")<br>
          <br>
          sloc = str_get_field(strll , 2, ",")<br>
            lat  = tofloat( str_get_field(strll , 3, ",")  )<br>
            lon  = tofloat( str_get_field(strll , 4, ",")  )<br>
            print(sloc +" : "+lat+" "+lon)<br>
          mnlat=(min(lat))<br>
          mxlat=(max(lat))<br>
          mnlon=(min(lon))<br>
          mxlon=(max(lon))<br>
          ;print(lon)<br>
          print(mnlon)<br>
          print(mxlon)<br>
          print(mnlat)<br>
          print(mxlat)<br>
          mlon = 390<br>
          dlon = -90.35 / mlon<br>
          lonn  = fspan (-116, (mlon - 1) * dlon, mlon)<br>
          print(lonn)<br>
          mlat = 390<br>
          dlat = 49.0 / mlat<br>
          latt  = fspan (40.01, (mlat - 1) * dlat, mlat)<br>
          print(latt)<br>
          ;gcdist = gc_latlon(mnlat,mnlon, mxlat,mxlon, 300,2)<br>
          ;print(gcdist)<br>
          ;print (gcdist@gclat+"  "+gcdist@gclon )<br>
          ;return<br>
          ;latt=gcdist@gclat<br>
          ;lonn=gcdist@gclon<br>
          ;print(min(latt))<br>
          ;print(max(latt))<br>
          ;print(max(lonn))<br>
          ;print(min(lonn))<br>
          diri="/home/dailysimms/prec-obs/01/"<br>
          z1 = asciiread(diri+"PrecJan1965-2014",-1,"float")<br>
          ;print(z1)<br>
          ;printVarSummary(z1)<br>
          ;a = (/1,2,3,4,5,6,7,8/)<br>
          ;390 rows by 50 columns<br>
          a0 = onedtond(z1,(/390,50/))<br>
          ;print(a0)<br>
          x=dim_avg(a0)<br>
          print(x)<br>
          set_default_fillvalue("string",  "")<br>
          zi = natgrid(lon, lat, x, lonn, latt)<br>
          print(zi)<br>
          zi!0="lat"<br>
          zi!1="lon"<br>
          zi&amp;lat=latt<br>
          zi&amp;lon=lonn<br>
          printVarSummary(zi)<br>
          print(zi)<br>
            opt    = True<br>
          opt@timing = True<br>
            rscan  = (/20,15,10, 5,3 /)<br>
          grid   = obj_anal_ic_deprecated(lon, lat, x, lonn, latt,
          rscan, opt)<br>
          printVarSummary(grid)<br>
          print(grid)<br>
          print(min(grid))<br>
          print(max(grid))<br>
          grid!0="lt"<br>
          grid!1="ln"<br>
          grid&amp;lt=latt<br>
          grid&amp;ln=lonn<br>
          printVarSummary(grid)<br>
          ;return<br>
;------------------------------------------------------------------<br>
          ; plot<br>
;------------------------------------------------------------------<br>
            wks      = gsn_open_wks("pdf","rdm2grid")<br>
            gsn_define_colormap(wks,"amwg")<br>
           plot     = new(2,graphic)<br>
          <br>
            res                     = True<br>
            res@gsnDraw             = False           ; don't draw<br>
            res@gsnFrame            = False           ; don't advance
          frame<br>
            res@cnFillOn            = True            ; turn on color<br>
           ;res@cnLinesOn           = False           ; turn off contour
          lines<br>
            res@cnLineLabelsOn      = False           ; turn off contour
          line labels<br>
            res@gsnSpreadColors     = True            ; spread out color
          table<br>
            res@lbLabelBarOn        = False           ; turn off
          individual cb's<br>
          <br>
          <br>
          res@gsnCenterString = "Original grid"<br>
            plot(0) = gsn_csm_contour_map_ce(wks,zi,res)<br>
          <br>
            plot(1) = gsn_csm_contour_map_ce(wks,grid,res)<br>
          ;************************************************<br>
          ; create panel<br>
          ;************************************************<br>
            resP                     = True                ; modify the
          panel plot<br>
           ;resP@txString            = title<br>
            resP@gsnMaximize         = True                ; make large<br>
            resP@gsnPanelLabelBar    = True                ; add common
          colorbar<br>
            resP@lbLabelAutoStride   = True                ; Let NCL
          decide spacing<br>
           ;resP@lbLabelStride       = 2                   ; force every
          other label<br>
           ;resP@lbLabelFontHeightF  = 0.0125              ; make labels
          smaller [0.2 default]<br>
          <br>
            gsn_panel(wks,plot,(/2,1/),resP)            ; now draw as
          one plot<br>
          <br>
          end<br>
          <br>
        </div>
        Warning message:<br>
        (0)    check_for_y_lat_coord: Warning: Data either does not
        contain a valid latitude coordinate array or doesn't contain one
        at all.<br>
        (0)    A valid latitude coordinate array should have a 'units'
        attribute equal to one of the following values: <br>
        (0)        'degrees_north' 'degrees-north' 'degree_north'
        'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN'
        'degreesN' 'deg north'<br>
        (0)    check_for_lon_coord: Warning: Data either does not
        contain a valid longitude coordinate array or doesn't contain
        one at all.<br>
        (0)    A valid longitude coordinate array should have a 'units'
        attribute equal to one of the following values: <br>
        (0)        'degrees_east' 'degrees-east' 'degree_east' 'degrees
        east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE'
        'deg east'<br>
        (0)    check_for_y_lat_coord: Warning: Data either does not
        contain a valid latitude coordinate array or doesn't contain one
        at all.<br>
        (0)    A valid latitude coordinate array should have a 'units'
        attribute equal to one of the following values: <br>
        (0)        'degrees_north' 'degrees-north' 'degree_north'
        'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN'
        'degreesN' 'deg north'<br>
        (0)    check_for_lon_coord: Warning: Data either does not
        contain a valid longitude coordinate array or doesn't contain
        one at all.<br>
        (0)    A valid longitude coordinate array should have a 'units'
        attribute equal to one of the following values: <br>
        (0)        'degrees_east' 'degrees-east' 'degree_east' 'degrees
        east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE'
        'deg east'<br>
        <br>
        <div><br>
          <br>
          <br>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
  </body>
</html>