Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 22, 2024
1 parent f543a66 commit e1cf6ab
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ repos:
types_or: [python, pyi, jupyter]
args: [--fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
types_or: [python, pyi, jupyter]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
defined by the Mozilla Public License, v. 2.0.
4 changes: 2 additions & 2 deletions notebooks/ntl-analysis/01_clean_data/02_extract_to_polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ for(roi_name in c("cadaster", "lbn_adm0", "lbn_adm1", "lbn_adm2", "lbn_adm3", "l

if(year >= 2012){
bm_r <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual", paste0("VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t",year,".tif")))

if(year <= 2022){
viirs_r_r <- raster(file.path(ntl_dir, "ntl-rasters", "viirs", "annual", paste0("LBN_viirs_mean_",year,".tif")))
} else{
viirs_r_r <- raster()
}

} else{
bm_r <- raster()
viirs_r_r <- raster()
Expand Down
4 changes: 2 additions & 2 deletions notebooks/ntl-analysis/02_analysis/map_ntl_annual.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#for(year_i in c(2019, 2022)){

# Load data --------------------------------------------------------------------
r_mean_19 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
r_mean_19 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2019.tif"))
r_mean_22 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
r_mean_22 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2023.tif"))

roi_sp <- read_sf(file.path(admin_bnd_dir, "lbn_adm_cdr_20200810", "lbn_admbnda_adm0_cdr_20200810.shp")) %>%
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ntl-analysis/02_analysis/percent_change_adm.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ for(roi_name in c("lbn_adm1", "lbn_adm2", "lbn_adm3", "lbn_adm4")){

roi_sf$pc22[roi_sf$pc22 > 100] <- 100
roi_sf$pc22[is.na(roi_sf$pc22)] <- 0

# Map --------------------------------------------------------------------------
city_df <- data.frame(lat = 33.898316, lon = 35.505696, name = "Beirut")

Expand Down
6 changes: 3 additions & 3 deletions notebooks/ntl-analysis/02_analysis/pixel_map_change.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Load data --------------------------------------------------------------------
roi_sf <- read_sf(file.path(admin_bnd_dir, "lbn_adm_cdr_20200810", "lbn_admbnda_adm0_cdr_20200810.shp"))

r12 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2012.tif"))
r22 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
r12 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2012.tif"))
r22 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2023.tif"))

r12 <- r12 %>% crop(roi_sf) %>% mask(roi_sf)
Expand Down
6 changes: 3 additions & 3 deletions notebooks/ntl-analysis/02_analysis/pixel_percent_change.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Load data --------------------------------------------------------------------
roi_sf <- read_sf(file.path(admin_bnd_dir, "lbn_adm_cdr_20200810", "lbn_admbnda_adm0_cdr_20200810.shp"))

r12 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2012.tif"))
r22 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
r12 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2012.tif"))
r22 <- raster(file.path(ntl_dir, "ntl-rasters", "blackmarble", "annual",
"VNP46A4_NearNadir_Composite_Snow_Free_qflag255_1_t2023.tif"))

r12 <- r12 %>% crop(roi_sf) %>% mask(roi_sf)
Expand Down

0 comments on commit e1cf6ab

Please sign in to comment.