Difference between revisions of "W2654 Data Visualization"

From Coder Merlin
m (Merlin moved page Project-2652 to W2654 Data Visualization: Improved navigation)
Line 1: Line 1:
[[File:DRAFT ICON.png|DRAFT ICON]]
== Prerequisites ==
== Prerequisites ==
* [[W2653 CSV File Processing]]
* [[W2653 CSV File Processing]]
Line 13: Line 12:
== Experiment ==
== Experiment ==
=== First Steps ===
=== First Steps ===
Create a new Igis shell project within your "project" directory.
{{ScenesShellPrepare|W2654}}
<syntaxhighlight lang="bash">
cd ~/projects
git clone https://github.com/TangoGolfDigital/IgisShell project-2652
</syntaxhighlight>


Enter into the Sources directory of the new project.
* Copy your '''Metar.swift''' file and your '''Example-metars.csv''' file from W2653 to the '''Sources''' subdirectory.
<syntaxhighlight lang="bash">
* Remove any code from global scope in the '''Metar.swift''' file
cd project-2652/Sources/IgisShell/
</syntaxhighlight>
 
Copy your main.swift file and your Example-metars.csv file from project-2651.
<syntaxhighlight lang="bash">
cp ../../../project-2651/main.swift Metar.swift
cp ../../../project-2651/Example-metars.csv .
</syntaxhighlight>
 
* Remove any code from global scope in the Metar.swift file
* Compile the project to ensure that it builds properly
* Compile the project to ensure that it builds properly


== Exercises ==
== Exercises ==
# In main.swift, 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.
# Create a new file, '''Metars.swift''' and 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.
# Find a map of the United States suitable for use as the background of a weather map.
# Find a map of the United States suitable for use as the background of a weather map.
# Select a few metars from each state (except in the northeast where you may select only one per state).  Using Igis, with the map as a full-screen background, plot the temperature (in celsius) of the station at the correct location on the map.   
# 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.   
# Now, at each station, produce a "Station Plot" in accordance with the station's data using the format indicated:
# Now, at each station, produce a "Station Plot" in accordance with the station's data using the format indicated:
[[File:Station Plot Model.png]]
[[File:Station Plot Model.png]]
Line 58: Line 43:
** Page 5-3, Figure 5-3 describes a Surface Analysis Chart Station Plot Model
** Page 5-3, Figure 5-3 describes a Surface Analysis Chart Station Plot Model
** Page 5-5, Figure 5-6 describes common weather symbols
** Page 5-5, Figure 5-6 describes common weather symbols
== Key Concepts ==

Revision as of 07:07, 1 May 2023

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

Prerequisites[edit]

Introduction[edit]

This tutorial will provide 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 and 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 may be helpful Code_Snippet:_Read_File
  • This date formatter may be helpful ISO 8601 Date Formatter (Swift Documentation)
  • While reading the file, you may find it helpful to print debugging output, including the line number and contents of that line, prior to processing the line. This will help you to more quickly identify errors.
  • More information about Metars and presentation may be found 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