Re: set grid point to missing value

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 7 Sep 2009 16:26:35 -0600

Hi Jeanne,

It looks like you are mixing the case of your variable name. In one
place
you have "areaFdSel" and another place you have "areaFDSel". NCL's
variables are case sensitive, so make sure you use the same name.
Note that your missing value in the print statement below is "1e20"
and not -999. The value 1e20 is a better one to use than -999.

I recommend reorganizing your code so that _FillValue is being set
immediately after it is initialized. Also, use the "_FillValue"
attribute
to set "(:,0,1)" to missing, rather than "1e20":

areaFdSel = fd20a1bCC(:,{llats:llatn},{llonw:llone})
areaFdSel@_FillValue = 1e20
areaFdSel(:,0,1) = areaFdSel@_FillValue

--Mary

On Sep 7, 2009, at 5:37 AM, Jeanne Thibeault wrote:

> Hello everyone,
>
> I need to do some calculations in a small region using model output
> with nlat = 3 and nlon = 2. One of these gridpoints doesn't meet
> the criteria to be included in the calculations, so I would like to
> be able to set the values for the grid point to the missing value.
> I have been unable to find a good example of how I might do this. A
> sample of my script is below. The grid point I want to leave out is
> lat dim(0) and lon dim(1). Is there an easy way to do this? Thank
> you for your help.
>
> Jeanne
>
> llats = -19 ;lat and lon range
> llatn = -16
> llonw = 290
> llone = 293
> ;************************************************
>
> areaFdSel = fd20a1bCC(:,{llats:llatn},{llonw:llone})
> printVarSummary(areaFdSel)
>
> nlat = 3
> nlon = 2
>
>
> areaFdSel(:,0,1) = -999
> areaFDSel@_FillValue = -999
> print(areaFDSel)
>
> Variable: areaFDSel
> Type: float
> Total Size: 4800 bytes
> 1200 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 200] x [lat | 3] x [lon | 2]
> Coordinates:
> time: [11132.5..36317.5]
> lat: [-18.9103572532454..-16.1088241568413]
> lon: [291.09375..292.5]
> Number Of Attributes: 10
> comment : Added PCMDI-required metadata and renamed field
> to CF 1.0 compliance
> history : Created using NCL code CCSM_A4_20thc.ncl on
> machine mineral
> missing_value : 1e+20
> long_name : Total number of frost days
> original_units : days
> original_name : Total number of frost days
> cell_methods : time: mean (interval: 1 year)
> units : days
> standard_name : Total number of frost days
> _FillValue : 1e+20
> (0,0,0) 0
> (0,0,1) 32
> (0,1,0) 4
> (0,1,1) 1
> (0,2,0) 2
> (0,2,1) 0
> (1,0,0) 1
> (1,0,1) 38
> (1,1,0) 2
> (1,1,1) 2
> (1,2,0) 1
> (1,2,1) 0
> (2,0,0) 3
> (2,0,1) 56
> (2,1,0) 17
> (2,1,1) 11
> (2,2,0) 9
> (2,2,1) 1
> (3,0,0) 5
> (3,0,1) 48
> (3,1,0) 19
> (3,1,1) 6
> (3,2,0) 8
> (3,2,1) 0
> (4,0,0) 2
> (4,0,1) 60
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 07 2009 - 16:26:35 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 08 2009 - 11:49:50 MDT