wind-python / windpowerlib

The windpowerlib is a library to model the output of wind turbines and farms.
https://oemof.org/
MIT License
330 stars 105 forks source link

Lists are stored as strings in turbine library fetched from the OpenEnergy database #141

Open jome1 opened 6 months ago

jome1 commented 6 months ago

When fetching all data with 'windpowerlib.data.store_turbine_data_from_oedb()', then listed data is stored as a string within the table. Why is it like this and what can be done, that the data is stored as a list in the respetice dataframe cell?

For example, the "power_curve_wind_speeds" is actually a list of wind speeds but when accessing the dataframe cell the data is there as a string.

birgits commented 6 months ago

Hi @jome1, I'm not quite sure I understand you correctly, but I think you mean, why are the power curve data stored as string in the csv file? The reason is, that pandas stores lists inside a dataframe that way. The windpowerlib handles that for you though. When reading the data from csv with this function, the string is converted back to a list of floats. Does that answer your question?

jome1 commented 6 months ago

Thanks so much for your fast and helpful response! (you understand my question correctly)

My general goal is to derive power curves in form of a 3-parameter logistical function. I am using the discrete power curve values from windpowerlib and apply a curve fitting.

When initializing a WindTurbine object, one has to also select the hub_heigt of the turbine_type. But the power curve is always the same in the database for every hub_height of a specific turbine_type. So I thought, I should just loop through the database (each row is one turbine_type and sometimes multiple hub_heights listed).

Just to clarify: The API documentation lists under wind turbine data

So I could loop through all turbine_types and their power curves in the locally stored turbine data csv file? The respective turbine_type and the path to the locally stored csv file are passed as a parameter to wind_turbine.get_turbine_data_from_file

birgits commented 6 months ago

Glad I could help. And yes, everything you wrote is correct.