E-deliver Digital Trash To The Source – Could There Be An App For That?

Litter is a problem of our throwaway culture and other negative societal forces. While it is obvious that litterers are partially responsible for polluting our communities and natural spaces, there are likely some natural instincts that are kicking in and overcoming them need resources, particularly in the realms of education, infrastructure, and community empowerment.

Beer bottles, soda cans, water bottles and other litter.
Beer bottles, soda cans, water bottles and other litter collected on a long dog walk.

On the other side of the equation though are the companies that create the cans, bottles, etc. that are thrown away in the first place and that fight efforts to implement policies that would be successful at reducing litter such as bottle deposits, extended producer responsibility (EPR), and single-use bans. Of course Coca-Cola, Dasani, Budweiser, etc. do not have to experience the harms to the community in terms of chemical leaching,  harm to animals, destruction of natural beauty, and even personal physical harms (e.g., from broken glass).

Imagine now if all of these materials could be easily returned to their creators.  Obviously EPR is designed to impose responsibility for the creators of waste, but the companies that don’t want to take responsibility fight such legislation tooth and nail.  Of course we could also rent a hop in a postal van like Kramer and Newman and drive those materials to Michigan (note it is illegal for you to do this, please don’t do that) or better yet return the bottles and cans directly to the companies that produce them.  Could you imagine that every Coke can got returned to Coca-Cola headquarters in Atlanta? If CEO James Quincy had to personally deal with the trash his company produces, they would be calling every Member of Congress asking for EPR (of course if you did drop off a bunch of Coke cans at their headquarters, they would probably have you arrested for littering).  Note that it probably is just fine to pick on Coca-Cola specifically: https://theintercept.com/2019/10/23/coca-cola-plastic-waste-pollution/.

Coca Cola HQ With Aluminum Can Piles
Coca Cola HQ (credit Hector Alejandro) and Aluminum Cans (credit Joe Loong)

But what if someone were to create the next best thing, an app for that. The concept is simple, instead of physically delivering the litter a picture of the litter is what is being delivered and of instead the litter being delivered to a company’s headquarters it gets directly delivered into their Twitter mentions and Instagram tags.  This, of course, is something you can do already as you can see from my twitter feed.  However, to make the barrier to entry easier the next step would be to make the connections automagically so snapping the picture uses image detection to find the brand and the social media handles for the company and then auto generates the text for your tweet and/or gram.  Another benefit of this approach is that it could allow for specific language on the ask for a campaign.

I personally would have loved to make this idea happen, but my coding skills are old, and while I know it is quite possible for this type of work to be done, how to do it might be above my skill level.  I hope this post finds its way to a coder in search of a good idea for how more effectively draw attention to the litter our planet faces.

ERTAC EGU Code v3.0 Available

A new version of the ERTAC EGU code, v3.0, is now available. The new version of the code simply ports v2.2 to work with Python v3.x, so this upgrade was more about retesting features than actual code changes. James at MDE was coded the port and I focused on the testing.

The new code base is available on github: https://github.com/bukim1/ERTAC-EGU-Emission-Projection-Tool. I hope others can put the code to good use.

He Knows If You’ve Been Voting

In 2020, I volunteered to write letters for VoteFwd. The idea behind it is that receiving a letter from someone in the leadup to an election can motivate reluctant voters to show up at the polls. Since voting is vital for our democracy to function, I joined numerous other activists in writing such letters, signing up for 20 letters each in Texas and North Carolina. I wrote my letters and sent them off as part of the big send, but I was wondering, did I have an impact?

40 letters was not too large of a number, but it was bordering on the point that some scripting would help me get to the bottom of my question. Each letter that I wrote had a PDF template that was printable that included the individual addresses (though I fully handwrote the actual letters, sorry I though the template was a little tacky). I then took all of the pdfs template for the voters I had written to, saved them in a folder, and wrote an R script to create a csv of the addresses (see code below).

The script produced a nice csv file with most of the information I needed so I imported them into my google contacts. I also labeled them so I could easily find these 40 contacts. Had I known, I would have added a phone number and removed the middle names for each contact as well so I recommend doing this to the csv at this point – more on this later.

The next step was to actually look up whether my folks voted. The reason why I imported the addresses into google contacts is because I wanted to use the phone app Impactive. This app allows you to look up which friends of yours regularly vote or not, and is especially easy to use if you have their addresses in your contacts since it hits voter files. In order to get the contacts to show up though, it was also necessary to have their phone numbers, which is why I added phone numbers after the fact. Since I didn’t actually have the 40 voters’ numbers I just picked a random number with Texas and North Carolina area codes.

And then I waited (March 2021). And waited (June 2021). And waited (September 2021). And waited (December 2021). And waited (February 2022). See it apparently takes a while for the voter file to update. I usually checked myself first before looking for my 40 voters since I know that I voted in 2020.

Finally, I checked on May 7, 2022 using Impactive to see if I voted, and I found out that I had voted in 2020, so I knew it was time to check my 40 voters. This is when I discovered that including the middle names made it harder to find the voters (I hypothesized that it was going to make it easier, but all of the middle names had to be deleted to get Impactive to work). And here are the results.

State Voted? Found? Percent Voted
NC 7 17 41%
TX 11 17 65%
Grand Total 18 34 53%

Unfortunately, I couldn’t find everyone. Some people didn’t show up, perhaps because they had moved, and some had common names and lived in a large city so I couldn’t make out which person was the one that had potentially gotten my letter. I did count one person though, since they had a common name, but all of the folks with the common name voted so I am sure one of them got my letter.

It did appear that I had could have had an impact. Obviously, it is a small sample size and I don’t have a counterfactual, but overall 53% of the 40 voters that I could find voted. This definitely made me think I should sign up for VoteFwd again in 2022 (you can too – https://votefwd.org/campaigns) and write more letters so I have a bigger sample size. I might try to do some with a template too to see if they is more or less effective (it certainly is quicker to use the template).  

RScript

library(dplyr)
library(pdftools)

filenames <- list.files(“/filepath/VoteForward Complete”, pattern=”*.pdf”, full.names=TRUE)
addresses <- data.frame(matrix(ncol = 6, nrow = 0))
colnames(addresses) <- c(“First Name”, “Last Name”, “Street Address”, “City”, “State”, “Zip”)

for(f in filenames) {
 letter_pdf <- pdf_data(f)[[1]]
 letter_text <- as.data.frame(arrange(letter_pdf,y, x)$text)
 i <- 0
 step <- 0
 first_name <- ”
 last_name <- ”
 street <- ”
 city <- ”
 state <- ”
 zip <- ”

 while(i < nrow(letter_text)) {
  i <- i+1
  current_row <- as.character(letter_text[i,])

  if(step == 3) {
   if(substr(current_row, nchar(current_row), nchar(current_row)) == “,”) {
    step <- 0
    city <- paste(city, substr(current_row, 1, nchar(current_row)-1))
    current_row <- as.character(letter_text[i+1,])
    state <- current_row
    current_row <- as.character(letter_text[i+2,])
    zip <- current_row
    addresses <- rbind(addresses,
              data.frame(`First.Name` = first_name, `Last.Name` = last_name, `Street.Address` = street, City = city, State = state, Zip = zip))
   } else {
    city <- ifelse(city == ”, current_row, paste(city, current_row))
   }
  }

  if(step == 2) {
   if(substr(current_row, nchar(current_row), nchar(current_row)) == “,”) {
    step <- 3
    street <- paste(street, substr(current_row, 1, nchar(current_row)-1))
   } else {
    street <- ifelse(street == ”, current_row, paste(street, current_row))
   }
  }

  if(step == 1) {
   if(substr(current_row, nchar(current_row), nchar(current_row)) == “,”) {
    step <- 2
    last_name <- substr(current_row, 1, nchar(current_row)-1)
   } else {
    first_name <- ifelse(first_name == ”, current_row, paste(first_name, current_row))
   }
  }
  if(as.character(letter_text[i,]) == “voting.” & as.character(letter_text[i+1,]) == “For:”) {
   i <- i+1
   step <- 1
  }
 }
}
write.csv(addresses, “Addresses.csv”)

ERTAC EGU Code v2.2 Available

It is exciting that the new version of the ERTAC EGU code, v2.2, is now available. I have worked on developing the new features for this open source python codebase, that uses EPA and state data to project future emissions from power plants. It was great to work with partners in several states and regional organizations to then test and evaluate the new code.

Full details of the new features are in a README, but some of the things I am particularly excited about are the so called “HIZG” hours and the new fuel/unit types and state input files.

We have found in previous versions that in projections, emissions from startup and shutdowns don’t get maintained. This because in the hourly Clean Air Markets Data (CAMD) that ERTAC EGU relies upon startups and shutdowns have heat input and emissions, but no gross load, though Heat Input Zero Gross load (HIZG). Since there ERTAC EGU projects by growing or shrinking generations due to supplied changes in demand, hours with no generation were simply dropped from consideration. With ERTAC v2.2 those hours can now be maintained. This not only allows startups and shutdowns to be projected to future years, it also is one of two necessary requirements to allow ERTAC EGU to process so called “non-EGUs,” essentially units in CAMD that do not generate power (e.g., oil refineries, steel mills, pulp mills).

The other major improvement is the ability to add new fuel unit types. The code was originally written to limit the user to five fuel/unit types. However, a new input allows users to add fuel/unit types. This was particularly useful to the group to allow non-EGUs to be processed. It also allows some types of power generators to be projected, such as various biomass facilities that were ignored in the original code. With incorporation of other data sources and extensive use of the “demand transfer” functionality one might be able to include renewables, though this was never tested. Also the ability to override the default state.csv file was included, which could allow this tool to be used to subdivide states (for instance to include EGUs within, and outside of, a nonattainment area in a state) or allow this tool to be used in other countries where hourly power plant data can be found.

This is all quite exciting. The new code base is available on github: https://github.com/bukim1/ERTAC-EGU-Emission-Projection-Tool. I hope others can put the code to good use.