Git Product home page Git Product logo

ag5tools's People

Contributors

dbrownf avatar kauedesousa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ag5tools's Issues

Unable to run example after installing

I get an error about a missing Python module after installation. I then tried installing the module with pip, I still get the same error after it successfully installed for me.

  ag5_download(variable = "2m_temperature",
                           statistic = "night_time_minimum",
                           day = "all",
                           month = "all",
                           year = 2015,
                           path = "C:/custom_target_folder"
                           )
List of 20
 $ python              : chr "/opt/homebrew/Cellar/[email protected]/3.10.12_1/bin/python3.10"
 $ libpython           : chr "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/Python"
 $ pythonhome          : chr "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10:/opt/homebrew/Cellar/pytho"| __truncated__
 $ pythonpath          : chr "/Users/adamsparks/Library/R/arm64/4.3/library/reticulate/config:/opt/homebrew/Cellar/[email protected]/3.10.12_1/Fram"| __truncated__
 $ prefix              : chr "/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.10"
 $ exec_prefix         : chr "/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.10"
 $ base_exec_prefix    : chr "/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.10"
 $ virtualenv          : chr ""
 $ virtualenv_activate : chr ""
 $ version_string      : chr "3.10.12 (main, Jun 20 2023, 19:43:52) [Clang 14.0.3 (clang-1403.0.22.14.1)]"
 $ version             : chr "3.10"
 $ architecture        : chr "64bit"
 $ anaconda            : logi FALSE
 $ conda               : chr "False"
 $ numpy               :List of 2
  ..$ path   : chr "/opt/homebrew/lib/python3.10/site-packages/numpy"
  ..$ version: list()
  .. ..- attr(*, "class")= chr "numeric_version"
 $ required_module     : chr "cdsapi"
 $ required_module_path: NULL
 $ available           : logi TRUE
 $ python_versions     : chr "/opt/homebrew/Cellar/[email protected]/3.10.12_1/bin/python3.10"
 $ forced              : chr "the current process"
 - attr(*, "class")= chr "py_config"
Error: Python module cdsapi was not found.

Detected Python configuration:

Ag5tools cdsapi client error

Dear David,
I am a PhD student at Wagenen University, I came across your Ag5tools Package. I followed all the steps but a get this error massage when I call download function.

Error in cdsapi$Client() : attempt to apply non-function

session_python gives following info
python: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf/python.exe
libpython: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf/python36.dll
pythonhome: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf
version: 3.6.15 (default, Dec 3 2021, 18:25:24) [MSC v.1916 64 bit (AMD64)] Architecture: 64bit
numpy: C:/Users/meer164/AppData/Local/anaconda3/envs/wk_ecmwf/Lib/site-packages/numpy numpy_version: 1.19.5
cdsapi: C:\Users\meer164\AppData\Local\ANACON~1\envs\wk_ecmwf\lib\site-packages\cdsapi_init_.p

NOTE: Python version was forced by RETICULATE_PYTHON

Can you please help me out?
Thanks in advance

Howard van Meer

Extracting scattered date from several coordinates using ag5_extract

Hi there,

I recently came across this package and found it amazing.

I am able to download the AgERA5 data that I wanted to my computer and can extract single coordinates and locations, however, I am struggling to batch download climate data that are not sequential.

For instance, I can download data from scattered days using the below code:

library(ag5Tools)
ag5_download(variable = "2m_temperature",
             statistic = "day_time_mean",
             day = c(01,05,10,15,20,25),
             month = c(10, 11, 12, 01, 02, 03),
             year = 2015,
             path = "/Users/myfolder"
)

But when trying to extract such specific dates I got the obvious error message below, which I understand that I have not downloaded all the dates within the interval between the first and second dates, and the argument date seems to do not support non-sequential dates, as explained elsewhere :

If dates is one value it extracts a single observation for the specified variable and location. If dates is a character vector of length == 2, it will extract a time series of the specified variable and location, where the first dates value is the start date and the second the end date.

Please find here what I did the and error message.


# Create vectors for days, months, and year
days <- c(01, 05, 10, 15, 20, 25)
months <- c(10, 11, 12, 01, 02, 03)
year <- 2015

# Generate all possible combinations of days and months
all_dates <- expand.grid(days = days, months = months)

# Create a data.frame with the dates column
df <- data.frame(dates = as.character(paste(year, all_dates$months, all_dates$days, sep = "-")))

# sample coordinates
df_coord <- data.frame(lat = c(-20, -24), lon = c(-80, -90))

ag5_extract(coords = df_coord, 
            lon = "lon",
            lat = "lat",
            # dates = all , 
            variable = "Temperature-Air-2m",
            statistic = "Mean-Day-Time", 
            path = "/Users/nicolaycunha/Desktop/Kaoma2015",
            celsius = TRUE)


Error in ag5_extract.numeric(coords = c(35.726364, -2.197162), dates = 2015 -  :   object 'ag5_data' not found

In summary, I am reaching out to inquire whether it is possible to extract scattered dates from different coordinates within a row. My current project involves analyzing a vast dataset encompassing multiple locations in South America, and I specifically require data ranging from 1980 to 2023 for approximately 5000 specific coordinates. Unfortunately, I have encountered challenges in efficiently utilizing the available package to achieve my objectives.

Ideally, I would like to download climate data solely for the required coordinates and a subset of dates. This approach would alleviate the need to manage extensive datasets on a local computer, thus enhancing the overall efficiency of the analysis process.

I would greatly appreciate any advice or assistance you can provide in this regard. Please let me know if the current version of the functions supports such capabilities or if there are alternative approaches to achieve the desired outcome.

Thank you kindly for your attention and support.

Best regards,
Nicolay

Error with extraction of wind variable

Dear David

It's me again, I downloaded all de files but when a want to extract "wind" from netcdf daily files I get de following error:

****dk_wind <- ag5_extract(coords = c(9.546480, 56.437384),

  •                    dates = c("2015-01-01", "2023-12-31"), variable = "10m_wind_speed", statistic="24_hour_mean",path = "D:/ERA5")
    

Error in get_file_path(date_to_search = X, variable, statistic, time, :
File not found****

All the other variables i can extract without any problem. My netcdf files are stored on a external drive because of size but that didn't give any problems for the other variables. What is the correct way for Variable and statistic for wind data sets?

Kind regards,
Howard

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.