-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from LBNL-ETA/develop
Develop
- Loading branch information
Showing
34 changed files
with
611 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
#include "create_integration_rule.h" | ||
|
||
#include <regex> | ||
|
||
Integration_Rule create_integration_rule(std::string const& line) | ||
namespace window_standards | ||
{ | ||
Integration_Rule integration_rule; | ||
Integration_Rule create_integration_rule(std::string const & line) | ||
{ | ||
Integration_Rule integration_rule; | ||
|
||
if(line.find("Trapezoidal") != std::string::npos) | ||
{ | ||
integration_rule.type = Integration_Rule_Type::TRAPEZOIDAL; | ||
integration_rule.k = 1; | ||
} | ||
else if(line.find("Rectangular") != std::string::npos) | ||
{ | ||
integration_rule.type = Integration_Rule_Type::RECTANGULAR; | ||
integration_rule.k = 1; | ||
} | ||
else if(line.find("Table") != std::string::npos) | ||
{ | ||
integration_rule.type = Integration_Rule_Type::TABLE; | ||
integration_rule.k = 1; | ||
} | ||
if(line.find("Trapezoidal") != std::string::npos) | ||
{ | ||
integration_rule.type = Integration_Rule_Type::TRAPEZOIDAL; | ||
integration_rule.k = 1; | ||
} | ||
else if(line.find("Rectangular") != std::string::npos) | ||
{ | ||
integration_rule.type = Integration_Rule_Type::RECTANGULAR; | ||
integration_rule.k = 1; | ||
} | ||
else if(line.find("Table") != std::string::npos) | ||
{ | ||
integration_rule.type = Integration_Rule_Type::TABLE; | ||
integration_rule.k = 1; | ||
} | ||
|
||
std::regex pattern(".*k=(\\S+)\\).*"); | ||
std::smatch matches; | ||
if(std::regex_search(line, matches, pattern)) | ||
{ | ||
std::string k = matches[1].str(); | ||
integration_rule.k = std::stod(k); | ||
} | ||
return integration_rule; | ||
} | ||
std::regex pattern(".*k=(\\S+)\\).*"); | ||
std::smatch matches; | ||
if(std::regex_search(line, matches, pattern)) | ||
{ | ||
std::string k = matches[1].str(); | ||
integration_rule.k = std::stod(k); | ||
} | ||
return integration_rule; | ||
} | ||
} // namespace window_standards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
#ifndef WINDOWS_STANDARDS_CREATE_INTEGRATION_RULE_H_ | ||
#define WINDOWS_STANDARDS_CREATE_INTEGRATION_RULE_H_ | ||
#ifndef WINDOW_STANDARDS_CREATE_INTEGRATION_RULE_H_ | ||
#define WINDOW_STANDARDS_CREATE_INTEGRATION_RULE_H_ | ||
|
||
#include <string> | ||
#include "integration_rule.h" | ||
#include <string> | ||
|
||
Integration_Rule create_integration_rule(std::string const& line); | ||
|
||
namespace window_standards | ||
{ | ||
Integration_Rule create_integration_rule(std::string const &line); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#ifndef WINDOWS_STANDARDS_CREATE_SPECTRUM_H_ | ||
#define WINDOWS_STANDARDS_CREATE_SPECTRUM_H_ | ||
#ifndef WINDOW_STANDARDS_CREATE_SPECTRUM_H_ | ||
#define WINDOW_STANDARDS_CREATE_SPECTRUM_H_ | ||
|
||
#include <string> | ||
|
||
#include "spectrum.h" | ||
|
||
Spectrum load_spectrum(std::istream & input); | ||
Spectrum create_spectrum(std::string const& line, std::string const& standard_directory); | ||
|
||
namespace window_standards | ||
{ | ||
Spectrum load_spectrum(std::istream & input); | ||
Spectrum create_spectrum(std::string const& line, std::string const& standard_directory); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
#include "create_wavelength_boundary.h" | ||
|
||
|
||
Wavelength_Boundary create_wavelength_boundary(std::string const& line) | ||
namespace window_standards | ||
{ | ||
Wavelength_Boundary wavelength_boundary; | ||
Wavelength_Boundary create_wavelength_boundary(std::string const & line) | ||
{ | ||
Wavelength_Boundary wavelength_boundary; | ||
|
||
if(line.find("Wavelength set") != std::string::npos) | ||
{ | ||
wavelength_boundary.type = Wavelength_Boundary_Type::WAVELENGTH_SET; | ||
} | ||
else | ||
{ | ||
wavelength_boundary.type = Wavelength_Boundary_Type::NUMBER; | ||
wavelength_boundary.value = std::stod(line); | ||
} | ||
if(line.find("Wavelength set") != std::string::npos) | ||
{ | ||
wavelength_boundary.type = Wavelength_Boundary_Type::WAVELENGTH_SET; | ||
} | ||
else | ||
{ | ||
wavelength_boundary.type = Wavelength_Boundary_Type::NUMBER; | ||
wavelength_boundary.value = std::stod(line); | ||
} | ||
|
||
return wavelength_boundary; | ||
} | ||
return wavelength_boundary; | ||
} | ||
} // namespace window_standards |
Oops, something went wrong.