Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

This exercise involves:

  • reading and visualising GRIB and CSV data
  • plotting text labels with Symbol Plotting
  • curve plotting on maps and xy-views
  • using the date functions in Macro
  • doing performing fiieldset computations in Macro

...

The storm track data is stored in the CSV file called 'called sandy_track.txt'txt. If you open this file you will see that it contains the date, time and geographical coordinates of the track points.

...

By returning the visual definition you have built a your Macro that behaves as if it were a real Symbol Plotting icon. So once save the Macro is saved and drag it into the plot and you should to see the labels appearing along the track.

...

With a new Cartesian View icon, set up a view to cater for the graph showing the mean sea level pressure values in hPa by setting

  • the x-axis type id to date
  • the y-axis label is to hPa
  • the y-axis minimum value is to 940 and its maximum is 1000

...

  • you read the track points from the CSV file
  • define a lat-lon box around each point
  • read the forecast mean sea level data for the box for the corresponding time
  • compute the minimum of the pressure in the box
  • from these minimum values you can build the curve data to plot.

Create new Macro and edit it. First, read the CSV file in the very same way as before but this time, on top of date and time, you also need to read latitude and longitude into vectors:

...

Next, read the forecast data for the current forecast step and the area you defined (supposing your area is called wbox):

Code Block
p=read(
		data: g,
		par: "msl",
		step: stepi*24,
		area : wbox
		)

Here we used the fact the forecasts steps are stored in hours units in the GRIB file.

Next, compute Compute the minimum of the field you read in using the minval() macro function:

Code Block
pmin=minval(p)

Finally, build the listthe lists for the values (scaling Pa units stored in the GRIB to hPa):

Code Block
trVal= trVal & [v/100]

and for the dates:

Code Block
trDate = trDate & [actDatedate(val_date(i)) + hour(actTimeval_time(i))]

Last build With this the body of the loop has been finished. The last step is to define an Input Visualiser and return it. The code you need to add is like this:

Code Block
vis = input_visualiser
(
    input_x_type        : "date",
    input_date_x_values : trDate,
    input_y_values      : trVal
)   

return [vis] 

Customising the storm track

...