Skip to content

Commit

Permalink
Merge branch 'upcoming/version_3.0' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	create_software_bundle.sh
#	polar2grid/add_coastlines.py
#	setup.py
  • Loading branch information
djhoese committed Feb 26, 2019
2 parents f0f7dfc + a74e624 commit 0a5be4c
Show file tree
Hide file tree
Showing 203 changed files with 24,879 additions and 14,165 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
53 changes: 38 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
language: python
python:
- '2.7'
virtualenv:
system_site_packages: true
before_install:
- sudo add-apt-repository ppa:ubuntugis/ppa -y
- sudo apt-get update -qq
- sudo apt-get install -y -qq libgdal1h libproj0
- sudo apt-get install -qq python-scipy python-numpy python-pyproj
language: generic
env:
global:
# Set defaults to avoid repeating in most cases
- PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
- NUMPY_VERSION=stable
- MAIN_CMD='python setup.py'
- CONDA_DEPENDENCIES='xarray dask toolz Cython sphinx cartopy pillow matplotlib scipy pyyaml pyproj pyresample coveralls coverage codecov behave netcdf4 h5py h5netcdf gdal rasterio imageio pyhdf mock libtiff sphinx-argparse graphviz python-graphviz pycoast'
- PIP_DEPENDENCIES='trollsift trollimage pyspectral pyorbital libtiff'
- SETUP_XVFB=False
- EVENT_TYPE='push pull_request'
- SETUP_CMD='test'
- CONDA_CHANNELS='conda-forge'
- CONDA_CHANNEL_PRIORITY='True'
matrix:
include:
- env: PYTHON_VERSION=3.6
os: linux
- env: PYTHON_VERSION=3.6
os: osx
install:
- pip install -r requirements.txt
- pip install -e ".[remap]"
- git clone --depth 1 git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- pip install git+https://github.com/pytroll/satpy.git
- pip install -e .
script:
python -m polar2grid.tests
cd doc
make html
- python -m polar2grid.tests && cd doc && make html
# make clean
# make latexpdf
#after_success:
#- if [[ $PYTHON_VERSION == 3.6 ]]; then coveralls; codecov; fi
#deploy:
# - provider: pypi
# user: dhoese
# password:
# secure: frK+0k1STeTM7SizRseP0qdTfOVz9ZMIra+3qEytPdxCLceXAH8LxPU16zj5rdNQxasF1hZ6rAd952fly+ypw2TEf5r2WnStrt7G5QlyE7VB6XGSDpIUxKF1FYccLvYs0/R6Y35MTEPqdM51PM5yEBjoY5b4tA3RF3fDq11cqc/SiWr6DgSLB1WJZULOdtCzBbfGbm5LyJ7yeNbISASSAwVvZTGWw7kJDgi0W5zxwEX82N5tBGbfKIu59qmxyj8FxmcrUwKZ4P3rQNg1kN1utzAB+PSf3GAVvbZfWJQuAKwMqpZgaV9lX0V7eUd/AxPobzEk9WyoNBMIdrSPej5BKWTDiYvaeRTOsggoUCSQJJA/SITEvkJgLWXoKKX2OWrM8RBUO4MoZJpPGXN42PRtMJkV2sx6ZigkpJlHdn39SsIRZX31zsfv8bBhclb70bt1Ts0fDd0rVdZAI6gMI+sgUePwEUn+XbWrvI0sMfDX3QsXDMV393RHgaIPxd+lRqUlYsNOxjsWpsbsvX55ePLxYHsNrv11KKyL/iGjGotVeVUO5D78qvfd4JrsUnMalQyZfW8NTEKa5Ebcs7gYJTwYEOTCQU12BkHOv1zFkjZG5RdGwkEvG3pykLhx+qDyYEd7pKB3TvhzLPqZPSrPxirwcoc0UzCc6ocYdzpqVuViFuk=
# distributions: sdist bdist_wheel
# skip_existing: true
# on:
# tags: true
# repo: pytroll/satpy

File renamed without changes.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ALL_PKG_INSTALL = $(ALL_PKG_DIRS:=_install)
ALL_PKG_SDIST = $(ALL_PKG_DIRS:=_sdist)
ALL_PKG_DEV = $(ALL_PKG_DIRS:=_dev)
DOC_DIR ?= /var/apache/www/htdocs/software/polar2grid
GEO_DOC_DIR ?= /var/apache/www/htdocs/software/geo2grid

EGG_REPOS_MACHINE = birch
EGG_REPOS_DIR = /var/apache/larch/htdocs/eggs/repos/polar2grid/
Expand Down Expand Up @@ -87,6 +88,18 @@ update_doc: build_doc_html
scp $(FN) birch.ssec.wisc.edu:/tmp/; \
ssh birch.ssec.wisc.edu "cd '$(DOC_DIR)'; rm -rf *; tar -xmzf /tmp/$(FN)"

build_doc_html_geo:
cd doc; \
make clean; \
make html POLAR2GRID_DOC=geo

update_doc_geo: build_doc_html_geo
cd doc/build/html; \
echo $(FN); \
tar -czf $(FN) *; \
scp $(FN) birch.ssec.wisc.edu:/tmp/; \
ssh birch.ssec.wisc.edu "cd '$(GEO_DOC_DIR)'; rm -rf *; tar -xmzf /tmp/$(FN)"

### Clean up what we've done ###
clean_sdist:
rm -rf $(DIST_DIR)
Expand Down
16 changes: 16 additions & 0 deletions NEWS_GEO2GRID.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Release Notes
=============

Version 1.0.0 (unreleased)
--------------------------

* New Geo2Grid Package!
* ABI L1B (abi_l1b) reader added
* AHI HSD (ahi_hsd) reader added
* AHI HRIT/HimawariCast (ahi_hrit) reader added
* Geotiff (geotiff) writer added
* Multi-threaded (multiple worker) processing
* Sharpened rayleigh-corrected full-resolution true and natural color RGBs
* Command line Lat/Lon defined subsets
* User defined grid capability
* MIN/MAX native resampling possible
63 changes: 36 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
Polar2Grid
==========
Polar2Grid and Geo2Grid
=======================

.. image:: https://travis-ci.org/ssec/polar2grid.svg
:target: https://travis-ci.org/ssec/polar2grid

Polar2Grid and Geo2Grid are a set of tools for extracting data from earth-observing satellite instruments,
remapping it to uniform grids, and writing that gridded data to a new file format.
As the names suggest, Polar2Grid is meant to operate on polar-orbiting satellite data and
Geo2Grid on geostationary satellite data. Due to the projects sharing a lot of internal functionality
their code bases are stored in the same code repository.
Both projects are created by scientists and software developers at the Space Science and Engineering Center (SSEC) at
the University of Wisconsin - Madison. Polar2Grid is distributed as part of the
`Community Satellite Processing Package (CSPP) <http://cimss.ssec.wisc.edu/cspp/>`_ for
processing of data received via direct broadcast antennas. Geo2Grid is distributed as part of the
`CSPP Geo <http://cimss.ssec.wisc.edu/csppgeo/>`_ project for processing of data received via direct broadcast
antennas. Although both projects were created to serve the direct
broadcast community, they can be used on most archived data files.
See the documentation for specific functionality.

.. image:: https://travis-ci.org/davidh-ssec/polar2grid.svg
:target: https://travis-ci.org/davidh-ssec/polar2grid
`Polar2Grid Documentation <http://www.ssec.wisc.edu/software/polar2grid/>`_

Polar2Grid is a set of tools for extracting swath data from earth-observing satellite instruments,
remapping it to uniform grids, and finally writing that gridded data to a new file format.
Polar2Grid is created by scientists and software developers at the Space Science and Engineering Center (SSEC) at
the University of Wisconsin - Madison. It is distributed as part of the
`Community Satellite Processing Package (CSPP) <http://cimss.ssec.wisc.edu/cspp/>`_ for
processing of data received via direct broadcast antennas. Although this is why Polar2Grid was created, it can be used
on most archived (non-DB) data files. See the documentation for specific functionality.
`Geo2Grid Documentation <http://www.ssec.wisc.edu/software/geo2grid/>`_

`GitHub Repository <https://github.com/ssec/polar2grid>`_

`Documentation <http://www.ssec.wisc.edu/software/polar2grid/>`_
`Polar2Grid Contact <http://cimss.ssec.wisc.edu/contact-form/index.php?name=CSPP%20Questions>`__

`GitHub Repository <https://github.com/davidh-ssec/polar2grid>`_
`CSPP LEO Forum <https://forums.ssec.wisc.edu/viewforum.php?f=66>`_

`Contact Us <http://cimss.ssec.wisc.edu/contact-form/index.php?name=CSPP%20Questions>`_
`CSPP Geo Forum <https://forums.ssec.wisc.edu/viewforum.php?f=67>`_

Installation
------------

It is recommended that users use the official Polar2Grid release compatible
It is recommended that users use the official Polar2Grid/Geo2Grid release compatible
with RHEL6+ systems whenever possible. This tarball is available through the
CSPP team's website (see above). To install the Polar2Grid python package
that provides most of the functionality of Polar2Grid can be installed with::

pip install -i http://larch.ssec.wisc.edu/simple polar2grid

Or from source::
CSPP team's website (see above). To install the Polar2Grid python package (used for Polar2Grid and Geo2Grid)
from source, run::

python setup.py install
pip install .

Contributing
------------

Feel free to submit issues and pull requests on Github or contact us (see above) about more involved feature requests.
We do ask that before you add features yourself or fix complex issues that you contact us in some way. Polar2Grid is
in active development and features and fixes are added all the time. Developers should see the
We do ask that before you add features yourself or fix complex issues that you contact us in some way. Both projects
are in active development and features and fixes are added all the time. Developers should see the
`Developer's Guide <http://www.ssec.wisc.edu/software/polar2grid/dev_guide/>`_ for more information on the internals
of Polar2Grid.
of both projects.

Directories
-----------
Expand All @@ -53,7 +61,8 @@ the source for some of these executables in the root of the repository.
- swbundle: Helper scripts and other files provided in the Polar2Grid Software Bundle released by the CSPP team.
- modis_crefl: Copy of the MODIS Corrected Reflectance software (CREFL) that includes updates for building with Makefile
- viirs_crefl: Copy of the VIIRS Corrected Reflectance software (CREFL) that includes updates for building with Makefile
- ms2gt: Custom version of the `ms2gt <http://nsidc.org/data/modis/ms2gt/>`_ software package with bug fixes and optimizations. This is not used as of P2Gv2.0 and will be removed in future revisions.
- ms2gt: Custom version of the `ms2gt <http://nsidc.org/data/modis/ms2gt/>`_ software package with bug fixes and
optimizations. This is not used as of P2Gv2.0 and will be removed in future revisions.
- etc: Configuration files used to customize the SatPy package for Polar2Grid users.

Branching Model
Expand All @@ -72,7 +81,7 @@ Copyright and License

::

Copyright (C) 2012-2017 Space Science and Engineering Center (SSEC), University of Wisconsin-Madison.
Copyright (C) 2012-2019 Space Science and Engineering Center (SSEC), University of Wisconsin-Madison.

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
Expand Down
130 changes: 130 additions & 0 deletions create_conda_software_bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#!/usr/bin/env bash
# Create a software bundle from a conda environment
# Usage: ./create_conda_software_bundle.sh <bundle directory>
# Creates a software bundle directory and a tarball of that directory

#SHELLB3_DEFAULT="ftp://ftp.ssec.wisc.edu/pub/shellb3/ShellB3-Linux-x86_64-20140212-r840-core-cspp.tar.gz"
BASE_P2G_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PY_DIR="$BASE_P2G_DIR"
BUNDLE_SCRIPTS_DIR="$BASE_P2G_DIR"/swbundle
VCREFL_DIR="$BASE_P2G_DIR"/viirs_crefl
MCREFL_DIR="$BASE_P2G_DIR"/modis_crefl
CACHE_DIR="/tmp"

oops() {
echo "OOPS: $*"
echo "FAILURE"
exit 1
}

cached_download() {
fn=`basename $1`
cache_path="${CACHE_DIR}/$fn"
pushd $CACHE_DIR
if [ ! -f $cache_path ]; then
wget $1 || oops "Could not download $1"
fi
popd
cp $cache_path . || oops "Could not copy cached download ${cache_path}"
}

# This assumes that the current conda environment is already active
which conda || oops "Conda environment must be available"
if [ $# -eq 1 ]; then
SB_NAME=$1
else
echo "ERROR: Invalid Arguments"
echo "Usage: ./create_conda_software_bundle.sh <bundle name>"
exit 1
fi

if [[ $SB_NAME == *"polar"* ]]; then
PROJECT="P2G"
else
PROJECT="G2G"
fi

pip install -U --no-deps . || oops "Couldn't install current polar2grid package"

SB_TARBALL="${SB_NAME}.tar.gz"
conda-pack -o $SB_TARBALL || oops "Couldn't create conda-packed tarball"
mkdir -p ${SB_NAME} || oops "Couldn't make output directory"
tar -xzf ${SB_TARBALL} -C ${SB_NAME} || oops "Couldn't untar conda-packed tarball"
cd ${SB_NAME} || oops "Couldn't change to software bundle directory"

echo "Copying user grid directory to software bundle"
cp -r ${BUNDLE_SCRIPTS_DIR}/grid_configs .
cp -r ${BUNDLE_SCRIPTS_DIR}/colormaps .
cp -r ${BUNDLE_SCRIPTS_DIR}/rescale_configs .

mkdir -p gshhg_data || oops "Could not make GSHHG data directory"
pushd gshhg_data
echo "Downloading GSHHG shapefiles"
cached_download https://www.soest.hawaii.edu/pwessel/gshhg/gshhg-shp-2.3.6.zip
unzip gshhg-shp-2.3.6.zip || oops "Could not unpack GSHHG shapefiles"
rm gshhg-shp-2.3.6.zip || oops "Could not delete the GSHHG zip file"
popd

# Create the VIIRS CREFL utilities
echo "Getting prebuilt VIIRS CREFL binaries..."
cd "$VCREFL_DIR"
make clean
make prebuilt || oops "Couldn't get prebuilt VIIRS CREFL binaries"
chmod a+x cviirs
chmod a+x h5SDS_transfer_rename
mv cviirs "$SB_NAME"/bin/
mv h5SDS_transfer_rename "$SB_NAME"/bin/
mv CMGDEM.hdf "$SB_NAME"/bin/
cp run_viirs_crefl.sh "$SB_NAME"/bin/
chmod a+x "$SB_NAME"/bin/run_viirs_crefl.sh

# Create the MODIS CREFL utilities
echo "Getting prebuilt MODIS CREFL binaries..."
cd "$MCREFL_DIR"
make clean
make prebuilt || oops "Couldn't get prebuilt MODIS CREFL binaries"
chmod a+x crefl
mv crefl "$SB_NAME"/bin/
mv tbase.hdf "$SB_NAME"/bin/
cp run_modis_crefl.sh "$SB_NAME"/bin/
chmod a+x "$SB_NAME"/bin/run_modis_crefl.sh

echo "Copying bash scripts to software bundle bin"
cd "$SB_NAME"
cp -P ${BUNDLE_SCRIPTS_DIR}/*.sh ${BUNDLE_SCRIPTS_DIR}/*.txt bin/ || echo "Couldn't copy scripts to bin/ directory"
# clean up readmes
if [[ $PROJECT == "P2G" ]]; then
rm -f bin/GEO2GRID_README.txt
mv bin/POLAR2GRID_README.txt README.txt
else
rm -f bin/POLAR2GRID_README.txt
mv bin/GEO2GRID_README.txt README.txt
fi


# Copy the release notes to the tarball
cp $BASE_P2G_DIR/NEWS.rst $SB_NAME/RELEASE_NOTES.txt || oops "Couldn't copy release notes to destination directory"

# Create a wmsupload.sh script
cd $SB_NAME/bin
wget https://realearth.ssec.wisc.edu/upload/re_upload || oops "Couldn't download and create re_upload script"
chmod u+x re_upload || oops "Couldn't make wmsupload.sh executable"

# Copy SatPy configurations
mkdir $SB_NAME/etc/satpy || oops "Couldn't create configuration 'etc/satpy' directory"
cp -r $BASE_P2G_DIR/etc/* $SB_NAME/etc/satpy/ || oops "Couldn't copy configuration 'etc' directory"

# Download pyspectral data
echo "Downloading pyspectral data..."
$SB_NAME/bin/download_pyspectral_data.sh || oops "Couldn't download pyspectral data"

# FIXME: Add the download_from_internet: False to the config
echo "download_from_internet: False" >> ${SB_NAME}/etc/pyspectral.yaml

# Tar up the software bundle
echo "Creating software bundle tarball..."
cd "$SB_NAME"/..
rm -f ${SB_TARBALL}
tar -czf "$SB_TARBALL" "$(basename "$SB_NAME")"

echo "SUCCESS"
Loading

0 comments on commit 0a5be4c

Please sign in to comment.