-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NCSS projection issues #42
Comments
Would this issue cause the example code for the daymet_grid_tmean function to no longer work? When I run the example I get the following error:
Using default path tempdir() ... |
Could you send a reproducible example using reprex. I can't debug based upon the information provided (R version, OS, library versions etc). The code you provided in the screenshot runs fine on my system R 3.6 / linux. library(daymetr)
download_daymet_tiles(
tiles = 11935,
start = 1980,
end = 1980,
param = c("tmin","tmax"),
path = tempdir()
)
#> NOTE: data is stored in tempdir() ...
#>
#> Downloading DAYMET data for tile: 11935; year: 1980; product: tmin
#> |======================================================================| 100%
#>
#> Downloading DAYMET data for tile: 11935; year: 1980; product: tmax
#> |======================================================================| 100%
test <- daymet_grid_tmean(
product = 11935,
year = 1980,
internal = TRUE
)
#> Using default path tempdir() ...
#> Loading required namespace: ncdf4 Created on 2021-02-02 by the reprex package (v0.3.0) |
Hello,
Thanks for getting back so quickly on this issue. Strange - it must be
something wrong with my computer, that code above always hits the same
errors about opening NC files on mine. Below is the reprex example of the
attached R code, with all my sesion information following, if that is
helpful. Thank you again.
library(reprex)
library(daymetr)
download_daymet_tiles(
tiles = 11935,
start = 1980,
end = 1980,
param = c("tmin","tmax"),
path = tempdir())
#> NOTE: data is stored in tempdir() ...
#>
#> Downloading DAYMET data for tile: 11935; year: 1980; product: tmin
#> |
|
| 0% |
|
| 1% |
|=
|======================================================================|
99% |
|======================================================================|
100%
#>
#> Downloading DAYMET data for tile: 11935; year: 1980; product: tmax
#> |
|
| 0% |
|======================================================================|
100%
tmean = daymet_grid_tmean(product = 11935,
year = 1980,
internal = TRUE,
path = tempdir())
#> Using default path tempdir() ...
#> Loading required namespace: ncdf4
#> Error in R_nc4_open: NetCDF: Unknown file format
#> Error in ncdf4::nc_open(filename, readunlim = FALSE, suppress_dimvals =
TRUE): Error in nc_open trying to open file
C:\Users\jprevey\AppData\Local\Temp\2\Rtmpm0qXyW\tmax_1980_11935.nc
Created on 2021
sessioninfo::session_info()
#> - Session info
---------------------------------------------------------------
#> setting value
#> version R version 4.0.3 (2020-10-10)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> ctype English_United States.1252
#> tz America/Denver
#> date 2021-02-04
#>
#> - Packages
-------------------------------------------------------------------
#> package * version date lib source
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.3)
#> backports 1.2.1 2020-12-09 [1] CRAN (R 4.0.3)
#> cli 2.2.0 2020-11-20 [1] CRAN (R 4.0.3)
#> codetools 0.2-16 2018-12-24 [1] CRAN (R 4.0.3)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.3)
#> curl 4.3 2019-12-02 [1] CRAN (R 4.0.3)
#> daymetr * 1.4 2019-02-07 [1] CRAN (R 4.0.3)
#> digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.3)
#> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.3)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.3)
#> fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.3)
#> fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.3)
#> glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.3)
#> highr 0.8 2019-03-20 [1] CRAN (R 4.0.3)
#> htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.3)
#> httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.3)
#> knitr 1.30 2020-09-22 [1] CRAN (R 4.0.3)
#> lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.3)
#> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.3)
#> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.3)
#> ncdf4 1.17 2019-10-23 [1] CRAN (R 4.0.3)
#> pillar 1.4.7 2020-11-20 [1] CRAN (R 4.0.3)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.3)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.3)
#> R6 2.5.0 2020-10-28 [1] CRAN (R 4.0.3)
#> raster 3.4-5 2020-11-14 [1] CRAN (R 4.0.3)
#> Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.3)
#> reprex * 1.0.0 2021-01-27 [1] CRAN (R 4.0.3)
#> rgdal 1.5-18 2020-10-13 [1] CRAN (R 4.0.3)
#> rlang 0.4.9 2020-11-26 [1] CRAN (R 4.0.3)
#> rmarkdown 2.6 2020-12-14 [1] CRAN (R 4.0.3)
#> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.3)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.3)
#> sp 1.4-4 2020-10-07 [1] CRAN (R 4.0.3)
#> stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.3)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.3)
#> styler 1.3.2 2020-02-23 [1] CRAN (R 4.0.3)
#> tibble 3.0.4 2020-10-12 [1] CRAN (R 4.0.3)
#> vctrs 0.3.5 2020-11-17 [1] CRAN (R 4.0.3)
#> withr 2.3.0 2020-09-22 [1] CRAN (R 4.0.3)
#> xfun 0.19 2020-10-30 [1] CRAN (R 4.0.3)
#> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.3)
#>
#> [1] C:/Users/jprevey/Documents/R/R-4.0.3/library
…On Tue, Feb 2, 2021 at 5:11 AM Koen Hufkens ***@***.***> wrote:
Could you send a reproducible example using reprex.
https://reprex.tidyverse.org/
I can't debug based upon the information provided (R version, OS, library
versions etc).
The code you provided in the screenshot runs fine on my system R 3.6 /
linux.
library(daymetr)
download_daymet_tiles(
tiles = 11935,
start = 1980,
end = 1980,
param = c("tmin","tmax"),
path = tempdir()
)#> NOTE: data is stored in tempdir() ...#> #> Downloading DAYMET data for tile: 11935; year: 1980; product: tmin #> |======================================================================| 100%#> #> Downloading DAYMET data for tile: 11935; year: 1980; product: tmax#> |======================================================================| 100%
test <- daymet_grid_tmean(
product = 11935,
year = 1980,
internal = TRUE
)#> Using default path tempdir() ...#> Loading required namespace: ncdf4
Created on 2021-02-02 by the reprex package <https://reprex.tidyverse.org>
(v0.3.0)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABORHSJQRI7NIKSFYYVSSJ3S47TXNANCNFSM4OCXQMWQ>
.
|
Try to download a file locally and open it. See if this works. It's an |
Hello,
Thank you - that helped! When I looked at the files in a local folder, for
some reason the tmax products are not downloaded correctly - file sizes are
very small (I tried for several different years). However, if I adjust the
code to request only one parameter (tmin or tmax) per
'download_daymet_tiles" call - then the file sizes for both tmin and
tmax .nc files are similarly large, and the mean function works. Below is
the code that did not work, followed by the code that did:
#######Not working:
download_daymet_tiles(
+ tiles = 11935,
+ start = 1982,
+ end = 1982,
+ param = c("tmin","tmax"),
+ path = "C:/Users/jprevey/Desktop/daymet")
Downloading DAYMET data for tile: 11935; year: 1982; product: tmin
|===================================================================================================================|
100%
Downloading DAYMET data for tile: 11935; year: 1982; product: tmax
|===================================================================================================================|
100%
tmean = daymet_grid_tmean(product = 11935,
+ year = 1982,
+ internal = TRUE,
+ path = "C:/Users/jprevey/Desktop/daymet")
Error in R_nc4_open: NetCDF: Unknown file format
Error in ncdf4::nc_open(filename, readunlim = FALSE, suppress_dimvals =
TRUE) :
Error in nc_open trying to open file C:\Users\jprevey\Desktop\daymet\
tmax_1982_11935.nc
*######## *Working!
download_daymet_tiles(
+ tiles = 11935,
+ start = 1982,
+ end = 1982,
+ param = "tmin",
+ path = "C:/Users/jprevey/Desktop/daymet")
Downloading DAYMET data for tile: 11935; year: 1982; product: tmin
|===================================================================================================================|
100%
download_daymet_tiles(
+ tiles = 11935,
+ start = 1982,
+ end = 1982,
+ param = "tmax",
+ path = "C:/Users/jprevey/Desktop/daymet")
Downloading DAYMET data for tile: 11935; year: 1982; product: tmax
|===================================================================================================================|
100%
tmean = daymet_grid_tmean(product = 11935,
+ year = 1982,
+ internal = TRUE,
+ path = "C:/Users/jprevey/Desktop/daymet")
Thank you again,
--
Janet S. Prevéy
Research Ecologist
U.S. Geological Survey
2150 Centre Ave, Bldg C
Fort Collins, CO 80526
970-226-9249
…On Fri, Feb 5, 2021 at 10:31 AM Koen Hufkens ***@***.***> wrote:
Try to download a file locally and open it. See if this works. It's an
ncdf error so check if this works.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABORHSO6NT5CW4KF3IGIWQLS5QTONANCNFSM4OCXQMWQ>
.
|
This is odd, as I can do this in one query and it gives me two files 80.4 MB in size. Might be a windows thing, although my unit tests don't give me issues on this either. |
This was fixed in release 1.4.1, carried over to version 1.5 (closing) |
NCSS downloads have a fault in their projection information, set the correct values as such:
The text was updated successfully, but these errors were encountered: