Assignment 6: Wind For this assignment, you will be working with data derived from the North American Mesoscale, or NAM, model. The data we're using defines a vector field over the continental United...

See attached file for all information and starter code


Assignment 6: Wind For this assignment, you will be working with data derived from the North American Mesoscale, or NAM, model. The data we're using defines a vector field over the continental United States, and your goal is to build a particle flow visualization. For an example of what this should look like when finished, you can check out this video. For this assignment, you will need to implement bilinear interpolation to allow you to access values in the vector field. (it's only worth 2 points, so don't go super crazy) When you go from one frame to the next, you will need to update the positions of all of the particles. You can use either Runga-Kutta (or RK4) integration or Euler integration. I suggest you start with Euler integration at first to make sure you are drawing things correctly, and later replace it with Runga-Kutta. If you turn in an assignment with correctly implemented Runge-Kutta integration, you will earn extra credit (for up to 22/20). To draw a large number of points very quickly, I suggest using beginShape(POINTS). After calling that, every position that you set with a call to vertex will draw a point on the screen at the position you specify. You can change the size of the dots by calling strokeWeight before beginShape. Once you are done drawing points, don't forget to call endShape. If you want to change the particles' colors, you can do that by changing the stroke color. Since we are using P3D in our call to size, you can have a different color for each dot. Starting Code Since it can be difficult to correctly read in scalar fields, I have prepared some code that reads in the data, draws a map to the screen, and will draw a vector representing the wind direction and magnitude under the mouse cursor. The earth image is based on this image from Wikipedia. · hw6.pde (starter processing code) · background.png (background image) · uwnd.csv (east-west component of wind vector field) · vwnd.csv (north-south component of wind vector field) Specific Requirements 1. Implement bilinear interpolation for accessing data in the vector field. In the code I am giving you, you can do this by finishing the readInterp function. 2. Create a visualization where multiple particles move around the screen with a speed and direction corresponding to the wind data. In my code, I had 2000 particles. 3. Each particle should have it's own 'lifetime', or number of frames until it is assigned a random position and reset to the maximum lifetime. When you update the position of the particle, you should update the lifetime. In my code, I had the maximum lifetime set to 200 frames. 4. When your visualization starts, all particles should be assigned a random position and a random lifetime, set to something between 0 and the maximum lifetime. 5. You do not need to worry about particles moving off-screen, since the readRaw function takes care of not crashing. 6. If you have any external sources that you referenced, you MUST include comments referencing these in your source code. Data Format Feel free to skip this section if the sample code makes sense. If you want more details, keep reading. The data I am providing you is in a CSV format, where the grid structure of the vector field is reflected in the grid structure of the data. The data is 560x240 samples, with each sample representing 1/8th degree of longitude or latitude. This data represents the wind speed at 10m above ground level, and covers the continental United States. The full extent of this data is from 135°W to 65°W, and from 55°N to 25°N. The two files, 'uwnd' and 'vwnd', each store one component of the wind vector. 'uwnd' stores the east-west component, and 'vwnd' stores the north-south component. In terms of the NAM dataset, these two variables are UGRD and VGRD at 10m above ground. Submission instructions This assignment should be submitted to Blackboard by the end of the day on Tuesday, April 28. For this assignment, you are NOT allowed to work with a partner. Corrections There are no corrections yet. Assignment 6: Wind For this assignment, you will be working with data derived from the North American Mesoscale, or NAM, model. The data we're using defines a vector field over the continental United States, and your goal is to build a particle flow visualization. For an example of what this should look like when finished, you can check out this video. For this assignment, you will need to implement bilinear interpolation to allow you to access values in the vector field. (it's only worth 2 points, so don't go super crazy) When you go from one frame to the next, you will need to update the positions of all of the particles. You can use either Runga-Kutta (or RK4) integration or Euler integration. I suggest you start with Euler integration at first to make sure you are drawing things correctly, and later replace it with Runga-Kutta. If you turn in an assignment with correctly implemented Runge-Kutta integration, you will earn extra credit (for up to 22/20). To draw a large number of points very quickly, I suggest using beginShape(POINTS). After calling that, every position that you set with a call to vertex will draw a point on the screen at the position you specify. You can change the size of the dots by calling strokeWeight before beginShape. Once you are done drawing points, don't forget to call endShape. If you want to change the particles' colors, you can do that by changing the stroke color. Since we are using P3D in our call to size, you can have a different color for each dot. Starting Code Since it can be difficult to correctly read in scalar fields, I have prepared some code that reads in the data, draws a map to the screen, and will draw a vector representing the wind direction and magnitude under the mouse cursor. The earth image is based on this image from Wikipedia. · hw6.pde (starter processing code) · background.png (background image) · uwnd.csv (east-west component of wind vector field) · vwnd.csv (north-south component of wind vector field) Specific Requirements 1. Implement bilinear interpolation for accessing data in the vector field. In the code I am giving you, you can do this by finishing the readInterp function. 2. Create a visualization where multiple particles move around the screen with a speed and direction corresponding to the wind data. In my code, I had 2000 particles. 3. Each particle should have it's own 'lifetime', or number of frames until it is assigned a random position and reset to the maximum lifetime. When you update the position of the particle, you should update the lifetime. In my code, I had the maximum lifetime set to 200 frames. 4. When your visualization starts, all particles should be assigned a random position and a random lifetime, set to something between 0 and the maximum lifetime. 5. You do not need to worry about particles moving off-screen, since the readRaw function takes care of not crashing. 6. If you have any external sources that you referenced, you MUST include comments referencing these in your source code. Data Format Feel free to skip this section if the sample code makes sense. If you want more details, keep reading. The data I am providing you is in a CSV format, where the grid structure of the vector field is reflected in the grid structure of the data. The data is 560x240 samples, with each sample representing 1/8th degree of longitude or latitude. This data represents the wind speed at 10m above ground level, and covers the continental United States. The full extent of this data is from 135°W to 65°W, and from 55°N to 25°N. The two files, 'uwnd' and 'vwnd', each store one component of the wind vector. 'uwnd' stores the east-west component, and 'vwnd' stores the north-south component. In terms of the NAM dataset, these two variables are UGRD and VGRD at 10m above ground. Submission instructions This assignment should be submitted to Blackboard by the end of the day on Tuesday, April 28. For this assignment, you are NOT allowed to work with a partner. Corrections There are no corrections yet.
Apr 25, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here