W2654 Data Visualization

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Prerequisites[edit]

Introduction[edit]

This tutorial provides an introduction to data visualization.

Research[edit]

Experiment[edit]

First Steps[edit]

Create a new Scenes shell project within your Experiences directory:

ty-cam@codermerlin:~$  cd ~/Experiences

ty-cam@codermerlin:~/Experiences$  git clone https://github.com/TheCoderMerlin/ScenesShellBasic W2654


Enter the Sources/ScenesShell directory of the new project:

ty-cam@codermerlin:~/Experiences$  cd W2654/Sources/ScenesShell/


Start button green arrow
Run the program.

ty-cam@codermerlin:~/Experiences/W2654/Sources/ScenesShell$  run


Ensure that you are logged on to the wiki. Then, click on the Tools menu followed by right-clicking on IGIS and selecting the menu item Open in New Window or Open in New Tab.

You'll know you're successful if you see the title bar change to "Coder Merlin: IGIS". (The browser window will be blank because we haven't added any graphics yet.)

Hint.pngHelpful Hint
It's useful to bookmark this page in your browser.
  • Copy your Metar.swift file and your Example-metars.csv file from W2653 to the Sources subdirectory.
  • Remove any code from global scope in the Metar.swift file.
  • Compile the project to ensure that it builds properly.

Exercises[edit]

  1. Create a new file, Metars.swift, then choose a collection data type, and read the data from the Example-metars.csv file into that type using your METAR class as the element type. Note that you must read the entire file, even if there are mistakes or omissions in that file. In such a case, you may skip only the errant line after printing a warning message to the console, which must include the errant line number.
  2. Find a map of the United States suitable for use as the background of a weather map.
  3. Select a few METARs from each state (except in the northeast where you may select only one per state). Using Scenes, with the map as a full-screen background, plot the temperature (in Celsius) of the station at the correct location on the map.
  4. Now, at each station, produce a "Station Plot" in accordance with the station's data using the format indicated:

Station Plot Model.png

 KLSF 270055Z AUTO 29016KTG23 5SM +RA BKN043 OVC055 14/10 A3012

Flight Category Colors: VFR MVFR IFR LIFR

Hints:

  • This code snippet might be helpful: Code_Snippet:_Read_File
  • This date formatter might be helpful: ISO 8601 Date Formatter (Swift Documentation)
  • While reading the file, you might find it helpful to print debugging output, including the line number and contents of that line, before processing the line. This will help you to more quickly identify errors.
  • More information about METARs and presentation is at FAA Circular
    • Page 3-9, Table 3-2 describes METAR Notations for Reporting Present Weather.
    • Page 5-3, Figure 5-3 describes a Surface Analysis Chart Station Plot Model.
    • Page 5-5, Figure 5-6 describes common weather symbols.