DEMOS/CMv4_SeasonalEx.R

#########################################################################################
### Draft USFWS Collision Fatality Model Code version 4.1                             ###
### This code is a working version only. It is not intended for general distribution. ###
### Check back often for updates to the model/code                                    ###
#########################################################################################

# Source the required function files:
# You will need to replace the file path with the correct file path for your
# computer (it should should point R to where you have save these files)

source("C:/workspace/projects/Eagles/training/DayLen.R")
source("C:/workspace/projects/Eagles/training/RVSmry.R")
source("C:/workspace/projects/Eagles/training/FatalFcns.R")

## double-slashes also work... 
# source("C:\\workspace\\training\\RFiles\\DayLen.R")
# source("C:\\workspace\\training\\RFiles\\RVSmry.R")
# source("C:\\workspace\\training\\RFiles\\FatalFcns.R")

## Super-user tip!! If you get really stuck with 'sourcing' the code files, you can always
## open the files (even in WordPad) and copy and paste directly into R 
## (you would want to do this before running the model code file)


## Define seasonal strata and calculate daylight hours:

#"PWRC Lat/long"
LatLng<-c(39.059083,-76.812766)

## SeasonType defines your end of season cut-dates or the type of default breakdown you want to use.
#SeasonType<-"Annual"
SeasonType=c("02/29","06/30","09/30")
Labels=c("Winter","Summer","Fall")
## Labels define the names of the seasons (ordering must be consistent with SeasonType)

### run the next 4 lines of code to get daylight hours
DayLtHr<-DayLen(LatLng[2],LatLng[1],Type=SeasonType,Labels) 
colnames(DayLtHr)[1]<-"Season"
DayLtHr$AveDayLen<-with(DayLtHr,DayLtHr/Days)
print(DayLtHr)
###

### PWRC Wind Project Data ###

cProject<-"PWRC Seasonal"

Name<-"Ida Modeler"#"Your Name Here" or the name to be associated with results printout

nTurbine<-c(50) #number of turbines

HazRadKm<-c(93/2/1000) #radius of hazardous area around each turbine (in km)

HzKM2<-sum(nTurbine*pi*HazRadKm^2) #hazardous area around each turbine (in km)

CntHr<-c(60/60)  # observation count duration (in hours)

## Create the "ExpSvy" data frame:
## this includes the seasonal category names (e.g. "Annual"), eagle minutes observed (e.g. 60), 
## number of counts of the duration specified in CntHr conducted (e.g. 130),
## the area observed at each observation point (e.g. area of 800-m circular plot in km), 
## and the daylight hours for each season (e.g. 4453.766 annual daylight hours)
## Note: these data are entered into the data frame manually  

ExpSvy<-data.frame(row.names=c("Winter","Summer","Fall"), 
                   EMin=c(5,10,8),
                   nCnt=c(80,60,100),
                   CntKM2=c(pi*(800/1000)^2),
                   DayLtHr=c(1546.809,1660.216,1246.741)
)

##  Indicate whether strata should be totaled:
##  If you do not have strata, this should be FALSE

AddTot<-TRUE #Add strata for total (TRUE) or not (FALSE)
josephstatwick/EagleModelCalc documentation built on May 16, 2019, 4:55 p.m.