<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi all<br>
<br>
I am trying to determine the significance of precipitation anomalies at each gridpoint over the Indian Ocean.<br>
I have calculated the pdfs at each gridpoint, in the script attached below and would like to display the spatial map of percentages from the pdfs over the Indian ocean to see how extreme the anomalies are over the chosen domain from 1000-1849AD.<br>
If anyone has advice on how to do this it would be much appreciated.<br>
<br>
Kindest Regards<br>
Melissa<br>
<br>
<br>
Code:<br>
;----------------------------------------------------------------------<br>
; pdf_1.ncl<br>
;----------------------------------------------------------------------<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" <br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" <br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
begin<br>
<br>
<br>
<br>
h=addfile("/mnt/geog/ml382/McGill_Project/pr/Scen2/PDF/pdf_ens_correct.nc", "r")
<br>
<br>
<br>
latS = -70.<br>
latN = 50. <br>
lonL = 0.<br>
lonR = 150.<br>
<br>
<br>
pr = h->pr<br>
lat = h->lat<br>
lon = h->lon<br>
<br>
nlat = dimsizes(lat)<br>
mlon = dimsizes(lon)<br>
<br>
opt = True<br>
opt@bin_nice = True<br>
<br>
do nl = 0, nlat-1<br>
do ml = 0, mlon-1<br>
<br>
nbins = 25<br>
pdf_gridpt = pdfx( pr(:,nl,ml),nbins,opt )<br>
printVarSummary(pdf_gridpt)<br>
<br>
<br>
printVarSummary(pdf_gridpt)<br>
print(pdf_gridpt)<br>
<br>
<br>
<br>
;create plot<br>
<br>
res = True ; plot mods desired<br>
<br>
res@cnFillOn = True ; turn on color for contours<br>
res@cnLinesOn = False ; turn off contour lines<br>
res@cnLineLabelsOn = False ; turn off contour line labels<br>
res@gsnScalarContour = True ; contours desired<br>
;res@cnFillPalette = cmap(17:,:) ; subset the color map<br>
<br>
<br>
res@lbOrientation = "Vertical" ; vertical label bar<br>
;res@pmLabelBarOrthogonalPosF = -0.01 ; move label bar closer<br>
<br>
; note, when doing a subregion, NCL determines the range of the data from<br>
; the full domain. If you wish to just consider the domain you are plotting,<br>
; you must manually set those levels.<br>
<br>
;res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels<br>
;res@cnMinLevelValF = 24.0 ; set min contour level<br>
;res@cnMaxLevelValF = 29 ; set max contour level<br>
;res@cnLevelSpacingF = 0.10 ; set contour spacing<br>
<br>
res@vcRefMagnitudeF = 1.0 ; define vector ref mag<br>
res@vcRefLengthF = 0.025 ; define length of vec ref<br>
;res@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector<br>
res@vcRefAnnoArrowLineColor = "black" ; change ref vector color<br>
res@vcRefAnnoArrowUseVecColor = False ; don't use vec color for ref<br>
<br>
res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors<br>
res@vcLineArrowColor = "black" ; change vector color<br>
res@vcLineArrowThicknessF = 2.0 ; change vector thickness<br>
res@vcVectorDrawOrder = "PostDraw" ; draw vectors last<br>
res@vcMinDistanceF = 0.02<br>
<br>
;res@gsnCenterString = "Difference in MME Wind Anomaly for Scen1 for the Non-Monsoon Season"<br>
res@gsnLeftString = ""<br>
res@gsnMainString = "" <br>
res@gsnRightString = ""<br>
<br>
res@mpMinLonF = lonL ; select a subregion<br>
res@mpMaxLonF = lonR<br>
res@mpMinLatF = latS<br>
res@mpMaxLatF = latN<br>
<br>
<br>
pres = True<br>
<br>
pres@mpFillOn = False<br>
pres@cnFillOn = True ; color on<br>
pres@cnLinesOn = False ; turn off contour lines<br>
pres@gsnScalarContour = True ; vectors over contours<br>
pres@gsnSpreadColors = True ; use full colormap<br>
;res@gsnSpreadColorEnd = -4 ; last color used<br>
pres@gsnAddCyclic = False<br>
;pres@gsnDraw = False ; do not draw the plot<br>
;pres@gsnFrame = False <br>
pres@lbLabelBarOn = True<br>
<br>
pres@gsnCenterString = "Difference in MME Wind Anomaly for Scen1 for the Non-Monsoon Season"<br>
pres@gsnLeftString = ""<br>
pres@gsnMainString = "" <br>
pres@gsnRightString = ""<br>
<br>
pres@mpMinLonF = lonL ; select a subregion<br>
pres@mpMaxLonF = lonR<br>
pres@mpMinLatF = latS<br>
pres@mpMaxLatF = latN<br>
<br>
<br>
pres@cnLevelSelectionMode= "ManualLevels" ; manual levels<br>
pres@cnMinLevelValF = 0.2 ; min level<br>
pres@cnMaxLevelValF = 2.8 ; max level<br>
pres@cnLevelSpacingF = 0.2 ; contour spacing<br>
<br>
<br>
wks = gsn_open_wks ("X11","PDF_mounttambora")<br>
gsn_define_colormap(wks,"WhiteBlueGreenYellowRed") ; choose colormap<br>
<br>
prres = True<br>
prres@gsnCenterString = "Precipitation PDF"<br>
<br>
<br>
plot = gsn_csm_xy (wks, pdf_gridpt@bin_center, pdf_gridpt, prres)<br>
plot1= gsn_csm_contour_map_ce(wks, pdf_gridpt, res)<br>
<br>
<br>
end do<br>
end do<br>
end<br>
<br>
</div>
</body>
</html>