solar position data
This commit is contained in:
		
							parent
							
								
									7405149f55
								
							
						
					
					
						commit
						3132d3e568
					
				| @ -6,6 +6,8 @@ from ladybug_geometry.geometry3d.pointvector import Point3D, Vector3D | |||||||
| from ladybug_geometry.geometry3d.plane import Plane | from ladybug_geometry.geometry3d.plane import Plane | ||||||
| from ladybug_geometry.geometry3d.polyface import Polyface3D | from ladybug_geometry.geometry3d.polyface import Polyface3D | ||||||
| 
 | 
 | ||||||
|  | import pvlib | ||||||
|  | 
 | ||||||
| from Utilities.Processes import calculate_no_of_panels | from Utilities.Processes import calculate_no_of_panels | ||||||
| 
 | 
 | ||||||
| logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||||
| @ -111,3 +113,27 @@ def create_panels(coordinates, c): | |||||||
|         panels.append(panel) |         panels.append(panel) | ||||||
| 
 | 
 | ||||||
|     return panels |     return panels | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def get_solar_data(c): | ||||||
|  |     logger.info( | ||||||
|  |         f"Getting solar position data for {c['simulation_date_time']['start']} to {c['simulation_date_time']['end']}" | ||||||
|  |     ) | ||||||
|  |     """ | ||||||
|  |     Function to get solar position from PVLib | ||||||
|  |     """ | ||||||
|  |     latitude = c["environment"]["location"]["latitude"] | ||||||
|  |     longitude = c["environment"]["location"]["longitude"] | ||||||
|  |     tz = c["simulation_date_time"]["tz"] | ||||||
|  | 
 | ||||||
|  |     times = pd.date_range( | ||||||
|  |         c["simulation_date_time"]["start"], | ||||||
|  |         c["simulation_date_time"]["end"], | ||||||
|  |         freq="15min", | ||||||
|  |         tz=tz, | ||||||
|  |     ) | ||||||
|  | 
 | ||||||
|  |     # Get solar position data using PVLib | ||||||
|  |     solar_positions = pvlib.solarposition.get_solarposition(times, latitude, longitude) | ||||||
|  | 
 | ||||||
|  |     return solar_positions | ||||||
|  | |||||||
| @ -3,6 +3,10 @@ array: | |||||||
|   spacing: 1 # spacing between adjacent panel rows in m |   spacing: 1 # spacing between adjacent panel rows in m | ||||||
|   edge_setback: 1.8 # distance from the edge of the roof to the array |   edge_setback: 1.8 # distance from the edge of the roof to the array | ||||||
| 
 | 
 | ||||||
|  | simulation_date_time: | ||||||
|  |   start: 2025-03-30 00:00 # start date and time in ISO 8601 format | ||||||
|  |   end: 2025-03-30 23:45 # end date and time in ISO 8601 format | ||||||
|  |   tz: Asia/Kuala_Lumpur # timezone for the simulation | ||||||
| environment: | environment: | ||||||
|   roof: |   roof: | ||||||
|     dimensions: |     dimensions: | ||||||
| @ -11,8 +15,7 @@ environment: | |||||||
|       width: 125 |       width: 125 | ||||||
|     albedo: 0.8 # % of light reflected from the surface |     albedo: 0.8 # % of light reflected from the surface | ||||||
|     tilt: 0 # degrees from horizontal |     tilt: 0 # degrees from horizontal | ||||||
| 
 |   location: | ||||||
| location: |  | ||||||
|     latitude: 3.1186108758412945 |     latitude: 3.1186108758412945 | ||||||
|     longitude: 101.57639813680093 |     longitude: 101.57639813680093 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user