flextra_run
Runs the FLEXTRA trajectory model
Tip
A tutorial on using FLEXTRA from within Metview is available here.
Note
This function performs the same task as the Flextra Run icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.
- flextra_run(**kwargs)
Runs the FLEXTRA trajectory model.
- Parameters
flextra_exe_path (str) – Specifies a user defined FLEXTRA executable. Both absolute and relative path can be given here. If it is left blank (this is the default) Metview will use the MV_FLEXTRA_EXE environment variable to locate the executable.
flextra_input_mode ({"path", "icon"}, default: "icon") – Specifies how the input data path is defined. When it is set to “path” you need to specify the input data file and the AVAILABLE file by their paths in
flextra_input_path
. In “icon” mode the input data is specified by aflextra_prepare()
object inflextra_input_data
.flextra_input_data (
flextra_prepare()
) – Specifies the location of the input data files usingflextra_prepare()
.flextra_input_path (str) – Specifies the location of the input data files. Both an absolute and relative path can be given here. Enabled when
flextra_input_mode
is “path”.flextra_available_file_path (str, default: "same_as_input_path") – Specifies the location of the AVAILABLE file. The default is “same_as_input_path” , which means that the AVAILABLE file is located in the same directory as the input data. Enabled when
flextra_input_mode
is “path”.flextra_run_label (str, default: "flextra run") – Specifies the FLEXTRA run label.
flextra_run_mode ({"normal", "cet", "flight"}, default: "normal") –
Specifies the run mode for the FLEXTRA simulation. The possible values are as follows:
”normal”: a group of trajectories is specified starting from the same point but at different times. Several starting points (thus several groups of trajectories) can be defined for a single FLEXTRA run.
”cet”: trajectories are generated starting from the points of a user-defined uniform grid in a three-dimensional domain.
”flight”: both the starting location and starting time for each trajectory can be set individually. This mode is useful to calculate e.g. trajectories released along the flight track of an aircraft.
flextra_trajectory_direction ({"forward", "backward"}, default: "forward") – Specifies the FLEXTRA simulation direction in time.
flextra_trajectory_length (str, default: "48") – Specifies the length of the FLEXTRA simulation. The format is HHH[:MM[:SS].
flextra_first_starting_date (str) – Specifies the start date of the period within which the trajectories will be released. Enabled when
flextra_run_mode
is “normal” or “cet”. The format is YYYYMMDD. Relative dates are allowed: e.g. -1 means yesterday, 0 means today, etc.flextra_first_starting_time (str) – Specifies the start time of the period within which the trajectories will be released. Enabled when
flextra_run_mode
is “normal” or “cet”. The format is HH[:MM[:SS].flextra_last_starting_date (str) – Specifies the end date of the period within which the trajectories will be released. Enabled when
flextra_run_mode
is “normal” or “cet”. The format is YYYYMMDD. Relative dates are allowed: e.g. -1 means yesterday, 0 means today, etc.flextra_last_starting_time (str) – Specifies the end time of the period within which the trajectories will be released. Enabled when
flextra_run_mode
is “normal” or “cet”. The format is HH[:MM[:SS].’flextra_starting_time_interval (str, default: "6") – Specifies the starting interval of trajectories within the starting period. Enabled when
flextra_run_mode
is set to “normal” or “cet”. The format is HHH[:MM[:SS].flextra_output_interval_mode ({"original", "interval", "both"}, default: "interval") –
Specifies how the output data (i.e. trajectory waypoints) will be written out into the output file. It can have three values:
”original”: the trajectory points are written out into the output file exactly at the computational time steps. In the FLEXTRA terminology these are called flexible time steps.
”interval”: the trajectory points are written out into the output file at regular intervals specified by parameter
flextra_output_interval_value
. In the FLEXTRA terminology these are called constant time steps.”both”: two output files will be generated: one for the flexible time steps and one for the constant time steps.
flextra_output_interval_value (str, default: "3") – Specifies the output frequency when
flextra_output_interval_mode
is set to “interval” or “both”. The format is HHH[:MM[:SS]. The default value is “3”, which means “3” hourly output.flextra_normal_types (number or list[number]) –
Specifies the list of trajectory types as numerical IDs when
flextra_run_mode
is “normal”. The possible values are as follows:1: 3 dimensional
2: model level
3: mixing layer
4: isobaric
5: isentropic
flextra_normal_names (str or list[str]) – Specifies the trajectory names when
flextra_run_mode
is set to “normal”.flextra_normal_latitudes (number or list[number]) – Specifies the latitudes of the trajectory start points when
flextra_run_mode
is set to “normal”.flextra_normal_longitudes (number or list[number]) – Specifies the longitudes of the trajectory start points when
flextra_run_mode
is set to “normal”.flextra_normal_levels (number or list[number]) – Specifies the levels of the trajectory start points when
flextra_run_mode
is set to “normal”.flextra_normal_level_units (number or list[number], default: 1) –
Specifies the level types (as numerical IDs) of the trajectory start points when
flextra_run_mode
is set to “normal”. The possible values are as follows:1: metres above sea level
2: metres above ground level
3: hPa
flextra_cet_type (list[number] or list[str], default: "3d") –
Specifies the list of trajectory types (numerical IDs or strings) when
flextra_run_mode
is set to “cet”. The possible values are as follows:1 or “3d”
2 or “model_level”
3 or “isobaric”
4 or “isentropic”
flextra_cet_name (str) – Specifies the trajectory name when
flextra_run_mode
is set to “cet”.flextra_cet_area (list[number], default: [-90, -180, 90, 180]) – Specify the geographical area of the start grid by a [South, West, North, East] list.
flextra_cet_dx (number, default: 1) – Specifies the start grid resolution in West-East direction in degrees when
flextra_run_mode
is set to “cet”.flextra_cet_dy (number, default: 1) – Specifies the start grid resolution in South-North direction in degrees when
flextra_run_mode
is set to “cet”.flextra_cet_top_level (number, default: 1) – Specifies the top level of the start grid volume when
flextra_run_mode
is set to “cet”.flextra_cet_bottom_level (number, default: 1) – Specifies the bottom level of the start grid when
flextra_run_mode
is set to “cet”.flextra_cet_dz (number, default: 1) – Specifies the start grid vertical resolution when
flextra_run_mode
is set to “cet”.flextra_cet_level_units ({"metres_asl", "metres_agl", "hpa"}, default: "hpa") –
Specifies the level types (as numerical IDs or strings) of the start grid when
flextra_run_mode
is set to “cet”. The possible values are as follows:1 or “metres_asl”: metres above sea level
2 or “metres agl”: metres above ground level
3 or “hpa”
flextra_flight_type (str, default: "3d") –
flextra_flight_name ({"list[str]"}) – Specifies the trajectory names when
flextra_run_mode
is set to “flight”.flextra_flight_latitudes (number or list[number]) – Specifies the latitudes of the trajectory start points when
flextra_run_mode
is set to “flight”.flextra_flight_longitudes (number or list[number]) – Specifies the longitudes of the trajectory start points when
flextra_run_mode
is set to “flight”.flextra_flight_levels (number or list[number]) – Specifies the levels of the trajectory start points when
flextra_run_mode
is set to “flight”.flextra_flight_level_units ({"metres_asl", "metres_agl", "hpa"}, default: "hpa") –
Specifies the level types (as numerical IDs or strings) of the trajectory start points when
flextra_run_mode
is set to “flight”. The possible values are as follows:1 or “metres_asl”: metres above sea level
2 or “metres agl”: metres above ground level
3 or “hpa”
flextra_flight_starting_dates (str or list[str], default: "6") – Specifies the starting dates of the trajectories when
flextra_run_mode
is set to “flight”. The format is HHH[:MM[:SS].flextra_flight_starting_times (str or list[str]) – Specifies the starting times of the trajectories when
flextra_run_mode
is set to “flight”. The format is HH[:MM[:SS].flextra_interpolation_type (interpolation, default: 1) –
Specifies the interpolation type. The possible values are as follows:
1: horizontal interpolation: bicubic, vertical interpolation: polynomial, temporal interpolation: linear
>1: horizontal interpolation: bilinear, vertical interpolation: linear, temporal interpolation: linear
flextra_cfl_spatial (number, default: 2.0) – Specifies the factor by which the time step must be smaller than that determined from the CFL criterion. This factor must be >1!
flextra_cfl_temporal (number, default: 2.0) – Specifies the factor by which the time step must be smaller than the time interval of the wind fields. This factor must be >1!
flextra_uncertainty_trajectories (str, default: "off") –
flextra_uncertainty_trajectory_number (number, default: 0) –
flextra_uncertainty_trajectory_distance (number, default: 0.5) –
flextra_uncertainty_trajectory_time_constant (number, default: 2.0) –
flextra_u_random_error (number, default: 0.08) –
flextra_v_random_error (number, default: 0.08) –
flextra_w_random_error (number, default: 0.08) –
- Return type
Request