[Git][debian-gis-team/pytroll-schedule][upstream] New upstream version 0.5.2

Antonio Valentino gitlab at salsa.debian.org
Wed Jul 10 00:19:02 BST 2019



Antonio Valentino pushed to branch upstream at Debian GIS Project / pytroll-schedule


Commits:
0d2cf670 by Antonio Valentino at 2019-07-09T23:00:20Z
New upstream version 0.5.2
- - - - -


6 changed files:

- .travis.yml
- CHANGELOG.md
- trollsched/boundary.py
- trollsched/satpass.py
- trollsched/tests/test_satpass.py
- trollsched/version.py


Changes:

=====================================
.travis.yml
=====================================
@@ -5,7 +5,7 @@ env:
   - PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
   - NUMPY_VERSION=stable
   - MAIN_CMD='python setup.py'
-  - CONDA_DEPENDENCIES='scipy coveralls coverage codecov mock six appdirs pykdtree pyresample docutils pyyaml matplotlib'
+  - CONDA_DEPENDENCIES='scipy coveralls coverage codecov mock six appdirs pykdtree pyresample docutils pyyaml matplotlib xarray'
   - PIP_DEPENDENCIES=''
   - SETUP_XVFB=False
   - EVENT_TYPE='push pull_request cron'
@@ -27,6 +27,9 @@ matrix:
 install:
     - git clone --depth 1 git://github.com/astropy/ci-helpers.git
     - source ci-helpers/travis/setup_conda.sh
+    # reactivate environment to set proj environment variables
+    - conda deactivate
+    - conda activate test
 script: coverage run --source=trollsched setup.py test
 after_success:
 - if [[ $PYTHON_VERSION == 3.6 ]]; then coveralls; fi
@@ -36,7 +39,7 @@ deploy:
     user: adybbroe
     password:
       secure: SY0qo7sZXDjDx0DHvuXrHvL9VTAulgU/T33d6UWXf469jT9DOexuZ2VYLgJbYQen5FSe5JmQE0ZMdId1cb8IPP/77qCgQK6f0lRDa43fSYXhcD+fHzlQskievJrwamkRYx6WBrJbwGAKBNinUgNSaTdbh9XUugziGFiOHUfVppM=
-    distributions: sdist
+    distributions: sdist bdist_wheel
     skip_existing: true
     on:
       tags: true


=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,16 @@
+## Version 0.5.2 (2019/03/19)
+
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 36](https://github.com/pytroll/pytroll-schedule/pull/36) - Add xarray to conda dependencies
+* [PR 35](https://github.com/pytroll/pytroll-schedule/pull/35) - Bugfix - when a set of sensors are provided choose avhrr if it is one of them
+* [PR 33](https://github.com/pytroll/pytroll-schedule/pull/33) - Bugfix avhrr naming
+
+In this release 3 pull requests were closed.
+
 ## Version 0.5.1 (2019/01/08)
 
 ### Issues Closed


=====================================
trollsched/boundary.py
=====================================
@@ -36,7 +36,8 @@ from pyorbital import geoloc, geoloc_instrument_definitions
 logger = logging.getLogger(__name__)
 
 INSTRUMENT = {'avhrr/3': 'avhrr',
-              'avhrr/2': 'avhrr'}
+              'avhrr/2': 'avhrr',
+              'avhrr-3': 'avhrr'}
 
 
 class SwathBoundary(Boundary):
@@ -70,9 +71,10 @@ class SwathBoundary(Boundary):
         else:
             scan_angle = 55.25
 
-        instrument_fun = getattr(geoloc_instrument_definitions, INSTRUMENT.get(instrument, instrument))
+        instrument_fun = getattr(geoloc_instrument_definitions,
+                                 INSTRUMENT.get(instrument, instrument))
 
-        if instrument in ["avhrr", "avhrr/3", "avhrr/2"]:
+        if instrument.startswith("avhrr"):
             sgeom = instrument_fun(scans_nb, scanpoints, scan_angle=scan_angle, frequency=100)
         elif instrument in ["ascat", ]:
             sgeom = instrument_fun(scans_nb, scanpoints)
@@ -112,7 +114,7 @@ class SwathBoundary(Boundary):
         if self.overpass.instrument == 'viirs':
             sec_scan_duration = 1.779166667
             along_scan_reduce_factor = 1
-        elif self.overpass.instrument in ['avhrr', 'avhrr/3', 'avhrr/2']:
+        elif self.overpass.instrument.startswith("avhrr"):
             sec_scan_duration = 1./6.
             along_scan_reduce_factor = 0.1
         elif self.overpass.instrument == 'ascat':
@@ -123,7 +125,7 @@ class SwathBoundary(Boundary):
         else:
             # Assume AVHRR!
             logmsg = ("Instrument scan duration not known. Setting it to AVHRR. Instrument: ")
-            logger.warning(logmsg + "%s", str(self.overpass.instrument))
+            logger.info(logmsg + "%s", str(self.overpass.instrument))
             sec_scan_duration = 1./6.
             along_scan_reduce_factor = 0.1
 


=====================================
trollsched/satpass.py
=====================================
@@ -145,9 +145,18 @@ class Pass(SimplePass):
         tle2 = kwargs.get('tle2', None)
         logger.debug("instrument: %s", str(instrument))
 
-        if isinstance(instrument, list):
-            logger.warning("Instrument is a list! Assume avhrr...")
-            instrument = 'avhrr'
+        if isinstance(instrument, (list, set)):
+            if 'avhrr' in instrument:
+                logger.warning("Instrument is a sequence Assume avhrr...")
+                instrument = 'avhrr'
+            elif 'viirs' in instrument:
+                logger.warning("Instrument is a sequence! Assume viirs...")
+                instrument = 'viirs'
+            elif 'modis' in instrument:
+                logger.warning("Instrument is a sequence! Assume modis...")
+                instrument = 'modis'
+            else:
+                raise TypeError("Instrument is a sequence! Don't know which one to choose!")
 
         default = NUMBER_OF_FOVS.get(instrument, 2048)
         self.number_of_fovs = kwargs.get('number_of_fovs', default)
@@ -451,10 +460,10 @@ def get_next_passes(satellites,
             get_terra_aqua_passes(passes, utctime, forward, sat, passlist, satorb, aqua_terra_dumps)
 
         else:
-            if sat.name.lower().startswith("metop") or sat.name.lower().startswith("noaa"):
-                instrument = "avhrr"
-            elif sat.name.upper() in VIIRS_PLATFORM_NAMES:
+            if sat.name.upper() in VIIRS_PLATFORM_NAMES:
                 instrument = "viirs"
+            elif sat.name.lower().startswith("metop") or sat.name.lower().startswith("noaa"):
+                instrument = "avhrr"
             elif sat.name.upper() in MERSI2_PLATFORM_NAMES:
                 instrument = "mersi2"
             else:


=====================================
trollsched/tests/test_satpass.py
=====================================
@@ -163,6 +163,35 @@ def get_region(areaid):
     return get_area_def(areaid)
 
 
+class TestPass(unittest.TestCase):
+
+    def setUp(self):
+        """Set up"""
+        self.n20orb = get_n20_orbital()
+        self.n19orb = get_n19_orbital()
+
+    def test_pass_instrument_interface(self):
+
+        tstart = datetime(2018, 10, 16, 2, 48, 29)
+        tend = datetime(2018, 10, 16, 3, 2, 38)
+
+        instruments = set(('viirs', 'avhrr', 'modis'))
+        overp = Pass('NOAA-20', tstart, tend, orb=self.n20orb, instrument=instruments)
+        self.assertEqual(overp.instrument, 'avhrr')
+
+        instruments = set(('viirs', 'modis'))
+        overp = Pass('NOAA-20', tstart, tend, orb=self.n20orb, instrument=instruments)
+        self.assertEqual(overp.instrument, 'viirs')
+
+        instruments = set(('amsu-a', 'mhs'))
+        self.assertRaises(TypeError, Pass, self,
+                          'NOAA-20', tstart, tend, orb=self.n20orb, instrument=instruments)
+
+    def tearDown(self):
+        """Clean up"""
+        pass
+
+
 class TestSwathBoundary(unittest.TestCase):
 
     def setUp(self):
@@ -215,6 +244,14 @@ class TestSwathBoundary(unittest.TestCase):
         assertNumpyArraysEqual(cont[0], LONS3)
         assertNumpyArraysEqual(cont[1], LATS3)
 
+        overp = Pass('NOAA-19', tstart, tend, orb=self.n19orb, instrument='avhrr-3')
+        overp_boundary = SwathBoundary(overp, frequency=500)
+
+        cont = overp_boundary.contour()
+
+        assertNumpyArraysEqual(cont[0], LONS3)
+        assertNumpyArraysEqual(cont[1], LATS3)
+
     def test_swath_coverage(self):
 
         # NOAA-19 AVHRR:
@@ -290,5 +327,6 @@ def suite():
     loader = unittest.TestLoader()
     mysuite = unittest.TestSuite()
     mysuite.addTest(loader.loadTestsFromTestCase(TestSwathBoundary))
+    mysuite.addTest(loader.loadTestsFromTestCase(TestPass))
 
     return mysuite


=====================================
trollsched/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: v0.5.1)"
-    git_full = "d91b43d7047454197ac960118dafd7294349ae6f"
-    git_date = "2019-01-08 21:15:09 +0100"
+    git_refnames = " (HEAD -> master, tag: v0.5.2)"
+    git_full = "9b594a35c74a12c895a7957565929b994f15f8fd"
+    git_date = "2019-03-19 10:53:57 +0100"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/pytroll-schedule/commit/0d2cf670326e894acd6f7139c105c4c6e32334bd

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pytroll-schedule/commit/0d2cf670326e894acd6f7139c105c4c6e32334bd
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/20190709/42fed7aa/attachment-0001.html>


More information about the Pkg-grass-devel mailing list