1 Intro and settings

This document outlines the methods used to assign environmental exposures for my masters research project. It draws on many data sources to assign exposures to any unique latitude, longitude, date and time in California. The exposures to be assigned by this code are as follows:

  • Weather
    • Temperature
    • Precipitation
    • Humidity
    • Wind speed and direction
  • Air Quality
    • Pollen
    • Particulate Matter (2.5 and 10)
    • Ozone
    • (Nitrogen dioxide?)
    • Aggregate Air Quality Index
  • Traffic-related air pollution
    • Proximity to nearest highway
    • Proximity to nearest primary or secondary road
    • (Other metric that includes traffic counts?)
  • Pesticides
    • Total pounds of pesticides applied within a given buffer from the inhaler actuation.
  • (Crime)
  • (NDVI)
  • (Tree cover)
  • (Surface temperature)

1.1 Creating a sample point

The following code creates a sample inhaler actuation, including the location and time.

# set lat and long for test point
longitude <- -121.7482695
latitude <- 38.6742656

# set sample date and time of inhaler use
date_inhaler <- as.Date("2012/05/07")
time <- "T12:00:00"

And here is a map of the sample point.

Now we can set some of the other variables used throughout this code.

# set buffer for pesticide (in meters)
pesticide.buffer <- 5000

# set buffer for motorways (in meters)
motorway.buffer <- 1000

# set air sampling buffer for AirNow Query (in meters)
air.quality.buffer <- 50000

# set number of days before inhaler use to look for pesticide applications
days_before <- 3

2 Weather

This first section takes the sample point and determines the weather at that time and location. I use the Forecast.io API to find hourly and daily averages of weather data. The Forecast.io API relies on many data sources, and the primary source for weather in California appears to be the USA NOAA’s Integrated Surface Database (ISD). More information on the quality control of ISD data can be found here. For this sample point, the following data sources were used by Forecast.io:

weather$flags
## $sources
## [1] "isd"
## 
## $`isd-stations`
## [1] "720576-99999" "724830-23232" "724836-23208" "724839-93225"
## [5] "999999-23271"
## 
## $units
## [1] "us"

2.1 Wind speed and direction

This graph shows the hourly temperature, humidity and precipitation and wind speed on: May 07, 2012 at the location shown in the map above.

And here is a wind rose showing hourly wind speed and direction on May 07, 2012

Questions

  • Do we use daily averages, hourly wind speed/direction, or something else for assigning exposure?

3 Air pollution

This section uses the EPA AirNow API to collect air quality data. A sample query for this date and time would be:

## [1] "http://www.airnowapi.org/aq/data/?startDate=2012-05-07T14&endDate=2012-05-07T15&parameters=O3,PM25,PM10,CO,NO2,SO2&BBOX=-122.322696374872,38.2238778904415,-121.173748547552,39.1245608684148&dataType=B&format=application/json&verbose=1&API_KEY=D2DDDB05-2267-4E4A-B05D-CE595EEF28C3"

This query returns data for all air quality monitoring stations within a 510^{4}m buffer of the inhaler actuation. For this sample point, this is data at at least one of the sampling stations for the following air pollutants:

  • NO2, OZONE, CO, PM2.5

3.1 Air quality monitoring stations

The API returns stations within a specified buffer of the sample point. Below is a map of the stations returned by the query. An 50km buffer from the inhaler actuation is outlined in red.

3.2 Inverse distance weighting

To estimate the exposure for criteria air pollutants, I use inverse distance weighting (IDW). This method interpolates the value of air pollutants using a weighted average between the measured values at each air quality monitoring station.

The following map shows the IDW Air Quality Index (AQI) for ozone. This method builds a 100 row x 100 column raster layer around the lat/long of inhaler actuation. The inverse distance weighting power (IDP) is specified as 6.

The calculated value of OZONE at the sample location is: 30

3.3 Pollen

Possibly will use the Accuweather API to accomplish this? Or find another source for historical pollen data? Or request historical data from AAAAI?


4 TRAP Analysis

This section outlines the methods used to estimate traffic-related air pollution (TRAP). We first download the road data, then calculate the distance from the sample point to both highways and other main roads.

4.1 Load OSM Roads

Below is a map of all roads within a 1000 meter radius of the sample point. The buffer is shaded blue, the motorways are red, secondary roads are orange, and all other roads are yellow.

4.2 Calculating Highway Proximity

  • add sample inhaler actuation
  • map shortest distance to nearest highway (red dotted line)
  • map shortest distance to nearest secondary road (orange dotted line)

This point is 237 meters (0.15 miles) away from the nearest highway.

4.3 Calculate Vehicle Miles Travelled

This first map shows the average annual daily traffic (AADT) for roads in the area, according from the Caltrans database.

Next, we select only the roads within a buffer of our inhaler use. We multiple the AADT by the length of each road segment (in miles), to calculate the daily vehicle miles travelled (VMT) for each road section.

Finally, we sum the total VMT to estimate the traffic density in the region surrounding the inhaler use. Total VMT for this buffer is: 70504 vehicle miles travelled

4.4 Next Steps:

  • calculate a function that returns a binary outcome for whether or not the actuation is within the designated buffer.
  • test this calculation on an array of variables (i.e. multiple actuations at once)

5 Land use analysis

5.1 DWR Polygons

The map below shows the DWR land use type in the area of the inhaler actuation.

The sample inhaler use is located in land use type: Commercial

5.2 Next steps:

  • consider methods for calculating average land use based on a buffering of the point.

6 Pesticide analysis

To analyze pesticide exposure, we use the Department of Pesticide Regulations, Pesticide Use Reporting Data. This data reports all commercial pesticide applications annually. The location is reported using the Public Land Survey System (PLSS), with a resolution of approximately one square mile.

6.1 Pesticide Data

Below is a graph of all pesticide use in Yolo and Sacramento counties for years 2012-14. The y axis shows pounds of pesticides applied per day:

Next Steps

  • remove outliers from PUR data

6.2 Pesticide application map

This is a map of pesticide use in Yolo and Sacramento Counties by PLSS section.

6.3 Estimate exposure

The exposure model for pesticides is still under development. It may eventually work as follows:

  1. take lat, long and buffer value (5000m)
  2. find all pesticide uses within the buffer of this location, on day of inhaler actuation and previous 2 days.
  3. for each pesticide use:
    • determine the crop on which this pesticide was used.
    • find all DWR land use polygons of the same crop with a centroid in that PLSS section polygon
    • create a new dataframe with metadata for each of these DWR polygons
    • create a new field that calculates the relative percentage of area for each DWR polygon
    • proportionately assign pesticide use to these DWR landuse polygons, in a new polygon called DWR_PUR
  4. create a buffer around each inhaler actuation
  5. if this buffer intersects with any DWR land use polygons in DWR_PUR,
    • calculate the percent of the area of the DWR_PUR polygon that is covered by the buffer
    • proportaionately assign pesticide pounds used, based on this percentage.
  6. sum all pesticide exposures.

6.3.1 take subset of PUR Data

  • Create a buffer of 5000 meters around the inhaler actuation.
  • Subset pesticide to show only pesticide applications within the buffer of this area
  • Subset pesticide data to show only include pesticide application within 3 days of the application date: 2012-05-07

This map shows all pesticide use within a 5000m buffer of the sample point, on the day of the inhaler actuation and the two days leading up to this day.

And here is a list of the individual pesticide applications.

##       MTRS chem_code lbs_chm_used acre_treated  applic_dt applic_time
##  M09N02E08      1929  106.5145905         75.0 2012-05-07        1000
##  M09N02E08      1996  148.3596000         75.0 2012-05-07        1000
##  M09N02E09       560   19.6000000          2.0 2012-05-05         800
##  M09N02E09       560  470.4000000         47.0 2012-05-05         800
##  M10N01E25       597    7.0268020         14.0 2012-05-07        1000
##  M10N01E25       597    0.6825820          1.4 2012-05-05         700
##  M10N01E25      1996    2.7996192          1.4 2012-05-05         700
##  M10N01E25      1996   27.9961056         14.0 2012-05-07        1000
##  M10N01E36        NA    0.0000000          5.0 2012-05-05        1000
##  M10N01E36      5759    0.7407000          5.0 2012-05-05        1000
##  M10N01E36      4003    0.9457335          5.0 2012-05-05        1000
##  aer_gnd_ind site_code
##            G     29136
##            G     29136
##            G     29141
##            G     29143
##            G     29136
##            G     29136
##            G     29136
##            G     29136
##            G     14011
##            G     14011
##            G     14011

6.4 Next steps

  • catch errors
  • calculate the percent of the area of the DWR_PUR polygon that is covered by the buffer and proportionately assign pesticide pounds used, based on this percentage.
  • separate pesticide applications based on type of pesticide
  • consider working on methods to increase spatial resolution of PUR application data by combining DWR landuse polygons and PLSS square-mile section polygons.

7 Summary data

For this hypothetical inhaler actuation we have now compiled the following data:

Weather

  • Daily wind speed: 6.34
  • Daily wind bearing: 333
  • Daily humidity: 0.33
  • Daily precipitation: 0

Air Quality Indexes

## [inverse distance weighted interpolation]
## [inverse distance weighted interpolation]
## [inverse distance weighted interpolation]
## [inverse distance weighted interpolation]
  • Ozone: 28
  • PM2.5: 26
  • PM10: insufficient data
  • NO2: 8.23
  • CO: -999
  • SO2: insufficient data

TRAP

  • Distance to highway: 237 meters (0.15 miles)
  • Distance to primary/secondary road: 140 meters (0.09 miles)

Land use

  • This inhaler use is located in land use type: Commercial

Pesticides

  • Proximal pesticide exposure: 785 pounds.
    • This counts all pesticides applied in the MTRS sections that intersect with a 5000 meter buffer around the location of inhaler actuation.
    • This only includes pesticides applied within 3 days leading up to the inhaler use.