Skip to content

Commit

Permalink
Merge pull request #95 from hcorson-dosch-usgs/cy_2023
Browse files Browse the repository at this point in the history
Update to calendar year 2023
  • Loading branch information
hcorson-dosch-usgs authored Jun 3, 2024
2 parents 8896fea + 54eac69 commit 724a945
Show file tree
Hide file tree
Showing 21 changed files with 247 additions and 156 deletions.
4 changes: 2 additions & 2 deletions 0_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ targets:
##-- Fetch configs --##

viz_start_date:
command: as.Date(I('2022-01-01'))
command: as.Date(I('2023-01-01'))
viz_end_date:
command: as.Date(I('2022-12-31'))
command: as.Date(I('2023-12-31'))
# Use bounding box in case we want to do this regionally someday
# Start with CONUS only
# I don't think this is being used any more ...
Expand Down
16 changes: 15 additions & 1 deletion 3_visualize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,22 @@ targets:
visualizations/data/gw-conditions-daily-proportions.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-daily-proportions.csv', config_file = I('lib/cfg/s3_config_viz.yml'))

# MUST BE RUN MANUALLY, AS UPLOADING FILES UPDATES THE BETA SITE
# Upload to Prod (beta bucket) a copy of the timeseries, daily proportions, site coords, and time labels to use on the beta site
visualizations/data/gw-conditions-peaks-timeseries-beta.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-peaks-timeseries.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))

visualizations/data/gw-conditions-daily-proportions-beta.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-daily-proportions.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))

visualizations/data/gw-conditions-site-coords-beta.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-site-coords.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))

visualizations/data/gw-conditions-time-labels-beta.csv.ind:
command: s3_put(target_name, '2_process/out/gw-conditions-time-labels.csv', config_file = I('lib/cfg/s3_config_viz_beta.yml'))

# MUST BE RUN MANUALLY, AS UPLOADING FILES UPDATES THE LIVE SITE
# Upload to Prod a copy of the timeseries, daily proportions, site coords, and time labels to use on the live site
# Upload to Prod (prod bucket) a copy of the timeseries, daily proportions, site coords, and time labels to use on the live site
visualizations/data/gw-conditions-peaks-timeseries-live.csv.ind:
command: s3_put(target_name, '3_visualize/out/gw-conditions-peaks-timeseries.csv', config_file = I('lib/cfg/s3_config_viz.yml'))

Expand Down
2 changes: 1 addition & 1 deletion 3_visualize/out/gw-conditions-daily-proportions-s3copy.ind
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hash: 7e98eb082cb2abda37fcd663230f1940
hash: 5d9d05238386e4f818f4d6f1ca051bc7

2 changes: 1 addition & 1 deletion 3_visualize/out/gw-conditions-peaks-timeseries-s3copy.ind
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hash: 27af0faa6ba9d1aa69ced5d194c1376b
hash: 15f470784c897971afd9c7a7f63366b2

2 changes: 1 addition & 1 deletion 3_visualize/out/gw-conditions-site-coords-s3copy.ind
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hash: 5c330a701c80681e587e4f1afe1f0139
hash: e2694c1d4d74f9e2ffd76c2f2c11f955

2 changes: 1 addition & 1 deletion 3_visualize/out/gw-conditions-time-labels-s3copy.ind
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hash: 8286962579ff4062969e873cc574bdd9
hash: d28ab3ba24b2f8f26b0eb7d27eb657ea

16 changes: 12 additions & 4 deletions 3_visualize/src/sf_utils_shift.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ shift_sf <- function(obj_sf, rotation_deg, scale, shift, proj_str) {

stopifnot(!is.na(st_crs(obj_sf)))

# store original projection (CONUS) to use to redefine projection
# once geometry is projected and shifted
proj_orig <- st_crs(obj_sf)

obj_sf_transf <- st_transform(obj_sf, proj_str)
obj_sfg <- st_geometry(obj_sf_transf)
obj_sfg_centroid <- st_centroid(obj_sfg)
Expand All @@ -176,10 +180,10 @@ shift_sf <- function(obj_sf, rotation_deg, scale, shift, proj_str) {
# Want to return a complete `sf` object, not just the geometry
# Not features were filtered, the values were just updated, so
# we can make a copy of `obj_sf` and then insert the updated
# geometry + add the appropriate projection info
# geometry + set the projection to the original CONUS projection
obj_sf_shifted <- obj_sf_transf # Make a copy
st_geometry(obj_sf_shifted) <- obj_sfg_shifted
st_crs(obj_sf_shifted) <- proj_str
st_crs(obj_sf_shifted) <- proj_orig

return(obj_sf_shifted)
}
Expand Down Expand Up @@ -265,6 +269,10 @@ shift_points_sf <- function(pts_sf, rotation_deg, scale, shift, proj_str, ref_sf

stopifnot(!is.na(st_crs(pts_sf)))

# store original projection (CONUS) to use to redefine projection
# once geometry is projected and shifted
proj_orig <- st_crs(pts_sf)

pts_sf_transf <- st_transform(pts_sf, proj_str)
pts_sfg <- st_geometry(pts_sf_transf)

Expand All @@ -283,10 +291,10 @@ shift_points_sf <- function(pts_sf, rotation_deg, scale, shift, proj_str, ref_sf
# Want to return a complete `sf` object, not just the geometry
# No features were filtered, the values were just updated, so
# we can make a copy of `pts_sf` and then insert the updated
# geometry + add the appropriate projection info
# geometry + set the projection to the original CONUS projection
pts_sf_shifted <- pts_sf # Make a copy
st_geometry(pts_sf_shifted) <- pts_sfg_shifted
st_crs(pts_sf_shifted) <- proj_str
st_crs(pts_sf_shifted) <- proj_orig

return(pts_sf_shifted)
}
Expand Down
3 changes: 3 additions & 0 deletions lib/cfg/s3_config_viz_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
profile: 'default'

bucket: 'water-visualizations-beta-website'
12 changes: 9 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ h2{
font-weight: 700;
@media screen and (max-width: 800px) {
font-size: 2rem;
}
}
@media screen and (max-height: 770px) {
font-size: 2em;
}
@media screen and (max-width: 650px) {
font-size: 1.3em;
}
Expand All @@ -109,10 +112,13 @@ h3{
//padding-top: 0.5em;
@media screen and (max-width: 800px) {
font-size: 1.3em;
}
}
@media screen and (max-height: 770px) {
font-size: 1.25em;
}
@media screen and (max-width: 650px) {
font-size: 1em;
}
}
}
h4{
font-size: 1.2em;
Expand Down
17 changes: 9 additions & 8 deletions src/assets/gw-conditions-labels-map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 724a945

Please sign in to comment.