Commit 58ef2e19 authored by Antonio Valentino's avatar Antonio Valentino

New upstream version 0.5.1

parent bc231d69
trollsched/version.py export-subst
......@@ -31,6 +31,16 @@ script: coverage run --source=trollsched setup.py test
after_success:
- if [[ $PYTHON_VERSION == 3.6 ]]; then coveralls; fi
#
deploy:
- provider: pypi
user: adybbroe
password:
secure: SY0qo7sZXDjDx0DHvuXrHvL9VTAulgU/T33d6UWXf469jT9DOexuZ2VYLgJbYQen5FSe5JmQE0ZMdId1cb8IPP/77qCgQK6f0lRDa43fSYXhcD+fHzlQskievJrwamkRYx6WBrJbwGAKBNinUgNSaTdbh9XUugziGFiOHUfVppM=
distributions: sdist
skip_existing: true
on:
tags: true
repo: pytroll/pytroll-schedule
notifications:
slack:
rooms:
......
## Version <RELEASE_VERSION> (2018/11/25)
## Version 0.5.1 (2019/01/08)
### Issues Closed
* [Issue 27](https://github.com/pytroll/pytroll-schedule/issues/27) - Drawing the ascat outline
* [Issue 25](https://github.com/pytroll/pytroll-schedule/issues/25) - New version slower in generating the schedule ([PR 26](https://github.com/pytroll/pytroll-schedule/pull/26))
In this release 2 issues were closed.
### Pull Requests Merged
#### Bugs fixed
* [PR 26](https://github.com/pytroll/pytroll-schedule/pull/26) - Speed up schedule generation ([25](https://github.com/pytroll/pytroll-schedule/issues/25))
* [PR 24](https://github.com/pytroll/pytroll-schedule/pull/24) - Bugfix schedule generation
#### Features added
* [PR 29](https://github.com/pytroll/pytroll-schedule/pull/29) - Move save_fig import in under the save function
* [PR 28](https://github.com/pytroll/pytroll-schedule/pull/28) - Restructure the get_next_passes putting some of the highly nested cod…
* [PR 26](https://github.com/pytroll/pytroll-schedule/pull/26) - Speed up schedule generation ([25](https://github.com/pytroll/pytroll-schedule/issues/25))
* [PR 23](https://github.com/pytroll/pytroll-schedule/pull/23) - Versioneer
In this release 6 pull requests were closed.
## Version 0.5.0 (2018/11/25)
### Issues Closed
......
include versioneer.py
include trollsched/version.py
pytroll-schedule
================
Reception scheduling of polar weather satellites
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9f039d7d640846ca89be8a78fa11e1f6)](https://www.codacy.com/app/adybbroe/pytroll-schedule?utm_source=github.com&utm_medium=referral&utm_content=pytroll/pytroll-schedule&utm_campaign=badger)
[![Build Status](https://travis-ci.org/pytroll/pytroll-schedule.png?branch=master)](https://travis-ci.org/pytroll/pytroll-schedule)
[![Coverage Status](https://coveralls.io/repos/github/pytroll/pytroll-schedule/badge.svg?branch=master)](https://coveralls.io/github/pytroll/pytroll-schedule?branch=master)
[![Code Health](https://landscape.io/github/pytroll/pytroll-schedule/master/landscape.png)](https://landscape.io/github/pytroll/pytroll-schedule/master)
[![PyPI version](https://badge.fury.io/py/pytroll-schedule.svg)](https://badge.fury.io/py/pytroll-schedule)
Reception scheduling of polar orbiting weather satellites
# Releasing pytroll-schedule
1. checkout master
2. pull from repo
3. run the unittests
4. run `loghub` and update the `CHANGELOG.md` file:
```
loghub pytroll/pytroll-schedule -u <username> -st v0.5.0 -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes"
```
Don't forget to commit!
5. Create a tag with the new version number, starting with a 'v', eg:
```
git tag v0.5.1 -m "Version 0.5.1"
```
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
[bdist_rpm]
requires=numpy pyresample pyorbital
release=1
# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files.
[versioneer]
VCS = git
style = pep440
versionfile_source = trollsched/version.py
versionfile_build =
tag_prefix = v
parentdir_prefix =
[bdist_wheel]
universal=1
[flake8]
max-line-length = 120
[coverage:run]
omit =
trollsched/version.py
versioneer.py
......@@ -25,12 +25,9 @@
"""
# workaround python bug: http://bugs.python.org/issue15881#msg170215
import multiprocessing
from setuptools import setup
import imp
import sys
version = imp.load_source('trollsched.version', 'trollsched/version.py')
import versioneer
requires = ['numpy', 'pyresample', 'pyorbital']
test_requires = ['satpy']
......@@ -40,7 +37,8 @@ if sys.version_info < (2, 7):
requires.append('argparse')
setup(name='pytroll-schedule',
version=version.__version__,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Scheduling satellite passes in Python',
author='Martin Raspaud',
author_email='martin.raspaud@smhi.se',
......
......@@ -23,6 +23,11 @@
"""Package file.
"""
from .version import get_versions
__version__ = get_versions()['version']
del get_versions
# shortest allowed pass in minutes
MIN_PASS = 4
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2018 PyTroll community
# Copyright (c) 2014-2019 PyTroll community
# Author(s):
......@@ -35,6 +35,9 @@ from pyorbital import geoloc, geoloc_instrument_definitions
logger = logging.getLogger(__name__)
INSTRUMENT = {'avhrr/3': 'avhrr',
'avhrr/2': 'avhrr'}
class SwathBoundary(Boundary):
......@@ -50,24 +53,30 @@ class SwathBoundary(Boundary):
# cheating at the moment.
# scan_angle = 55.37
if instrument == "modis":
# scan_angle = 55.0
scan_angle = 55.0
instrument = "avhrr"
elif instrument == "viirs":
# scan_angle = 55.84
scan_angle = 55.84
instrument = "viirs"
elif instrument == "iasi":
# scan_angle = 48.3
scan_angle = 48.3
instrument = "avhrr"
elif overpass.satellite == "noaa 16":
# scan_angle = 55.25
scan_angle = 55.25
instrument = "avhrr"
else:
# scan_angle = 55.25
elif instrument == "mersi2":
scan_angle = 55.4
instrument = "avhrr"
else:
scan_angle = 55.25
instrument_fun = getattr(geoloc_instrument_definitions, instrument)
instrument_fun = getattr(geoloc_instrument_definitions, INSTRUMENT.get(instrument, instrument))
if instrument in ["olci", "avhrr", "ascat", "avhrr/3", "avhrr/2"]:
if instrument in ["avhrr", "avhrr/3", "avhrr/2"]:
sgeom = instrument_fun(scans_nb, scanpoints, scan_angle=scan_angle, frequency=100)
elif instrument in ["ascat", ]:
sgeom = instrument_fun(scans_nb, scanpoints)
elif instrument in ["olci", ]:
sgeom = instrument_fun(scans_nb, scanpoints)
elif instrument == 'viirs':
sgeom = instrument_fun(scans_nb, scanpoints, scan_step=scan_step)
......@@ -86,7 +95,7 @@ class SwathBoundary(Boundary):
return (lons.reshape(-1, len(scanpoints)),
lats.reshape(-1, len(scanpoints)))
def __init__(self, overpass, scan_step=20, frequency=100):
def __init__(self, overpass, scan_step=50, frequency=200):
# compute area covered by pass
Boundary.__init__(self)
......@@ -102,20 +111,26 @@ class SwathBoundary(Boundary):
logger.debug("Instrument = %s", self.overpass.instrument)
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']:
sec_scan_duration = 1./6.
along_scan_reduce_factor = 0.1
elif self.overpass.instrument == 'ascat':
sec_scan_duration = 3.74747474747
along_scan_reduce_factor = 1
# Overwrite the scan step
scan_step = 1
else:
# Assume AVHRR!
logmsg = ("Instrument scan duration not known. Setting it to AVHRR. Instrument: ")
logger.warning(logmsg + "%s", str(self.overpass.instrument))
sec_scan_duration = 1./6.
along_scan_reduce_factor = 0.1
# From pass length in seconds and the seconds for one scan derive the number of scans in the swath:
scans_nb = scanlength_seconds/sec_scan_duration
scans_nb = scanlength_seconds/sec_scan_duration * along_scan_reduce_factor
# Devide by the scan step to a reduced number of scans:
scans_nb = np.ceil(scans_nb/scan_step)
scans_nb = np.floor(scans_nb/scan_step)
scans_nb = int(max(scans_nb, 1))
sides_lons, sides_lats = self.get_instrument_points(self.overpass,
......
This diff is collapsed.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013, 2014, 2015, 2016, 2017, 2018 Martin Raspaud
# Copyright (c) 2013 - 2019 PyTroll
# Author(s):
......@@ -26,22 +26,18 @@
import logging
import logging.handlers
import os
from six.moves.configparser import ConfigParser
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from six.moves.configparser import ConfigParser
from datetime import datetime, timedelta
from pprint import pformat
import numpy as np
from pyorbital import astronomy
from pyresample import utils as resample_utils
try:
from trollsched import utils
except ImportError:
import utils
from trollsched import utils
from trollsched.spherical import get_twilight_poly
from trollsched.graph import Graph
from trollsched.satpass import get_next_passes, SimplePass
......@@ -577,8 +573,11 @@ def parse_datetime(strtime):
def save_passes(allpasses, poly, output_dir):
for passage in allpasses:
passage.save_fig(poly, directory=output_dir)
"""Save overpass plots to png and store in directory *output_dir*
"""
from trollsched.drawing import save_fig
for overpass in allpasses:
save_fig(overpass, poly=poly, directory=output_dir)
def get_passes_from_xml_file(filename):
......@@ -603,6 +602,7 @@ def build_filename(pattern_name, pattern_dict, kwargs):
for v in pattern_dict.values():
if "{" + k + "}" in v:
kwargs[k] = pattern_dict[k].format(**kwargs)
return pattern_dict[pattern_name].format(**kwargs)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment