Setup Measurement Site
Introduction
WindFarmer: Analyst has the concept of a measurement site which can be of different types: Mast, Lidar, Sodar, Reference Station and a Reanalysis Node.
These snippets show how to setup a measurement site from external files. WindFarmer: Analyst also allows you to create frequency and/or turbulence distributions from time series data in the project. For that see Measurement Campaign
Add a mast
// Define the name of the mast
string mastName = "My Mast";
// Define mast location
Location mastLocation = new Location(324259, 6674517);
// Create a mast object
Mast mast = new Mast(mastName, mastLocation);
// Add the mast to the workbook
Workbook.Climate.MeasurementSites.Add(mast);
Add other measurement sites
// Create a lidar
Lidar lidar1 = new Lidar("Lidar 1", new Location(324350, 6674650));
// Create a sodar
Sodar sodar1 = new Sodar("Sodar 1", new Location(324420, 6674300));
// Create a reference station
ReferenceStation refStation = new ReferenceStation(
"Airport",
new Location(300500, 6675000));
// Create a reanalysis node
ReanalysisNode merra1 = new ReanalysisNode(
"MERRA_NW",
new Location(300000, 6600000));
// Add measurement sites to the workbook
Workbook.Climate.MeasurementSites.Add(lidar1);
Workbook.Climate.MeasurementSites.Add(sodar1);
Workbook.Climate.MeasurementSites.Add(refStation);
Workbook.Climate.MeasurementSites.Add(merra1);
Load a tab file
// Can be loaded from folder next to the workbook using relative path.
FrequencyDistribution FD =
Toolbox.MeasurementCampaign.CreateFrequencyDistributionFromTabFile(@"Folder\Demo.tab");
// Save a frequency distribution to a measurement site at 28m AGL. This will generate the
// wind climate automatically.
Toolbox.MeasurementCampaign.SaveDistribution(
Workbook.Climate.MeasurementSites["My Mast"],
FD,
"Demo FD",
28.0,
true);
Load a wti file
// Can be loaded from folder next to the workbook using relative path.
TurbulenceIntensityDistribution TI =
Toolbox.MeasurementCampaign.CreateTurbulenceIntensityDistributionFromWtiFile(
@"Folder\demo.wti");
// Save a turbulence intensity distribution to a measurement site at 28m AGL.
// This will generate the wind climate automatically.
Toolbox.MeasurementCampaign.SaveDistribution(
Workbook.Climate.MeasurementSites["My Mast"],
TI,
"Demo TI",
28.0,
true);
Import a sensor point resource
// Get the wind climate created from saving a distribution.
WindClimate windClimate = Workbook.Climate.MeasurementSites["My Mast"].WindClimates[28.0];
// Load sensor point resource to wind climate object (windClimate).
// Requires full path to file
Toolbox.ImportPointWindResource(
@"C:\TestData\Demomast_MastHeight.wrg",
windClimate);
Import a RSF
// Get the wind climate created from saving a distribution.
WindClimate windClimate = Workbook.Climate.MeasurementSites["My Mast"].WindClimates[28.0];
// Load a discrete wind resource to wind climate object (windClimate). Requires full path
Toolbox.ImportDiscreteWindResource(@"C:\TestData\Demo_discrete.rsf", windClimate);
Import gridded wind resource
// Get the wind climate created from saving a distribution.
WindClimate windClimate = Workbook.Climate.MeasurementSites["My Mast"].WindClimates[28.0];
// Load gridded wind resource to wind climate object (windClimate). Requires full path
Toolbox.ImportGridWindResource(@"C:\TestData\Demo.wrg", windClimate);