Skip to content

Instantly share code, notes, and snippets.

Andrew Bannerman flare9x

  • USA
View GitHub Profile
@flare9x
flare9x / first_pass_tmin.jl
Last active Apr 19, 2019
First Pass B31.3 Pressure Tmin and API 574 Structural Tmin Assessment
View first_pass_tmin.jl
# Step 1 - Calculate B31.3 Pressure Tmin
# Step 2 - Obtain API 574 Structural Tmin From Table 7
# Step 3 - Calculate remaining wall thickness at the area of interest
# Step 4 - Check that the remaining wall thickness is above pressure and/or structural tmin
# Step 5 - Assess how much corrosion allowance has been lost / how much remains
# Step 1 - Calculate B31.3 Pressure Tmin
# ASME B31.3 - 304.1.2 Straight Pipe Under Internal Pressure
Tnom = 1
P = 2220 # Shell specification DD, Design Pressure 2220psig @ 100F
@flare9x
flare9x / rectangle_vessel_one_stay_plate.R
Last active Feb 6, 2019
# Rectangle Vessels With Stay Plate - ASME VIII # Figure 13-2(a) - Sketch (7)
View rectangle_vessel_one_stay_plate.R
# Rectangle Vessels With Stay Plates
# Figure 13-2(a) - Sketch (7)
# 13-9 STAYED VESSELS OF RECTANGULAR CROSS SECTION
# [FIGURE 13-2(A) SKETCHES (7) AND (8)]
#--- Begin single Script
# Material SA-516 Gr 70 (S)
S = 20000
@flare9x
flare9x / rectangle_vessel_stresses_tmin.R
Last active Feb 4, 2019
ASME Section VIII – Division 1 - Appendix 13
View rectangle_vessel_stresses_tmin.R
# ASME VIII 2017
# 13-4 DESIGN OF VESSELS OF NONCIRCULAR CROSS SECTION
# Figure 13-2(a) Vessels of Rectangular Cross Section
# Selection = Sketch (1)
#--- Begin single script - validate calculations against example problem
# ASME PTB-4-2013 - Example Problem - Header Box Data
# Material = SA516, Grade 70 (S)
@flare9x
flare9x / abs_tmin.jl
Last active Jan 31, 2019
ABS Piping Tmin + Tnominal Calculation
View abs_tmin.jl
# ABS Tmin
# 5.1.1 Pipes Subject to Internal Pressure (2002)
ID = 4.0
OD = 4.5
ratio = OD / ID
ratio = 1.125
# Check tmin applies:
View FDA.Event.Study.rbind.weeks.prior.FDA.R
# Scrape Historical FDA events
# Clean Data - Extract Date from text
# Clean up Catalyst Column - remove date, white space
# Sort by ascending date order
# Note 2x non ticker symbols, these are removed
require(XML)
require(dplyr)
require(PerformanceAnalytics)
require(data.table)
@flare9x
flare9x / nasdaq_etf_list.R
Created Jan 24, 2019
Obtain List of ETFS From nasdaq.com
View nasdaq_etf_list.R
# Obtain List of ETFS From nasdaq.com
# Andrew Bannerman 10.4.2017
library(data.table)
# Read ETF list csv file from nasdaq.com
# Use fread() from data.table package
# install.packages("data.table")
read.data <- fread("http://www.nasdaq.com/investing/etfs/etf-finder-results.aspx?download=Yes")
@flare9x
flare9x / us_census_texas_vacancy_rate.R
Created Jan 18, 2019
Interactive Map - US Census - Texas Vacancy Rate
View us_census_texas_vacancy_rate.R
# Packages
library(tigris)
library(acs)
library(stringr) # to pad fips codes
library(rgdal) # for readOGR and others
library(sp) # for spatial objects
library(leaflet) # for interactive maps (NOT leafletR here)
library(dplyr) # for working with data frames
library(ggplot2) # for plotting
library(RColorBrewer) # color pallete
@flare9x
flare9x / us_census_median_home_value.R
Last active Jan 18, 2019
Interactive Map - US Census Data - Texas Median Home Value
View us_census_median_home_value.R
# Packages
library(tigris)
library(acs)
library(stringr) # to pad fips codes
library(rgdal) # for readOGR and others
library(sp) # for spatial objects
library(leaflet) # for interactive maps (NOT leafletR here)
library(dplyr) # for working with data frames
library(ggplot2) # for plotting
library(RColorBrewer) # color pallete
View population_age_6_yr_change.R
# Packages
library(tigris)
library(acs)
library(stringr) # to pad fips codes
library(rgdal) # for readOGR and others
library(sp) # for spatial objects
library(leaflet) # for interactive maps (NOT leafletR here)
library(dplyr) # for working with data frames
library(ggplot2) # for plotting
library(RColorBrewer) # color pallete
@flare9x
flare9x / us_census_6yr_population_change.R
Created Jan 18, 2019
Interactive Map - US Census 6yr Population Change
View us_census_6yr_population_change.R
# US Census Population 6 yr change
# create a geographic set to grab tabular data (acs)
geo<-geo.make(state=c("TX"),
county="*", tract="*")
#geo<-geo.make(state=c("NY"),
# county=c(5, 47, 61, 81, 85), tract="*")
# !!!! important note -- the package has not been updated to 2013
# data so I'm using the five year span that ends in 2012
You can’t perform that action at this time.