Welcome to the documentation of the pyrise package!¶
Contents:
pyrise¶
- Free software: ISC license
- Documentation: https://hirise-tools.readthedocs.io.
Features¶
- the products module offers full standard path creations for all HiRISE products.
- the downloads module offers helpers to download HiRISE full and browse products
- for Mac only, a command-line tool called ‘abrowse’ is installed that downloads and opens annotated browse products in the Preview.app
Credits¶
This package was created with Cookiecutter and the forked michaelaye/cookiecutter-pypackage-conda project template.
Installation¶
Stable release¶
To install hirise-tools, run this command in your terminal:
$ pip install pyrise
This is the preferred method to install hirise-tools, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
From sources¶
The sources for hirise-tools can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone git://github.com/michaelaye/pyrise
Or download the tarball:
$ curl -OL https://github.com/michaelaye/pyrise/tarball/master
Once you have a copy of the source, you can install it with:
$ python setup.py install
Contributing¶
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report Bugs¶
Report bugs at https://github.com/michaelaye/pyrise/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Fix Bugs¶
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.
Implement Features¶
Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.
Write Documentation¶
pyrise could always use more documentation, whether as part of the official pyrise docs, in docstrings, or even on the web in blog posts, articles, and such.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/michaelaye/pyrise/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Get Started!¶
Ready to contribute? Here’s how to set up pyrise for local development.
Fork the pyrise repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/pyrise.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv pyrise $ cd pyrise/ $ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 pyrise tests $ python setup.py test or py.test $ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
- The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check https://travis-ci.org/michaelaye/pyrise/pull_requests and make sure that the tests pass for all supported Python versions.
Credits¶
Development Lead¶
- K.-Michael Aye <kmichael.aye@gmail.com>
Contributors¶
None yet. Why not be the first?
pyrise¶
hirise_tools package¶
Submodules¶
hirise_tools.cli module¶
hirise_tools.data module¶
hirise_tools.downloads module¶
hirise_tools.indexfiles module¶
hirise_tools.labels module¶
hirise_tools.products module¶
-
class
pyrise.products.
HiRISE_URL
(product_path, params=None, query=None, fragment=None)[source]¶ Bases:
object
Manage HiRISE URLs.
Provide a storage path as calculated from above objects and put together the full URL to the HiRISE product.
Parameters: product_path (str or pathlib.Path) – Storage path to the product -
initurl
= 'https://hirise-pds.lpl.arizona.edu/PDS/RDR/ESP/ORB_011400_011499/ESP_011491_0985/ESP_011491_0985_RED.LBL'¶
-
netloc
= 'hirise-pds.lpl.arizona.edu'¶
-
path
¶
-
pdspath
= PosixPath('/PDS')¶
-
scheme
= 'https'¶
-
url
¶
-
-
class
pyrise.products.
OBSERVATION_ID
(obsid=None)[source]¶ Bases:
object
Manage HiRISE observation ids.
For example PSP_003092_0985.
phase is set to PSP for orbits < 11000, no setting required.
Parameters: obsid (str, optional) – One can optionally also create an ‘empty’ OBSERVATION_ID object and set the properties accordingly to create a new obsid. -
get_upper_orbit_folder
()[source]¶ get the upper folder name where the given orbit folder is residing on the hisync server
-
orbit
¶
-
phase
¶
-
s
¶
-
storage_path_stem
¶
-
targetcode
¶
-
-
class
pyrise.products.
PRODUCT_ID
(initstr=None)[source]¶ Bases:
object
Manage storage paths for HiRISE RDR products (also EXTRAS.)
Attributes jp2_path and label_path get you the official RDR product, with kind steering if you get the COLOR or the RED product. All other properties go to the RDR/EXTRAS folder.
Parameters: initstr (str, optional) – Note
The “PDS” part of the path is handled in the HiRISE_URL class.
-
abrowse_path
¶
-
browse_path
¶
-
edr_storage_stem
¶
-
jp2_fname
¶
-
jp2_path
¶
-
kind
¶
-
kinds
= ['RED', 'BG', 'IR', 'COLOR', 'IRB', 'MIRB', 'MRGB', 'RGB']¶
-
label_fname
¶
-
label_path
¶
-
nomap_browse_path
¶
-
nomap_jp2_path
¶
-
nomap_thumbnail_path
¶
-
obsid
¶
-
quicklook_path
¶
-
s
¶
-
storage_stem
¶
-
thumbnail_path
¶
-
-
class
pyrise.products.
SOURCE_PRODUCT_ID
(spid=None, saveroot=None)[source]¶ Bases:
object
Manage SOURCE_PRODUCT_ID.
Example
‘PSP_003092_0985_RED4_0’
-
bg_ccds
= ['BG12', 'BG13']¶
-
ccd
¶
-
ccdno
¶
-
ccds
= ['RED0', 'RED1', 'RED2', 'RED3', 'RED4', 'RED5', 'RED6', 'RED7', 'RED8', 'RED9', 'IR10', 'IR11', 'BG12', 'BG13']¶
-
channel
¶
-
color
¶
-
fname
¶
-
fpath
¶
-
furl
¶
-
ir_ccds
= ['IR10', 'IR11']¶
-
local_cube
¶
-
local_path
¶
-
red_ccds
= ['RED0', 'RED1', 'RED2', 'RED3', 'RED4', 'RED5', 'RED6', 'RED7', 'RED8', 'RED9']¶
-
s
¶
-
stitched_cube_name
¶
-