Skip to content

spharris/pvwatts-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pvwatts-java

pvwatts-java is a relatively faithful implementation of the NREL PVWatts v4 and v5 APIs. This is accomplished via the SAM SDK.

Development Status

Simulation results for PVWatts 4 and PVWatts 5 match those from the official API fairly closely, and the numbers that matter (energy production) match exactly. With that said, there are currently a few differences between pvwatts-java and the official implementation:

  1. Error messages returned by pvwatts-java are not always the same as those returned by PVWatts.
  2. Simulation location can only be specified by lat and lon, not address. This is unlikely to change.
  3. Similarly, file_id does nothing.
  4. Other minor differences.

Usage

pvwatts-java is usable in two ways: as a drop-in replacement for the PvWatts JSON APIs or as a library that you can call directly.

Web API

To start the API, simply run mvn clean compile exec:java -Dexec.args="--weather_directory=<directory>". Once it has finished starting, the server will be available at http://localhost:3000. The v4 API and the v5 APIs are located at /pvwatts/v4.json and /pvwatts/v5.json, respectively. Before trying to run any simulations, make sure to take a look at the weather data section.

You can see the documentation for those APIs here (v4) and here (v5).

Library

The web api uses the underlying PvWatts4Service and PvWatts5Service classes in order to run simulations. These services accept a PvWattsXRequest and return a PvWattsXResponse containing the inputs and outputs of each service. The requests and responses contain the same data as the APIs linked above.

Weather Data

pvwatts-java understands .tm2 files and TMY3-formatted .csv files, but no weather data is included in the package. By default, pvwatts-java will look for TMY2 and TMY3 data in the weather/tmy2 and weather/tmy3 subdirectories of the project path. This path can be set via the command line (see above) or, if you're not using the provided server, by injecting a value with the Guice key <String, WeatherDirectory>.

To get started, you can download common datasets from the following locations:

Simply download the entire archive of files and extract them to the weather directory that you specified. pvwatts-java will find the files there.

About

An implementation of NREL's PVWatts API in Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published