Versions Compared

Key

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

This tutorial demonstrates how to generate a single plume trajectories trajectory with FLEXPART and how to visualise the results in various ways.

...

Note

Please enter folder 'plume_trtrajectory' to start working.


Info

In this example we will generate a forward trajectories trajectory by releasing atmospheric tracers from Newcastle.

...

This says that the release will happen over a 3 h period between heights in the lower 500 m at Newcastle and we will release 1000 kg of material in total.

...

Code Block
languagepy
#Run flexpart (asynchronous call!)
r = flexpart_run(
	output_path			:	"result_tr",
	input_path			:	"../data",
	starting_date		:	20120517,
	starting_time		:	12,
	ending_date			:	20120519,
	ending_time			:	12,
	output_field_type	:	"none",
	output_trajectory	:	"on",
	output_area			:	[40,-25,66,10],
	output_grid			:	[0.25,0.25],
	output_levels		:	500,
	release_species		:	1,
	releases			:	rel_ncastle
 
print(r)

Here we defined both the input and output path and specified the simulation period , and the output grid as well. We also told FLEXPART to only generate plume trajectories on output..

Info

The actual species that will be released is defined as an integer number (for details about using the species see here). With the default species settings number 1 stands for atmospheric  tracer.

If we run this macro (or alternatively right-click execute the FLEXPART Run icon) the results resulting CSV file, 'tr_r1.csv', will be available (after a minute or so) will be available in folder 'result_tr'. The computations actually took place in a temporary folder then Metview copied the results to the output folder. If we open folder 'result_tr' we will see the 'tr_r1. csv' CSV file containing the plume trajectories. For details about the FLEXPART trajectory outputs click here.

Step 1 - Plotting the mean track

...

First, we read the CSV file .using a Table Reader:

Code Block
languagepy
#The input file
dIn="result_tr_single"
inFile=dIn  & "/tr_r1.csv"

#Read table (CSV) data
tbl=read_table(table_filename: inFile,
    table_header_row: "2",
    table_meta_data_rows: "1")

Next, we determine the trajectory (i.e. the release) start date and time from the table header:

Code Block
languagepy
#Read runDate from table header
runDate=date(metadata_value(tbl,"runDate"))
runTime=number(metadata_value(tbl,"runTime"))
runDate=runDate + hour(runTime/10000)

#Read release start  date from table header
startSec=number(metadata_value(tbl,"start"))
releaseDate=runDate + second(startSec)

Next, we read the coordinates of the mean track and define an use Input Visualiser and Graph Plotting to plot it:

Code Block
languagepy
#Read columns from table
mLat=tolist(values(tbl,"meanLat"))
mLon=tolist(values(tbl,"meanLon"))

#visualiser
iv_curve = input_visualiser(
	   input_plot_type	:	"geo_points",
	   input_longitude_variable	:	mLon,
	   input_latitude_variable	:	mLat	  	  
	)

#line attributes
graph_curve=mgraph(graph_line_colour: "red",
         graph_line_thickness: "3",
         graph_symbol: "on",
         graph_symbol_marker_index: 15,
         graph_symbol_height: 0.5,
         graph_symbol_colour: "white",
         graph_symbol_outline: "on"
        ) 

...

The trajectory output file also contains the coordinates of the cluster centres. In this step we will show a possible way to plot this extra bit of information together with the mean trajectory. Our approach is as follow:

  • we plot the track as a curve
  • we plot the mean trajectory points using symbols of different

...

  • shape and

...

  • colour at different times
  • we use use the same symbols and colour-coding for the cluster centres

...

  • but we use smaller a smaller symbol size for better readability

The macro to use is 'plot_tr_step3.mv'. We will see how this macro works.

First, we read the CSV file .using a Table Reader:

Code Block
languagepy
#The input file
dIn="result_tr_single"
inFile=dIn  & "/tr_r1.csv"

#Read table (CSV) data
tbl=read_table(table_filename: inFile,
    table_header_row: "2",
    table_meta_data_rows: "1")

Next


The first difference is that we need to determine the middle of the release interval since the trajectory waypoint times are given in seconds elapsed since this date. The release date reading part needs to be modified like this:

...