Skip to content

Commit

Permalink
developments on buddy_eve
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Lussana committed Jun 8, 2018
1 parent 09f4db6 commit 18a91b4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions test/config_test_RR1.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ conf<-list(
rr.wcor.filemeps="/home/cristianl/data/titan/meps_2_5km_20180403T12Z_test.nc",
rr.wcor.filesetup="meps",
# fg (radar)
# fg=T,
# fg.file="/home/cristianl/data/titan/norway.mos.sri-acrr-1h.noclass-clfilter-vpr-clcorr-block.utm33-1000.20180403.nc",
# fg.type="radar",
# thrpos.fg=100,
# thrneg.fg=.1,
fg=T,
fg.file="/home/cristianl/data/titan/norway.mos.sri-acrr-1h.noclass-clfilter-vpr-clcorr-block.utm33-1000.20180403.nc",
fg.type="radar",
thrpos.fg=100,
thrneg.fg=.1,
# fge (MEPS)
# fge=T,
# fge.file="/home/cristianl/data/titan/meps_2_5km_20180403T12Z_test.nc",
# fge.type="meps",
# sdmin.fge=0.2,
# iqrmin.fge=0.2,
# csd.fge=2,
# infsd.fge=3,
# ciqr.fge=2,
# infiqr.fge=3,
fge=T,
fge.file="/home/cristianl/data/titan/meps_2_5km_20180403T12Z_test.nc",
fge.type="meps",
sdmin.fge=0.2,
iqrmin.fge=0.2,
csd.fge=2,
infsd.fge=3,
ciqr.fge=2,
infiqr.fge=3,
# buddy-check
i.buddy=3,
dr.buddy=3000, #m
Expand Down
30 changes: 15 additions & 15 deletions titan.R
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ p <- add_argument(p, "--i.buddy_eve",
default=1,
short="-iBe")
p <- add_argument(p, "--thr.buddy_eve",
help="buddy_eve-check threshold (same dimension of thr_eve.buddy_eve). flag observation if: is event(no) and at least a fraction of thr.buddy_eve of the neighbouring observations are event(yes) OR is event(yes) and at least a fraction of thr.buddy_eve of the neighbouring observations are event(no). (default is 0.9, i.e. 90% of the neighbouring observations)",
help="buddy_eve-check threshold (same dimension of thr_eve.buddy_eve). flag observation as suspect if: is event(no) and less than a fraction of thr.buddy_eve of the neighbouring observations are event(no) OR is event(yes) and less than a fraction of thr.buddy_eve of the neighbouring observations are event(yes). (default is 0.05, i.e. 5% of the neighbouring observations)",
type="numeric",
default=NA,
nargs=Inf)
Expand Down Expand Up @@ -3706,9 +3706,9 @@ if (any(is.na(argv$dr.buddy_eve)))
if (length(argv$dr.buddy_eve)!=length(argv$thr_eve.buddy_eve))
argv$dr.buddy_eve<-c(3000,3000,3000)
if (any(is.na(argv$thr.buddy_eve)))
argv$thr.buddy_eve<-c(0.9,0.9,1)
argv$thr.buddy_eve<-c(0.05,0.05,1)
if (length(argv$thr.buddy_eve)!=length(argv$thr_eve.buddy_eve))
argv$thr.buddy_eve<-c(0.9,0.9,1)
argv$thr.buddy_eve<-c(0.05,0.05,1)
if (any(is.na(argv$n.buddy_eve)))
argv$n.buddy_eve<-c(5,5,5)
if (length(argv$n.buddy_eve)!=length(argv$n_eve.buddy_eve))
Expand Down Expand Up @@ -5040,22 +5040,22 @@ if (argv$buddy_eve) {
# suspect if:
if (argv$thr.buddy_eve[j]<1) {
sus<-which(
(stSp_buddy_eve[1,]>argv$n.buddy_eve[j] &
stSp_buddy_eve[2,]<argv$dz.buddy_eve[j] &
is.na(dqcflag[ix])) &
doit[ix]==1 &
( (stSp_buddy_eve[3,]==0 & ((1-stSp_buddy_eve[4,])<=argv$thr.buddy_eve[j])) |
(stSp_buddy_eve[3,]==1 & ( stSp_buddy_eve[4,]<=argv$thr.buddy_eve[j])) ))
(stSp_buddy_eve[1,]>argv$n.buddy_eve[j] &
stSp_buddy_eve[2,]<argv$dz.buddy_eve[j] &
is.na(dqcflag[ix])) &
doit[ix]==1 &
( (stSp_buddy_eve[3,]==0 & ((1-stSp_buddy_eve[4,])<=argv$thr.buddy_eve[j])) |
(stSp_buddy_eve[3,]==1 & ( stSp_buddy_eve[4,]<=argv$thr.buddy_eve[j])) ))
} else if (argv$thr.buddy_eve[j]>=1) {
nyes<-round(stSp_buddy_eve[1,]*stSp_buddy_eve[4,],0)
nno<-stSp_buddy_eve[1,]-nyes
sus<-which(
(stSp_buddy_eve[1,]>argv$n.buddy_eve[j] &
stSp_buddy_eve[2,]<argv$dz.buddy_eve[j] &
is.na(dqcflag[ix])) &
doit[ix]==1 &
( (stSp_buddy_eve[3,]==0 & nno<argv$thr.buddy_eve[j]) |
(stSp_buddy_eve[3,]==1 & nyes<argv$thr.buddy_eve[j]) ))
(stSp_buddy_eve[1,]>argv$n.buddy_eve[j] &
stSp_buddy_eve[2,]<argv$dz.buddy_eve[j] &
is.na(dqcflag[ix])) &
doit[ix]==1 &
( (stSp_buddy_eve[3,]==0 & nno<argv$thr.buddy_eve[j]) |
(stSp_buddy_eve[3,]==1 & nyes<argv$thr.buddy_eve[j]) ))
rm(nyes,nno)
} else {
sus<-integer(0)
Expand Down

0 comments on commit 18a91b4

Please sign in to comment.