Rules for Inputting Data Files
Updating an Existing Input Data File
If you want to update input data that already has existing input data file, modify the existing file to revise or add new values or replace the existing file with a new .dat file having the same format.
Creating a New Input Data File
|
|
|
Before adding a new input variable, verify the variable is defined in \Database\VBInput.jl. |
If you want to add new input data to the model:
- Create a semi-colon delimited text file saved with a .dat extension.
- Name the file the same as the variable name (ex: vDmd.dat). By convention, the input variables are named with a 'v' prefix. During processing of the input data, the "v" variables are assigned to model variables.
- Set up the data file such that each row contains one year's data along with its qualifying information.
- Put the name of the variable in the first column.
- The next columns will contain set descriptors for the given variable, listed in reverse order as how the variable is defined.
- Add the units to the next column. The units should match exactly the units that are listed for that variable in \Database\VBInput.jl.
- The last column should contain the data values.
Below shows an example of the column entries for the variable, vGCPot[Plant,Node,Area,Year]
- Column 1: Variable name (ex: vGCPot;)
- Column 2: Year descriptors (ex: 2023;)
- Column 3: Area descriptor (ex: Ontario;)
- Column 4: Node descriptor (ex: Ontario;)
- Column 5: Plant descriptor (Gas/Oil Combined Cycle;)
- Column 6: Units (ex: MW;)
- Column 7: Data value (ex: 6708.32)
vGCPot.dat
Variable;Year;Area;Node;Plant;Units;Data
vGCPot;2023;Ontario;Ontario;Gas/Oil Combined Cycle;MW;6708.32
vGCPot;2023;Ontario;Ontario;Onshore Wind;10000
...
Incorporating a New .DAT File into the Model
To incorporate the new .dat file into the model, follow the steps below:
- Add variable to database source code (VBInput.jl, vData_ElectricUnits.jl, etc).
- Make sure to include units and generally format the declaration similar to the other variables.
- Add variable to \InputData\InputTablesForVariable.csv.
- Include variable name, input data file name with no extension, and the folder inside \InputData\ where the data is located.
- Review \InputData\UnitMap.csv.
- The unit in the input file (.dat) must be in the first column.
- The unit of the database source code variable (from step 1) must be in the second column.
- If a unit conversion is required, input the Factor into column 3 (Factor). The input data will be divided by the factor.
- If a currency conversion is required, the units must include ‘Nominal CN$’, ‘US$’, or ‘CN$’.
- If the variable is in vData_ElectricUnits.jl, the input data will automatically be moved into the model variable.
- The assumption is the model variable name is the input variable name without the ‘v’
- vUnArea is moved to UnArea.
- Many variables need to be moved to an “X” variable, for example vUnGC is moved to XUnGC.
- This relationship is mapped in \InputData\InputVariableToModelVariable.csv.
- Only exception variables need to be mapped.
- Note that for convenience and data uniformity reasons several headers in the input data do not correspond to model sets. For example, ECC is referred to as Sector.
- A full list of the header exceptions can be found here:
- \InputData\PromulaHeaders_ClientHeaders.txt
- To test the variable, first re compile the Promula database, then run the input data process.
- You can use batch files in 2020Model.
- CreateVBInput.bat/ CreateElectricUnitDBs.bat