-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
The link to Variable Style Rules (https://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html) appears to be broken:
pvlib-python/pvlib/iotools/midc.py
Lines 155 to 207 in b3c1b5e
| def read_midc(filename, variable_map={}, raw_data=False, **kwargs): | |
| """Read in National Renewable Energy Laboratory Measurement and | |
| Instrumentation Data Center weather data. The MIDC is described in [1]_. | |
| Parameters | |
| ---------- | |
| filename: string or file-like object | |
| Filename, url, or file-like object of data to read. | |
| variable_map: dictionary | |
| Dictionary for mapping MIDC field names to pvlib names. Used to rename | |
| the columns of the resulting DataFrame. Does not map names by default. | |
| See Notes for an example. | |
| raw_data: boolean | |
| Set to true to use format_index_raw to correctly format the date/time | |
| columns of MIDC raw data files. | |
| kwargs : dict | |
| Additional keyword arguments to pass to `pandas.read_csv` | |
| Returns | |
| ------- | |
| data: Dataframe | |
| A dataframe with DatetimeIndex localized to the provided timezone. | |
| Notes | |
| ----- | |
| The `variable_map` argument should map fields from MIDC data to pvlib | |
| names. | |
| E.g. if a MIDC file contains the variable 'Global Horizontal [W/m^2]', | |
| passing the dictionary below will rename the column to 'ghi' in | |
| the returned Dataframe. | |
| {'Global Horizontal [W/m^2]': 'ghi'} | |
| See the MIDC_VARIABLE_MAP for collection of mappings by site. | |
| For a full list of pvlib variable names see the `Variable Style Rules | |
| <https://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html>`_. | |
| Be sure to check the units for the variables you will use on the | |
| `MIDC site <https://midcdmz.nrel.gov/>`_. | |
| References | |
| ---------- | |
| .. [1] NREL: Measurement and Instrumentation Data Center | |
| `https://midcdmz.nrel.gov/ <https://midcdmz.nrel.gov/>`_ | |
| """ | |
| data = pd.read_csv(filename, **kwargs) | |
| if raw_data: | |
| data = format_index_raw(data) | |
| else: | |
| data = format_index(data) | |
| data = data.rename(columns=variable_map) | |
| return data |
kandersolar
