WWW.DISSERTATION.XLIBX.INFO
FREE ELECTRONIC LIBRARY - Dissertations, online materials
 
<< HOME
CONTACTS



Pages:     | 1 |   ...   | 10 | 11 || 13 |

«A Thesis Presented to the Faculty of the Graduate School of Cornell University In Partial Fulfillment of the Requirements for the Degree of Master of ...»

-- [ Page 12 ] --
2246335 4/7/2013 16:00,0,17.575189 4/7/2013 17:00,0,17.5421025 4/7/2013 18:00,0,17.0223435 4/7/2013 19:00,0,15.9008485 4/7/2013 20:00,0,14.714512 4/7/2013 21:00,0,11.1190725 4/7/2013 22:00,0,8.1942365 4/7/2013 23:00,0,6.3445385 4/8/2013 0:00,0,5.121964

–  –  –

This code is run on the raw gas chromatograph data after peak integration. It cleans up the raw data, makes calibration curves, and calculates concentrations of N2O for each field sample, then writes a csv file containing the concentration data.

############################################## #clear all variables rm(list=ls()) #set working directory to source of csv files setwd("./final_data/csvfiles") #loads tables from csv files as variable called "RSTUYZN2O" RSTUYZN2O-read.csv("FT529.csv", header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, comment.char="") #discards data marked with "REJY" in extra_field RSTUYZN2O-RSTUYZN2O[RSTUYZN2O$extra_field != "REJY",] #reforms dataframes without null entries RSTUYZN2O-RSTUYZN2O[RSTUYZN2O$samplename != "no data",] #drop samples with zero peak area RSTUYZN2O-RSTUYZN2O[RSTUYZN2O$ECDarea1 != 0,] #add new column for concentration RSTUYZN2O$conc_ppm-NA #convert dates from factors to dates

–  –  –

as.Date(as.character(RSTUYZN2O$collectdate),format="%Y%m%d") #convert samplename to characterstring RSTUYZN2O$samplename-as.character(RSTUYZN2O$samplename) #converts sample comment field from factors to character arrays, then substring of first 3 characters RSTUYZN2O$samplecomment-substr(as.character(RSTUYZN2O$samplecomment),1,3) ############################################################################## ###### #separates data by Check samples, calibrations and field samples based on "CAL" or "CHK" in the sample comment #split data into separate dataframes based on "CAL" and "CHK" RSTUYZN2O_CAL-RSTUYZN2O[RSTUYZN2O$samplecomment == "CAL",] #add extra field for quadratic calibration curves RSTUYZN2O_CAL$areaSQ - (RSTUYZN2O_CAL$ECDarea1)^2 #remaining data should be all field samples RSTUYZN2O_FLD-RSTUYZN2O[RSTUYZN2O$samplecomment != "CHK" & RSTUYZN2O$samplecomment !="CAL",] ############################################################################## ######## #set up calibration table:

#establish concentrations for standards #assigns values to concentration field based on calibration name

–  –  –

RSTUYZN2O_CAL$conc_ppm[RSTUYZN2O_CAL$samplename == "0.33"]- 0.33 #assign value for 50/50 RSTUYZN2O_CAL$conc_ppm[RSTUYZN2O_CAL$samplename == "0.5"]- 0.5 #assign value for N2O standard RSTUYZN2O_CAL$conc_ppm[RSTUYZN2O_CAL$samplename == "0.8"]- 0.8 ############################################################################## ######### #do regression models for each set of calibrations #splits 1x CALS into dataframes by collection date CAL-split(RSTUYZN2O_CAL, RSTUYZN2O_CAL$originalsequence, drop=TRUE) #same to keep points PTS-split(RSTUYZN2O_CAL, RSTUYZN2O_CAL$originalsequence, drop=TRUE) #loop replaces data frame elements of CAL1X with a regression model of that dataframe

–  –  –

{ CAL[[j]]-lm(conc_ppm ~ ECDarea1, CAL[[j]], na.action = na.omit) } ############################################################################## ####### #plots all regression models xpt - seq(from = 0, to = 130, by = 0.1)

–  –  –

plot(PTS[[i]]$ECDarea1, PTS[[i]]$conc_ppm, type='p',pch=19, cex = 1,col=1, main=names(CAL[i]),xlab="Peak area", ylab="Concentration (ppm)", ylim = c(0,1), xlim=c(0,130))

–  –  –

abline(reg=CAL[[i]], untf = FALSE, col="red") } #combine all regression models into one data frame CAL.lm-CAL ############################################################################## ########## #establish concentrations for all field samples based on appropriate linear model coefficients #math convert to injection concentration from vial concentration RSTUYZN2O_FLD$CALslope-NA RSTUYZN2O_FLD$CALintercept-NA

–  –  –

RSTUYZN2O_FLD$conc_ppm[k]RSTUYZN2O_FLD$CALslope[k]*RSTUYZN2O_FLD$ECDarea1[k]) + RSTUYZN2O_FLD$CALintercept[k]) } ############################################################################## ############################################

–  –  –

This script loads the output of script 1. It organizes the concentration data by chamber and determines the slope dC/dt by linear regression. It plots the regression along with the original data points for visual verification, then assembles a dataframe of final slope values for each chamber and writes this to a csv file.

#clear all variables rm(list=ls()) #set working directory to source of csv files setwd("./concentration") #loads tables from csv files conc-read.csv("FT_conc.csv", header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, comment.char="") #add column to dataframe and add concatenated info for each replicate conc$repID-paste(conc$collectdate, conc$subplot, conc$position, conc$treatment, conc$replicate, sep="/") #add column for (correcttime)^2 for regression fiting later conc$tsquare-(conc$correcttime^2) #creates nested dataframes for each replicate conc.df-split(conc, conc$repID) #creates more dataframes to receive modles and "n" based on same dimensions as conc.df quad.df-split(conc, conc$repID) linear.df-split(conc, conc$repID)

–  –  –





#loop to determine dc/dt at t = 0 for each replicate time series for (i in 1:length(conc.df)) eval(parse(text=paste("n.df$'", names(conc.df[i]),"'-length(rownames(conc.df[[i]]))", sep=""))) # if there are 3 points, do a linear regression and send the model to linear.df data frame if (length(rownames(conc.df[[i]])) == 3) { eval(parse(text=paste("quad.df$'", names(conc.df[i]),"'-NA", sep=""))) eval(parse(text=paste("linear.df$'", names(conc.df[i]),"'-lm(conc_ppm ~ correcttime, conc.df[[i]])", sep=""))) } #if there are four points, calcualate both linear and quadratic models and send to dataframes

–  –  –

{ eval(parse(text=paste("quad.df$'", names(conc.df[i]),"'-lm(conc_ppm ~ correcttime + tsquare, conc.df[[i]])", sep=""))) eval(parse(text=paste("linear.df$'", names(conc.df[i]),"'-lm(conc_ppm ~ correcttime, conc.df[[i]])", sep=""))) } #entry for replicates with less than 3 points, no model but print replicate and "n"

–  –  –

{ eval(parse(text=paste("quad.df$'", names(conc.df[i]),"'-NA", sep=""))) eval(parse(text=paste("linear.df$'", names(conc.df[i]),"'-NA", sep=""))) } } ############################################################################## ################ #plots of quadratic models and points #create vector of x points xpt-seq(0,60, by=0.1) for (k in 0:(floor(length(conc.df)/9))) { #mac wont recognize windows()function

–  –  –

if (is.na(quad.df[(9*k)+j]) == TRUE & is.na(linear.df[(9*k)+j]) == TRUE) eval(parse(text = paste("ypt-(coef(quad.df$'",names(conc.df[(9*k)+j]),"')[1] + coef(quad.df$'",names(conc.df[(9*k)+j]),"')[2]*xpt + coef(quad.df$'",names(conc.df[(9*k)+j]),"')[3]*xpt^2)", sep="")))

–  –  –

eval(parse(text=paste("plot(conc.df$'", names(conc.df[(9*k)+j]), "'$correcttime,", "conc.df$'", names(conc.df[(9*k)+j]), "'$conc_ppm, type='p',pch=19, cex=2,col=2, ylim=c(0.25,0.55))", sep="")))

–  –  –

eval(parse(text=paste("plot(conc.df$'", names(conc.df[(9*k)+j]), "'$correcttime,", "conc.df$'", names(conc.df[(9*k)+j]), "'$conc_ppm, type='p',pch=19, cex=2,col=3, ylim=c(0.25,0.55))", sep="")))

–  –  –

} } } } ############################################################################## ######################################## #create dataframe with final flux values for both linear and quadratics flux.df-as.data.frame(matrix(ncol=9,nrow=length(n.df))) names(flux.df)-c("date","subplot", "position", "treatment","replicate","slopeL","LRsq","slopeQ","QRsq") for (q in 1:length(n.df)) { flux.df$date[q]-substr(names(n.df[q]), 1, 10) flux.df$subplot[q]-substr(names(n.df[q]), 12, 12)

–  –  –

{ eval(parse(text = paste("flux.df$slopeL[q]-coef(linear.df$'", names(n.df[q]), "')[2]", sep="" ))) eval(parse(text = paste("flux.df$LRsq[q]-summary(linear.df$'", names(n.df[q]), "')$r.squared", sep="")))

–  –  –

{ eval(parse(text = paste("flux.df$slopeL[q]-coef(linear.df$'", names(n.df[q]), "')[2]", sep="" ))) eval(parse(text = paste("flux.df$LRsq[q]-summary(linear.df$'", names(n.df[q]), "')$r.squared", sep=""))) eval(parse(text = paste("flux.df$slopeQ[q]-coef(quad.df$'", names(n.df[q]), "')[2]", sep="" )))

–  –  –

"')$r.squared", sep=""))) } } ############################################################################## ### #remove fluxes for replicates with n 3 flux.df-flux.df[is.na(flux.df$slopeL) == FALSE,] #make dataframe from flux.df, replacing linear slope and Rsquared where quadratic is NA or negative slopeQ.df-flux.df #where slopeQ is NA (less than 4 points) replace QRsq with LRsq slopeQ.df$QRsq[is.na(slopeQ.df$slopeQ) == TRUE]-slopeQ.df$LRsq[is.na(slopeQ.df$slopeQ) == TRUE] #where slopeQ is NA, (less than 4 points), replace with slope L for that row slopeQ.df$slopeQ[is.na(slopeQ.df$slopeQ) == TRUE]slopeQ.df$slopeL[is.na(slopeQ.df$slopeQ) == TRUE] #where quadratic slope is negative, replace quadratic Rsquared with linear R squared slopeQ.df$QRsq[slopeQ.df$slopeQ 0]-slopeQ.df$LRsq[slopeQ.df$slopeQ 0] #where quadratic slope is negative, replace quadratic slope with linear slope slopeQ.df$slopeQ[slopeQ.df$slopeQ 0]-slopeQ.df$slopeL[slopeQ.df$slopeQ 0] #write slope datafiles

–  –  –

This script loads the output of script 2. For flux calculation, it also loads the molar volume data which is based on the temperature and air pressure conditions for each date.

Constants for chamber volume and area, as well as molar mass of N2O are defined and the script calculates fluxes in units of g N2O m-2 min-1 and writes an output file.

#clear all variables rm(list=ls()) #Load data files #set working directory to source of csv files setwd("./slope") #loads slope tables from csv files slope.df-read.csv("FT_slope.csv", header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, comment.char="") #set working directory to source of csv files setwd("..") setwd("./soilmoisture") #loads Vm table from csv files Vm.df-read.csv("FT_Vm.csv", header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, comment.char="") ############################################################################## ######################################## #combine all data into one data frame!

–  –  –

Vm.df$date-as.Date(Vm.df$date, format = '%m/%d/%Y') slope.df$date-as.Date(slope.df$date, format = '%Y-%m-%d') #add columns to slope table and specify enviornmental data slope.df$Vm-NA #loop to add Vm to slope table by matching dates for (i in 1:length(Vm.df$date)) { slope.df$Vm[slope.df$date == Vm.df$date[i]]-Vm.df$Vm_m3_mol[i] } ############################################################################## ################################################## #Establish other variables and calculate fluxes #chamber volume in m3 Vcham-0.019718 #chamber area in m2 Acham-0.065563 #molecular mass N2O in g/mol Mn2o-44.0128 #create and populate flux column for both linear and quadratic regressions flux.df-slope.df #fluxes ar in g m^-2 min-1

–  –  –

flux.df$fluxQ-flux.df$slopeQ*(Vcham*Mn2o)/(Acham*flux.df$Vm*10^6) #add ID for unique chamber replicate flux.df$ID-as.factor(paste(flux.df$subplot, flux.df$position, flux.df$treatment, flux.df$replicate, sep = "")) #write fluxes to datafile #set directory setwd("..") setwd("./flux") #write file write.csv(flux.df, file = "FT_flux_613.CSV")

–  –  –

This script loads the flux output file generated by script 3. It runs the Wilcoxon signedrank test and the Kruskal-Wallis rank-sum test on all fluxes to determine differences between treatments.

#clear all variables rm(list=ls()) #Load data files #set working directory to source of csv files setwd("./flux") #loads slope tables from csv files flux.df-read.csv("FT_flux_613.csv", header = TRUE, sep = ",", quote="\"", dec=".", fill = TRUE, comment.char="") # create ID 2 for treatments and position flux.df$ID2 -paste(flux.df$position, flux.df$treatment, sep = "") ############################################################################## ############################### #4. Wilcoxon signed-rank test for all daily pairs of subplots (i.e. AHT # vs. AHC and AHT vs. ALT).

# average both replicates for each day #split into pairs of reps flux4.df - split(flux.df, paste( substr(flux.df$ID,1,3),flux.df$date, sep = ".")) #create empty dataframe and name columns

–  –  –

colnames(mean4.df) - c( 'date', 'ID','ID2','strip','pos', 'treat', 'mean_flxL') #loop to fill dataframe for (i in 1:length(flux4.df)) { mean4.df$date[i] - substr(names(flux4.df[i]),5,14 ) mean4.df$ID[i] - substr(names(flux4.df[i]),1,3 ) mean4.df$ID2[i] - substr(names(flux4.df[i]), 2,3) mean4.df$mean_flxL[i] - mean(flux4.df[[i]]$fluxL, na.rm = FALSE)#False results in the actual average for BLT on 4/4, NA. TRue results in the one remaining value mean4.df$strip[i] -substr(mean4.df$ID[i],1,1) mean4.df$pos[i] -substr(mean4.df$ID[i],2,2) mean4.df$treat[i] -substr(mean4.df$ID[i],3,3) } ######test 1 #test flux ~ treatment: not signifcant #V = 994, p-value = 0.07298 wilcox.test(mean4.df$mean_flxL ~ mean4.df$treat, paired = TRUE, na.action = "na.pass") #or mean4.1.df - split(mean4.df, mean4.df$treat) #finds location of NA in "TREAT" split NAvect1 - is.na(mean4.1.df[[2]]$mean_flxL) #set other pair to NA

–  –  –



Pages:     | 1 |   ...   | 10 | 11 || 13 |


Similar works:

«Northern Rivers NSW Aboriginal and Torres Strait Islander Workers Directory 1 Lismore City Council January 2016 FOREWORD The Aboriginal Worker’s Directory is produced bi-annually and is compiled and updated by Lismore City Council. Lismore has a diverse population and is the regional centre for the Far North Coast. It is a magnet for the arts, culture, and alternative lifestyles. There is a large student population due to the presence of Southern Cross University and Lismore TAFE. The...»

«The role of wild grasses in subsistence and sedentism: new evidence from the northern Fertile Crescent Manon Savard, Mark Nesbitt and Martin K. Jones Abstract Sedentism is usually regarded as a pre-condition for the development of crop husbandry in Southwest Asia and, consequently, sedentary pre-agrarian sites are an important focus of research on the origins of agriculture. It is often assumed that wild grasses were as important for huntergatherers as domesticated cereals were for early...»

«EC-LEDS ENHANCING CAPACITY FOR LOW EMISSION DEVELOPMENT STRATEGIES NATIONAL RENEWABLE ENERGY LABORATORY RENEWABLE ENERGY OPPORTUNITY ASSESSMENT FOR USAID MEXICO November 2015 Andrea Watson, Ricardo Bracho, Rachel Romero, Megan Mercer EC-LEDS is managed by the U.S. Agency for International Development (USAID) and Department of State with support from the U.S. Department of Energy, U.S. Environmental Protection Agency, U.S. Department of Agriculture, and U.S. Forest Service. Printed with a...»

«Predictions in Ungauged Basins: PUB Kick-off (Proceedings of the PUB Kick-off meeting held in Brasilia, 74 20–22 November 2002). IAHS Publ. 309, 2007. Water Balance Methodology for indirect assessment and prediction of basin water yield under human-induced land use changes N. V. PENKOVA & I. A. SHIKLOMANOV State Hydrological Institute (SHI), 23 Second Line VO, 199053, St. Petersburg, Russia penkov@peterlink.ru Abstract The lastest versions of the Heat and Water Balance Models (HWBMs) are...»

«Best Management Practices for Agricultural Erosion and Sediment Control SONOMA COUNTY AGRICULTURAL COMMISSIONER’S OFFICE TABLE OF CONTENTS INTRODUCTION REGULATORY REQUIREMENTS CALIFORNIA TIGER SALAMANDER MAP CHAPTER ONE LAYOUT AND SITE DEVELOPMENT ENVIRONMENTAL CONCERNS SITE EVALUATION BEST MANAGEMENT PRACTICES EXAMPLE VINEYARD LAYOUT EXAMPLE VINEYARD LAYOUT NEAR STREAM CHAPTER TWO ROADS ENVIRONMENTAL CONCERNS SITE EVALUATION BEST MANAGEMENT PRACTICES FOR AGRICULTURAL ROADS EXAMPLE OUTSLOPED...»

«CURRICULUM VITA NAME: Mark C. Siemens 6425 W. 8th St.ADDRESS: Yuma, AZ 85364 CONTACT: (928) 782-3836 siemens@cals.arizona.edu EDUCATION: Ph.D. Agricultural and Biosystems Engineering, University of Arizona; 1996 Dissertation Title: Cable Drawn Farming System Analysis and Control Development M.S. Mechanical and Industrial Engineering, University of Illinois, 1990 Thesis Title: Computer Model to Predict the Hydraulic Pump Requirements of Backhoe Type Excavators B.S. Mechanical and Industrial...»

«HAIL, HAIL, HAIL ! THE SUMMERTIME HAZARD OF EASTERN COLORADO Nolan J. Doesken, Assistant State Climatologist (Colorado Climate publication, April 1994, Volume 17, Number 7, Special Feature Section) INTRODUCTION Hail ! the word itself sends feelings of frustration through Colorado farmers. Each year, millions of dollars of agricultural losses occur when hailstorms s weep across the Eastern Plains. Hundreds of Colorado wheat farmers can tell tales of disappointment about years when their crop had...»

«A GREAT KOREAN MUSIC PIONEER MIN-CHONG PARK: A PERFORMANCE GUIDE OF HIS SELECTED VIOLIN WORKS A Dissertation Submitted to the Graduate Faculty of the Louisiana State University and Agricultural and Mechanical College in partial fulfillment of the requirement for the degree of Doctor of Musical Arts in The School of Music by Sin Myung Min B.A., Kookmin University, 2006 M.M., Temple University, 2009 December 2014 ACKNOWLEDGEMENTS I would like to express my deep appreciation to the members of my...»

«Pak. J. Bot., 41(4): 1627-1635, 2009. DEVELOPMENT OF GENETIC LINKAGE MAP OF LEAF HAIRINESS IN GOSSYPIUM HIRSUTUM (COTTON) USING MOLECULAR MARKERS IFTIKHAR ALI1*, ABIDA KAUSAR1, MEHBOOB-UR-REHMAN3, YUSUF ZAFAR3, MUHAMMAD ASIF3, MUHAMMAD ASHRAF2, SANA RIAZ1, SARA ZAFAR1, ABDUL WAHID2, SOBIA MAQSOOD1, MUBASHIR NIAZ1 AND SYED QAISER ABBAS1 1 Department of Botany, GC University, Faisalabad, Pakistan 2 Department of Botany, University of Agriculture, Faisalabad, Pakistan 3 National Institute of...»

«SAFER TO STEAL THAN SCORE: PRESS COVERAGE OF FINANCIAL AND SEXUAL SCANDALS, AND ELECTORAL OUTCOMES A Dissertation Submitted to the Graduate Faculty of the Louisiana State University and Agricultural and Mechanical College in partial fulfillment of the requirements for the degree of Doctor of Philosophy in The Manship School of Mass Communication by Chance York B.G.S., University of Kansas, 2008 M.S., Kansas State University, 2010 May 2014 ©Copyright 2014 Chance York All rights reserved ii...»

«Patient & Family Guide to Hospice Care Serving Colorado’s Front Range The Kingfisher, calm and at peace, nested upon water, quieter of restlessness. A Patient & Family Guide to Hospice Care To All, I just want you to know what an honor it is for Halcyon to be invited into your lives in such an intimate way. We are very much committed to living up to your expectations, wishes and desires. Halcyon is a clinician owned hospice. It’s vision is to provide patient centered care to people who...»

«DIALOGUES, DYSFUNCTIONAL TRANSITIONS, AND EMBODIED PLOT SCHEMAS: (RE) CONSIDERING FORM IN CHOPIN’S SONATAS AND BALLADES A Dissertation Submitted to the Graduate Faculty of the Louisiana State University and Agricultural and Mechanical College In partial fulfillment of the requirements for the degree of Doctor of Philosophy in The School of Music by Jonathan Mitchell B.M., Millsaps College, 2004 M.M., Louisiana State University, 2006 December 2012 ACKNOWLEDGMENTS I am grateful for the numerous...»





 
<<  HOME   |    CONTACTS
2016 www.dissertation.xlibx.info - Dissertations, online materials

Materials of this site are available for review, all rights belong to their respective owners.
If you do not agree with the fact that your material is placed on this site, please, email us, we will within 1-2 business days delete him.