Coder Social home page Coder Social logo

santandermetgroup / climate4r.climdex Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 4.0 7.26 MB

A climate4R package for calculation of the ETCCDI core climate indices (part of the climate4R bundle)

Home Page: https://github.com/SantanderMetGroup/climate4R

License: GNU General Public License v3.0

R 100.00%

climate4r.climdex's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

climate4r.climdex's Issues

climdexGrid() function returns monthly outputs instead of yearly when crossing season is specified

I am trying to calculate climate change indices for a specific crossing season (October to April) from 1981 to 2020 but I get results as months instead of the season year. For the given period 1981 to 2020, I expected the output to have 39 seasons layers but it returns 273 monthly layers. Is there a way for me to specify that a year is defined after 212 days(days between October and April no leap)?

Please find my code below and attached data

#Calculating the indices
ds1<-"/Volumes/Untitled 2/Daily kk/Daily2_pr19812020.nc"

ppt.eobs <- loadGridData(dataset = ds1,
var = "ppt",
years = 1982:2020,
season = c(10,11,12,1,2,3,4))

PRCPTOT.indices=climdexGrid('PRCPTOT',pr =ppt.eobs,input.arg.list = list(base.range=c(1982,2020),northern.hemisphere=FALSE),cal = "365_day")
Daily2_pr19812020.nc.zip

Error in using a function "climdexGrid()"

Hello!
According to the definition of the climate index "Rnnmm", nn is a user defined threshold. When I tried to calculate the "R1mm" by using "climdexGrid()", it told me error in match.arg(index.code...). How can I define the nn threshold?
The code is:

R1mm <- climdexGrid(pr = prdata, index.code = "R1mm")
Error in match.arg(index.code, choices = c("FD", "SU", "ID", "TR", "GSL", :
'arg' should be one of “FD”, “SU”, “ID”, “TR”, “GSL”, “TXx”, “TNx”, “TXn”, “TNn”, “TN10p”, “TX10p”, “TN90p”, “TX90p”, “WSDI”, “CSDI”, “DTR”, “Rx1day”, “Rx5day”, “SDII”, “R10mm”, “R20mm”, “Rnnmm”, “CDD”, “CWD”, “R95pTOT”, “R99pTOT”, “PRCPTOT”

Thank you in advance!

Can the beginning and end date of Growth Season be extracted along with the length of the growing season?

I have used climdexGrid to calculate growth season length using Cordex data:

GSL.grid <- climdexGrid(tn = tasmin,tx=tasmax, index.code = "GSL")

It works perfectly, but I would like to know the date that the growth season is starting to be calculated (index when the mean temperature above 5 has been achieved for 6 days and the 'counting' of the GSL is initiated ) and the date that it ends. Is that something achievable with your package?

Possible to set the threshold for frost day indices?

I was wondering if it is possible to change the 0 degree threshold for the calculation of frost days? In the calculation of certain frost events, particularly in relation to plant damage, other thresholds are commonly used. It would be great to have the option to set the threshold for the "FD" index. Muchas gracias por tu ayuda!

package ‘climdex.pcic’ is not available for this version of R

while installing this package with:

/usr/bin/R -e "devtools::install_github(c('SantanderMetGroup/loadeR.java', 'SantanderMetGroup/transformeR', 'SantanderMetGroup/climate4R.climdex','SantanderMetGroup/climate4R.UDG','SantanderMetGroup/loadeR', 'SantanderMetGroup/visualizeR','SantanderMetGroup/downscaleR', 'SantanderMetGroup/loadeR.2nc'))"

on debian 12 stable (which has R 4.2.2) we receive this warning:

Warning messages:
1: package ‘climdex.pcic’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 
2: In i.p(...) :
  installation of package ‘/tmp/RtmpHvShJw/file921406163fc/climate4R.climdex_0.2.3.tar.gz’ had non-zero exit status

the installation works fine on debian 11 oldstable (which has R 4.0.4)

Support for trend analysis

Would be great if there were functions for performing trend analysis for ETCCDI indicators using the climate4R data structures so that multiple ensembles can be analyzed in one go.

climdexGrid does not take station data input?

Does climdexGrid not take climate4R station data type? I tried the following:

download.file("http://meteo.unican.es/work/loadeR/data/VALUE_ECA_86_v2.tar.gz", destfile = "VALUE_ECA_86_v2.tar.gz")
untar("VALUE_ECA_86_v2.tar.gz")
value <- "VALUE_ECA_86_v2"
example1 <- loadStationData(dataset = value, var="tmax", stationID = c("000234", "003946"), years = 1981:2000)
SU1<-climdexGrid(tx=example1, index.code="SU")

which gives the following error message:
Error in aperm.default(array3D, match(c("time", "lat", "lon"), dimNames)) : perm is of wrong length 3 (!= 2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.