Skip to content

Commit

Permalink
Merge branch 'rodents-533' of https://github.com/weecology/PortalData
Browse files Browse the repository at this point in the history
…into rodents-533
  • Loading branch information
Lindsey Bell committed Nov 7, 2024
2 parents c886f04 + 870385d commit 36641ed
Show file tree
Hide file tree
Showing 19 changed files with 7,488 additions and 5,905 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
- name: Setup R (Ubuntu)
uses: eddelbuettel/github-actions/r2u-setup@master

- name: Install system dependencies

- name: Install Python and packages
run: |
pipx install --include-deps pandas numpy landsatxplore
python -m pip install --upgrade pip
python -m pip install pandas numpy landsatxplore
- name: Install packages
run: Rscript install-packages.R
Expand Down
3 changes: 0 additions & 3 deletions DataCleaningScripts/clean_pit_tags.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@



#
# determines if a tag is a PIT tag by its structure
# requires species input for comparison, returns a logical vector
Expand Down
8 changes: 4 additions & 4 deletions DataCleaningScripts/get_regional_weather.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
library(httr)
library(jsonlite)
library(dplyr)
library(lubridate)
library(httr, warn.conflicts=FALSE, quietly = TRUE)
library(jsonlite, warn.conflicts=FALSE, quietly = TRUE)
library(dplyr, warn.conflicts=FALSE, quietly = TRUE)
library(lubridate, warn.conflicts=FALSE, quietly = TRUE)

# Explicitly assign magrittr pipe operator
`%>%` <- magrittr::`%>%`
Expand Down
8 changes: 4 additions & 4 deletions DataCleaningScripts/new_rodent_data.r
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This script is for cleaning new rodent data. Data must first be entered in two separate sheets in
# an excel file, by two different people to reduce entry error.

library(openxlsx)
library(sqldf)
library(RCurl)
library(dplyr)
library(openxlsx, warn.conflicts=FALSE, quietly = TRUE)
library(sqldf, warn.conflicts=FALSE, quietly = TRUE)
library(RCurl, warn.conflicts=FALSE, quietly = TRUE)
library(dplyr, warn.conflicts=FALSE, quietly = TRUE)

source('DataCleaningScripts/general_data_cleaning_functions.R')
source('DataCleaningScripts/rodent_data_cleaning_functions.R')
Expand Down
2 changes: 1 addition & 1 deletion DataCleaningScripts/old_weather_overlap.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source("DataCleaningScripts/new_weather_data.r")
# Open raw .dat file of new data
filepath = "~/Dropbox (UFL)/Portal/PORTAL_primary_data/Weather/Raw_data/2002_Station/"

metfile <- "Met526"
metfile <- "Met534"

rawdata <- read.csv(paste(filepath,metfile,'.dat',sep=''),head=F,sep=',',
col.names=c('code','year','jday','hour','precipitation','airtemp','RH'))
Expand Down
2 changes: 1 addition & 1 deletion DataCleaningScripts/rodent_data_cleaning_functions.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(dplyr)
library(dplyr, warn.conflicts=FALSE, quietly = TRUE)

currentdir = getwd()

Expand Down
6 changes: 3 additions & 3 deletions DataCleaningScripts/update_ndvi.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://www.usgs.gov/landsat-missions/landsat-collection-2-level-2-science-products

`%>%` <- magrittr::`%>%`
library(terra)
library(terra, warn.conflicts=FALSE, quietly = TRUE)

#' @title create_portal_area
#'
Expand Down Expand Up @@ -84,7 +84,7 @@ summarize_ndvi_snapshot <- function(records, targetpath = tempdir()) {
print(records["display_id"])
source <- "USGS"
sensor <- paste0("Landsat", records["satellite"])
date <- as.Date(records["acquisition_date"])
date <- lubridate::ymd_hms(format(records["acquisition_date"], format = "%Y-%m-%d %T %Z"))

r <- extract_and_mask_raster(records, targetpath)

Expand All @@ -96,7 +96,7 @@ summarize_ndvi_snapshot <- function(records, targetpath = tempdir()) {
md <- median(values(r),na.rm=T)
mi <- min(values(r),na.rm=T)
ma <- max(values(r),na.rm=T)
va <- var(values(r),na.rm=T)
va <- var(values(r),na.rm=T)[1,1]
pix <- length(values(r))

d <- data.frame(date = as.Date(date), sensor = sensor, source = source,
Expand Down
2 changes: 1 addition & 1 deletion DataCleaningScripts/update_portal_plant_censuses.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# you must manually change it's value to zero
# If a season gets skipped entirely, it should also be manually added

library(dplyr)
library(dplyr, warn.conflicts=FALSE, quietly = TRUE)

#' Appends new census dates to Portal_plant_censuses
#'
Expand Down
4 changes: 2 additions & 2 deletions DataCleaningScripts/update_portal_plots.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
library(zoo)
library(dplyr)
library(zoo, warn.conflicts=FALSE, quietly = TRUE)
library(dplyr, warn.conflicts=FALSE, quietly = TRUE)

#' Appends new dates to Portal_plots
#'
Expand Down
4 changes: 2 additions & 2 deletions DataCleaningScripts/update_portal_rodent_trapping.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This creates the Portal_rodent_trapping.csv file in the Rodents folder
# Record of which plots were or were not trapped in each census and exact dates

library(dplyr)
library(zoo)
library(dplyr, warn.conflicts=FALSE, quietly = TRUE)
library(zoo, warn.conflicts=FALSE, quietly = TRUE)

#' Appends new trapping dates to Portal_rodent_trapping
#'
Expand Down
9 changes: 9 additions & 0 deletions NDVI/ndvi.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3484,3 +3484,12 @@
2024-09-14,"Landsat9","USGS",4422,0.173520664484033,0,0.000632123801695432,0.118960499898486,0.398667167522295
2024-09-15,"Landsat8","USGS",4422,0.17025756402245,0,0.00055928485460436,0.120118623266412,0.379759732720423
2024-09-23,"Landsat9","USGS",4422,0.167676355093998,0,0.00063424708970505,0.115105957893011,0.364816615862614
2024-09-30,"Landsat9","USGS",4422,0.172568612806747,0,0.000494937339088828,0.123923577888206,0.335097179865221
2024-10-01,"Landsat8","USGS",4422,0.166459781440317,0,0.000543715142538043,0.114510263525275,0.328321623322148
2024-10-08,"Landsat8","USGS",4422,0.165106511068842,0,0.000506610375668904,0.115104776957244,0.329573601645699
2024-10-09,"Landsat9","USGS",4422,0.163941535906633,0,0.000485204046313852,0.116881268485778,0.317717607625432
2024-10-16,"Landsat9","USGS",4422,0.149134311322764,0,0.00039804975228395,0.10748957570742,0.281760004394518
2024-10-17,"Landsat8","USGS",4422,0.1604018867701,1.74129353233831,0.000873001576652171,0.0678971456100207,0.318145747109597
2024-10-24,"Landsat8","USGS",4422,0.160642248438728,0,0.000481665685045098,0.113067961979703,0.319706957638722
2024-10-25,"Landsat9","USGS",4422,0.157566866599098,0,0.000452752872489841,0.110638886780744,0.301651741293532
2024-11-01,"Landsat9","USGS",4422,0.160292985228627,66.0334690185436,0.00028536222862143,0.117894326596515,0.245805390358092
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PortalData

<!-- badges: start -->
[![Build Status](https://github.com/weecology/PortalData/workflows/CI/badge.svg)](https://github.com/weecology/PortalData/actions)
[![Build Status](https://github.com/weecology/PortalData/actions/workflows/main.yml/badge.svg)](https://github.com/weecology/PortalData/actions/workflows/main.yml)
[![License](http://i.creativecommons.org/p/zero/1.0/88x31.png)](https://raw.githubusercontent.com/weecology/PortalData/main/LICENSE)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1215988.svg)](https://doi.org/10.5281/zenodo.1215988)
[![NSF-1929730](https://img.shields.io/badge/NSF-1929730-blue.svg)](https://nsf.gov/awardsearch/showAward?AWD_ID=1929730)
Expand Down
1 change: 1 addition & 0 deletions Rodents/moon_dates.csv
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,4 @@
583,2024-08-04,532,2024-08-10
584,2024-09-02,NA,NA
585,2024-10-02,NA,NA
586,2024-10-31,NA,NA
4 changes: 4 additions & 0 deletions Weather/Portal_storms.csv
Original file line number Diff line number Diff line change
Expand Up @@ -37571,3 +37571,7 @@
"2024-10-18 23:30:00",1383,12.72,0
"2024-10-18 23:35:00",1384,12.73,0
"2024-10-18 23:40:00",1385,12.72,0
"2024-11-03 17:15:00",1386,12.89,0.254
"2024-11-03 17:20:00",1387,12.88,0
"2024-11-03 17:25:00",1388,12.86,0
"2024-11-03 17:30:00",1389,12.86,0
Loading

0 comments on commit 36641ed

Please sign in to comment.