Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zhang Xin
StraylightSim
Commits
83945b31
Commit
83945b31
authored
Jun 30, 2023
by
Zhang Xin
Browse files
nan error: star straylight
parent
74c87464
Changes
2
Show whitespace changes
Inline
Side-by-side
StrayLight.cpp
View file @
83945b31
...
@@ -334,6 +334,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
...
@@ -334,6 +334,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
double
E1
[
7
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
};
double
E1
[
7
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
};
double
pstsun
,
pstmoon
;
double
pstsun
,
pstmoon
;
if
(
isfinite
(
faisun
)
==
false
){
faisun
=
0
;
}
if
(
isfinite
(
thetasun
)
==
false
){
thetasun
=
0
;
}
if
(
thetasun
<=
PI
/
2
)
if
(
thetasun
<=
PI
/
2
)
{
{
pstsun
=
pow
(
10
,
PST
(
faisun
,
thetasun
));
pstsun
=
pow
(
10
,
PST
(
faisun
,
thetasun
));
...
@@ -342,6 +348,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
...
@@ -342,6 +348,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
{
{
pstsun
=
0
;
pstsun
=
0
;
}
}
if
(
isfinite
(
faimoon
)
==
false
){
faimoon
=
0
;
}
if
(
isfinite
(
thetamoon
)
==
false
){
thetamoon
=
0
;
}
if
(
thetamoon
<=
PI
/
2
&&
thetamoon
>=
PI
/
90
)
if
(
thetamoon
<=
PI
/
2
&&
thetamoon
>=
PI
/
90
)
{
{
pstmoon
=
pow
(
10
,
PST
(
faimoon
,
thetamoon
));
pstmoon
=
pow
(
10
,
PST
(
faimoon
,
thetamoon
));
...
@@ -360,6 +372,7 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
...
@@ -360,6 +372,7 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
E1
[
i
]
=
Es_fil
[
i
]
*
pstsun
*
Sheltersun
*
SunRatio
[
i
]
+
Em_fil
[
i
]
*
pstmoon
*
moonphase
*
Sheltermoon
*
MoonRatio
[
i
];
E1
[
i
]
=
Es_fil
[
i
]
*
pstsun
*
Sheltersun
*
SunRatio
[
i
]
+
Em_fil
[
i
]
*
pstmoon
*
moonphase
*
Sheltermoon
*
MoonRatio
[
i
];
}
}
for
(
int
i
=
0
;
i
<
2
;
i
++
)
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
{
ephcom
.
getPosVel
(
Planets
[
i
],
ju
,
pos
,
vel
);
ephcom
.
getPosVel
(
Planets
[
i
],
ju
,
pos
,
vel
);
...
@@ -369,6 +382,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
...
@@ -369,6 +382,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
continue
;
continue
;
}
}
double
faip
=
OB
.
Azimuth
(
planet
,
PY
);
double
faip
=
OB
.
Azimuth
(
planet
,
PY
);
if
(
isfinite
(
faip
)
==
false
){
faip
=
0
;
}
if
(
isfinite
(
thetap
)
==
false
){
thetap
=
0
;
}
double
pstp
=
pow
(
10
,
PST
(
faip
,
thetap
));
double
pstp
=
pow
(
10
,
PST
(
faip
,
thetap
));
double
shelterp
=
ShelterEarth
(
SAT
,
planet
)
*
ShelterPlate
(
planet
,
OB
,
PY
,
fai
,
op
,
sum
);
double
shelterp
=
ShelterEarth
(
SAT
,
planet
)
*
ShelterPlate
(
planet
,
OB
,
PY
,
fai
,
op
,
sum
);
double
planetphase
=
sun
.
Angle
(
planet
)
/
PI
;
double
planetphase
=
sun
.
Angle
(
planet
)
/
PI
;
...
@@ -387,6 +406,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
...
@@ -387,6 +406,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
continue
;
continue
;
}
}
double
faip
=
OB
.
Azimuth
(
planet
,
PY
);
double
faip
=
OB
.
Azimuth
(
planet
,
PY
);
if
(
isfinite
(
faip
)
==
false
){
faip
=
0
;
}
if
(
isfinite
(
thetap
)
==
false
){
thetap
=
0
;
}
double
pstp
=
pow
(
10
,
PST
(
faip
,
thetap
));
double
pstp
=
pow
(
10
,
PST
(
faip
,
thetap
));
double
shelterp
=
ShelterEarth
(
SAT
,
planet
)
*
ShelterPlate
(
planet
,
OB
,
PY
,
fai
,
op
,
sum
);
double
shelterp
=
ShelterEarth
(
SAT
,
planet
)
*
ShelterPlate
(
planet
,
OB
,
PY
,
fai
,
op
,
sum
);
double
proportion
=
pstp
*
shelterp
/
planet
.
Square
();
double
proportion
=
pstp
*
shelterp
/
planet
.
Square
();
...
@@ -418,6 +443,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
...
@@ -418,6 +443,12 @@ void PointSource(double ju, double sat[3], double ob[3], double py[3], double E[
if
(
theta
<
PI
/
2
&&
theta
>
PI
/
90
)
if
(
theta
<
PI
/
2
&&
theta
>
PI
/
90
)
{
{
double
faistar
=
OB
.
Azimuth
(
star
,
PY
);
double
faistar
=
OB
.
Azimuth
(
star
,
PY
);
if
(
isfinite
(
faistar
)
==
false
){
faistar
=
0
;
}
if
(
isfinite
(
theta
)
==
false
){
theta
=
0
;
}
double
pst
=
pow
(
10
,
PST
(
faistar
,
theta
));
double
pst
=
pow
(
10
,
PST
(
faistar
,
theta
));
double
shelter
=
ShelterEarth
(
SAT
,
star
)
*
ShelterPlate
(
star
,
OB
,
PY
,
fai
,
op
,
sum
);
//太费时间了
double
shelter
=
ShelterEarth
(
SAT
,
star
)
*
ShelterPlate
(
star
,
OB
,
PY
,
fai
,
op
,
sum
);
//太费时间了
double
proportion
=
pst
*
shelter
;
double
proportion
=
pst
*
shelter
;
...
...
libstraylight.dylib
View file @
83945b31
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment