API Reference
List of Parameters
Below, we list all the parameters that can be set to run and plot a simulation from a terminal. The parameters can be set either inline in the command line or imported from a .txt file. One or two minus signs should be preappended, if short names or long names are used, respectively.
Simulation Run Parameters
Note: The parameters f and a are on/off flag arguments. They should be set accordingly.
| Short Name | Long Name | Description |
|---|---|---|
| sim | simulation_type | Type of simulation, recommended normal unless you use fragmentation. |
| tmp | temperature | NetCDF temperature file. |
| c | current | NetCDF current file. |
| o | outfile | NetCDF outfile path. |
| b | bathymetry | NetCDF seafloor depth file. |
| buff | readerbuffer | OceanDrift reader vertical buffer size. Default should be sufficient. |
| s | starttime | Start time of simulation - format YYYY-MM-DD-h. |
| w0 | initialvelocity | Initial velocity in m/s, positive up. Default is -0.01. |
| ffunc | ffunction | Fragmentation function, variables must be enclosed in ;; - example np.sqrt(;T;) / ;u; ** 2>np.random(len(;T;)). |
| f | fragmentation | Allow fragmentation. |
| a | advection | Allow horizontal advection. |
| st | steps | Number of simulation steps. |
| dt | timestep | Time step of simulation - format H:M:S. |
| dto | timestepoutput | Output time step of simulation - format H:M:S. Recommended use for long simulations - decrease the number of saved steps. |
| d | decaytype | Type of decay rate - linear or exp |
| log | loglevel | Level of logging info displayed in console, while running a simulation. |
| oceanonly | oceanonly | Move land particles to sea. Recommended use: do not set this, unless the number of elements is sufficiently small. Otherwise you will run out of memory space. The reason is in opendrift handling of such particles. It is sfar better to simply mask out such elements in preprocessing, see e.g. the mask_grid() method. |
| sdata | seeddata | Path to initial seed pickle data file. |
| mdtype | microbialdecaytype | Type of biomas rate - mass or area |
| wtype | vertical_velocity_type | Type of vertical sinking velocity - constant or variable |
| ev | export_variables | Names of variables to be exported. Either separate variables with a comma, or specify export level with number. Level 0 returns all variables. |
| sf | splitfactor | Split simulation to sf subsimulations and run them with the grid simulation_type. |
Simulation Plot Parameters
Note: The method and files parameters are positional arguments. They should include only their actual values, rather than their respective names as well.
Note: The parameters abs, add and diff are on/off flag arguments. They should be set accordingly.
| Short Name | Long Name | Description |
|---|---|---|
| method | Ploting method to call. | |
| files | NetCDF filepaths to simulations. Each file should occupy one line in the parameters file. | |
| lons | lons | .txt file of longitude seed. If None -180:180:1 |
| lats | lats | .txt file of latitude seed. If None -90:90:1 |
| cmap | cmap | Colormap. |
| t | title | Figure title - format aaa_bbb_ccc |
| abs | absolute | Set, if you would like the variables to have absolute values. |
| diff | diff | Set, if you would like to display the differnece between simulation variables. |
| add | add | Set, if you would like to display the sum of simulation variables. |
| o | outfile | Outfile path, where the plot is saved. |
| fs | figsize | Figsize - format W:H |
| fts | fontsize | Fontsize in px. |
| fwgt | fontweight | Fontweight. |
| d | depth | Depth at which calculations take place. If >= 5000 (<=-5000), it is set to sea floor. |
| clip | clip | Clip values - format Vmin:Vmax. Use m for minus sign. |
| sh | shrink | Shrink colorbar in percentage (between 0 and 1). |
| loc | locations | SPeciffic locations - format lon1:lat1,lon2:lat2... |
| p1 | prop1 | Property to plot on x axis in drifter_properties method. |
| p2 | prop2 | Property to plot on y axis drifter_properties method. |
| cblabel | colorbarlabel | Label of colorbar. |
| xlabel | xlabel | X-axis label. |
| ylabel | ylabel | Y-axis label. |
| xlim | xlim | Xlim - format xmin:xmax |
| ylim | ylim | Ylim - format ymin:ymax |
| lw | linewidth | Line width. |
| legend | legend | Legend of labels - format label1,label2 |
| color | color | Plot color - format color1,color2,color3... |
| ls | linestyle | Plot linestyles - format ls1,ls2,ls3... |
| bins | bins | Histogram number of bins. |
| group | group | Group cells by biome/latitude/longitude. |
| diffidx | diffidx | Index at which the input files are split into two groups, which are added separateley. The second group sum is then subtracted from the first group sum. Default is half. |
| mc | martincurve | Martin curve coefficient. If None, it will not be plotted. |
| supt | suptitle | Titles for specific axes. Format ax1title,ax2title... |
| mhwpath | mhwintesitypath | Will be deprecated. |
| dpi | dpi | Output image dpi resolution. |