reskit.weather.CosmoSource
==========================

.. py:module:: reskit.weather.CosmoSource


Submodules
----------

.. toctree::
   :maxdepth: 1

   /_readthedocs/reskit/weather/CosmoSource/CosmoSource/index


Classes
-------

.. autoapisummary::

   reskit.weather.CosmoSource.CosmoSource


Package Contents
----------------

.. py:class:: CosmoSource(source, bounds=None, indexPad=0, **kwargs)

   Bases: :py:obj:`reskit.weather.NCSource.NCSource`


   Handles the sources Sev created from the COSMO-REA6 dataset (cannot handle the original sources because they're whack)

   Initialize a COSMO style netCDF4 file source

   * Assumes REA6 conventions

   :param source: The path to the main data file
   :type source: str
   :param bounds:
                  The boundaries of the data which is needed
                    * Usage of this will help with memory management
                    * If None, the full dataset is loaded in memory
   :type bounds: Anything acceptable to geokit.Extent.load(), optional
   :param padExtent:
                     The padding to apply to the boundaries
                       * Useful in case of interpolation
   :type padExtent: numeric, optional
   :param timeBounds:
                      Used to employ a slice of the time dimension
                        * Expect two pandas Timestamp objects> The first indicates the point
                          to start collecting data, and the second indicates the end
   :type timeBounds: tuple of length 2, optional


   .. py:attribute:: GWA50_CONTEXT_MEAN_SOURCE
      :value: None



   .. py:attribute:: GWA100_CONTEXT_MEAN_SOURCE
      :value: None



   .. py:attribute:: MAX_LON_DIFFERENCE
      :value: 0.6



   .. py:attribute:: MAX_LAT_DIFFERENCE
      :value: 0.6



   .. py:method:: loc2Index(loc, outsideOkay=False, asInt=True)

      Returns the closest X and Y indexes corresponding to a given location
      or set of locations

      :param loc: The location(s) to search for
                  * A single tuple with (lon, lat) is acceptable, or a list of such tuples
                  * A single point geometry (as long as it has an SRS), or a list
                    of geometries is okay
                  * geokit,Location, or geokit.LocationSet are best!
      :type loc: Anything acceptable by geokit.LocationSet
      :param outsideOkay: Determines if points which are outside the source's lat/lon grid
                          are allowed
                          * If True, points outside this space will return as None
                          * If False, an error is raised
      :type outsideOkay: bool, optional

      :returns: * **If a single location is given** (*tuple*) --

                  * Format: (yIndex, xIndex)
                  * y index can be accessed with '.yi'
                  * x index can be accessed with '.xi'
                * **If multiple locations are given** (*list*) --

                  * Format: [ (yIndex1, xIndex1), (yIndex2, xIndex2), ...]
                  * Order matches the given order of locations



   .. py:method:: loadRadiation()

      frankCorrection: 'Bias correction of a novel European reanalysis data set for solar energy applications'



   .. py:method:: loadWindSpeedLevels()


   .. py:method:: loadWindSpeedAtHeight(height=100)

      NEEDS UPDATING!



   .. py:method:: loadTemperature(processor=lambda x: x - 273.15)

      Load the typical pressure variable



   .. py:method:: loadPressure()

      Load the typical pressure variable



   .. py:method:: loadSet_PV(verbose=False, _clockstart=None, _header='')


   .. py:method:: getWindSpeedAtHeights(locations, heights, spatialInterpolation='near', forceDataFrame=False, outsideOkay=False, _indicies=None)

      Retrieve complete time series for a variable from the source's loaded data
      table at the given location(s)

      :param locations:
                        The location(s) to search for
                          * A single tuple with (lon, lat) is acceptable, or a list of such
                            tuples
                          * A single point geometry (as long as it has an SRS), or a list
                            of geometries is okay
                          * geokit,Location, or geokit.LocationSet are best, though
      :type locations: Anything acceptable by geokit.LocationSet
      :param spatialInterpolation:
                                   The interpolation method to use
                                     * 'near' => For each location, extract the time series at the
                                       closest lat/lon index
                                     * 'bilinear' => For each location, use the time series of the
                                       surrounding +/- 1 index locations to create an estimated time
                                       series at the given location using a biliear scheme
                                     * 'cubic' => For each location, use the time series of the
                                       surrounding +/- 2 index locations to create an estimated time
                                       series at the given location using a cubic scheme
      :type spatialInterpolation: str, optional
      :param forceDataFrame: Instructs the returned value to take the form of a DataFrame
                             regardless of how many locations are specified
      :type forceDataFrame: bool, optional

          outsideOkay : bool, optional
              Determines if points which are outside the source's lat/lon grid
              are allowed
              * If True, points outside this space will return as None
              * If False, an error is raised

      :returns: * **If a single location is given** (*pandas.Series*) --

                  * Indexes match to times
                * **If multiple locations are given** (*pandas.DataFrame*) --

                  * Indexes match to times
                  * Columns match to the given order of locations



