Skip to content

Commit

Permalink
typo was sourcing the wrong data file.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbrey committed Dec 3, 2018
1 parent ec64d35 commit 2b5ba2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions support_r_scripts/daily_bluesky_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ url_base <- paste0("https://smoke.airfire.org/bluesky-daily/output/standard/", m
# TODO: until the condition is satisfied.
check_for_files <- function(URL){

# Test statements to see if the new files that are needed exist.
fire_locations_test <- FALSE
smoke_dispersion_test <- FALSE

Expand Down Expand Up @@ -259,7 +260,7 @@ bs2v2 <- function(fileName) {

# Create a new netcdf file
fileName_v2 <- str_replace(fileName, ".nc", "_v2.nc")
new_nc <- nc_create(fileName_v2, pm25Var)
new_nc <- nc_create(fileName_v2, pm25Var)

# Put data into the newly defined variable
ncvar_put(new_nc, pm25Var, pm25)
Expand All @@ -269,14 +270,15 @@ bs2v2 <- function(fileName) {

print("Created the new version of the smoke_dispersion.nc file.")
return(time) # Handy for indexing values.

}

# Now run this function on the file we just downloaded. It returns time array
# that can be used for slicing the gridded smoke data.
time_nc <- bs2v2(fileName)

# working with the raster brick of the nc file
nc_path <- paste0(home_path, "data/smoke_dispersion_v2.nc")
nc_path <- paste0(home_path, "data/smoke_dispersion_test_v2.nc")

# get nc data as raster as class "RasterBrick"
smoke_brick <- brick(nc_path)
Expand Down

0 comments on commit 2b5ba2f

Please sign in to comment.