Skip to content
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

Closed
khufkens opened this issue Jun 19, 2020 · 7 comments
Closed

NCSS projection issues #42

khufkens opened this issue Jun 19, 2020 · 7 comments

Comments

@khufkens
Copy link
Member

NCSS downloads have a fault in their projection information, set the correct values as such:

# set the correct projection
raster::projection(r) <- "+proj=lcc +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +units=km +no_defs"
@khufkens khufkens pinned this issue Jun 19, 2020
@janetprevey
Copy link

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:

tmean <- daymet_grid_tmean(path = tempdir(),

  •                        product = 11935,
    
  •                        year = 1980,
    
  •                        internal = TRUE)
    

Using default path tempdir() ...
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\1\Rtmp8mbClo\tmax_1980_11935.nc

image

@khufkens
Copy link
Member Author

khufkens commented Feb 2, 2021

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 (v0.3.0)

@janetprevey
Copy link

janetprevey commented Feb 4, 2021 via email

@khufkens
Copy link
Member Author

khufkens commented Feb 5, 2021

Try to download a file locally and open it. See if this works. It's an ncdf error so check if this works.

@janetprevey
Copy link

janetprevey commented Feb 12, 2021 via email

@khufkens
Copy link
Member Author

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.

@khufkens
Copy link
Member Author

khufkens commented May 7, 2021

This was fixed in release 1.4.1, carried over to version 1.5 (closing)

@khufkens khufkens closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants