Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
CI
  • Loading branch information
scivision committed Sep 2, 2018
1 parent 7c19564 commit d34614d
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 26 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Expand Up @@ -12,12 +12,14 @@ os:
- linux


install: pip install -e .[tests,io]
install:
- pip install -e .[test,io]
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then pip install -e .[cov]; fi

script:
- pytest -rsv
- flake8
- mypy . --ignore-missing-imports
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then flake8; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then mypy . --ignore-missing-imports; fi

after_success:
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then
Expand Down
16 changes: 8 additions & 8 deletions README.md
@@ -1,15 +1,15 @@
[![Build Status](https://travis-ci.com/scivision/goes-quickplot.svg?branch=master)](https://travis-ci.com/scivision/goes-quickplot)
[![Coverage Status](https://coveralls.io/repos/github/scivision/goes-quickplot/badge.svg?branch=master)](https://coveralls.io/github/scivision/goes-quickplot?branch=master)
[![Build status](https://ci.appveyor.com/api/projects/status/0e066xr36xt9rfbb?svg=true)](https://ci.appveyor.com/project/scivision/goes-quickplot)
[![PyPi version](https://img.shields.io/pypi/pyversions/goes-quickplot.svg)](https://pypi.python.org/pypi/goes-quickplot)
[![PyPi formats](https://img.shields.io/pypi/format/goes-quickplot.svg)](https://pypi.python.org/pypi/goes-quickplot)
[![PyPi Download stats](http://pepy.tech/badge/goes-quickplot)](http://pepy.tech/project/goes-quickplot)
[![Build Status](https://travis-ci.com/scivision/GOESutils.svg?branch=master)](https://travis-ci.com/scivision/GOESutils)
[![Coverage Status](https://coveralls.io/repos/github/scivision/GOESutils/badge.svg?branch=master)](https://coveralls.io/github/scivision/GOESutils?branch=master)
[![Build status](https://ci.appveyor.com/api/projects/status/ork0ny0prr1h8hen?svg=true)](https://ci.appveyor.com/project/scivision/goesutils)
[![PyPi version](https://img.shields.io/pypi/pyversions/goesutils.svg)](https://pypi.python.org/pypi/goesutils)
[![PyPi formats](https://img.shields.io/pypi/format/goesutils.svg)](https://pypi.python.org/pypi/goesutils)
[![PyPi Download stats](http://pepy.tech/badge/goesutils)](http://pepy.tech/project/goesutils)

# GOES Quickplot
# GOES Utilities

Quick Python script to download and plot GOES satellite preview and hi-resolution data by date/time.

![goes-quickplot7 absorption](tests/goes13-IR-2017-07-13-12.jpg)
![goesutils7 absorption](tests/goes13-IR-2017-07-13-12.jpg)

## Install

Expand Down
6 changes: 3 additions & 3 deletions get-goes-hires.py
Expand Up @@ -6,7 +6,7 @@
Copy from the "cd ..." command through all the "get ..." commands
4. Load and process that text file with this program.
"""
import goes_quickplot.io as gqio
import goesutils
from argparse import ArgumentParser


Expand All @@ -17,9 +17,9 @@ def main():
p.add_argument('-host', help='FTP host', default='ftp.class.ngdc.noaa.gov')
p = p.parse_args()

ftpdir, flist = gqio.parse_email(p.txtfn)
ftpdir, flist = goesutils.parse_email(p.txtfn)

gqio.get_hires(p.host, ftpdir, flist, p.outdir)
goesutils.get_hires(p.host, ftpdir, flist, p.outdir)


if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions get-goes-preview.py
Expand Up @@ -7,7 +7,7 @@
This program is for downloading:
* 3-hour JPG low-resolution previews
"""
import goes_quickplot
import goesutils
from argparse import ArgumentParser


Expand All @@ -20,7 +20,7 @@ def main():
p.add_argument('outdir', help='directory to write data')
p = p.parse_args()

goes_quickplot.get_preview(p.outdir, p.start, p.stop, p.goessat, p.goesmode)
goesutils.get_preview(p.outdir, p.start, p.stop, p.goessat, p.goesmode)


if __name__ == '__main__':
Expand Down
File renamed without changes.
8 changes: 6 additions & 2 deletions goes_quickplot/io.py → goesutils/io.py
Expand Up @@ -99,7 +99,8 @@ def loadhires(fn: Path, downsample: int=None) -> xarray.DataArray:
return img


def get_hires(host: str, ftpdir: str, flist: list, odir: Path, clobber: bool=False):
def get_hires(host: str, ftpdir: str, flist: List[str],
odir: Path, clobber: bool=False):
"""download hi-res GOES data over FTP"""

odir = Path(odir).expanduser()
Expand Down Expand Up @@ -134,7 +135,7 @@ def get_hires(host: str, ftpdir: str, flist: list, odir: Path, clobber: bool=Fal
sleep(0.5) # anti-leech


def parse_email(txtfn: Path):
def parse_email(txtfn: Path) -> Tuple[str, List[str]]:
"""Parse GOES hi-res file list from email"""
txtfn = Path(txtfn).expanduser()

Expand Down Expand Up @@ -188,6 +189,9 @@ def dl_goes(t: datetime, outdir: Path, goes: int, mode: str):


def urlretrieve(url: str, fn: Path, overwrite: bool=False):
"""
the way urlretrieve should be with timeout
"""
if not overwrite and fn.is_file() and fn.stat().st_size > 10000:
print(f'SKIPPED {fn}')
return
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions plot-goes.py
Expand Up @@ -9,8 +9,8 @@
from pathlib import Path
from matplotlib.pyplot import show # draw, pause,
from argparse import ArgumentParser
import goes_quickplot as gq
from goes_quickplot.plots import plotgoes
import goesutils as gq
from goesutils.plots import plotgoes


def main():
Expand Down
10 changes: 6 additions & 4 deletions setup.cfg
@@ -1,9 +1,10 @@
[metadata]
name = goes_quickplot
name = goesutils
version = 1.0.8
author = Michael Hirsch, Ph.D.
url = https://github.com/scivision/goes-quick-plot
description = easily download and plot GOES weather satellite data
author_email = scivision@users.noreply.github.com
url = https://github.com/scivision/goesutils
description = Simple download and plot GOES weather satellite data
keywords =
goes
satellite
Expand Down Expand Up @@ -37,11 +38,12 @@ install_requires =
[options.extras_require]
tests =
pytest
cov =
pytest-cov
coveralls
flake8
mypy
plots =
plots =
cartopy
matplotlib
io =
Expand Down
4 changes: 2 additions & 2 deletions tests/test_all.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
import goes_quickplot as gq
import goesutils as gq
import pytest
from pathlib import Path

Expand All @@ -20,4 +20,4 @@ def test_load_hires():


if __name__ == '__main__':
pytest.main(['-xv', __file__])
pytest.main(['-xrsv', __file__])

0 comments on commit d34614d

Please sign in to comment.