Skip to content

Commit

Permalink
explicit ncdf4 calls in internal.R
Browse files Browse the repository at this point in the history
  • Loading branch information
dklinges9 committed Jan 24, 2022
1 parent dcd324f commit 8e60f12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ nc_to_df <- function(nc, long, lat, start_time, end_time, dtr_cor = FALSE,
dtr_cor_fac = 1) {

#open nc file
nc_dat = nc_open(nc)
nc_dat = ncdf4::nc_open(nc)
# Error trapping
# Check if start_time is after first time observation
start <- lubridate::ymd_hms("1900:01:01 00:00:00") + (nc_dat$dim$time$vals[1] * 3600)
Expand Down Expand Up @@ -199,7 +199,7 @@ nc_to_df <- function(nc, long, lat, start_time, end_time, dtr_cor = FALSE,
rad_dni, rad_dif, szenith, timezone)

# close nc file
nc_close(nc_dat)
ncdf4::nc_close(nc_dat)
return(dat)
}

Expand All @@ -216,7 +216,7 @@ nc_to_df <- function(nc, long, lat, start_time, end_time, dtr_cor = FALSE,
nc_to_df_precip <- function(nc, long, lat, start_time, end_time) {

# open nc file
nc_dat = nc_open(nc)
nc_dat = ncdf4::nc_open(nc)
# Error trapping
# Check if start_time is after first time observation
start <- lubridate::ymd_hms("1900:01:01 00:00:00") + (nc_dat$dim$time$vals[1] * 3600)
Expand Down Expand Up @@ -264,7 +264,7 @@ nc_to_df_precip <- function(nc, long, lat, start_time, end_time) {
dplyr::select(., obs_time, precipitation)

# close nc file
nc_close(nc_dat)
ncdf4::nc_close(nc_dat)
return(dat)
}

Expand Down

0 comments on commit 8e60f12

Please sign in to comment.