{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Merge datasets along frequency\n\nExample of how to merge refined hydrodynamic databases.\n\nIn this example a model was run multiple times with different frequency grids.\n\nRAO data is merged using xarrays 'merge' method while the added-mass and damping are merged\nusing xarrays 'concat' method along the omega dimension.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from mafredo import *\n\ntry:\n\n    # First create the object\n    cylinder = Hyddb1.create_from_capytaine('open_cylinder.nc')\n    cylinder_refined = Hyddb1.create_from_capytaine('open_cylinder_2.nc')\n    cylinder_further_refined = Hyddb1.create_from_capytaine('open_cylinder_3.nc')\n\n    # merge\n    cylinder.add(cylinder_refined)\n    cylinder.add(cylinder_further_refined)\n\n    # and finally plot\n    cylinder.plot()\n\nexcept:\n    pass # read-the-docs"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}