[pyorbital] 01/04: New upstream version 1.1.1
Antonio Valentino
a_valentino-guest at moszumanska.debian.org
Tue Jan 10 19:49:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
a_valentino-guest pushed a commit to branch master
in repository pyorbital.
commit 7c5a559160d685766fece06ff92991e6dca8fa51
Author: Antonio Valentino <antonio.valentino at tiscali.it>
Date: Tue Jan 10 19:39:51 2017 +0000
New upstream version 1.1.1
---
.bumpversion.cfg | 7 ++
.gitchangelog.rc | 190 +++++++++++++++++++++++++++++
changelog.rst | 22 ++++
pyorbital/geoloc_instrument_definitions.py | 12 +-
pyorbital/orbital.py | 55 ++++++++-
pyorbital/version.py | 2 +-
6 files changed, 280 insertions(+), 8 deletions(-)
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
new file mode 100644
index 0000000..01c9521
--- /dev/null
+++ b/.bumpversion.cfg
@@ -0,0 +1,7 @@
+[bumpversion]
+current_version = 1.1.1
+commit = True
+tag = True
+
+[bumpversion:file:pyorbital/version.py]
+
diff --git a/.gitchangelog.rc b/.gitchangelog.rc
new file mode 100644
index 0000000..3a5fcd7
--- /dev/null
+++ b/.gitchangelog.rc
@@ -0,0 +1,190 @@
+##
+## Format
+##
+## ACTION: [AUDIENCE:] COMMIT_MSG [!TAG ...]
+##
+## Description
+##
+## ACTION is one of 'chg', 'fix', 'new'
+##
+## Is WHAT the change is about.
+##
+## 'chg' is for refactor, small improvement, cosmetic changes...
+## 'fix' is for bug fixes
+## 'new' is for new features, big improvement
+##
+## AUDIENCE is optional and one of 'dev', 'usr', 'pkg', 'test', 'doc'
+##
+## Is WHO is concerned by the change.
+##
+## 'dev' is for developpers (API changes, refactors...)
+## 'usr' is for final users (UI changes)
+## 'pkg' is for packagers (packaging changes)
+## 'test' is for testers (test only related changes)
+## 'doc' is for doc guys (doc only changes)
+##
+## COMMIT_MSG is ... well ... the commit message itself.
+##
+## TAGs are additionnal adjective as 'refactor' 'minor' 'cosmetic'
+##
+## They are preceded with a '!' or a '@' (prefer the former, as the
+## latter is wrongly interpreted in github.) Commonly used tags are:
+##
+## 'refactor' is obviously for refactoring code only
+## 'minor' is for a very meaningless change (a typo, adding a comment)
+## 'cosmetic' is for cosmetic driven change (re-indentation, 80-col...)
+## 'wip' is for partial functionality but complete subfunctionality.
+##
+## Example:
+##
+## new: usr: support of bazaar implemented
+## chg: re-indentend some lines !cosmetic
+## new: dev: updated code to be compatible with last version of killer lib.
+## fix: pkg: updated year of licence coverage.
+## new: test: added a bunch of test around user usability of feature X.
+## fix: typo in spelling my name in comment. !minor
+##
+## Please note that multi-line commit message are supported, and only the
+## first line will be considered as the "summary" of the commit message. So
+## tags, and other rules only applies to the summary. The body of the commit
+## message will be displayed in the changelog without reformatting.
+
+
+##
+## ``ignore_regexps`` is a line of regexps
+##
+## Any commit having its full commit message matching any regexp listed here
+## will be ignored and won't be reported in the changelog.
+##
+ignore_regexps = [
+ r'@minor', r'!minor',
+ r'@cosmetic', r'!cosmetic',
+ r'@refactor', r'!refactor',
+ r'@wip', r'!wip',
+ r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
+ r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
+ r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
+ ]
+
+
+## ``section_regexps`` is a list of 2-tuples associating a string label and a
+## list of regexp
+##
+## Commit messages will be classified in sections thanks to this. Section
+## titles are the label, and a commit is classified under this section if any
+## of the regexps associated is matching.
+##
+section_regexps = [
+ ('New', [
+ r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
+ ]),
+ ('Changes', [
+ r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
+ ]),
+ ('Fix', [
+ r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
+ ]),
+
+ ('Other', None ## Match all lines
+ ),
+
+]
+
+
+## ``body_process`` is a callable
+##
+## This callable will be given the original body and result will
+## be used in the changelog.
+##
+## Available constructs are:
+##
+## - any python callable that take one txt argument and return txt argument.
+##
+## - ReSub(pattern, replacement): will apply regexp substitution.
+##
+## - Indent(chars=" "): will indent the text with the prefix
+## Please remember that template engines gets also to modify the text and
+## will usually indent themselves the text if needed.
+##
+## - Wrap(regexp=r"\n\n"): re-wrap text in separate paragraph to fill 80-Columns
+##
+## - noop: do nothing
+##
+## - ucfirst: ensure the first letter is uppercase.
+## (usually used in the ``subject_process`` pipeline)
+##
+## - final_dot: ensure text finishes with a dot
+## (usually used in the ``subject_process`` pipeline)
+##
+## - strip: remove any spaces before or after the content of the string
+##
+## Additionally, you can `pipe` the provided filters, for instance:
+#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ")
+#body_process = Wrap(regexp=r'\n(?=\w+\s*:)')
+body_process = noop
+
+
+## ``subject_process`` is a callable
+##
+## This callable will be given the original subject and result will
+## be used in the changelog.
+##
+## Available constructs are those listed in ``body_process`` doc.
+subject_process = (strip |
+ ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
+ ucfirst | final_dot)
+
+
+## ``tag_filter_regexp`` is a regexp
+##
+## Tags that will be used for the changelog must match this regexp.
+##
+tag_filter_regexp = r'^v[0-9]+\.[0-9]+(\.[0-9]+)?$'
+
+
+## ``unreleased_version_label`` is a string
+##
+## This label will be used as the changelog Title of the last set of changes
+## between last valid tag and HEAD if any.
+unreleased_version_label = "%%version%% (unreleased)"
+
+
+## ``output_engine`` is a callable
+##
+## This will change the output format of the generated changelog file
+##
+## Available choices are:
+##
+## - rest_py
+##
+## Legacy pure python engine, outputs ReSTructured text.
+## This is the default.
+##
+## - mustache(<template_name>)
+##
+## Template name could be any of the available templates in
+## ``templates/mustache/*.tpl``.
+## Requires python package ``pystache``.
+## Examples:
+## - mustache("markdown")
+## - mustache("restructuredtext")
+##
+## - makotemplate(<template_name>)
+##
+## Template name could be any of the available templates in
+## ``templates/mako/*.tpl``.
+## Requires python package ``mako``.
+## Examples:
+## - makotemplate("restructuredtext")
+##
+output_engine = rest_py
+#output_engine = mustache("restructuredtext")
+#output_engine = mustache("markdown")
+#output_engine = makotemplate("restructuredtext")
+
+
+## ``include_merges`` is a boolean
+##
+## This option tells git-log whether to include merge commits in the log.
+## The default is to include them.
+include_merges = True
diff --git a/changelog.rst b/changelog.rst
index 17619cf..be5c2a0 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -1,6 +1,28 @@
Changelog
=========
+v1.1.1 (2017-01-10)
+-------------------
+
+- Update changelog. [Martin Raspaud]
+
+- Bump version: 1.1.0 → 1.1.1. [Martin Raspaud]
+
+- Allow offset application to be turned off (avhrr) [Martin Raspaud]
+
+ Signed-off-by: Martin Raspaud <martin.raspaud at smhi.se>
+
+
+- Add a generic get_observer_look function. [Martin Raspaud]
+
+ Signed-off-by: Martin Raspaud <martin.raspaud at smhi.se>
+
+
+- Add bump and changelog config files. [Martin Raspaud]
+
+ Signed-off-by: Martin Raspaud <martin.raspaud at smhi.se>
+
+
v1.1.0 (2016-10-27)
-------------------
diff --git a/pyorbital/geoloc_instrument_definitions.py b/pyorbital/geoloc_instrument_definitions.py
index 60bac0d..b8a3c2c 100644
--- a/pyorbital/geoloc_instrument_definitions.py
+++ b/pyorbital/geoloc_instrument_definitions.py
@@ -37,8 +37,10 @@ Both scan angles and scan times are then combined into a ScanGeometry object.
"""
import numpy as np
+
from pyorbital.geoloc import ScanGeometry
+
################################################################
#
# AVHRR
@@ -47,7 +49,7 @@ from pyorbital.geoloc import ScanGeometry
def avhrr(scans_nb, scan_points,
- scan_angle=55.37, frequency=1 / 6.0):
+ scan_angle=55.37, frequency=1 / 6.0, apply_offset=True):
"""Definition of the avhrr instrument.
Source: NOAA KLM User's Guide, Appendix J
@@ -60,11 +62,13 @@ def avhrr(scans_nb, scan_points,
avhrr_inst = np.tile(avhrr_inst, [scans_nb, 1])
# building the corresponding times array
- offset = np.arange(scans_nb) * frequency
# times = (np.tile(scan_points * 0.000025 + 0.0025415, [scans_nb, 1])
# + np.expand_dims(offset, 1))
- times = (np.tile(scan_points * 0.000025, [scans_nb, 1])
- + np.expand_dims(offset, 1))
+
+ times = np.tile(scan_points * 0.000025, [scans_nb, 1])
+ if apply_offset:
+ offset = np.arange(scans_nb) * frequency
+ times += np.expand_dims(offset, 1)
return ScanGeometry(avhrr_inst, times.ravel())
diff --git a/pyorbital/orbital.py b/pyorbital/orbital.py
index 48a4875..431578a 100644
--- a/pyorbital/orbital.py
+++ b/pyorbital/orbital.py
@@ -25,11 +25,12 @@
"""Module for computing the orbital parameters of satellites.
"""
+import warnings
from datetime import datetime, timedelta
+
import numpy as np
-from pyorbital import tlefile
-from pyorbital import astronomy
-import warnings
+
+from pyorbital import astronomy, tlefile
ECC_EPS = 1.0e-6 # Too low for computing further drops.
ECC_LIMIT_LOW = -1.0e-3
@@ -71,6 +72,54 @@ class OrbitalError(Exception):
pass
+def get_observer_look(sat_lon, sat_lat, sat_alt, utc_time, lon, lat, alt):
+ """Calculate observers look angle to a satellite.
+ http://celestrak.com/columns/v02n02/
+
+ utc_time: Observation time (datetime object)
+ lon: Longitude of observer position on ground
+ lat: Latitude of observer position on ground
+ alt: Altitude above sea-level (geoid) of observer position on ground
+
+ Return: (Azimuth, Elevation)
+ """
+ (pos_x, pos_y, pos_z), (vel_x, vel_y, vel_z) = astronomy.observer_position(
+ utc_time, sat_lon, sat_lat, sat_alt)
+
+ (opos_x, opos_y, opos_z), (ovel_x, ovel_y, ovel_z) = \
+ astronomy.observer_position(utc_time, lon, lat, alt)
+
+ lon = np.deg2rad(lon)
+ lat = np.deg2rad(lat)
+
+ theta = (astronomy.gmst(utc_time) + lon) % (2 * np.pi)
+
+ rx = pos_x - opos_x
+ ry = pos_y - opos_y
+ rz = pos_z - opos_z
+
+ sin_lat = np.sin(lat)
+ cos_lat = np.cos(lat)
+ sin_theta = np.sin(theta)
+ cos_theta = np.cos(theta)
+
+ top_s = sin_lat * cos_theta * rx + \
+ sin_lat * sin_theta * ry - cos_lat * rz
+ top_e = -sin_theta * rx + cos_theta * ry
+ top_z = cos_lat * cos_theta * rx + \
+ cos_lat * sin_theta * ry + sin_lat * rz
+
+ az_ = np.arctan(-top_e / top_s)
+
+ az_ = np.where(top_s > 0, az_ + np.pi, az_)
+ az_ = np.where(az_ < 0, az_ + 2 * np.pi, az_)
+
+ rg_ = np.sqrt(rx * rx + ry * ry + rz * rz)
+ el_ = np.arcsin(top_z / rg_)
+
+ return np.rad2deg(az_), np.rad2deg(el_)
+
+
class Orbital(object):
"""Class for orbital computations.
diff --git a/pyorbital/version.py b/pyorbital/version.py
index b233f3b..46e3a50 100644
--- a/pyorbital/version.py
+++ b/pyorbital/version.py
@@ -23,4 +23,4 @@
"""Version file.
"""
-__version__ = "v1.1.0"
+__version__ = "v1.1.1"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pyorbital.git
More information about the Pkg-grass-devel
mailing list