Re: Error with dim_area_avg

From: Ipshita Majhi <ipmajhi_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 23 2014 - 16:05:39 MDT

Yes I did see the sce printVarSummary. I added latitude and longitude to it
and now I want extract sce data for particular latitude and longitude

I saw that after adding latitude and longitude
the values are

(87,87),0

Does that make it three dimension


On Wed, Jul 23, 2014 at 2:03 PM, Karin Meier-Fleischer <
meier-fleischer@dkrz.de> wrote:

> Alessandra is right, there is one } to much at the end of the following
> line:
>
> z2 = sce({10:30},{40:60},:,:}) ; select specific region
>
> it should be
>
> z2 = sce({10:30},{40:60},:,:) ; select specific region
>
> BUT your printVarSummary of the variable sce shows that the variable has
> only
> 2 dimensions (rows and cols) so either way the line z2 is incorrect.
>
> Bye,
> Karin
>
> Am 23.07.2014 um 23:14 schrieb Ipshita Majhi <ipmajhi@alaska.edu>:
>
> I am also adding the PrintVarSummary in addition to the other error
> Variable:sce
> Type:byte
> Total Size:7744 bytes
> :7744 bytes
> Number of dimensions :2
> Dimesions and sizes: [rows | 88]X [cols | 88]
> Coordinates :
> Number of attributes:9
> time:7
> long_name:NOAA/NCDC Climate Date 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
>
> *************
> Variable:lat
> Type:double
> Total Size : 61952 bytes
> 7744 values
> Number of Dimensions :2
> Dimensions and sizes: [rows | 88] X [cols | 88]
> Coordinates:
> Number of Attributes:5
> standard_name: latitude
> long_name: latitude of cell center in half mesh grid, based on NOAA NMC
> Limited Area Fine Mesh Grid
> Units : degree_north
> valid_range : (0,90)
> _FillValue: -999
>
> ************
> Variable: lon
> Type : double
> Total size: 61952 bytes
> 7744 values
> Number of Dimensions: 2
> Dimensions and sizes :[rows | 88] X [ cols | 88]
> Coordinates:
> Number of Attributes :5
> standard_name: longitude
> long_name: longitude of cell center in half mesh grid, base on NOAA NMC
> Limited Area Fine Mesh grid unites degrees_east
> valid_range(-180,180)
> _FillValue:: -999
>
>
> On Wed, Jul 23, 2014 at 1:13 PM, Ipshita Majhi <ipmajhi@alaska.edu> wrote:
>
>> Here are the error messages
>>
>> fatal: error in statement
>> fatal: syntax error : line 3 in file
>> area_avg_ims_sce.ncl
>>
>> *
>> ^
>> fatal : error in statement
>> fatal: syntax error :line 22 in file
>> area_avg_ims_sce.ncl before or near }
>>
>> z2=sce({10:30},{40:60},:,:}
>>
>> fatal:sytax error : line 32 in file area_avg_ims_sce.ncl before or near ;
>> create
>> timeXlong array
>> z2ma=dim_avg_wrap(z2(time
>> fatal:syntax error: line -1 before or near
>> ^
>> fatal: error in statement
>>
>>
>> On Wed, Jul 23, 2014 at 12:48 PM, Karin Meier-Fleischer <
>> meier-fleischer@dkrz.de> wrote:
>>
>>> Please send the complete error message.
>>>
>>>
>>> Am 23.07.2014 um 22:32 schrieb Ipshita Majhi <ipmajhi@alaska.edu>:
>>>
>>> Why is this not working? It says the synatax at Z2 is not correct
>>>
>>> ************************************************
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>> ;************************************************
>>> begin
>>> ;************************************************
>>> ; read in netCDF file
>>> ;************************************************
>>> a =addfile("~/Documents/Snow_cover_IMS/
>>> nhsce_v01r01_19661004_20140602.nc","r")
>>>
>>> sce=a->snow_cover_extent(0,:,:)
>>> lat=a->latitude
>>> lon=a->longitude
>>>
>>>
>>> ;Attaching latitude and longitude to sce
>>> sce@lat2d=lat
>>> sce@lon2d=lon
>>>
>>> z2 = sce({10:30},{40:60},:,:}) ; select specific region
>>> delete(sce)
>>> printVarSummary(z2)
>>>
>>> z2Area = wgt_areaave_Wrap(z2,1.0,1.0,0) ; create area-avg. timeseries
>>>
>>> printVarSummary(z2Area)
>>>
>>> z2_za = dim_avg_Wrap(z2) ; create time x lat array
>>>
>>> z2_ma = dim_avg_Wrap(z2(time|:,lon|:,lat|:) ; create time x lon array
>>>
>>> printVarSummary(z2_za)
>>> printVarSummary(z2_ma)
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>>
>
>

Received on Wed Jul 23 10:05:45 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2014 - 15:10:55 MDT