Re: confidence interval

From: Mateus Teixeira <mateus.teixeira_at_nyahnyahspammersnyahnyah>
Date: Thu, 2 Jul 2009 13:07:42 -0300

Hi Lei,

Let's assume that you have two files (or one only) which contain your
confident intervals boundaries and you read them (it) in NCL into two
arrays.
So, you can create two additional arrays, one for each boundary, like

do i = 0, nlat-1 ; <- for latitude
   do j = 0, nlon-1 ; <- for longitude
       if( myField( i, j ) .ge. upConfInterval( i, j ) ) then
; <= for upper boundary of confidence interval
             myMask_upConfInterval( i, j ) = 1
       else
             myMask_upConfInterval( i, j ) = 0
       end if
       if( myField( i, j ) .le. lowConfInterval( i, j ) )
then ; <= for lower boundary of confidence interval
             myMask_lowConfInterval( i, j ) = 1
       else
             myMask_lowConfInterval( i, j ) = 0
       end if
   end do
end do

Now, you can mask your field with this information, like

maskUp = myField ; <= just to
don't loose dims info
maskUp = mask( myField, myMask_upConfInterval, 1 )

maskLow = myField
maskLow = mask( myField, myMask_lowConfInterval, 1 )

Finally, you only have to plot using the scheme that I showed before, using
this arrays. But, you'll have two plots, one for lower boundary and another
for upper boundary.

Best regards,

Mateus

2009/7/2 Lei <dream916_at_gmail.com>

> Hi Mateus,
> Thank you for your suggestions. The figure provided is exactly what I
> want to get. A few more questions about your scripts:
> 1. are both the "mask" and "contourField" netCDF files created by putting
> 0 for below 90% confidence and 1 for above 90% confidence?
> 2. Confidence intervals have two boundaries (up and bottom). Is it
> possible to plot different colors for passing 90% confidence for up limit
> and low limit?
> Thanks,
> Lei
>
>
> On Wed, Jul 1, 2009 at 9:47 PM, Mateus Teixeira <mateus.teixeira_at_gmail.com
> > wrote:
>
>> Hi Lei,
>>
>> You can create another array in which you put 0 for below 90% confidence
>> and 1 for above 90% confidence. After, you can plot this array as filled
>> contours, without its contour, then plot above this field, the rainfall
>> field.
>>
>> As a result, you'll have your rainfall field with shades where it is above
>> 90% significant.
>>
>> See below
>>
>> mapa = True
>> mapa_at_gsnFrame = False
>> mapa_at_gsnDraw = False
>> mapa_at_gsnAddCyclic = False
>> mapa_at_cnFillOn = True ; c/
>> preenchimento de cores
>> mapa_at_cnLinesOn = False ; s/ linhas
>> mapa_at_cnLineLabelsOn = False ; s/ rotulos nas
>> linhas
>> mapa_at_cnMonoFillColor = True ; uma unica cor =
>> sombreado
>> mapa_at_cnFillColor = "grey" ; cor do
>> sombreado
>> mapa_at_lbLabelBarOn = False ; s/ barra de
>> cores
>> plot0 = gsn_csm_contour_map_ce( wks, mask, mapa ) ; plota sombreado
>>
>> mapa2 = True
>> mapa2_at_gsnFrame = False
>> mapa2_at_gsnDraw = False
>> mapa2_at_gsnAddCyclic = False
>> mapa2_at_cnFillOn = False
>> plot1 = gsn_csm_contour( wks, contourField, mapa2 )
>>
>> overlay( plot0, plot1 )
>> draw( plot0 )
>>
>> As you can see, plot0 is the shaded field and plot1 is the contour plot.
>> See, also, an attached figure showing the result of this plot.
>>
>> I hope I could help you
>>
>> Best regards,
>>
>> Mateus
>>
>>
>>
>>
>>
>> 2009/7/1 Lei <dream916_at_gmail.com>
>>
>>> Hi,
>>> I would like to highlight (shade) the regions with precipitation
>>> above or below 90% confidence limits. For each grid cell, the
>>> confidence limits are different. Is there any efficient way to do
>>> this? Thanks,
>>> Lei
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>>
>> --
>> Mateus da Silva Teixeira
>>
>> Registered Linux User #466740
>>
>
>

-- 
Mateus da Silva Teixeira
Registered Linux User #466740

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 02 2009 - 10:07:42 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 02 2009 - 11:39:38 MDT