[ncl-talk] Computing coefficient of determination with gridded datasets

Efren Lopez Blanco elb at bios.au.dk
Sat Jan 13 03:21:42 MST 2018


Hi there,

I would like to compute the coefficient of determination (r squared) between 2 gridded datasets of the form (time,lat,lon). In order to do so, I aim to apply the escorc_n function. The two datasets I am using look like:

Variable: cveg_HWSD_b_avg_3d
Type: double
Total Size: 106560 bytes
            13320 values
Number of Dimensions: 3
Dimensions and sizes:        [time | 1] x [lat | 37] x [lon | 360]
Coordinates:
            time: [1..1]
            lat: [79.5..43.5]
            lon: [-179.5..179.5]
Number Of Attributes: 6
  average_op_ncl :              dim_avg_n over dimension(s): time
  missing_value :  -9999
  units :   g C m-2
  long_name :       C stored in Cveg
  percentile :           50
  _FillValue :          1.000000020040877e+20
(0)           C stored in Cveg: min=0.1382737806910972   max=12.84650588106167

Variable: lpjml_hadgem2_es_avg_mask_3d
Type: double
Total Size: 106560 bytes
            13320 values
Number of Dimensions: 3
Dimensions and sizes:        [time | 1] x [lat | 37] x [lon | 360]
Coordinates:
            time: [1..1]
            lat: [79.5..43.5]
            lon: [-179.5..179.5]
Number Of Attributes: 6
  units :   kg m-2
  long_name :       Carbon Mass in Vegetation
  standard_name :              vegetation_carbon_content
  average_op_ncl :              dim_avg_n over dimension(s): time
  missing_value :  1e+20
  _FillValue :          1.000000020040877e+20
(0)           Carbon Mass in Vegetation: min=3.493304393487051e-05   max=15.10204410552979

Then I apply the function:

lpjml_r = escorc_n(cveg_HWSD_b_avg_3d,lpjml_hadgem2_es_avg_mask_3d, 0, 0)   ; r(nlat,mlon)

However, I’ve noticed the output only contain NAs:

Variable: lpjml_r
Type: double
Total Size: 106560 bytes
            13320 values
Number of Dimensions: 2
Dimensions and sizes:        [lat | 37] x [lon | 360]
Coordinates:
            lat: [79.5..43.5]
            lon: [-179.5..179.5]
Number Of Attributes: 6
  missing_value :  -9999
  average_op_ncl :              dim_avg_n over dimension(s): time
  units :   g C m-2
  long_name :       C stored in Cveg
  percentile :           50
  _FillValue :          1.000000020040877e+20
(0)           C stored in Cveg: min=1.000000020040877e+20   max=1.000000020040877e+20

Am I doing something wrong? I’ve also tried to convert from double to float.

Best,
Efren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180113/42c848df/attachment.html>


More information about the ncl-talk mailing list