.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/example_satellite.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_example_satellite.py: Satellite ================================== .. GENERATED FROM PYTHON SOURCE LINES 6-13 .. code-block:: Python from opendrift import test_data_folder as tdf from opendrift.readers import reader_netCDF_CF_generic from opendrift.models.openoil import OpenOil o = OpenOil(loglevel=20) # Set loglevel to 0 for debug information .. rst-class:: sphx-glr-script-out .. code-block:: none 13:52:12 INFO opendrift:576: OpenDriftSimulation initialised (version 1.14.7 / v1.14.7-15-g2988cd4) .. GENERATED FROM PYTHON SOURCE LINES 14-15 Adjusting some configuration .. GENERATED FROM PYTHON SOURCE LINES 15-32 .. code-block:: Python o.set_config('drift:vertical_mixing', False) o.set_config('processes:dispersion', True) o.set_config('processes:evaporation', False) o.set_config('processes:emulsification', True) o.set_config('drift:current_uncertainty', .1) # Diffusion o.set_config('drift:wind_uncertainty', 1) # Arome reader_arome = reader_netCDF_CF_generic.Reader(tdf + '16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc') # Norkyst reader_norkyst = reader_netCDF_CF_generic.Reader(tdf + '16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc') o.add_reader([reader_norkyst, reader_arome]) .. rst-class:: sphx-glr-script-out .. code-block:: none 13:52:12 INFO opendrift.readers:63: Opening file with xr.open_dataset 13:52:12 INFO opendrift.readers.reader_netCDF_CF_generic:332: Detected dimensions: {'time': 'time', 'x': 'x', 'y': 'y'} 13:52:12 INFO opendrift.readers:63: Opening file with xr.open_dataset 13:52:13 INFO opendrift.readers.reader_netCDF_CF_generic:332: Detected dimensions: {'x': 'X', 'y': 'Y', 'z': 'depth', 'time': 'time'} .. GENERATED FROM PYTHON SOURCE LINES 33-34 Seed oil particles within contour detected from satellite .. GENERATED FROM PYTHON SOURCE LINES 34-37 .. code-block:: Python o.seed_from_gml(tdf + 'radarsat_oil_satellite_observation/RS2_20151116_002619_0127_SCNB_HH_SGF_433012_9730_12182143_Oil.gml', num_elements=2000) .. rst-class:: sphx-glr-script-out .. code-block:: none 13:52:13 INFO opendrift.models.openoil.openoil:1708: Oil type not specified, using default: GENERIC BUNKER C 13:52:13 INFO opendrift.models.openoil.adios.dirjs:86: Querying ADIOS database for oil: GENERIC BUNKER C 13:52:13 INFO opendrift.models.openoil.openoil:1717: Using density 988.1 and viscosity 0.02169233387797564 of oiltype GENERIC BUNKER C 13:52:13 INFO opendrift.models.basemodel.environment:203: Adding a global landmask from GSHHG 13:52:16 INFO opendrift.models.basemodel.environment:227: Fallback values will be used for the following variables which have no readers: 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_surface_height: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: upward_sea_water_velocity: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_significant_height: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_ice_area_fraction: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_ice_x_velocity: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_ice_y_velocity: 0.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_water_temperature: 10.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_water_salinity: 34.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: sea_floor_depth_below_sea_level: 10000.000000 13:52:16 INFO opendrift.models.basemodel.environment:230: ocean_vertical_diffusivity: 0.020000 13:52:16 INFO opendrift.models.basemodel.environment:230: ocean_mixed_layer_thickness: 50.000000 .. GENERATED FROM PYTHON SOURCE LINES 38-39 Running model for 6 hours .. GENERATED FROM PYTHON SOURCE LINES 39-41 .. code-block:: Python o.run(steps=6*4, time_step=900) .. rst-class:: sphx-glr-script-out .. code-block:: none 13:52:16 INFO opendrift:1803: Skipping environment variable upward_sea_water_velocity because of condition ['drift:vertical_advection', 'is', False] 13:52:16 INFO opendrift:1803: Skipping environment variable ocean_vertical_diffusivity because of condition ['drift:vertical_mixing', 'is', False] 13:52:16 INFO opendrift:1803: Skipping environment variable ocean_mixed_layer_thickness because of condition ['drift:vertical_mixing', 'is', False] 13:52:16 INFO opendrift:1814: Storing previous values of element property lon because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous'])) 13:52:16 INFO opendrift:1814: Storing previous values of element property lat because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous'])) 13:52:16 INFO opendrift:952: Using existing reader for land_binary_mask to move elements to ocean 13:52:16 INFO opendrift:982: All points are in ocean 13:52:16 INFO opendrift.models.openoil.openoil:692: Oil-water surface tension is 0.035935 Nm 13:52:16 INFO opendrift.models.openoil.openoil:705: Max water fraction not available for GENERIC BUNKER C, using default 13:52:16 INFO opendrift:2111: 2015-11-16 00:26:18.770000 - step 1 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 00:41:18.770000 - step 2 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 00:56:18.770000 - step 3 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 01:11:18.770000 - step 4 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 01:26:18.770000 - step 5 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 01:41:18.770000 - step 6 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 01:56:18.770000 - step 7 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 02:11:18.770000 - step 8 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 02:26:18.770000 - step 9 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 02:41:18.770000 - step 10 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 02:56:18.770000 - step 11 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 03:11:18.770000 - step 12 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 03:26:18.770000 - step 13 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 03:41:18.770000 - step 14 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 03:56:18.770000 - step 15 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 04:11:18.770000 - step 16 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 04:26:18.770000 - step 17 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 04:41:18.770000 - step 18 of 24 - 1990 active elements (0 deactivated) 13:52:17 INFO opendrift:2111: 2015-11-16 04:56:18.770000 - step 19 of 24 - 1990 active elements (0 deactivated) 13:52:18 INFO opendrift:2111: 2015-11-16 05:11:18.770000 - step 20 of 24 - 1990 active elements (0 deactivated) 13:52:18 INFO opendrift:2111: 2015-11-16 05:26:18.770000 - step 21 of 24 - 1990 active elements (0 deactivated) 13:52:18 INFO opendrift:2111: 2015-11-16 05:41:18.770000 - step 22 of 24 - 1990 active elements (0 deactivated) 13:52:18 INFO opendrift:2111: 2015-11-16 05:56:18.770000 - step 23 of 24 - 1990 active elements (0 deactivated) 13:52:18 INFO opendrift:2111: 2015-11-16 06:11:18.770000 - step 24 of 24 - 1990 active elements (0 deactivated) .. raw:: html
<xarray.Dataset> Size: 8MB
    Dimensions:                                                                              (
                                                                                              trajectory: 1990,
                                                                                              time: 25)
    Coordinates:
      * trajectory                                                                           (trajectory) int64 16kB ...
      * time                                                                                 (time) datetime64[ns] 200B ...
    Data variables: (12/41)
        status                                                                               (trajectory, time) float32 199kB ...
        moving                                                                               (trajectory, time) float32 199kB ...
        age_seconds                                                                          (trajectory, time) float32 199kB ...
        origin_marker                                                                        (trajectory, time) float32 199kB ...
        lon                                                                                  (trajectory, time) float32 199kB ...
        lat                                                                                  (trajectory, time) float32 199kB ...
        ...                                                                                   ...
        sea_ice_x_velocity                                                                   (trajectory, time) float32 199kB ...
        sea_ice_y_velocity                                                                   (trajectory, time) float32 199kB ...
        sea_water_temperature                                                                (trajectory, time) float32 199kB ...
        sea_water_salinity                                                                   (trajectory, time) float32 199kB ...
        sea_floor_depth_below_sea_level                                                      (trajectory, time) float32 199kB ...
        land_binary_mask                                                                     (trajectory, time) float32 199kB ...
    Attributes: (12/163)
        Conventions:                                                             ...
        standard_name_vocabulary:                                                ...
        featureType:                                                             ...
        title:                                                                   ...
        summary:                                                                 ...
        keywords:                                                                ...
        ...                                                                                                               ...
        geospatial_lon_units:                                                    ...
        geospatial_lon_resolution:                                               ...
        runtime:                                                                 ...
        geospatial_vertical_min:                                                 ...
        geospatial_vertical_max:                                                 ...
        geospatial_vertical_positive:                                            ...


.. GENERATED FROM PYTHON SOURCE LINES 42-43 Print and plot results .. GENERATED FROM PYTHON SOURCE LINES 43-46 .. code-block:: Python print(o) o.animation(fast=True, buffer=0.1) .. rst-class:: sphx-glr-script-out .. code-block:: none =========================== -------------------- Reader performance: -------------------- /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc 0:00:00.1 total 0:00:00.0 preparing 0:00:00.0 reading 0:00:00.0 interpolation 0:00:00.0 interpolation_time 0:00:00.0 rotating vectors 0:00:00.0 masking -------------------- /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc 0:00:00.0 total 0:00:00.0 preparing 0:00:00.0 reading 0:00:00.0 interpolation 0:00:00.0 interpolation_time 0:00:00.0 rotating vectors 0:00:00.0 masking -------------------- global_landmask 0:00:00.0 total 0:00:00.0 preparing 0:00:00.0 reading 0:00:00.0 masking -------------------- Performance: 5.8 total time 4.5 configuration 0.0 preparing main loop 0.0 moving elements to ocean 1.3 main loop 0.1 updating elements 0.0 oil weathering 0.0 updating viscosities 0.0 updating densities 0.0 emulsification 0.0 dispersion 0.0 cleaning up -------------------- =========================== Model: OpenOil (OpenDrift version 1.14.7) 1990 active Oil particles (0 deactivated, 0 scheduled) ------------------- Environment variables: ----- x_sea_water_velocity y_sea_water_velocity 1) /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc ----- x_wind y_wind 1) /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc ----- land_binary_mask 1) global_landmask ----- Readers not added for the following variables: sea_floor_depth_below_sea_level sea_ice_area_fraction sea_ice_x_velocity sea_ice_y_velocity sea_surface_height sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment sea_surface_wave_period_at_variance_spectral_density_maximum sea_surface_wave_significant_height sea_surface_wave_stokes_drift_x_velocity sea_surface_wave_stokes_drift_y_velocity sea_water_salinity sea_water_temperature Discarded readers: Time: Start: 2015-11-16 00:26:18.770000 UTC Present: 2015-11-16 06:26:18.770000 UTC Calculation steps: 24 * 0:15:00 - total time: 6:00:00 Output steps: 25 * 0:15:00 =========================== 13:52:18 WARNING opendrift:2473: Plotting fast. This will make your plots less accurate. 13:52:19 INFO opendrift:4660: Saving animation to /root/project/docs/source/gallery/animations/example_satellite_0.gif... 13:52:34 INFO opendrift:3094: Time to make animation: 0:00:16.150352 .. GENERATED FROM PYTHON SOURCE LINES 47-48 .. image:: /gallery/animations/example_satellite_0.gif .. GENERATED FROM PYTHON SOURCE LINES 48-50 .. code-block:: Python o.plot(fast=True, buffer=0.1) .. image-sg:: /gallery/images/sphx_glr_example_satellite_001.png :alt: OpenDrift - OpenOil (GENERIC BUNKER C) 2015-11-16 00:26 to 2015-11-16 06:26 UTC (25 steps) :srcset: /gallery/images/sphx_glr_example_satellite_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 13:52:34 WARNING opendrift:2473: Plotting fast. This will make your plots less accurate. (,
) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 32.855 seconds) .. _sphx_glr_download_gallery_example_satellite.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_satellite.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_satellite.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: example_satellite.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_