Comments (6)
subtraction of seasonal mean requires a smoothing:
"sousseasmean"<-function(dat,conv.time,l.mon=1:12,
l.year=unique(conv.time$year),rprint=FALSE)
{
dat.m=dat
seas.cyc=c()
time.cyc=c()
Calcul du cycle saisonnier pour une liste d'annees dans l.year
if(rprint) print("Seasonal cycle")
for(mon in l.mon){
r.day=range(conv.time$day[conv.time$month==mon])
for(day in r.day[1]:r.day[2]){
m.day=apply(dat[conv.time$day==day & conv.time$month==mon &
conv.time$year %in% l.year,],2,mean,na.rm=TRUE)
seas.cyc=rbind(seas.cyc,m.day)
time.cyc$month=c(time.cyc$month,mon)
time.cyc$day=c(time.cyc$day,day)
}
}
Lissage par spline du cycle saisonnier avec preservation des derivees aux bords
if(rprint) print("Seasonal cycle smoothing")
seas.cyc.spl=rbind(seas.cyc,seas.cyc,seas.cyc)
for(i in 1:ncol(seas.cyc)){
seas.cyc.spl[,i]=smooth.spline(seas.cyc.spl[,i],spar=0.8)$y
}
seas.cyc.spl=seas.cyc.spl[(nrow(seas.cyc)+1):(2*nrow(seas.cyc)),]
Soustraction du cycle saisonnier
if(rprint) print("Seasonal anomalies")
for(t in 1:nrow(dat)){
mon=conv.time$month[t]
day=conv.time$day[t]
ii= which(time.cyc$month %in% mon & time.cyc$day %in% day)
dat.m[t,]=dat[t,]-seas.cyc.spl[ii,]
}
datsub=list(anom=dat.m,seascyc=list(seascyc=seas.cyc.spl,timecyc=time.cyc))
}# fin de la definition de fonction
from flyingpigeon.
That's the R - smooth ....
from flyingpigeon.
from flyingpigeon.
R routine is not handling different calenders:
CMIP5 dataset exists with with 365 days (no 29th feb) calenders.
HadGEM is comming with 360 days
but 'sousseasmean' expect 366 days for the annual cycle
from flyingpigeon.
from flyingpigeon.
Done ;-)
from flyingpigeon.
Related Issues (20)
- Bug with subset on opendap resources
- polygon subset: loop over single files HOT 1
- Split plot process into seperate processes for each plottype HOT 2
- ocgis skips rlat rlon values for polygon subsets
- plot spatial_analoges via plot_map function
- reactivate plot_robustness HOT 1
- reactivate Robustness Process HOT 1
- Average over polygon subset HOT 7
- Flyingpigeon independend of eggshell HOT 4
- readthedocs documentation failed HOT 18
- add tests and test-notebooks HOT 24
- brocken test_wps_subset_bbox HOT 2
- Move IO objects from subset base to wpsio HOT 1
- Refactor subsetting processes HOT 2
- Testdata for ensemble processes
- add variable as parameter for country and continent subsets
- take out sort_by_filename in country continent subset
- Using IPCC Color Palettes
- subset_wfs_polygon fails with too many features
- Process definition with minOccurs=1 and defaultvalue contracdict themselves
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flyingpigeon.