GithubHelp home page GithubHelp logo

hzambran / hydrotsm Goto Github PK

View Code? Open in Web Editor NEW
41.0 8.0 13.0 19.46 MB

Time Series Management and Analysis for Hydrological Modelling

Home Page: https://CRAN.R-project.org/package=hydroTSM

R 100.00%
hydrology hydrology-modeling hydrology-statistical r resource water-resources

hydrotsm's Introduction

hydroTSM

Research software impact CRAN License monthly total Build Status dependencies

R-CMD-check

hydroTSM provides S3 functions for management, analysis and plotting of time series used in hydrology and related environmental sciences. In particular, this package is highly oriented to hydrological modelling tasks.

The focus of this package has been put in providing a collection of tools useful for the daily work of hydrologists (although an effort was made to optimize each function as much as possible, functionality has had priority over speed).

Bugs / comments / questions / collaboration of any kind are very welcomed, and in particular, datasets that can be included in this package for academic purposes.

Installation

Installing the latest stable version from CRAN:

install.packages("hydroTSM")

Alternatively, you can also try the under-development version from Github:

if (!require(devtools)) install.packages("devtools")
library(devtools)
install_github("hzambran/hydroTSM")

Reporting bugs, requesting new features

If you find an error in some function, or want to report a typo in the documentation, or to request a new feature (and wish it be implemented :) you can do it here

Citation

citation("hydroTSM")

To cite hydroTSM in publications use:

Zambrano-Bigiarini, Mauricio (2024). hydroTSM: Time Series Management and Analysis for Hydrological Modelling. R package version 0.7-0. URL:https://cran.r-project.org/package=hydroTSM. doi:10.5281/zenodo.839565.

A BibTeX entry for LaTeX users is

@Manual{hydroTSM,
title = {hydroTSM: Time Series Management, Analysis and Interpolation for Hydrological Modelling},
author = {Zambrano-Bigiarini, Mauricio},
note = {R package version 0.7-0},
year = {2024}, url = {https://cran.r-project.org/package=hydroTSM},
doi = {doi:10.5281/zenodo.839565},
}

Vignettes

  1. Daily precipitation. Here you can find an introductory vignette showing the use of several hydroTSM functions for analysing daily precipitation data.

  2. Daily streamflows. Here you can find an introductory vignette showing the use of several hydroTSM functions for analysing daily streamflow data.

Related Material

  • R: a statistical environment for hydrological analysis (EGU-2010) abstract, poster.

  • Using R for analysing spatio-temporal datasets: a satellite-based precipitation case study (EGU-2017) abstract, poster.

See Also

hydrotsm's People

Contributors

hzambran avatar jthurner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydrotsm's Issues

fdc

Estimado Mauricio, primero que todo, felicitaciones por el package, me ha sido muy util para mi trabajo. Lo unico, es que me gustaria saber si hay alguna manera de que la funcion fdc, en vez de solo plotear la flow duration curve, tambien entregue los valores correspondientes. Eso me seria de gran utilidad.

Muchas gracias de antemano, saludos.

daily2monthly, hydroplot: error

I've been using the hydroTSM library (congrats!).

Since last week is not working anymore.

After import data, I tried to use dailymonthly, hydroplot, and appear the message:
Error in Summary.factor(c(5L, 542L, 138L, 5L, 598L, 5L, 184L, 5L, 149L, :
‘sum’ not meaningful for factors

When I try use smry(x):

smry(x)
Index x
Min. 1985-01-01 NA
1st Qu. 1993-09-26 NA
Median 2002-06-21 NA
Mean 2002-06-21 NA
3rd Qu. 2011-03-16 NA
Max. 2019-12-09 NA
IQR NA
sd NA
cv NA
Skewness NA
Kurtosis NA
NA's NA
n NA

Any suggestion to fix?

autumm should be autumn

Dear writer,

I think that in the function time2season the result "autumm" should be "autumn".

Kind regards,
Niek

Warning about multiple namespaces

Hi, In R 3.4.1 for x86_64-w64-mingw32, if I load zoo, hydroTSM, and imputeTS, I got the following warning three times:

library("zoo")
library("hydroTSM") #izoo2rzoo
library("imputeTS") #na.mean

Found more than one class "zoo" in cache; using the first, from namespace 'quantmod'
Also defined byspacetime

Is this a bug, or is there something I'm not doing correctly?

Dry and Wet Spell

HydroTSM and hydroGOF are amazing packages from your side and these are really efficient.
Beside several functions of these impressive packages, is there a way to count the days of each month with different precipitation amount, i.d 0.0mm, 0.1mm, 0.5mmm, 1.0mmm and so on along with respective date.

Plans to re-publish to CRAN?

Hi,

Thanks for your packages, they are very nice! I was wondering if there were any plans to fix the dependency on the now archived maptools and to re-publish to CRAN? Same goes for the hydroGOF package (which is actually the package I am more interested in).

I ask mainly because my package depends on hydroGOF so it would be nice to know if I should plan installing from GitHub or CRAN long term... (preferably CRAN 😃).

Best,
Moritz

subdaily2daily: only executable functions 'sum' and 'mean' ?

Issue originally reported by Jamis Bruening (Huxley College of the Environment) on April 10th, 2015.

---------- START -----------

library(hydroTSM)

###Loading the time series of hourly streamflows for the station Karamea at Gorge

data(KarameaAtGorgeQts)
x <- KarameaAtGorgeQts

subsetting to only 2 days

y <- window(x, end="1980-01-03")

creating a data.frame

Y <- cbind(y,y)

mean for data.frame: OK

subdaily2daily(Y,FUN=mean,na.rm=TRUE)

mean for xts : OK

subdaily2daily(y,FUN=mean,na.rm=TRUE)

sum for data.frame : Not OK (for each day it sums all the columns )

subdaily2daily(Y,FUN=sum,na.rm=TRUE)

sum for xts : OK

subdaily2daily(y,FUN=sum,na.rm=TRUE)

min for data.frame : Not OK (for each day it computes the min of all

the columns )
subdaily2daily(Y,FUN=min,na.rm=TRUE)

min for xts : OK

subdaily2daily(y,FUN=min,na.rm=TRUE)

---------- END -----------

How do I shift the HQ and LQ values

How do I shift the HQ and LQ values that are shown at the bottom left.
I'm plotting more than one curve and wanted to put the values side by side.

Thanks in advance

hydroTSM load problem on mac

I installed hydroTSM without problem, but getting errors when loading the library:

library(hydroTSM)
Error: package or namespace load failed for ‘hydroTSM’:
package slot missing from signature for generic ‘coerce’
and classes STFDF, RasterBrick
cannot use with duplicate class names (the package may need to be re-installed)

Urgent help on what to do, highly appreciated

dm2seasonal: allow flexible definition of seasons

Original question from 'Bernard Okoński UP ':

I think it would be great that the values for the argument season should be maximum flexible that everyone can chose any month sequence or a period that suits ones research end geographic region e.g. hydrologic year in Atlantic Europe starts November 1st of one year and October 30th of the next, in the US October 1st of one year and September 30th of the next, Vegetation period (mean temp. above 5C) is roughly from the beginning of April to the end of October.

The problem will be with months starting with the same letter with JFMAMJJASOND but the same issue was solved in treeclim package by Christian Zang. There is dcc function with that functionality for calculating correlation/multiple correlation with arguments:

selection=.range(-4:-9)+.range(4:9) indicating the season April to September previous year and April to September the next year as an explanatory data for calculation of linear correlation

FDC: Suppress table output when using RMarkdown

When I use fdc() in hydroTSM_0.5-1, the table of data for the graph is echoed to the console output. This is OK during regular operation, however, when using RMarkdown it puts the entire table of data below the curve, and I can't seem to figure our how to supress that output using the options documented here: https://cran.r-project.org/web/packages/hydroTSM/hydroTSM.pdf

Is there a hidden option or one that I am missing that can be used to suppress the table of data? If not, I am willing to look into the library code to see if it can be added. Thanks in advance.

User defined seasons

I have rainfall data from 2000 - 2017. There are 2 seasons. The dry season is from January to May and the wet season is from June to December. How do I define these seasons in the hydroTSM package? What function would I have to use?

[Question] - hydroTSM - support for multi languages

Dear Developers,

thank you for creating such great package as hydroTSM!
I'm really impressed by the possibilites which hydroTSM package provides me.

Unfortunately, it seems that regardless of the selected locale (Sys.setlocale), labels are displayed in English only.

Let me provide an example of two commands (output attached as images):

smry(do_dalszej_analizy,digits = 7)
smry_hydrotsm

hydroplot(do_dalszej_analizy_tis, var.type="Precipitation", var.unit=jednostka, xlab="Czas", ylab="", ptype="ts", main=co,pfreq="dm", stype="default")
hydroplot_hydrotsm

Is there any possibility to replace mentioned (on attached print screens) labels to polish counterparts?
Is it a matter of preparing translation (I can prepare some translations if needed)?

Vulnerability to absence of retiring r-spatial packages

00check.log
is a recent check log from running under _SP_EVOLUTION_STATUS_=2 without retiring r-spatial packages on the library path. hydroTSM depends strongly on maptools to use maptools::readShapePoly, which is has been deprecated for years. Both gstat and automap depend strongly on sf, so there is no reason in terms of load image to avoid sf. If you wish to stay with sp objects, read with sf and coerce to sp.

HydroTSM and R 3.5

Hi,
I have difficulty in using HydroTSM on R 3.5 (I run code working before and receive many error, perharps also on zoo package). Do you know if there is some difficulties in this perspective ?
Best Regards

Imminent removal from Environmetrics Task View

As HydroTSM has been archived on CRAN, because of the dependency on maptools (which is now archived following the great upheaval), it now also needs to be removed from the Environmetrics Task View cran-task-views/Environmetrics#15. If you plan to fix the issue and resubmit to CRAN, great, I can hold off removing it from the view. I see that others have raised the specific issue of the maptools dependency over recent months but I haven't seen a response from you. If I don't hear back by Jan 2nd 2024, I'll remove HydroTSM and HydroGOF from the Task View. If you need help getting the package back on CRAN, let us know and I might have time to help.

daily2monthly conversions

Respected,

is it possible to use HydroTsm to aggregate daily satellite base data to monthly scale?

Regards

error with daily2monthly with FUN=sum and nr.rm=T

Hi
Thank you for creating this enormusly useful package

I have found a problem when you transform data from daily2monthly or 2annual using the "sum" function and use the na.rm=T.

When one has a daily series and that series has a complete month without values, it should return an NA, doesn´t it? It happens that it returns a 0 as if all the NA in that month were 0.
The same happens when I tried to accummulate values from monthly to annual.

I manage to correct it with this three simple commands:

Sobs.mes <- daily2monthly(Sobs, FUN=sum, na.rm=T)
ind.arr <- which(Sobs.mes == 0, arr.ind = T)
for (i in 1:4) {Sobs.mes[ ind.arr[ which( ind.arr[ ,2] == i ), 1], i] <- NA}

Hope that can be changed for the next update

All the best
Nicolás Duque-Gardeazábal

Climograph function no longer uses monthly values

Using ?climograph, the documentation shows that the function can use monthly values in a zoo object (for precipitation and temperatures), however, this is not possible due to an error in the "daily2annual" function (error that hydroTSM shows in the console), that clearly does not use monthly values as input.

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.