Component List for reading files

File_met

component used to read and manage weather files. Creating the necessary weather variables to be used by other components.

Parameters

Example:


...

met = pro.new_component("File_met","met")
met.parameter("file_name").value = "examples/met_files/sevilla.met"

To generate the variables in the simulation time step, the values are obtained by linear interpolation of the data available in the meteorological file. The variables associated with the solar position are calculated, not obtained from the values stored in the file.

Variables

File_data

Component to read temporary data files and use them as simulation variables.

Parameters

If we use the "SIMULATION" option of the "file_step" parameter and the number of data in the file is less than the number of time steps during the simulation, to obtain the variables we will go back to the beginning of the data file each time the end of the file is reached.

the first simulation instant is the initial_time plus 1/2 of the time_step. For example, if initial_time = “01/01/2001 00:00:00” and time_step = 3600, then the first simulation instant is: “01/01/2001 00:30:00”, the second: “01/01/2001 01:30:00”, and so on.

If we use the "OWN" option of the "file_step" parameter and the simulated time instant is before or after the time instants collected in the file, the first value will be taken if it is before and the last one if it is after. Otherwise a linear interpolation will be performed to obtain the values of each of the simulation steps.

Example:


...

datas = osm.new_component("File_dat","datas")
param = {
    "file_name": "examples/input_files/data_example.csv",
    "file_type": "CSV",
    "file_step": "SIMULATION",
}
datas.set_parameters(param)

Variables

The component will generate a variable for each of the columns of the data file, using as name and unit for the variable the first row of the file. The unit must be written after the name in square brackets.

For example for the following CSV file:


n, temperature [ºC], humidity [kg/kg as]
 1, 15.1, 0.00792
 2, 14.6, 0.00788
 3, 14.1, 0.00783
 4, 13.5, 0.00772
 5, 13.0, 0.00766
...

Three variables will be created with names: n, temperature and humidity. And with the units indicated in square brackets.