Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetObsData
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
MetObsData
Commits
8b25b7e9
Commit
8b25b7e9
authored
Sep 11, 2014
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
Fix some issues with solar position
Bump version.
parent
b0f8042b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
metobs/data/solar_position.py
+42
-43
42 additions, 43 deletions
metobs/data/solar_position.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
43 additions
and
44 deletions
metobs/data/solar_position.py
+
42
−
43
View file @
8b25b7e9
...
...
@@ -71,8 +71,7 @@ __docformat__ = 'restructuredtext en'
__version__
=
'
$Revision: 1.6 $
'
# $Source: /cvsroot/TOOLS/dev/metobs/python/data/metobs/data/solar_position.py,v $
from
metobs
import
mytime
from
metobs.data
import
NaN
,
approx_eq
from
metobs.data
import
NaN
,
util
import
math
_days
=
[
"
Sunday
"
,
"
Monday
"
,
"
Tuesday
"
,
"
Wednesday
"
,
"
Thursday
"
,
"
Friday
"
,
"
Saturday
"
]
...
...
@@ -349,7 +348,7 @@ class SolarPosition(object):
return
self
.
_eqTime
@property
def
timenow
(
self
):
return
mytime
.
datetime_to_epoch
(
self
.
_date
)
/
3600
return
util
.
to_unix_timestamp
(
self
.
_date
)
/
3600
@property
def
date
(
self
):
return
self
.
_date
...
...
@@ -424,10 +423,10 @@ def solar_position(date, latitude, longitude):
>>>
assert
approx_eq
(
s
.
elevation
,
22.038213553352705
,
_ACCEPTABLE_DELTA
)
>>>
assert
approx_eq
(
s
.
cosZen
,
0.3752248974802099
,
_ACCEPTABLE_DELTA
)
"""
if
not
date
.
tzinfo
:
date
=
mytime
.
set_tz
(
date
,
tz
=
mytime
.
LocalTimezone
)
year
,
month
,
day
,
hh
,
mm
,
ss
=
date
.
timetuple
()[:
6
]
GMToffset
=
0
if
date
.
tzinfo
:
tzoffset
=
date
.
tzinfo
.
utcoffset
(
date
)
if
tzoffset
.
days
<
0
:
GMToffset
=
-
(
24
-
tzoffset
.
seconds
/
3600
)
...
...
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
8b25b7e9
...
...
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup
(
name
=
'
metobs.data
'
,
version
=
'
0.5
dev
'
,
version
=
'
0.5
'
,
packages
=
find_packages
(
exclude
=
[
"
*.tests
"
,
"
*.tests.*
"
,
"
tests.*
"
,
"
tests
"
]),
namespace_packages
=
[
'
metobs
'
],
include_package_data
=
True
,
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment