[Git][debian-gis-team/pyorbital][master] 10 commits: New upstream version 1.6.1
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Tue Aug 17 16:29:58 BST 2021
Antonio Valentino pushed to branch master at Debian GIS Project / pyorbital
Commits:
60cc0867 by Antonio Valentino at 2021-08-17T10:05:40+00:00
New upstream version 1.6.1
- - - - -
787b7160 by Antonio Valentino at 2021-08-17T10:05:41+00:00
Update upstream source from tag 'upstream/1.6.1'
Update to upstream version '1.6.1'
with Debian dir 766426c4a634dbee8ed79c29ecb7652b5a7dbc4f
- - - - -
bb368777 by Antonio Valentino at 2021-08-17T10:06:20+00:00
New upstream release
- - - - -
7a0bb031 by Antonio Valentino at 2021-08-17T10:12:13+00:00
Update the copyright file
- - - - -
17801975 by Antonio Valentino at 2021-08-17T10:19:18+00:00
Drop 0001-Skip-tests-if-data-are-not-available.patch
- - - - -
90470088 by Antonio Valentino at 2021-08-17T10:25:04+00:00
Drop 0002-Fix-tests.patch
- - - - -
8b1277ec by Antonio Valentino at 2021-08-17T10:25:41+00:00
Trim trailing whitespace.
Changes-By: lintian-brush
Fixes: lintian: trailing-whitespace
See-also: https://lintian.debian.org/tags/trailing-whitespace.html
- - - - -
dfc9a59d by Antonio Valentino at 2021-08-17T14:56:44+00:00
Update debian/docs
- - - - -
0338903f by Antonio Valentino at 2021-08-17T15:17:45+00:00
Update lintian overrides
- - - - -
e4ffd97e by Antonio Valentino at 2021-08-17T15:22:21+00:00
Set distribution to unstable
- - - - -
25 changed files:
- + .github/workflows/ci.yaml
- + .github/workflows/deploy-sdist.yaml
- − .travis.yml
- CHANGELOG.md
- − README
- + README.md
- RELEASING.md
- + continuous_integration/environment.yaml
- debian/changelog
- debian/copyright
- debian/docs
- − debian/patches/0001-Skip-tests-if-data-are-not-available.patch
- − debian/patches/0002-Fix-tests.patch
- − debian/patches/series
- − debian/python-pyorbital-doc.lintian-overrides
- debian/python3-pyorbital.lintian-overrides
- pyorbital/etc/platforms.txt
- pyorbital/geoloc_instrument_definitions.py
- pyorbital/orbital.py
- pyorbital/tests/test_aiaa.py
- pyorbital/tests/test_geoloc.py
- pyorbital/tests/test_orbital.py
- pyorbital/tests/test_tlefile.py
- pyorbital/version.py
- setup.py
Changes:
=====================================
.github/workflows/ci.yaml
=====================================
@@ -0,0 +1,48 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+ test:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: true
+ matrix:
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
+ python-version: ["3.7", "3.8", "3.9"]
+
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ OS: ${{ matrix.os }}
+ ACTIONS_ALLOW_UNSECURE_COMMANDS: true
+
+ steps:
+ - name: Checkout source
+ uses: actions/checkout at v2
+
+ - name: Setup Conda Environment
+ uses: conda-incubator/setup-miniconda at v2
+ with:
+ miniconda-version: "latest"
+ python-version: ${{ matrix.python-version }}
+ mamba-version: "*"
+ channels: conda-forge,defaults
+ environment-file: continuous_integration/environment.yaml
+ activate-environment: test-environment
+
+ - name: Install Pyorbital
+ shell: bash -l {0}
+ run: |
+ pip install --no-deps -e .
+
+ - name: Run unit tests
+ shell: bash -l {0}
+ run: |
+ pytest --cov=pyorbital pyorbital/tests --cov-report=xml
+
+ - name: Upload unittest coverage to Codecov
+ uses: codecov/codecov-action at v1
+ with:
+ flags: unittests
+ file: ./coverage.xml
+ env_vars: OS,PYTHON_VERSION,UNSTABLE
=====================================
.github/workflows/deploy-sdist.yaml
=====================================
@@ -0,0 +1,25 @@
+name: Deploy sdist
+
+on:
+ release:
+ types:
+ - published
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout source
+ uses: actions/checkout at v2
+
+ - name: Create sdist
+ shell: bash -l {0}
+ run: python setup.py sdist
+
+ - name: Publish package to PyPI
+ if: github.event.action == 'published'
+ uses: pypa/gh-action-pypi-publish at v1.4.1
+ with:
+ user: __token__
+ password: ${{ secrets.pypi_password }}
\ No newline at end of file
=====================================
.travis.yml deleted
=====================================
@@ -1,20 +0,0 @@
-language: python
-python:
-- '3.7'
-- '3.8'
-install:
-- pip install dask[array] xarray
-- pip install .
-- pip install coveralls
-script: coverage run --source=pyorbital setup.py test
-after_success: coveralls
-deploy:
- provider: pypi
- user: Martin.Raspaud
- password:
- secure: P3WiHVzDAJyZmiIfSF3PhY7Xqp3P3pSHhogla8u3KOw4Sy5Ye6IWwMX1+pupAyhdXgo8ZgGT4+wOn9dBejaLEA0RGIRLMHXd1QxP9BbPD5te/k5aTpzHILx786g5R6G4yw/8s/sftQC6lJT+0jJd2OJjQJsnNUJJTG8OC2uwq3Y=
- distributions: sdist
- skip_existing: true
- on:
- tags: true
- repo: pytroll/pyorbital
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,31 @@
+## Version 1.6.1 (2021/04/12)
+
+### Issues Closed
+
+* [Issue 63](https://github.com/pytroll/pyorbital/issues/63) - Runtime error in get_next_passes ([PR 64](https://github.com/pytroll/pyorbital/pull/64))
+* [Issue 62](https://github.com/pytroll/pyorbital/issues/62) - can this tool run
+* [Issue 22](https://github.com/pytroll/pyorbital/issues/22) - get_next_passes returns max-elevation-time time not between rise & fall time ([PR 76](https://github.com/pytroll/pyorbital/pull/76))
+
+In this release 3 issues were closed.
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 76](https://github.com/pytroll/pyorbital/pull/76) - Fix parabolic estimation ([22](https://github.com/pytroll/pyorbital/issues/22))
+* [PR 65](https://github.com/pytroll/pyorbital/pull/65) - Add requests to the requirements
+* [PR 64](https://github.com/pytroll/pyorbital/pull/64) - Fix inappropriate runtime warning ([63](https://github.com/pytroll/pyorbital/issues/63))
+* [PR 60](https://github.com/pytroll/pyorbital/pull/60) - Skip tests if data are not available
+* [PR 59](https://github.com/pytroll/pyorbital/pull/59) - Fix tests on i386
+
+#### Features added
+
+* [PR 75](https://github.com/pytroll/pyorbital/pull/75) - Fix numpy deprecation warnings
+* [PR 67](https://github.com/pytroll/pyorbital/pull/67) - Added CALIPSO among platforms
+
+In this release 7 pull requests were closed.
+
+
## Version 1.6.0 (2020/06/24)
### Issues Closed
=====================================
README deleted
=====================================
@@ -1,5 +0,0 @@
-This is pyorbital, python package for computing orbital parameters from tle
-files, and making diverse astronomical computations.
-
-It is part of the pytroll project:
-http://pytroll.org
\ No newline at end of file
=====================================
README.md
=====================================
@@ -0,0 +1,13 @@
+Pyorbital
+=========
+
+[![Build status](https://github.com/pytroll/pyorbital/workflows/CI/badge.svg?branch=master)](https://github.com/pytroll/pyorbital/workflows/CI/badge.svg?branch=master)
+[![Coverage Status](https://coveralls.io/repos/github/pytroll/pyorbital/badge.svg?branch=master)](https://coveralls.io/github/pytroll/pyorbital?branch=master)
+[![PyPI version](https://badge.fury.io/py/pyorbital.svg)](https://badge.fury.io/py/pyorbital)
+
+
+This is the Pyorbital, a Python package for computing orbital parameters from TLE
+files, and making various astronomical computations.
+
+It is part of the Pytroll project: http://pytroll.org
+
=====================================
RELEASING.md
=====================================
@@ -6,7 +6,8 @@
4. run `loghub` and update the `CHANGELOG.md` file:
```
-loghub pytroll/pyorbital -u <username> -st v0.8.0 -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes"
+loghub pytroll/pysorbital --token <personal access token (see https://github.com/settings/tokens)> -st v<previous version> -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes"
+
```
Don't forget to commit!
@@ -14,10 +15,20 @@ Don't forget to commit!
5. Create a tag with the new version number, starting with a 'v', eg:
```
-git tag v0.22.45 -m "Version 0.22.45"
+git tag -a v0.22.45 -m "Version 0.22.45"
```
See [semver.org](http://semver.org/) on how to write a version number.
6. push changes to github `git push --follow-tags`
-7. Verify travis tests passed and deployed sdist and wheel to PyPI
+
+7. Verify github action unittests passed.
+
+8. Create a "Release" on GitHub by going to
+ https://github.com/pytroll/pyorbital/releases and clicking "Draft a new release".
+ On the next page enter the newly created tag in the "Tag version" field,
+ "Version X.Y.Z" in the "Release title" field, and paste the markdown from
+ the changelog (the portion under the version section header) in the
+ "Describe this release" box. Finally click "Publish release".
+
+9. Verify the GitHub actions for deployment succeed and the release is on PyPI.
=====================================
continuous_integration/environment.yaml
=====================================
@@ -0,0 +1,30 @@
+name: test-environment
+channels:
+ - conda-forge
+dependencies:
+ - xarray
+ - dask
+ - distributed
+ - toolz
+ - Cython
+ - sphinx
+ - cartopy
+ - pillow
+ - matplotlib
+ - scipy
+ - pyyaml
+ - pyproj
+ - pyresample
+ - coveralls
+ - coverage
+ - codecov
+ - behave
+ - mock
+ - zarr
+ - geoviews
+ - pytest
+ - pytest-cov
+ - fsspec
+ - pip
+ - pip:
+ - trollsift
=====================================
debian/changelog
=====================================
@@ -1,11 +1,21 @@
-pyorbital (1.6.0-4) UNRELEASED; urgency=medium
+pyorbital (1.6.1-1) unstable; urgency=medium
- * Team upload.
+ [ Bas Couwenberg ]
* Bump watch file version to 4.
* Bump Standards-Version to 4.5.1, no changes.
* Update watch file for GitHub URL changes.
- -- Bas Couwenberg <sebastic at debian.org> Fri, 06 Nov 2020 19:49:14 +0100
+ [ Antonio Valentino ]
+ * New upstream release.
+ * Update the debian/copyright file.
+ * debian/patches:
+ - drop 0001-Skip-tests-if-data-are-not-available.patch,
+ applied upstream.
+ - drop 0002-Fix-tests.patch, applied upstream.
+ * debian/doc updated (README renamed into README.md).
+ * Update debian/*.lintian-overrides
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it> Tue, 17 Aug 2021 15:21:52 +0000
pyorbital (1.6.0-3) unstable; urgency=medium
=====================================
debian/copyright
=====================================
@@ -3,12 +3,12 @@ Upstream-Name: pyorbital
Source: https://github.com/pytroll/pyorbital
Files: *
-Copyright: 2013-2019, PyTroll Community
+Copyright: 2013-2021, PyTroll Community
2011-2018, Esben S. Nielsen <esn at dmi.dk>
2011-2018, Panu Lahtinen <panu.lahtinen at fmi.fi
2011, 2014, SMHI
2012-2015, Adam Dybbroe <adam.dybbroe at smhi.se>
- 2011-2018, Martin Raspaud <martin.raspaud at smhi.se>
+ 2011-2021, Martin Raspaud <martin.raspaud at smhi.se>
2012-2014, The Pytroll crew
2013-2015, 2017, Mikhail Itkin <itkin.m at gmail.com>
License: GPL-3+
=====================================
debian/docs
=====================================
@@ -1 +1 @@
-README
+README.md
=====================================
debian/patches/0001-Skip-tests-if-data-are-not-available.patch deleted
=====================================
@@ -1,29 +0,0 @@
-From: Antonio Valentino <antonio.valentino at tiscali.it>
-Date: Sun, 23 Dec 2018 07:20:42 +0000
-Subject: Skip tests if data are not available
-
-Forwarded to upstream: https://github.com/pytroll/pyorbital/pull/60
----
- pyorbital/tests/test_aiaa.py | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/pyorbital/tests/test_aiaa.py b/pyorbital/tests/test_aiaa.py
-index 365f237..519b0f6 100644
---- a/pyorbital/tests/test_aiaa.py
-+++ b/pyorbital/tests/test_aiaa.py
-@@ -79,10 +79,15 @@ def get_results(satnumber, delay):
- line = f_2.readline()
-
-
-+_DATAPATH = os.path.dirname(os.path.abspath(__file__))
-+
- class AIAAIntegrationTest(unittest.TestCase):
- """Test against the AIAA test cases.
- """
-
-+ @unittest.skipIf(
-+ not os.path.exists(os.path.join(_DATAPATH, "SGP4-VER.TLE")),
-+ 'SGP4-VER.TLE not available')
- def test_aiaa(self):
- """Do the tests against AIAA test cases.
- """
=====================================
debian/patches/0002-Fix-tests.patch deleted
=====================================
@@ -1,24 +0,0 @@
-From: Antonio Valentino <antonio.valentino at tiscali.it>
-Date: Mon, 20 Jul 2020 15:17:45 +0000
-Subject: Fix tests
-
-Forwarded to upstream: https://github.com/pytroll/pyorbital/pull/59
----
- pyorbital/orbital.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/pyorbital/orbital.py b/pyorbital/orbital.py
-index 85c504d..eccc464 100644
---- a/pyorbital/orbital.py
-+++ b/pyorbital/orbital.py
-@@ -544,8 +544,8 @@ class Orbital(object):
-
- try:
- tcross = optimize.bisect(_nprime,
-- a=np.datetime64(tstart, time_unit).astype(int),
-- b=np.datetime64(tend, time_unit).astype(int),
-+ a=np.datetime64(tstart, time_unit).astype(np.int64),
-+ b=np.datetime64(tend, time_unit).astype(np.int64),
- rtol=rtol)
- except ValueError:
- # Bisection did not converge
=====================================
debian/patches/series deleted
=====================================
@@ -1,2 +0,0 @@
-0001-Skip-tests-if-data-are-not-available.patch
-0002-Fix-tests.patch
=====================================
debian/python-pyorbital-doc.lintian-overrides deleted
=====================================
@@ -1,3 +0,0 @@
-# sphinx does not provide language_data.js
-embedded-javascript-library */language_data.js please use sphinx
-
=====================================
debian/python3-pyorbital.lintian-overrides
=====================================
@@ -1,2 +1,3 @@
application-in-library-section python usr/bin/fetch_tles
library-package-name-for-application usr/bin/fetch_tles
+package-contains-documentation-outside-usr-share-doc usr/lib/python3/dist-packages/pyorbital/etc/platforms.txt
=====================================
pyorbital/etc/platforms.txt
=====================================
@@ -5,6 +5,7 @@
# platform names from OSCAR.
ALOS-2 39766
CloudSat 29107
+CALIPSO 29108
CryoSat-2 36508
CSK-1 31598
CSK-2 32376
=====================================
pyorbital/geoloc_instrument_definitions.py
=====================================
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (c) 2013 - 2019 PyTroll Community
+# Copyright (c) 2013 - 2021 PyTroll Community
# Author(s):
@@ -62,15 +62,15 @@ def avhrr(scans_nb, scan_points,
np.zeros((len(scan_points),))))
avhrr_inst = np.tile(
- avhrr_inst[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ avhrr_inst[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
# times = (np.tile(scan_points * 0.000025 + 0.0025415, [scans_nb, 1])
# + np.expand_dims(offset, 1))
- times = np.tile(scan_points * 0.000025, [np.int(scans_nb), 1])
+ times = np.tile(scan_points * 0.000025, [np.int32(scans_nb), 1])
if apply_offset:
- offset = np.arange(np.int(scans_nb)) * frequency
+ offset = np.arange(np.int32(scans_nb)) * frequency
times += np.expand_dims(offset, 1)
return ScanGeometry(avhrr_inst, times)
@@ -95,7 +95,7 @@ def avhrr_gac(scan_times, scan_points,
np.zeros((len(scan_points),))))
avhrr_inst = np.tile(
- avhrr_inst[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ avhrr_inst[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
times = (np.tile(scan_points * 0.000025, [scans_nb, 1])
+ np.expand_dims(offset, 1))
@@ -159,10 +159,10 @@ def viirs(scans_nb, scan_indices=slice(0, None),
scan_points = entire_width[scan_indices.astype('int')]
scan_pixels = len(scan_points)
- ''' initial angle 55.84 deg replaced with 56.28 deg found in
- VIIRS User's Guide from NESDIS, version 1.2 (09/10/2013).
- Ref : NOAA Technical Report NESDIS 142.
- Seems to be better (not quantified)'''
+ # Initial angle 55.84 deg replaced with 56.28 deg found in
+ # VIIRS User's Guide from NESDIS, version 1.2 (09/10/2013).
+ # Ref : NOAA Technical Report NESDIS 142.
+ # Seems to be better (not quantified).
across_track = \
(scan_points / (chn_pixels / 2. - 0.5) - 1) * np.deg2rad(-56.28)
y_max_angle = np.arctan2(11.87 / 2, 824.0)
@@ -188,7 +188,7 @@ def viirs(scans_nb, scan_indices=slice(0, None),
SEC_EACH_SCANCOLUMN = 0.0002779947917
sec_scan_duration = 1.779166667
times = np.tile(scan_points * SEC_EACH_SCANCOLUMN,
- [np.int(scans_nb*scan_lines), 1])
+ [np.int32(scans_nb*scan_lines), 1])
offset = np.repeat(np.arange(scans_nb) *
sec_scan_duration*scan_step, scan_lines)
times += np.expand_dims(offset, 1)
@@ -236,12 +236,12 @@ def amsua(scans_nb, scan_points=None):
samples = np.vstack(((scan_points / (scan_len * 0.5 - 0.5) - 1)
* np.deg2rad(scan_angle),
np.zeros((len(scan_points),))))
- samples = np.tile(samples[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ samples = np.tile(samples[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
offset = np.arange(scans_nb) * scan_rate
times = (np.tile(scan_points * sampling_interval + sync_time,
- [np.int(scans_nb), 1])
+ [np.int32(scans_nb), 1])
+ np.expand_dims(offset, 1))
# build the scan geometry object
@@ -287,11 +287,11 @@ def mhs(scans_nb, scan_points=None):
# build the instrument (scan angles)
samples = np.vstack(((scan_points / (scan_len * 0.5 - 0.5) - 1) * np.deg2rad(scan_angle),
np.zeros((len(scan_points),))))
- samples = np.tile(samples[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ samples = np.tile(samples[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
offset = np.arange(scans_nb) * scan_rate
- times = (np.tile(scan_points * sampling_interval + sync_time, [np.int(scans_nb), 1]) + np.expand_dims(offset, 1))
+ times = (np.tile(scan_points * sampling_interval + sync_time, [np.int32(scans_nb), 1]) + np.expand_dims(offset, 1))
# scan_angles = np.linspace(-np.deg2rad(scan_angle), np.deg2rad(scan_angle), scan_len)[scan_points]
@@ -345,11 +345,11 @@ def hirs4(scans_nb, scan_points=None):
samples = np.vstack(((scan_points / (scan_len * 0.5 - 0.5) - 1)
* np.deg2rad(scan_angle),
np.zeros((len(scan_points),))))
- samples = np.tile(samples[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ samples = np.tile(samples[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
offset = np.arange(scans_nb) * scan_rate
- times = (np.tile(scan_points * sampling_interval, [np.int(scans_nb), 1])
+ times = (np.tile(scan_points * sampling_interval, [np.int32(scans_nb), 1])
+ np.expand_dims(offset, 1))
# build the scan geometry object
@@ -395,11 +395,11 @@ def atms(scans_nb, scan_points=None):
scan_angles = np.linspace(-np.deg2rad(scan_angle), np.deg2rad(scan_angle), scan_len)[scan_points]
samples = np.vstack((scan_angles, np.zeros(len(scan_points) * 1,)))
- samples = np.tile(samples[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ samples = np.tile(samples[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
offset = np.arange(scans_nb) * scan_rate
- times = (np.tile(scan_points * sampling_interval, [np.int(scans_nb), 1])
+ times = (np.tile(scan_points * sampling_interval, [np.int32(scans_nb), 1])
+ np.expand_dims(offset, 1))
# build the scan geometry object
@@ -449,12 +449,12 @@ def mwhs2(scans_nb, scan_points=None):
samples = np.vstack(((scan_points / (scan_len * 0.5 - 0.5) - 1)
* np.deg2rad(scan_angle),
np.zeros((len(scan_points),))))
- samples = np.tile(samples[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ samples = np.tile(samples[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
offset = np.arange(scans_nb) * scan_rate
times = (np.tile(scan_points * sampling_interval + sync_time,
- [np.int(scans_nb), 1])
+ [np.int32(scans_nb), 1])
+ np.expand_dims(offset, 1))
# # build the instrument (scan angles)
@@ -500,13 +500,13 @@ def olci(scans_nb, scan_points=None):
np.deg2rad(scan_angle_east), scan_len)
inst = np.vstack((scanline_angles, np.zeros(scan_len,)))
- inst = np.tile(inst[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ inst = np.tile(inst[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
# building the corresponding times array
# times = (np.tile(scan_points * 0.000025 + 0.0025415, [scans_nb, 1])
# + np.expand_dims(offset, 1))
- times = np.tile(np.zeros_like(scanline_angles), [np.int(scans_nb), 1])
+ times = np.tile(np.zeros_like(scanline_angles), [np.int32(scans_nb), 1])
# if apply_offset:
# offset = np.arange(np.int(scans_nb)) * frequency
# times += np.expand_dims(offset, 1)
@@ -544,12 +544,12 @@ def ascat(scan_nb, scan_points=None):
[scanline_angles_one, scanline_angles_two])[scan_points]
inst = np.vstack((scan_angles, np.zeros(scan_len * 1,)))
- inst = np.tile(inst[:, np.newaxis, :], [1, np.int(scan_nb), 1])
+ inst = np.tile(inst[:, np.newaxis, :], [1, np.int32(scan_nb), 1])
# building the corresponding times array
offset = np.arange(scan_nb) * scan_rate
times = (np.tile(scan_points * sampling_interval,
- [np.int(scan_nb), 1]) + np.expand_dims(offset, 1))
+ [np.int32(scan_nb), 1]) + np.expand_dims(offset, 1))
return ScanGeometry(inst, times)
=====================================
pyorbital/orbital.py
=====================================
@@ -22,15 +22,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-"""Module for computing the orbital parameters of satellites.
-"""
+"""Module for computing the orbital parameters of satellites."""
+import logging
import warnings
from datetime import datetime, timedelta
+import numpy as np
from scipy import optimize
-import numpy as np
from pyorbital import astronomy, dt2np, tlefile
try:
@@ -47,6 +47,8 @@ except ImportError:
xr = None
has_xarray = False
+logger = logging.getLogger(__name__)
+
ECC_EPS = 1.0e-6 # Too low for computing further drops.
ECC_LIMIT_LOW = -1.0e-3
ECC_LIMIT_HIGH = 1.0 - ECC_EPS # Too close to 1
@@ -206,9 +208,7 @@ class Orbital(object):
return t_mid
def get_position(self, utc_time, normalize=True):
- """Get the cartesian position and velocity from the satellite.
- """
-
+ """Get the cartesian position and velocity from the satellite."""
kep = self._sgdp4.propagate(utc_time)
pos, vel = kep2xyz(kep)
@@ -220,6 +220,7 @@ class Orbital(object):
def get_lonlatalt(self, utc_time):
"""Calculate sublon, sublat and altitude of satellite.
+
http://celestrak.com/columns/v02n03/
"""
(pos_x, pos_y, pos_z), (vel_x, vel_y, vel_z) = self.get_position(
@@ -390,18 +391,24 @@ class Orbital(object):
f_c = fun(c)
x = b
-
- while True:
- x = x - 0.5 * (((b - a) ** 2 * (f_b - f_c)
- - (b - c) ** 2 * (f_b - f_a)) /
- ((b - a) * (f_b - f_c) - (b - c) * (f_b - f_a)))
- if np.isnan(x):
- return b
- if abs(b - x) <= tol:
- return x
-
- a, b, c = (a + x) / 2.0, x, (x + c) / 2.0
- f_a, f_b, f_c = fun(a), fun(b), fun(c)
+ with np.errstate(invalid='raise'):
+ while True:
+ try:
+ x = x - 0.5 * (((b - a) ** 2 * (f_b - f_c)
+ - (b - c) ** 2 * (f_b - f_a)) /
+ ((b - a) * (f_b - f_c) - (b - c) * (f_b - f_a)))
+ except FloatingPointError:
+ return b
+ if abs(b - x) <= tol:
+ return x
+ f_x = fun(x)
+ # sometimes the estimation diverges... return best guess
+ if f_x > f_b:
+ logger.info('Parabolic interpolation did not converge, returning best guess so far.')
+ return b
+
+ a, b, c = (a + x) / 2.0, x, (x + c) / 2.0
+ f_a, f_b, f_c = fun(a), f_x, fun(c)
# every minute
times = utc_time + np.array([timedelta(minutes=minutes)
@@ -410,7 +417,6 @@ class Orbital(object):
zcs = np.where(np.diff(np.sign(elev)))[0]
res = []
risetime = None
- falltime = None
for guess in zcs:
horizon_mins = get_root(
elevation, guess, guess + 1.0, tol=tol / 60.0)
@@ -418,7 +424,6 @@ class Orbital(object):
if elev[guess] < 0:
risetime = horizon_time
risemins = horizon_mins
- falltime = None
else:
falltime = horizon_time
fallmins = horizon_mins
@@ -544,8 +549,8 @@ class Orbital(object):
try:
tcross = optimize.bisect(_nprime,
- a=np.datetime64(tstart, time_unit).astype(int),
- b=np.datetime64(tend, time_unit).astype(int),
+ a=np.datetime64(tstart, time_unit).astype(np.int64),
+ b=np.datetime64(tend, time_unit).astype(np.int64),
rtol=rtol)
except ValueError:
# Bisection did not converge
@@ -823,9 +828,9 @@ class _SGDP4(object):
raise NotImplementedError('Deep space calculations not supported')
if np.any(a < 1):
- raise Exception('Satellite crased at time %s', utc_time)
+ raise Exception('Satellite crashed at time %s', utc_time)
elif np.any(e < ECC_LIMIT_LOW):
- raise ValueError('Satellite modified eccentricity to low: %s < %e'
+ raise ValueError('Satellite modified eccentricity too low: %s < %e'
% (str(e[e < ECC_LIMIT_LOW]), ECC_LIMIT_LOW))
e = np.where(e < ECC_EPS, ECC_EPS, e)
=====================================
pyorbital/tests/test_aiaa.py
=====================================
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (c) 2011, 2014 SMHI
+# Copyright (c) 2011 - 2021 Pytroll Community
# Author(s):
@@ -79,10 +79,15 @@ def get_results(satnumber, delay):
line = f_2.readline()
+_DATAPATH = os.path.dirname(os.path.abspath(__file__))
+
+
class AIAAIntegrationTest(unittest.TestCase):
- """Test against the AIAA test cases.
- """
+ """Test against the AIAA test cases."""
+ @unittest.skipIf(
+ not os.path.exists(os.path.join(_DATAPATH, "SGP4-VER.TLE")),
+ 'SGP4-VER.TLE not available')
def test_aiaa(self):
"""Do the tests against AIAA test cases.
"""
=====================================
pyorbital/tests/test_geoloc.py
=====================================
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (c) 2014, 2017, 2018 Martin Raspaud
+# Copyright (c) 2014, 2017, 2018, 2021 Martin Raspaud
# Author(s):
@@ -72,9 +72,9 @@ class TestGeoloc(unittest.TestCase):
xy = np.vstack((np.deg2rad(np.array([10, 0, -10])),
np.array([0, 0, 0])))
- xy = np.tile(xy[:, np.newaxis, :], [1, np.int(scans_nb), 1])
+ xy = np.tile(xy[:, np.newaxis, :], [1, np.int32(scans_nb), 1])
- times = np.tile([-0.1, 0, 0.1], [np.int(scans_nb), 1])
+ times = np.tile([-0.1, 0, 0.1], [np.int32(scans_nb), 1])
instrument = ScanGeometry(xy, times)
@@ -109,11 +109,11 @@ class TestGeoloc(unittest.TestCase):
start_of_scan = np.datetime64(datetime(2014, 1, 8, 11, 30))
times = instrument.times(start_of_scan)
- self.assertEquals(times[0, 1], start_of_scan)
- self.assertEquals(times[0, 0], start_of_scan -
- np.timedelta64(100, 'ms'))
- self.assertEquals(times[0, 2], start_of_scan +
- np.timedelta64(100, 'ms'))
+ self.assertEqual(times[0, 1], start_of_scan)
+ self.assertEqual(times[0, 0], start_of_scan -
+ np.timedelta64(100, 'ms'))
+ self.assertEqual(times[0, 2], start_of_scan +
+ np.timedelta64(100, 'ms'))
def test_geodetic_lat(self):
"""Test the determination of the geodetic latitude."""
@@ -178,7 +178,7 @@ class TestGeolocDefs(unittest.TestCase):
geom = viirs(1, np.array([0, 3200, 6399]))
expected_fovs = np.array([
np.tile(np.array([[0.98, -0., -0.98]]), [32, 1]),
- np.tile(np.array([[0., -0., 0]]), [32, 1])], dtype=np.float)
+ np.tile(np.array([[0., -0., 0]]), [32, 1])], dtype=np.float64)
self.assertTrue(np.allclose(geom.fovs,
expected_fovs, rtol=1e-2, atol=1e-2))
@@ -186,7 +186,7 @@ class TestGeolocDefs(unittest.TestCase):
geom = viirs(2, np.array([0, 3200, 6399]))
expected_fovs = np.array([
np.tile(np.array([[0.98, -0., -0.98]]), [32*2, 1]),
- np.tile(np.array([[0., -0., 0]]), [32*2, 1])], dtype=np.float)
+ np.tile(np.array([[0., -0., 0]]), [32*2, 1])], dtype=np.float64)
self.assertTrue(np.allclose(geom.fovs,
expected_fovs, rtol=1e-2, atol=1e-2))
@@ -200,7 +200,7 @@ class TestGeolocDefs(unittest.TestCase):
0.32, 0.26, 0.2, 0.15, 0.09, 0.03, -0.03, -0.09, -0.15,
-0.2, -0.26, -0.32, -0.38, -0.44, -0.49, -0.55, -0.61, -0.67,
-0.73, -0.78, -0.84]],
- np.zeros((1, 30))], dtype=np.float)
+ np.zeros((1, 30))], dtype=np.float64)
self.assertTrue(np.allclose(geom.fovs, expected_fovs, rtol=1e-2, atol=1e-2))
def test_mhs(self):
@@ -218,7 +218,7 @@ class TestGeolocDefs(unittest.TestCase):
-0.36, -0.38, -0.4, -0.42, -0.44, -0.46, -0.48, -0.49, -0.51,
-0.53, -0.55, -0.57, -0.59, -0.61, -0.63, -0.65, -0.67, -0.69,
-0.71, -0.73, -0.75, -0.77, -0.79, -0.8, -0.82, -0.84, -0.86]],
- np.zeros((1, 90))], dtype=np.float)
+ np.zeros((1, 90))], dtype=np.float64)
self.assertTrue(np.allclose(geom.fovs,
expected_fovs, rtol=1e-2, atol=1e-2))
@@ -234,7 +234,7 @@ class TestGeolocDefs(unittest.TestCase):
-0.27, -0.3, -0.33, -0.36, -0.39, -0.42, -0.46, -0.49, -0.52,
-0.55, -0.58, -0.61, -0.64, -0.68, -0.71, -0.74, -0.77, -0.8,
-0.83, -0.86]],
- np.zeros((1, 56))], dtype=np.float)
+ np.zeros((1, 56))], dtype=np.float64)
self.assertTrue(np.allclose(geom.fovs,
expected_fovs, rtol=1e-2, atol=1e-2))
@@ -254,7 +254,7 @@ class TestGeolocDefs(unittest.TestCase):
-0.47, -0.49, -0.51, -0.53, -0.55, -0.57, -0.59, -0.61, -0.63,
-0.65, -0.67, -0.69, -0.71, -0.73, -0.75, -0.76, -0.78, -0.8,
-0.82, -0.84, -0.86, -0.88, -0.9, -0.92]],
- np.zeros((1, 96))], dtype=np.float)
+ np.zeros((1, 96))], dtype=np.float64)
self.assertTrue(np.allclose(geom.fovs,
expected_fovs, rtol=1e-2, atol=1e-2))
@@ -273,13 +273,13 @@ class TestGeolocDefs(unittest.TestCase):
-0.60737458, -0.63180919, -0.6562438, -0.68067841,
-0.70511302, -0.72954763, -0.75398224, -0.77841685,
-0.80285146, -0.82728607, -0.85172067, -0.87615528,
- -0.90058989, -0.9250245]], np.zeros((1, 42))], dtype=np.float)
+ -0.90058989, -0.9250245]], np.zeros((1, 42))], dtype=np.float64)
self.assertTrue(np.allclose(
geom.fovs, expected_fovs, rtol=1e-2, atol=1e-2))
geom = ascat(1, np.array([0, 41]))
expected_fovs = np.array([[[0.9250245, -0.9250245]],
- [[0., 0.]]], dtype=np.float)
+ [[0., 0.]]], dtype=np.float64)
self.assertTrue(np.allclose(
geom.fovs, expected_fovs, rtol=1e-2, atol=1e-2))
=====================================
pyorbital/tests/test_orbital.py
=====================================
@@ -155,6 +155,18 @@ class Test(unittest.TestCase):
self.assertTrue(len(res) == 15)
+ def test_get_next_passes_issue_22(self):
+ """Check that max"""
+ line1 = '1 28654U 05018A 21083.16603416 .00000102 00000-0 79268-4 0 9999'
+ line2 = '2 28654 99.0035 147.6583 0014816 159.4931 200.6838 14.12591533816498'
+
+ orb = orbital.Orbital("NOAA 18", line1=line1, line2=line2)
+ t = datetime(2021, 3, 9, 22)
+ next_passes = orb.get_next_passes(t, 1, -15.6335, 27.762, 0.)
+ rise, fall, max_elevation = next_passes[0]
+ assert rise < max_elevation < fall
+ print(next_passes)
+
@mock.patch('pyorbital.orbital.Orbital.get_lonlatalt')
def test_utc2local(self, get_lonlatalt):
get_lonlatalt.return_value = -45, None, None
@@ -283,6 +295,22 @@ class TestGetObserverLook(unittest.TestCase):
np.testing.assert_allclose(elev.data.compute(), self.exp_elev)
+class TestRegressions(unittest.TestCase):
+ """Test regressions."""
+
+ def test_63(self):
+ """Check that no runtimewarning is raised, #63."""
+ import warnings
+ from pyorbital.orbital import Orbital
+ from dateutil import parser
+ warnings.filterwarnings('error')
+ orb = Orbital("Suomi-NPP",
+ line1="1 37849U 11061A 19292.84582509 .00000011 00000-0 25668-4 0 9997",
+ line2="2 37849 98.7092 229.3263 0000715 98.5313 290.6262 14.19554485413345")
+ orb.get_next_passes(parser.parse("2019-10-21 16:00:00"), 12, 123.29736, -13.93763, 0)
+ warnings.filterwarnings('default')
+
+
def suite():
"""The suite for test_orbital
"""
@@ -290,5 +318,6 @@ def suite():
mysuite = unittest.TestSuite()
mysuite.addTest(loader.loadTestsFromTestCase(Test))
mysuite.addTest(loader.loadTestsFromTestCase(TestGetObserverLook))
+ mysuite.addTest(loader.loadTestsFromTestCase(TestRegressions))
return mysuite
=====================================
pyorbital/tests/test_tlefile.py
=====================================
@@ -29,6 +29,7 @@ import datetime
import unittest
from unittest import mock
import os
+from contextlib import suppress
line0 = "ISS (ZARYA)"
line1 = "1 25544U 98067A 08264.51782528 -.00002182 00000-0 -11606-4 0 2927"
@@ -275,7 +276,8 @@ class TestSQLiteTLE(unittest.TestCase):
def tearDown(self):
"""Clean temporary files."""
- self.temp_dir.cleanup()
+ with suppress(PermissionError, NotADirectoryError):
+ self.temp_dir.cleanup()
def test_init(self):
"""Test that the init did what it should have."""
=====================================
pyorbital/version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (HEAD -> master, tag: v1.6.0)"
- git_full = "3ff7a6b1631deea9aed6ef227017e74f3ebdc379"
- git_date = "2020-06-24 13:56:04 +0200"
+ git_refnames = " (tag: v1.6.1)"
+ git_full = "6b7e685766c268de35f5b42688e066a81418bd73"
+ git_date = "2021-04-12 11:48:04 +0200"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
setup.py
=====================================
@@ -1,12 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2011-2014, 2018, 2020
+# Copyright (c) 2011-2021 Pytroll Community
#
# Author(s):
#
# Martin Raspaud <martin.raspaud at smhi.se>
# Panu Lahtinen <panu.lahtinen at fmi.fi>
+# Adam Dybbroe <adam.dybbroe at smhi.se>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,12 +28,19 @@ import os
from setuptools import setup, find_packages
import versioneer
+try:
+ with open('./README.md', 'r') as fd:
+ long_description = fd.read()
+except IOError:
+ long_description = ''
+
+
setup(name='pyorbital',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Orbital parameters and astronomical computations in Python',
- author='Martin Raspaud, Esben S. Nielsen',
- author_email='martin.raspaud at smhi.se',
+ author='The Pytroll Team',
+ author_email='pytroll at googlegroups.com',
classifiers=["Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 " +
@@ -42,10 +50,12 @@ setup(name='pyorbital',
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Astronomy"],
url="https://github.com/pytroll/pyorbital",
+ long_description=long_description,
+ long_description_content_type='text/markdown',
test_suite='pyorbital.tests.suite',
packages=find_packages(),
package_data={'pyorbital': [os.path.join('etc', 'platforms.txt')]},
scripts=['bin/fetch_tles.py', ],
- install_requires=['numpy>=1.11.0,!=1.14.0', 'scipy'],
+ install_requires=['numpy>=1.19.0', 'scipy', 'requests'],
zip_safe=False,
)
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyorbital/-/compare/1dbf090209fcfb7b0436a14f066a3837b3d99f28...e4ffd97ea5355444c70915f70781bbfe42766653
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyorbital/-/compare/1dbf090209fcfb7b0436a14f066a3837b3d99f28...e4ffd97ea5355444c70915f70781bbfe42766653
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210817/014abe06/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list