Assignment 3.a - Meteoric

Write the problem statement and plan the design of an application with a partner.

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.

  1. Create an assignment3/ directory in your seng-201/ directory.
  2. Download spec.txt and meteorite_landings.csv. Place them in the assignment3/ directory.
  3. 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
...
FieldDescription
nameA name for the specific meteorite.
idA unique integer identifier for the meteorite.
yearThe year the meteorite was found or observed. Years are positive 4-digit integers.
reclatThe latitude at which the meteorite was found. Latitudes are floats in the range [-90.0,90.0].
reclongThe 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:

  1. Run from the CLI as python meteoric.py <command> <argument>
  2. 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 command
  • python meteoric.py year: missing argument
  • python meteoric.py year s: invalid argument
  • python 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.

Last modified October 15, 2024.