Assignment 3.a - Meteoric
Group work
You will complete all parts of Assignment 3 with a partner. Partners will be paired up in class on Oct 15. You may look up your partner on the Canvas People tab and searching for your name.
You may collaborate with your partner(s) only. You will be working together to submit one assignment. Equal contribution is required.
Submitting code or other solutions from anywhere other than your own brains is cheating.
- Can you research how to use a particular function or library such as pytest? Yes.
- Can you get code that solves all or part of your homework? No.
- When in doubt, ask. I will not be upset if you ask.
Refer to the full details in the Syllabus on Canvas.
Setup
You will complete a program to analyze the NASA Meteorite Landings dataset: https://data.nasa.gov/widgets/gh4g-9sfh.
- Create an
assignment3/
directory in yourseng-201/
directory. - Download
spec.txt
andmeteorite_landings.csv
. Place them in theassignment3/
directory. - An implementation file,
meteoric.py
will be made available on Thursday.
Dataset
Open meteorite_landings.csv
in a text editor or spreadsheet application such as Excel or Google Sheets to view the data. The data looks like this:
name,id,year,reclat,reclong
Aachen,1,1880,50.775,6.08333
Aarhus,2,1951,56.18333,10.23333
Abee,6,1952,54.21667,-113
Acapulco,10,1976,16.88333,-99.9
...
Field | Description |
---|---|
name | A name for the specific meteorite. |
id | A unique integer identifier for the meteorite. |
year | The year the meteorite was found or observed. Years are positive 4-digit integers. |
reclat | The latitude at which the meteorite was found. Latitudes are floats in the range [-90.0,90.0]. |
reclong | The longitude at which the meteorite was found. Longitudes are floats in the range [-180.0,180.0]. |
Part A - problem statement
With your partner, write a problem statement as you did for Assignment 1. Copy the text below verbatim into the problem outline section of spec.txt
. Remember that problem statements do not specify design or implementation details.
Do not implement anything yet; you will be given starter code on Thursday.
Problem outline
This program analyzes the NASA Meteorite Landings dataset available at https://data.nasa.gov/widgets/gh4g-9sfh.
The program must run in two ways:
- Run from the CLI as
python meteoric.py <command> <argument>
- Run or debug
meteoric.py
without arguments and it will prompt the user to input the<command> <argument>
in the console.
The program must understand the following commands:
year <integer>
: Print out the meteorite data for all meteorites discovered in the<integer>
year. It is possible that no meteorites were discovered in a given year. Example usage:python meteoric.py year 1999
geopoint <latitude,longitude>
: Print out the meteorite data for the meteorite with the closest great-circle distance to the coordinates. Latitude is a float in the range [-90.0, 90.0]. Longitude is a float in the range [-180.0, 180.0]. Example usage:python meteoric.py geopoint 34.2257,-77.9447
Print meteorite data to the console in a human-friendly format.
Do not assume the <command>
or <argument>
are present or valid. The program must print an error message, not an exception or stack trace, if given bad arguments. Some examples of bad program calls:
python meteoric.py test
: invalid commandpython meteoric.py year
: missing argumentpython meteoric.py year s
: invalid argumentpython meteoric.py year 1999 2001 asd
: invalid arguments
Important: Code will be provided for you that loads the data from meteorite_landings.csv
into a data structure. You do not need to validate the data in the CSV file, however, some fields may be blank if the information is missing.
Rubric
Complete the spec.txt
template:
- (8 pts) Sample outputs covering all requirements.
- (8 pts) At least eight distinct exceptional conditions.
- (4 pts) All other elements of the problem statement template are completed.
Submission due Oct 16
One partner submits their team’s spec.txt
to the Canvas assignment page.