[Thread Prev][Thread Next][Index]

Re: [ferret_users] creating a mask for calculating Equatable Threat Score(ETS)



thanks Ansley,
I regridded the two dataset using CHIRPS
now when I try, nothing is calculated .
and there is no error message
let ets = (a1-ar)/(a1+b1+c1-ar)
list ets[l=1,k=1]
             VARIABLE : (A1-AR)/(A1+B1+C1-AR)
             LONGITUDE: 24E to 54E
             LATITUDE : 12S to 24N
             Z        : 1
             TIME     : 01-MAR-2003 00:00
        ....
let bias = (a1+b1)/(a1+c1)
list bias
             VARIABLE : (A1+B1)/(A1+C1)
             SUBSET   : 3 by 92 points (Z-TIME)
             LONGITUDE: 24E to 54E
             LATITUDE : 12S to 24N
                       1   2   3  
                        1   2   3
 01-MAR-2003 00 /  1:............
 02-MAR-2003 00 /  2:............
 03-MAR-2003 00 /  3:............
 04-MAR-2003 00 /  4:............
 05-MAR-2003 00 /  5:............
 06-MAR-2003 00 /  6:............
 07-MAR-2003 00 /  7:............
 08-MAR-2003 00 /  8:............
 09-MAR-2003 00 /  9:............
 10-MAR-2003 00 / 10:............
 11-MAR-2003 00 / 11:............
 12-MAR-2003 00 / 12:............
 13-MAR-2003 00 / 13:............
 14-MAR-2003 00 / 14:............
 15-MAR-2003 00 / 15:............
 16-MAR-2003 00 / 16:............
 17-MAR-2003 00 / 17:............
 18-MAR-2003 00 / 18:............
 19-MAR-2003 00 / 19:............
 20-MAR-2003 00 / 20:............
 21-MAR-2003 00 / 21:............
 22-MAR-2003 00 / 22:............
 23-MAR-2003 00 / 23:............
 24-MAR-2003 00 / 24:............
 25-MAR-2003 00 / 25:............
 26-MAR-2003 00 / 26:............
 27-MAR-2003 00 / 27:............
 28-MAR-2003 00 / 28:............
 29-MAR-2003 00 / 29:............
 30-MAR-2003 00 / 30:............
 31-MAR-2003 00 / 31:............
 01-APR-2003 00 / 32:............
 02-APR-2003 00 / 33:............
 03-APR-2003 00 / 34:............
 04-APR-2003 00 / 35:............
 05-APR-2003 00 / 36:............
 06-APR-2003 00 / 37:............
 07-APR-2003 00 / 38:............
 08-APR-2003 00 / 39:............
 09-APR-2003 00 / 40:............
 10-APR-2003 00 / 41:............
 11-APR-2003 00 / 42:............
 12-APR-2003 00 / 43:............
 13-APR-2003 00 / 44:............
 14-APR-2003 00 / 45:............
 15-APR-2003 00 / 46:............
 16-APR-2003 00 / 47:............
 17-APR-2003 00 / 48:............
 18-APR-2003 00 / 49:............
 19-APR-2003 00 / 50:............
 20-APR-2003 00 / 51:............
 21-APR-2003 00 / 52:............
 22-APR-2003 00 / 53:............
 23-APR-2003 00 / 54:............
 24-APR-2003 00 / 55:............
 25-APR-2003 00 / 56:............
 26-APR-2003 00 / 57:............
 27-APR-2003 00 / 58:............
 28-APR-2003 00 / 59:............
 29-APR-2003 00 / 60:............
 30-APR-2003 00 / 61:............
 01-MAY-2003 00 / 62:............
 02-MAY-2003 00 / 63:............
 03-MAY-2003 00 / 64:............
 04-MAY-2003 00 / 65:............
 05-MAY-2003 00 / 66:............
 06-MAY-2003 00 / 67:............
 07-MAY-2003 00 / 68:............
 08-MAY-2003 00 / 69:............
 09-MAY-2003 00 / 70:............
 10-MAY-2003 00 / 71:............
 11-MAY-2003 00 / 72:............
 12-MAY-2003 00 / 73:............
 13-MAY-2003 00 / 74:............
 14-MAY-2003 00 / 75:............
 15-MAY-2003 00 / 76:............
 16-MAY-2003 00 / 77:............
 17-MAY-2003 00 / 78:............
 18-MAY-2003 00 / 79:............
 19-MAY-2003 00 / 80:............
 20-MAY-2003 00 / 81:............
 21-MAY-2003 00 / 82:............
 22-MAY-2003 00 / 83:............
 23-MAY-2003 00 / 84:............
 24-MAY-2003 00 / 85:............
 25-MAY-2003 00 / 86:............
 26-MAY-2003 00 / 87:............
 27-MAY-2003 00 / 88:............
 28-MAY-2003 00 / 89:............
 29-MAY-2003 00 / 90:............
 30-MAY-2003 00 / 91:............
 31-MAY-2003 00 / 92:............
 
! bias and ETS are calculated
message/continue "ETS and bias are calculated"
ETS and bias are calculated
 


On Wed, Mar 29, 2017 at 1:33 AM, Ansley C. Manke <ansley.b.manke@xxxxxxxx> wrote:

Hi,

I have not tried your example, but the messages are indicating that the variables are not on the same common time axis. I would suggest that you do more "stat " or plotting commands as you define the intermediate variables to see where the definitions are valid and where there is some mis-match in the grids that make the definition invalid.

The AMBIGUOUS COORDINATES messages are warnings, saying that the _expression_ might be able to be computed, but that their grids do not have matching coordinate values.  Here is some documentation about that (I searched for "ambiguous") in the Users Guide to find this.  http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/XPRESSIONS#_VPID_90

When you go to write out the variable, the different grids of the expressions cannot be reconciled to make a grid and compute the result.

-Ansley

On 3/28/2017 1:22 PM, afwande juliet wrote:
Dear ALL users
I have two dataset Observed and Model output with  3months on each file. I want to calcuate ETS for 10mm/day, 20mm/day and 50mm/day threshold. I began by defining mask for observed and model as shown below but got the following error when I want to save the ETS value as .dat.

use "/media/anyuola/Transcend/GEORGE/OBS/cru_pr_Oct_Dec_1997_2002_2006.nc"! d=1
use "/media/anyuola/Transcend/GEORGE/OBS/chirps_monthly_Oct_Dec_1997_2002_2006_rg.nc"! d=2
use "/media/anyuola/Transcend/GEORGE/OBS/cru_pr_Mar_May_1998_2003_2007.nc" ! d=3
use "/media/anyuola/Transcend/GEORGE/OBS/chirps_monthly_mar_may_1998_2003_2007_rg.nc"! d=4

use "/media/anyuola/Transcend/GEORGE/BML/WET/BML_monthly_Oct_Dec_1997_2002_2006.nc" ! d=5
use "/media/anyuola/Transcend/GEORGE/GRELL/WET/GRELL_monthly_Oct_Dec_1997_2002_2006.nc" ! d=6
use "/media/anyuola/Transcend/GEORGE/KF/WET/KF_monthly_Oct_Dec_1997_2002_2006.nc" ! d=7
use "/media/anyuola/Transcend/GEORGE/KFT/WET/KFT_monthly_Oct_Dec_1997_2002_2006.nc" ! d=8

use "/media/anyuola/Transcend/GEORGE/BML/WET/BML_monthly_mar_may_1998_2003_2007.nc" ! d=9
use "/media/anyuola/Transcend/GEORGE/GRELL/WET/GRELL_monthly_mar_may_1998_2003_2007.nc" ! d=10
use "/media/anyuola/Transcend/GEORGE/KF/WET/KF_monthly_mar_may_1998_2003_2007.nc" ! d=11
use "/media/anyuola/Transcend/GEORGE/KFT/WET/KFT_monthly_mar_may_1998_2003_2007.nc" ! d=12



!define threshhold mask
let mask1 = IF pre[i=1:160,j=1:88,l=1:3,d=1] GE 10 then 1
let mask=pre[d=1]*mask1
list mask
stat mask
!let mask1 = IF rainnc[i=1:200,j=1:200,l=1]+rainc[i=1:200,j=1:200,l=1] GE $3 then 1
let mask2 = IF pr[i=1:160,j=1:88,l=1:3,k=1,d=5] GE 10 then 1
let mask1=pr[d=5]*mask2
list mask1
stat mask1

!a is hits yes-yes
let a = IF mask EQ mask1 AND mask EQ 1 then 1
!let a1 = 'a[i=1:199@sum,j=1:199@sum]'
  let a1 = a[i=1:160@sum,j=1:88@sum]
!list a1

!b is forecast yes obs no
let b = IF mask1 EQ 1 AND mask EQ 0 then 1
let b1 = b[i=1:160@sum,j=1:88@sum]

!c is forecast no obs yes
let c = IF mask1 EQ 0 AND mask EQ 1 then 1
let c1 = c[i=1:160@sum,j=1:88@sum]

!d is no no
let d = IF mask EQ mask1 AND mask EQ 0 then 1
let d1 = d[i=1:160@sum,j=1:88@sum]

!ar is  a+b * a+c / a +b +c +d
let ar = ((a1+b1)*(a1+c1))/(a1+b1+c1+d1)

let ets = (a1-ar)/(a1+b1+c1-ar)
save/file =ets.dat ets

let bias = (a1+b1)/(a1+c1)

! bias and ETS are calculated
message/continue "ETS and bias are calculated"


save/file =ets.dat ets
           *** NOTE: Ambiguous coordinates on T axis: PRE[D=1]*MASK1
           *** NOTE: Ambiguous coordinates on T axis: IF MASK EQ MASK1 AND MASK EQ 0 THEN 1
           *** NOTE: Ambiguous coordinates on T axis: IF MASK EQ MASK1 AND MASK EQ 0 THEN 1
           *** NOTE: Ambiguous coordinates on T axis: IF MASK1 EQ 0 AND MASK EQ 1 THEN 1
           *** NOTE: Ambiguous coordinates on T axis: ((A1+B1)*(A1+C1))/(A1+B1+C1+D1)
           *** NOTE: Ambiguous coordinates on T axis: IF MASK1 EQ 1 AND MASK EQ 0 THEN 1
           *** NOTE: Ambiguous coordinates on T axis: IF MASK EQ MASK1 AND MASK EQ 1 THEN 1
           *** NOTE: Ambiguous coordinates on T axis: IF MASK EQ MASK1 AND MASK EQ 1 THEN 1
           *** NOTE: Ambiguous coordinates on T axis: ((A1+B1)*(A1+C1))/(A1+B1+C1+D1)
           *** NOTE: Ambiguous coordinates on T axis: ((A1+B1)*(A1+C1))/(A1+B1+C1+D1)
           *** NOTE: Ambiguous coordinates on T axis: ((A1+B1)*(A1+C1))/(A1+B1+C1+D1)
           *** NOTE: Ambiguous coordinates on T axis: ((A1+B1)*(A1+C1))/(A1+B1+C1+D1)
           *** NOTE: Ambiguous coordinates on T axis: ((A1+B1)*(A1+C1))/(A1+B1+C1+D1)
           *** NOTE: Ambiguous coordinates on T axis: (A1-AR)/(A1+B1+C1-AR)
           *** NOTE: Ambiguous coordinates on T axis: (A1-AR)/(A1+B1+C1-AR)
 **ERROR: illegal limits: MASK1 is not in the range T=35717:39065
          Axis extremes are T=19971002:19971232
LIST/FORMAT=CDF/file =ets.dat ets
Command file, command group, or REPEAT execution aborted


Could someone help here. I have used these thread to follow but seemingly I cant get the correct way out

Attached is two datasets and script




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement