This is an automated email from the git hooks/post-receive script. a_valentino-guest pushed a commit to branch master in repository pyresample.
commit c79de2e4d39d89c147f0065286789a262e898be8 Author: Antonio Valentino <antonio.valent...@tiscali.it> Date: Wed Nov 16 20:08:50 2016 +0000 New upstream version 1.2.7 --- .bumpversion.cfg | 7 + .gitchangelog.rc | 193 +++++++++++++++++++++ appveyor.yml | 8 +- appveyor/missing-headers.ps1 | 53 ------ changelog.rst | 260 ++++++++++++++++++----------- pyresample/plot.py | 13 +- pyresample/spherical_geometry.py | 38 +++-- pyresample/test/test_spherical_geometry.py | 4 +- pyresample/version.py | 2 +- 9 files changed, 404 insertions(+), 174 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..7ba38cd --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,7 @@ +[bumpversion] +current_version = 1.2.7 +commit = True +tag = True + +[bumpversion:file:pyresample/version.py] + diff --git a/.gitchangelog.rc b/.gitchangelog.rc new file mode 100644 index 0000000..c714767 --- /dev/null +++ b/.gitchangelog.rc @@ -0,0 +1,193 @@ +## +## 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'^Merge commit .* into HEAD', + 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'^([Bb]ug)?[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. +##git log --pretty=format:"- %s%n%b" --since="$(git show -s --format=%ad `git rev-list --tags --max-count=1`)" +## - 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 +body_process = ReSub(r'(?m)\s*^Signed-off-by: .*$\s*', '') + + +## ``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) + final_dot) +#subject_process = noop + +## ``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 = False diff --git a/appveyor.yml b/appveyor.yml index 3216a64..9975c62 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,10 +48,6 @@ install: # install miniconda with the powershell script install.ps1 - "powershell ./appveyor/install.ps1" - # install missing headers that aren't included with MSVC 2008 - # https://github.com/omnia-md/conda-recipes/pull/524 - # Needed for pykdtree to compile on appveyor's Windows machines - - "powershell ./appveyor/missing-headers.ps1" # Prepend newly installed Python to the PATH of this build (this cannot be # done from inside the powershell script as it would require to restart @@ -68,11 +64,9 @@ install: # target Python version and architecture - "conda update --yes conda" - "conda config --add channels conda-forge" - - "conda create -q --yes -n test python=%PYTHON_VERSION% basemap-data-hires sphinx pyproj scipy" + - "conda create -q --yes -n test python=%PYTHON_VERSION% basemap-data-hires sphinx pyproj scipy pykdtree" - "activate test" - "pip install coveralls" - # Try to install pykdtree, but continue on if we can't - - "pip install pykdtree || (call )" - "where python" build: false # Not a C# project, build stuff at the test step instead. diff --git a/appveyor/missing-headers.ps1 b/appveyor/missing-headers.ps1 deleted file mode 100644 index 44e1b90..0000000 --- a/appveyor/missing-headers.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -function InstallMissingHeaders () { - # Visual Studio 2008 is missing stdint.h, but you can just download one - # from the web. - # http://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio - $webclient = New-Object System.Net.WebClient - - $include_dirs = @("C:\Program Files\Microsoft SDKs\Windows\v7.0\Include", - "C:\Program Files\Microsoft SDKs\Windows\v7.1\Include", - "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include", - "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include", - "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include") - - Foreach ($include_dir in $include_dirs) { - $urls = @(@("https://raw.githubusercontent.com/chemeris/msinttypes/master/stdint.h", "stdint.h"), - @("https://raw.githubusercontent.com/chemeris/msinttypes/master/inttypes.h", "inttypes.h")) - - Foreach ($i in $urls) { - $url = $i[0] - $filename = $i[1] - - $filepath = "$include_dir\$filename" - if (Test-Path $filepath) { - Write-Host $filename "already exists in" $include_dir - continue - } - - Write-Host "Downloading remedial " $filename " from" $url "to" $filepath - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - } - } -} - -function main() { - InstallMissingHeaders -} - -main diff --git a/changelog.rst b/changelog.rst index 8dc4a9e..2e0d99a 100644 --- a/changelog.rst +++ b/changelog.rst @@ -1,10 +1,54 @@ Changelog ========= -%%version%% (unreleased) ------------------------- +v1.2.7 (2016-11-15) +------------------- -- Update changelog. [Martin Raspaud] +- update changelog. [Martin Raspaud] + +- Bump version: 1.2.6 → 1.2.7. [Martin Raspaud] + +- Add bump and changelog config files. [Martin Raspaud] + +- Merge pull request #49 from Funkensieper/fix-polygon-area. [Martin + Raspaud] + + Fix polygon area + +- Disable snapping of angles in get_polygon_area() [Stephan + Finkensieper] + + - Add option to disable snapping in Arc.angle() + - Don't snap angles when computing polygon areas in order to + prevent negative area values + - Adjust reference values in tests on overlap-rate + + +- Fix polygon area computation for R != 1. [Stephan Finkensieper] + + Parentheses were missing, see + + http://mathworld.wolfram.com/SphericalTriangle.html + + for reference. Only affects earth radius R != 1 which is not + implemented yet. + + +- Install pykdtree from conda forge in pre-master. [davidh-ssec] + +- Merge pull request #47 from mitkin/feature_plot-cmap. [David Hoese] + + Add option to choose colormap + +- Add option to choose colormap. [Mikhail Itkin] + + Make possible to indicate which colormap to use when plotting image + + +v1.2.6 (2016-10-19) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.2.5 → 1.2.6. [Martin Raspaud] @@ -49,7 +93,10 @@ Changelog - Add slack notifications from appveyor. [davidh-ssec] -- Update changelog. [Martin Raspaud] +v1.2.5 (2016-07-21) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.2.4 → 1.2.5. [Martin Raspaud] @@ -77,7 +124,7 @@ Changelog Numpy does some special macro stuff to define a good npy_isnan function. Some systems define a macro for it, others don't. Hopefully this works for all systems. A better solution might be to define a templated isnan that calls npy_isnan if it isn't an integer. -- Fix EWA compile failure on windows python 3.5. [David Hoese] +- fix EWA compile failure on windows python 3.5. [David Hoese] - Make pykdtree install on appveyor optional. [davidh-ssec] @@ -116,7 +163,10 @@ Changelog - Fix EWA resampling's isnan to work better with windows. [davidh-ssec] -- Update changelog. [Martin Raspaud] +v1.2.4 (2016-06-27) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.2.3 → 1.2.4. [Martin Raspaud] @@ -124,7 +174,10 @@ Changelog - Fix case when __builtins__ is a dict. [Martin Raspaud] -- Update changelog. [Martin Raspaud] +v1.2.3 (2016-06-21) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.2.2 → 1.2.3. [Martin Raspaud] @@ -133,7 +186,10 @@ Changelog 'pyresample.ewa' wasn't listed before and was not importable from an installed package. -- Update changelog. [Martin Raspaud] +v1.2.2 (2016-06-21) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.2.1 → 1.2.2. [Martin Raspaud] @@ -141,7 +197,10 @@ Changelog Without this, the compilation of the ewa extension crashes. -- Update changelog. [Martin Raspaud] +v1.2.1 (2016-06-21) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.2.0 → 1.2.1. [Martin Raspaud] @@ -153,7 +212,19 @@ Changelog - Merge branch 'pre-master' of github.com:mraspaud/pyresample into pre- master. [Adam.Dybbroe] -- Update changelog. [Martin Raspaud] +- Merge branch 'pre-master' of github.com:mraspaud/pyresample into pre- + master. [Adam.Dybbroe] + + Conflicts: + docs/source/conf.py + + +- Run the base class init function first. [Adam.Dybbroe] + +v1.2.0 (2016-06-17) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.1.6 → 1.2.0. [Martin Raspaud] @@ -163,13 +234,6 @@ Changelog - Add two convenience methods lonlat2colrow and colrow2lonlat to AreaDefinition-class. [Sauli Joro] -- Merge branch 'pre-master' of github.com:mraspaud/pyresample into pre- - master. [Adam.Dybbroe] - - Conflicts: - docs/source/conf.py - - - Fix bug in EWA grid origin calculation. [davidh-ssec] Forgot that cell height was negative so ended up subtracting a negative, going in the wrong direction for the Y origin of the grid. @@ -347,12 +411,6 @@ Changelog PyCharm and possibly other IDEs don't really play well with unittest TestSuites, but work as expected when `load_tests` is used. -- Update changelog. [Martin Raspaud] - -- Bump version: 1.1.5 → 1.1.6. [Martin Raspaud] - -- Run the base class init function first. [Adam.Dybbroe] - - Make kd_tree test work on older numpy version. [Martin Raspaud] VisibleDeprecationWarning is not available in numpy <1.9. @@ -363,6 +421,13 @@ Changelog - Run tests on python 3.5 in travis also. [Martin Raspaud] +v1.1.6 (2016-02-25) +------------------- + +- update changelog. [Martin Raspaud] + +- Bump version: 1.1.5 → 1.1.6. [Martin Raspaud] + - Fix #35 supporting scipy kdtree again. [Martin Raspaud] A previous commit was looking for a 'data_pts' attribute in the kdtree @@ -399,7 +464,10 @@ Changelog - Fix possible type mismatch with pykdtree. [Brian Hawkins] -- Update changelog. [Martin Raspaud] +v1.1.5 (2015-10-12) +------------------- + +- update changelog. [Martin Raspaud] - Bump version: 1.1.4 → 1.1.5. [Martin Raspaud] @@ -410,12 +478,21 @@ Changelog - Fix the unicode problem in python3. [Martin Raspaud] -- Update changelog. [Martin Raspaud] +v1.1.4 (2015-10-08) +------------------- -- Bump version: 1.1.3 → 1.1.4. [Martin Raspaud] +Fix +~~~ - Bugfix: Accept unicode proj4 strings. Fixes #24. [Martin Raspaud] +Other +~~~~~ + +- update changelog. [Martin Raspaud] + +- Bump version: 1.1.3 → 1.1.4. [Martin Raspaud] + - Add python-configobj as a rpm requirement in setup.cfg. [Martin Raspaud] @@ -425,9 +502,6 @@ Changelog Numpy won't take non-integer indices soon, so make index an int. -1.1.3 (2015-02-03) ------------------- - - Merge branch 'release-1.1.3' [Martin Raspaud] - Merge branch 'licence-lgpl' into pre-master. [Martin Raspaud] @@ -438,9 +512,6 @@ Changelog - Merge branch 'hotfix-v1.1.2' into pre-master. [Martin Raspaud] -1.1.2 (2014-12-17) ------------------- - - Merge branch 'hotfix-v1.1.2' [Martin Raspaud] - Bump up version number. [Martin Raspaud] @@ -471,16 +542,16 @@ Changelog * Added travis build status badge -- Remove pip `-e` switch. [Mikhail Itkin] +- remove pip `-e` switch. [Mikhail Itkin] - Merge branch 'master' of github.com:mitkin/pyresample. [Mikhail Itkin] -- Don't use setup.py for basemap installation. [Mikhail Itkin] +- don't use setup.py for basemap installation. [Mikhail Itkin] Instead of putting basemap and matplotlib into `extras_require` install them directly -- Don't use setup.py for basemap installation. [Mikhail Itkin] +- don't use setup.py for basemap installation. [Mikhail Itkin] Instead of putting basemap and matplotlib into `extras_require` install them directly @@ -511,6 +582,8 @@ Changelog - Merge branch 'release-v1.1.1' [Martin Raspaud] +- Merge branch 'release-v1.1.1' [Martin Raspaud] + - Restore API functionality by importing necessary modules in __init__ [Martin Raspaud] @@ -547,29 +620,9 @@ Changelog - Merge branch 'release-v1.1.1' into pre-master. [Martin Raspaud] -- Merge branch 'pre-master' of https://code.google.com/p/pyresample into - pre-master. [Martin Raspaud] - -- A stray line of code is removed and I take back the recent enhancement - concerning swath to swath mapping. [Adam Dybbroe] - -- Removed debug printouts. [Adam Dybbroe] - -- More active support of swath to swath reprojection. [Adam Dybbroe] - -- Add a plot on multiprocessing performance increases. [Martin Raspaud] - -- Added outer_boundary_corners property to the area def class. [Adam - Dybbroe] - -1.1.1 (2014-12-10) ------------------- - -- Merge branch 'release-v1.1.1' [Martin Raspaud] - - Add news about new release. [Martin Raspaud] -- Remove some relative imports. [Martin Raspaud] +- remove some relative imports. [Martin Raspaud] - Cleanup and bump up version number to v1.1.1. [Martin Raspaud] @@ -594,53 +647,68 @@ Changelog - Update README. [Martin Raspaud] -- Corrected docs. [Esben S. Nielsen] +- Merge branch 'pre-master' of https://code.google.com/p/pyresample into + pre-master. [Martin Raspaud] + +- A stray line of code is removed and I take back the recent enhancement + concerning swath to swath mapping. [Adam Dybbroe] + +- Removed debug printouts. [Adam Dybbroe] + +- More active support of swath to swath reprojection. [Adam Dybbroe] + +- Add a plot on multiprocessing performance increases. [Martin Raspaud] + +- Added outer_boundary_corners property to the area def class. [Adam + Dybbroe] + +- corrected docs. [Esben S. Nielsen] -- Modified uncert count to show above 0. Updated docs to relect uncert +- modified uncert count to show above 0. Updated docs to relect uncert option. [Esben S. Nielsen] -- Cleaned up code a bit in kd_tree.py. [Esben S. Nielsen] +- cleaned up code a bit in kd_tree.py. [Esben S. Nielsen] -- Made API doc work with readthedocs and bumped version number. [Esben +- made API doc work with readthedocs and bumped version number. [Esben S. Nielsen] -- Cleaned up code and tests. [Esben S. Nielsen] +- cleaned up code and tests. [Esben S. Nielsen] -- Added masking of uncert counts. [Esben S. Nielsen] +- added masking of uncert counts. [Esben S. Nielsen] -- Test passes again for uncertainty calculations. [Esben S. Nielsen] +- test passes again for uncertainty calculations. [Esben S. Nielsen] -- Changed uncertainty API. First working uncertainty version. [Esben S. +- changed uncertainty API. First working uncertainty version. [Esben S. Nielsen] -- Not quite there. [Esben S. Nielsen] +- not quite there. [Esben S. Nielsen] -- Basic uncertainty implemented. [Esben S. Nielsen] +- basic uncertainty implemented. [Esben S. Nielsen] -- Updated docs. [Esben S. Nielsen] +- updated docs. [Esben S. Nielsen] - Fixing bug, and adding unittest-main run. [Adam Dybbroe] - Making get_xy_from_lonlat work on arrays of points as well as single points. [Adam Dybbroe] -- Renamed functions in geometry.py and added proj_x_coords and +- renamed functions in geometry.py and added proj_x_coords and proj_y_coords properties. [Esben S. Nielsen] -- Corrected __eq__ in geometry. [Esben S. Nielsen] +- corrected __eq__ in geometry. [Esben S. Nielsen] - Merge branch 'pre-master' of https://code.google.com/p/pyresample into pre-master. [Adam Dybbroe] -- Now kd_tree resampling selects dtype. [Esben S. Nielsen] +- now kd_tree resampling selects dtype. [Esben S. Nielsen] -- Removed random print statement. [Esben S. Nielsen] +- removed random print statement. [Esben S. Nielsen] -- Made get_capabilites function. [Esben S. Nielsen] +- made get_capabilites function. [Esben S. Nielsen] -- Test passes again. [Esben S. Nielsen] +- test passes again. [Esben S. Nielsen] -- Removed caching from geometry. [Esben S. Nielsen] +- removed caching from geometry. [Esben S. Nielsen] - Merge branch 'pre-master' of https://code.google.com/p/pyresample into pre-master. [Martin Raspaud] @@ -649,14 +717,14 @@ Changelog - Unittests should work for both py2.6 and 2.7. [Adam Dybbroe] -- Updated docs. [Esben S. Nielsen] +- updated docs. [Esben S. Nielsen] -- Fixed unit tests. [Esben S. Nielsen] +- fixed unit tests. [Esben S. Nielsen] - Using assertRaises in py2.6 and py2.7 compatible version. [Adam Dybbroe] -- Bugfix to unittest suite. [Adam Dybbroe] +- bugfix to unittest suite. [Adam Dybbroe] - Trying to make test-functions compatible with both python 2.6 and 2.7. [Adam Dybbroe] @@ -666,23 +734,23 @@ Changelog - Adding function get_xy_from_lonlat. [Adam Dybbroe] -- Integrated pykdtree and handled latlong projection bug. [Esben S. +- integrated pykdtree and handled latlong projection bug. [Esben S. Nielsen] -- Updated unit tests according to deprecation warnings. [Esben S. +- updated unit tests according to deprecation warnings. [Esben S. Nielsen] - Better parsing of a area definition (allow ':' in value fields) [Lars Orum Rasmussen] -- Updated docs. [Esben S. Nielsen] +- updated docs. [Esben S. Nielsen] - Merge branch 'pre-master' of https://code.google.com/p/pyresample into pre-master. [Martin Raspaud] -- Doc version. [esn] +- doc version. [esn] -- Improved Basemap integration with globe projections. Updated docs on +- improved Basemap integration with globe projections. Updated docs on epsilon. [esn] - Accomodate for allclose behaviour change in numpy 1.6.2. [Martin @@ -692,9 +760,9 @@ Changelog broadcasted to the same shape. Hence a ValueError catch to return False. -- Updadet doc for plotting. [Esben S. Nielsen] +- updadet doc for plotting. [Esben S. Nielsen] -- Updated plot test to use AGG. [Esben S. Nielsen] +- updated plot test to use AGG. [Esben S. Nielsen] - Now handles plotting in Plate Carre projection. Added utils.fwhm2sigma function. [Esben S. Nielsen] @@ -702,24 +770,24 @@ Changelog - Merge branch 'master' of https://code.google.com/p/pyresample. [Esben S. Nielsen] -- Added pypi info. [Esben S. Nielsen] +- added pypi info. [Esben S. Nielsen] -- Built docs. [Esben S. Nielsen] +- built docs. [Esben S. Nielsen] -- Corrected test_swath.py to account for implementation specific +- corrected test_swath.py to account for implementation specific precision. [Esben S. Nielsen] -- More datatype specifications. [Esben S. Nielsen] +- more datatype specifications. [Esben S. Nielsen] -- Removed warning check for python 2.5. [Esben S. Nielsen] +- removed warning check for python 2.5. [Esben S. Nielsen] -- Corrected multi channnel bug. Added warnings for potential problematic +- corrected multi channnel bug. Added warnings for potential problematic neighbour query condition. [Esben S. Nielsen] - Now str() generates a unique string for area and coordinate definition object. [Lars Orum Rasmussen] -- Corrected manifest so doc images are included. [Esben S. Nielsen] +- corrected manifest so doc images are included. [Esben S. Nielsen] - Moved tests dir to test. Updated MANIFEST.in. [Esben S. Nielsen] @@ -728,7 +796,7 @@ Changelog - Applied setup.py patches. Made plotting more robust. [Esben S. Nielsen] -- Applied patch for getting version number. [Esben S. Nielsen] +- applied patch for getting version number. [Esben S. Nielsen] - Bugfixing quicklooks. [StorPipfugl] @@ -763,7 +831,7 @@ Changelog - Updated install_requires. [StorPipfugl] -- Version 0.7.3. [StorPipfugl] +- version 0.7.3. [StorPipfugl] - Bugfixes: Correct number of channels in empty result set. Resampling of masked data to 1d swath now works. [StorPipfugl] @@ -783,6 +851,8 @@ Changelog - Removed dist dir. [StorPipfugl] +- No commit message. [StorPipfugl] + - Updated documentation. New release. [StorPipfugl] - Started updating docstrings. [StorPipfugl] @@ -806,8 +876,10 @@ Changelog - Mime types set. [StorPipfugl] +- No commit message. [StorPipfugl] + - Moved to Google Code under GPLv3 license. [StorPipfugl] -- Moved to Google Code. [StorPipfugl] +- moved to Google Code. [StorPipfugl] diff --git a/pyresample/plot.py b/pyresample/plot.py index 4631be8..ea0cc52 100644 --- a/pyresample/plot.py +++ b/pyresample/plot.py @@ -155,7 +155,7 @@ def area_def2basemap(area_def, **kwargs): def _get_quicklook(area_def, data, vmin=None, vmax=None, label='Variable (units)', num_meridians=45, - num_parallels=10, coast_res='c'): + num_parallels=10, coast_res='c', cmap='jet'): """Get default Basemap matplotlib plot """ @@ -170,15 +170,14 @@ def _get_quicklook(area_def, data, vmin=None, vmax=None, if num_parallels > 0: bmap.drawparallels(np.arange(-90, 90, num_parallels)) if not (np.ma.isMaskedArray(data) and data.mask.all()): - col = bmap.imshow(data, origin='upper', vmin=vmin, vmax=vmax) + col = bmap.imshow(data, origin='upper', vmin=vmin, vmax=vmax, cmap=cmap) plt.colorbar(col, shrink=0.5, pad=0.05).set_label(label) - return plt def show_quicklook(area_def, data, vmin=None, vmax=None, label='Variable (units)', num_meridians=45, - num_parallels=10, coast_res='c'): + num_parallels=10, coast_res='c', cmap='jet'): """Display default quicklook plot Parameters @@ -207,14 +206,16 @@ def show_quicklook(area_def, data, vmin=None, vmax=None, plt = _get_quicklook(area_def, data, vmin=vmin, vmax=vmax, label=label, num_meridians=num_meridians, - num_parallels=num_parallels, coast_res=coast_res) + num_parallels=num_parallels, coast_res=coast_res, + cmap=cmap) plt.show() plt.close() def save_quicklook(filename, area_def, data, vmin=None, vmax=None, label='Variable (units)', num_meridians=45, - num_parallels=10, coast_res='c', backend='AGG'): + num_parallels=10, coast_res='c', backend='AGG', + cmap='jet'): """Display default quicklook plot Parameters diff --git a/pyresample/spherical_geometry.py b/pyresample/spherical_geometry.py index e332fb2..36aa245 100644 --- a/pyresample/spherical_geometry.py +++ b/pyresample/spherical_geometry.py @@ -191,8 +191,16 @@ class Arc(object): def __str__(self): return str((str(self.start), str(self.end))) - def angle(self, other_arc): + def angle(self, other_arc, snap=True): """Oriented angle between two arcs. + + Parameters + ---------- + other_arc : Arc + snap : boolean + Snap small angles to 0. Allows for detecting colinearity. Disable + snapping when calculating polygon areas as it might lead to + negative area values. """ if self.start == other_arc.start: a__ = self.start @@ -217,12 +225,20 @@ class Arc(object): ub_ = a__.cross(c__) val = ua_.dot(ub_) / (ua_.norm() * ub_.norm()) - if abs(val - 1) < EPSILON: - angle = 0 - elif abs(val + 1) < EPSILON: - angle = math.pi + if snap: + if abs(val - 1) < EPSILON: + angle = 0 + elif abs(val + 1) < EPSILON: + angle = math.pi + else: + angle = math.acos(val) else: - angle = math.acos(val) + if 0 <= val - 1 < EPSILON: + angle = 0 + elif -EPSILON < val + 1 <= 0: + angle = math.pi + else: + angle = math.acos(val) n__ = ua_.normalize() if n__.dot(c__) > 0: @@ -303,11 +319,11 @@ def get_polygon_area(corners): b1_ = Arc(c1_, corners[idx]) b2_ = Arc(c1_, corners[idx + 1]) b3_ = Arc(corners[idx], corners[idx + 1]) - e__ = (abs(b1_.angle(b2_)) + - abs(b2_.angle(b3_)) + - abs(b3_.angle(b1_))) - area += R ** 2 * e__ - math.pi - return area + e__ = (abs(b1_.angle(b2_, snap=False)) + + abs(b2_.angle(b3_, snap=False)) + + abs(b3_.angle(b1_, snap=False))) + area += e__ - math.pi + return R ** 2 * area def get_intersections(b__, boundaries): diff --git a/pyresample/test/test_spherical_geometry.py b/pyresample/test/test_spherical_geometry.py index 169df45..69eb46b 100644 --- a/pyresample/test/test_spherical_geometry.py +++ b/pyresample/test/test_spherical_geometry.py @@ -151,8 +151,8 @@ class TestOverlap(unittest.TestCase): [57.304862819933433, 57.304862819933433]]) area2 = geometry.SwathDefinition(lons2, lats2) - self.assertAlmostEqual(area1.overlap_rate(area2), 0.5, 2) - self.assertAlmostEqual(area2.overlap_rate(area1), 0.068, 3) + self.assertAlmostEqual(area1.overlap_rate(area2), 0.509, 2) + self.assertAlmostEqual(area2.overlap_rate(area1), 0.0685, 3) class TestSphereGeometry(unittest.TestCase): diff --git a/pyresample/version.py b/pyresample/version.py index 9fa86ae..e4c3540 100644 --- a/pyresample/version.py +++ b/pyresample/version.py @@ -15,4 +15,4 @@ # You should have received a copy of the GNU Lesser General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. -__version__ = '1.2.6' +__version__ = '1.2.7' -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pyresample.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel