Skip to content

Commit

Permalink
uniform weather pre-save format
Browse files Browse the repository at this point in the history
  • Loading branch information
tobin-ford committed Jan 31, 2025
1 parent 00ae56a commit 492fade
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pvdeg.geospatial.plot\_sparse\_analysis\_land
=============================================

.. currentmodule:: pvdeg.geospatial

.. autofunction:: plot_sparse_analysis_land
6 changes: 6 additions & 0 deletions docs/source/_autosummary/pvdeg.utilities.linear_normalize.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pvdeg.utilities.linear\_normalize
=================================

.. currentmodule:: pvdeg.utilities

.. autofunction:: linear_normalize
6 changes: 6 additions & 0 deletions docs/source/_autosummary/pvdeg.utilities.merge_sparse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pvdeg.utilities.merge\_sparse
=============================

.. currentmodule:: pvdeg.utilities

.. autofunction:: merge_sparse
6 changes: 6 additions & 0 deletions docs/source/_autosummary/pvdeg.weather.emtpy_weather_ds.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pvdeg.weather.emtpy\_weather\_ds
================================

.. currentmodule:: pvdeg.weather

.. autofunction:: emtpy_weather_ds
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pvdeg.weather.weather\_distributed
==================================

.. currentmodule:: pvdeg.weather

.. autofunction:: weather_distributed
67 changes: 66 additions & 1 deletion pvdeg/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,4 +1233,69 @@ def weather_distributed(

weather_ds[dict(gid=i)] = weather_ds_collection[i]

return weather_ds, meta_df, gids_failed
return weather_ds, meta_df, gids_failed



# def _nsrdb_to_uniform(weather_df: pd.DataFrame, meta: dict) -> tuple[pd.DataFrame, dict]:

# map_weather(weather_df=weather_df)
# map_meta(meta)

# # check if weather is localized, convert to GMT (like pvgis)
# # check if time index is on the hour or 30 minutes
# # weather_df.index - pd.Timedelta("30m")

# # NSRDB datavars
# # Year Month Day Hour Minute dew_point dhi
# # dni ghi albedo pressure temp_air
# # wind_direction wind_speed relative_humidity

# weather_dropables = ['Year', 'Month', 'Day', 'Hour', 'Minute', 'dew_point']
# meta_dropables = [...]

# # NSRDB meta
# # {'Source': 'NSRDB',
# # 'Location ID': '145809',
# # 'City': '-',
# # 'State': '-',
# # 'Country': '-',
# # 'Dew Point Units': 'c',
# # 'DHI Units': 'w/m2',
# # 'DNI Units': 'w/m2',
# # 'GHI Units': 'w/m2',
# # 'Temperature Units': 'c',
# # 'Pressure Units': 'mbar',
# # 'Wind Direction Units': 'Degrees',
# # 'Wind Speed Units': 'm/s',
# # 'Surface Albedo Units': 'N/A',
# # 'Version': '3.2.0',
# # 'latitude': 39.73,
# # 'longitude': -105.18,
# # 'altitude': 1820,
# # 'tz': -7,
# # 'wind_height': 2}
# ...

# def _pvgis_to_uniform(weather_df: pd.DataFrame, meta: dict) -> tuple[pd.DataFrame, dict]:

# map_weather(weather_df=weather_df)
# map_meta(meta)

# # drop meaningless variables

# # pvgis datavars
# # temp_air relative_humidity ghi dni dhi
# # IR(h) wind_speed wind_direction pressure

# weather_dropables = ["IR(h)"]
# meta_dropables = ['irradiance_time_offset', ...]

# # pvgis meta
# # {'latitude': 24.7136,
# # 'longitude': 46.6753,
# # 'irradiance_time_offset': -0.1955,
# # 'altitude': 646.0,
# # 'wind_height': 10,
# # 'Source': 'PVGIS'})
# ...

0 comments on commit 492fade

Please sign in to comment.