Calculates the distance traveled based on amtrac and airport lookup tables, included.
Both detailed output and error output are in the output directory.
Repository: https://github.com/williamscollege/emissions-calc
Script location: Run locally
Developers: Cheryl Handsaker (2018), Updated by Sam Gilman, Cheryl Handsaker (2019)
Zilkha Center
Replace the file travel.csv in the /input folder with your file. Maggie Koperniak is the source for the data. Data includes baggage fees marked with "XAO", "XAA", and "FEE".
IMPORTANT: Data should be sorted in the following order:
- Passenger Name ASC then by
- Merchant (ASC) then by
- Origin City (ASC) then by
- Desination City (ASC) then by
- Amount (DESC)
Run on the command line "php index.php"
Produces a summary of the mileage, broken out by train and airline travel.
#Output There are four detailed files produced in the /output directory
processed.csv is the file that outputs each line in the input file with a status code indicating how it was interpreted.
- P - Processed and included in the mileage calculation
- C - Credit without a corresponding charge. No mileage is added or subtracted.
- N - No miles calculated. This indicates the origin and destination city are the same.
- I - Incidentals. This line assumes these charges are for baggage fees, seat upgrades and meals.
- M - Manual review needed.
- X - Coded incidenentals using "XAO", "XAA", and "FEE".
- E - Error indicates that one of the fields required for processing is missing. Typically this is the origin or destination city.
- U - Unused. Indicated this line was somehow missed in the processing.
manualreview.csv is a file for items that require human review in context.
unprocessed.csv is a file of the errors encountered, such as missing origin or destination city.
mileage.csv is a file of the rows that go into the calculated mileage.