Re: How to fix this image

From: Ipshita Majhi <ipmajhi_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 21 2014 - 12:57:17 MDT

I have the Print Var summary. I was wondering how to remove the black
background. I want put boxes around the arctic extract the data specified
by those boxes based on those latitude and longitude



On Sat, Jul 19, 2014 at 8:40 AM, Alan Brammer <abrammer@albany.edu> wrote:

> If your file is the same as the one I just pulled from the below location=
.
> Then snow_cover_extent apparently only has 2 values (0 or 1) for no_snow
> or snow_covered.
>
>
> ftp://cdr.ncdc.noaa.gov/cdr/snowcover/nhsce_v01r01_19661004_20140630.nc
>
>
> Check a ncl_filedump of the file and you’ll possibly see the belo=
w:
>
> byte snow_cover_extent ( time, rows, cols )
> long_name : NOAA/NCDC Climate Data Record of snow cover extent
> standard_name : surface_snow_binary_mask
> grid_mapping : coord_system
> coordinates : longitude latitude time snow_cover_threshold
> valid_range : ( 0, 1 )
> flag_values : ( 0, 1 )
> flag_meanings : no_snow snow_covered
> _FillValue : -9
>
>
>
> If the contour levels wasn’t the issue, reply to the list with mo=
re
> specifics.
>
>
>
> Alan.
>
>
>
> ##############################
> Alan Brammer,
> PhD Student,
>
> Department of Atmospheric and Environmental Sciences,
> University at Albany, State University of New York, Albany, NY, 12222
> abrammer@albany.edu
> ##############################
>
> On Jul 18, 2014, at 8:04 PM, Ipshita Majhi <ipmajhi@alaska.edu> wrote:
>
> I have plotted snow cover data and I have attached lat and lon to it and
> when I plot I get this image
>
> Here is my code:-
> ;*******************************************
> 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"
>
> a =addfile("~/Documents/Snow_cover_IMS/nhsce_v01r01_19661004_20140602.n=
c
> ","r")
> sce=a->snow_cover_extent(0,:,:)
>
> lat=a->latitude(:,:)
>
> print(lat(:,1))
>
> lon=a->longitude(:,:)
> ;print(sce)
> ;print("Hello")
> ;printVarSummary(sce)
> ;printVarSummary(lat)
> ;printVarSummary(lon)
>
> delete_VarAtts(sce, -1)
>
> ;Attaching variables
> sce!0="lat2d"
> sce!1="lon2d"
>
> sce@lat2d=lat
> sce@lon2d=lon
>
>
>
> printVarSummary(sce)
>
>
> ; Plotting code
>
> wks = gsn_open_wks("ps","sce_ims")
> gsn_define_colormap(wks,"default")
>
>
> res = True
> res@cnFillOn = True
> res@cnLinesOn = False
> res@cnLineLabelsOn = False
> res@cnFillMode = "rasterfill"
> res@cnMissingValFillColor = 28 ; "gray"
>
> ;
> ; Since the data is categorical, values between the categories need to be
> ; excluded. Use Explicit level selection to accomplish this.
> ;
>
> res@cnLevelSelectionMode = "explicitlevels"
> res@cnLevels = (/ 0.99,1.99, 2.99, 3.99, 4.99 /)
> res@cnFillColors = (/ 1, 4, 19, 6, 0, 1 /) ; (/"black", "blue", "green"=
,
> "yellow", "white", "black" /)
> res@lbLabelAlignment = "boxcenters"
> res@lbLabelStrings = (/ "water", "land", "ice", "snow" /)
>
> ;
> ; First draw the plot without projecting into map coordinates.
> ; This has the drawback that only index values are used as tick marks
> ; but it is fast
> ;
> res@gsnPolar = "NH" ; specify the hemisphere
> plot = gsn_csm_contour_map_polar(wks,sce,res) ; create the plot
>
>
> What is missing?
>
> <sce_ims.ps>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

Received on Mon Jul 21 06:57:23 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT