windpowerlib icon indicating copy to clipboard operation
windpowerlib copied to clipboard

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

Open jome1 opened this issue 1 year ago • 3 comments

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.

jome1 avatar Jun 03 '24 09:06 jome1

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?

birgits avatar Jun 04 '24 07:06 birgits

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

  • data.store_turbine_data_from_oedb: accesses the oedb database, shows it and stores it locally?
  • wind_turbine.get_turbine_data_from_file: fetches turbine data from the locally stored csv file

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

jome1 avatar Jun 04 '24 09:06 jome1

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

birgits avatar Jun 04 '24 11:06 birgits