Re: [Fwd: NCL question]

From: Mary Haley (haley AT XXXXXX)
Date: Mon Jul 29 2002 - 14:56:21 MDT

  • Next message: Dennis Shea: "Re: [Fwd: NCL question]"

    >
    > i'm trying to run the following straightforward script. it runs
    > completely through with no errors - but i get an empty map with no SST
    > anomalies (i'm trying to plot the Reynolds SST anomaly data from last
    > week).
    >
    > here is the script. am i doing something onviously wrong with respect to
    > setting the graphics control "res@"

    Dear Ncl-talkers,

    I just wanted to mention what was going on with this script, so that
    others might benefit from the answer. The data file
    "reynolds_ssta.cdf" had the value "NaN" as a value for the
    "missing_value" attribute of "ssta" and then there were several "NaN"s
    in the "ssta" data as well.

    NCL will not recognize "NaN", even as a missing value. You need to have
    an actual number like "1e36" or "-9999" for the missing value.

    If you get "NaN"s in your netCDF data file, then you might want to go
    back to the source that created the file, and make sure that you write
    out real values instead of NaNs.

    --Mary

    > ;******************************************************
    > 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"
    > begin
    > ;************************************************
    > ; read the file
    > ;************************************************
    > in = addfile("/tigris/dt/hcullen/NCL/data/reynolds_ssta.cdf","r")
    > vars = getfilevarnames(in)
    > print(vars)
    > nvars = dimsizes(vars)
    > ssta = in->ssta
    > T= in->T
    > lat = in->Y
    > lon = in->X
    > printVarSummary(ssta)
    > ;************************************************
    > ; assign variables and reorder lat and lon
    > ;************************************************
    > ssta!0="T"
    > ssta!1="lat"
    > ssta!2="lon"
    > ;************************************************
    > ; create plot
    > ;************************************************
    > wks = gsn_open_wks("X11","hotspots")
    > gsn_define_colormap(wks,"gui_default")
    >
    > res = True ; plot options desired
    > res@mpGridAndLimbOn = False ; turn on lat/lon lines
    > res@mpGridLatSpacingF = 30. ; spacing for lat lines
    > res@mpGridLonSpacingF = 30. ; spacing for lon lines
    >
    > res@gsnSpreadColors = True
    > res@cnFillOn = True ; turn on color fill
    > res@cnInfoLabelOn = False ; turn off contour info
    > label
    > res@cnLinesOn = False ; turn off contour lines
    > res@cnLineLabelsOn = False ; turn off line labels
    >
    > res@gsnAddCyclic = False ; data already has cyclic
    > point
    >
    > res@mpOutlineOn = True ; turn on continental
    > outlines
    > res@mpOutlineBoundarySets = "National" ; add country boundaries
    > res@lbLabelBarOn = False ; No single label
    > bar
    >
    > res@cnLevelSelectionMode = "ManualLevels" ; manual contour levels
    > res@cnMinLevelValF = -5.0 ; min level
    > res@cnMaxLevelValF = 5.0 ; max level
    > res@cnLevelSpacingF = 0.1 ; interval
    >
    > printVarSummary(ssta)
    > plot = gsn_csm_contour_map_ce(wks,ssta(0,:,:), res)
    > end
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Mon Jul 29 2002 - 14:59:44 MDT