-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Create weather data/iotools page in User's Guide #1754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1633cd6
add a bit of content
kandersolar aee7b7d
Apply suggestions from code review
kandersolar e05498c
Merge remote-tracking branch 'upstream/main' into weatherdoc
kandersolar 6f5e243
revisions
kandersolar c2ba0e6
further improvements
kandersolar 37adc7d
Apply suggestions from code review
kandersolar b15cd4c
make :py:mod:`pvlib.iotools` link to API reference
kandersolar f744ed7
move mention of iotools paper
kandersolar 400f205
cleanup
kandersolar 7257ca8
whatsnew
kandersolar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.. _weatherdata: | ||
|
||
Importing weather data | ||
====================== | ||
|
||
Many PV modeling applications require irradiance and meteorological datasets | ||
as the inputs to a PV system model. These weather datasets are available | ||
from many sources and in many formats. The :py:mod:`pvlib.iotools` module | ||
kandersolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
contains functions to retrieve and import these datasets in a form | ||
that is convenient to use with the rest of pvlib. | ||
|
||
kandersolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Usage | ||
----- | ||
|
||
Although there are some exceptions, the :py:mod:`pvlib.iotools` functions | ||
provide a uniform interface for reading data files in many common formats. | ||
Specifically, :py:mod:`pvlib.iotools` functions usually return two objects: | ||
a :py:class:`pandas.DataFrame` of the actual dataset and, plus a metadata | ||
dictionary. Most :py:mod:`pvlib.iotools` functions also have | ||
a ``map_variables`` parameter to automatically translate | ||
the column names used in the data file (which vary widely across datasets) | ||
into standard pvlib names (see :ref:`variables_style_rules`). Typical usage | ||
looks like this: | ||
|
||
.. code-block:: python | ||
|
||
df, metadata = pvlib.iotools.function(..., map_variables=True) | ||
|
||
|
||
Most :py:mod:`pvlib.iotools` functions work with time series datasets. | ||
In that case, the returned ``df`` DataFrame has a datetime index, localized | ||
to the appropriate time zone where possible. The metadata dictionary | ||
varies based on the function/dataset being used. | ||
|
||
For the full list of available :py:mod:`pvlib.iotools` functions, see | ||
:ref:`iotools`. | ||
|
||
|
||
File readers | ||
------------ | ||
|
||
Some weather data file formats have internal structure that requires | ||
more than just a call to :py:func:`pandas.read_csv`. pvlib provides | ||
functions for reading files in many of these formats. Functions that | ||
read and parse files in a particular format have names that begin with ``read_``: | ||
:py:func:`~pvlib.iotools.read_tmy3`, :py:func:`~pvlib.iotools.read_epw`, and so on. | ||
|
||
|
||
Online APIs | ||
----------- | ||
|
||
Several :py:mod:`pvlib.iotools` functions access the internet to fetch data from | ||
external web APIs. For example, :py:func:`~pvlib.iotools.get_pvgis_hourly` | ||
downloads data from PVGIS's webservers and returns it as a python variable. | ||
Functions that retrieve data from the internet have names that begin with | ||
``get_``: :py:func:`~pvlib.iotools.get_bsrn`, :py:func:`~pvlib.iotools.get_psm3`, | ||
:py:func:`~pvlib.iotools.get_pvgis_tmy`, and so on. | ||
|
||
Some of these data providers require registration. In those cases, your | ||
access credentials must be passed as parameters to the function. See the | ||
individual function documentation pages for details. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.