• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NREL / SolTrace / 19580451842

21 Nov 2025 06:52PM UTC coverage: 89.184% (+0.4%) from 88.811%
19580451842

push

github

web-flow
Merge pull request #85 from NREL/simdata_io_json

Add json import/export to SimulationData

423 of 451 new or added lines in 17 files covered. (93.79%)

9 existing lines in 3 files now uncovered.

5970 of 6694 relevant lines covered (89.18%)

7997777.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.11
/coretrace/simulation_data/sun.hpp
1
/**
2
 * @file sun.hpp
3
 * @brief Solar source modeling and sun shape definitions
4
 *
5
 * Defines solar source properties including sun shape models,
6
 * solar position calculations, and ray generation from solar disk.
7
 * Includes models for different sun shape distributions and
8
 * solar tracking calculations for CST systems.
9
 */
10

11
#ifndef SOLTRACE_SUN_H
12
#define SOLTRACE_SUN_H
13

14
#include "ray_source.hpp"
15
#include "datetime.hpp"
16
#include "vector3d.hpp"
17

18
namespace SolTrace::Data {
19

20
class Sun : public RaySource
21
{
22
public:
NEW
23
    Sun() : my_shape(SunShape::UNKNOWN),
×
NEW
24
            my_position(Vector3d(std::numeric_limits<double>::quiet_NaN(), 
×
25
                std::numeric_limits<double>::quiet_NaN(), 
NEW
26
                std::numeric_limits<double>::quiet_NaN()))
×
NEW
27
    { this->my_position.zero(); }
×
28
    virtual ~Sun() {}
24✔
29

30
    virtual const Vector3d &get_position() const
×
31
    {
32
        return this->my_position;
×
33
    }
34
    virtual Vector3d &get_position()
60✔
35
    {
36
        return this->my_position;
60✔
37
    }
38
    virtual void set_position(const Vector3d &pos)
6✔
39
    {
40
        this->my_position = pos;
6✔
41
        return;
6✔
42
    }
43
    virtual void set_position(double x, double y, double z)
17✔
44
    {
45
        this->my_position.set_values(x, y, z);
17✔
46
        return;
17✔
47
    }
48
    virtual void set_position(const DateTime &, double lat, double long) {}
×
49
    virtual SunShape get_shape() const
48✔
50
    {
51
        return this->my_shape;
48✔
52
    }
53
    virtual void set_shape(SunShape shape,
54
                           double _sigma,
55
                           double _half_width,
56
                           double _csr,        
57
                           std::vector<double> _user_angle = {},
58
                           std::vector<double> _user_intensity = {});
59
    virtual void calculate_buie_parameters(double& kappa, double& gamma);
60

61
private:
62
    void set_gaussian_distribution(double _sigma);
63
    void set_pillbox_distribution(double _half_width);
64
    void set_buie_csr_distribution(double _csr);
65
    void set_user_defined_distribution(std::vector<double> _user_angle,
66
                                       std::vector<double> _user_intensity);
67

68
    SunShape my_shape;
69
    Vector3d my_position;
70
};
71

72
} // namespace SolTrace::Data
73

74
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc