fasterraster
A fast multi-threaded python library for performing raster operations with simple IO
Science Score: 64.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: science.org -
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.9%) to scientific vocabulary
Repository
A fast multi-threaded python library for performing raster operations with simple IO
Basic Info
- Host: GitHub
- Owner: asenogles
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Size: 31.3 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Faster-Raster
fasterraster is a fast multi-threaded python library for performing raster operations using openMP and numpy objects complete with simple IO.
- Github repository: https://github.com/asenogles/fasterraster
- PyPI: https://pypi.org/project/fasterraster
Motivation
fasterraster was developed to quickly perform raster operations, enabling self-supervised learning for raster based analyses. fasterraster provides a cython wrapper for optimized openMP c code. Data objects are handled by numpy allowing for straightforward memory management. Currently only computation of visual/morphological features have been implemented however this is open to expansion in the future. All code is still in development and thus it is recommended to test fully before use.
Installation
fasterraster has currently been tested on Linux and Microsoft windows operating systems. You will need python>=3.6 installed. It is recommended to install fasterraster within a virtual environment.
Install using pip
To install fasterraster from PyPI using pip:
console
pip install fasterraster
Install from source
To build fasterraster from source, download this repository and run:
console
python3 setup.py build_ext --inplace
Note: You will need to have the required build dependencies installed.
Example
```python import timeit import numpy as np import fasterraster as fr from pathlib import Path
NTESTS = 10
Load a .bil file containing a DEM
fname = Path('./test_data/dem.bil') dem = fr.read(fname)
regular python implementation of hillshade function
from https://www.neonscience.org/resources/learning-hub/tutorials/create-hillshade-py
def pyhillshade(dem, cellsize, azimuth=330, altitude=30): azimuth = 360.0 - azimuth
dem = dem / cell_size
x, y = np.gradient(dem)
slope = np.pi/2. - np.arctan(np.sqrt(x*x + y*y))
aspect = np.arctan2(-x, y)
azimuthrad = azimuth*np.pi/180.
altituderad = altitude*np.pi/180.
shaded = np.sin(altituderad)*np.sin(slope)
+ np.cos(altituderad)*np.cos(slope) * np.cos(
(azimuthrad - np.pi/2.) - aspect)
return 255*(shaded + 1)/2
Time hillshade computation using regular python
time = timeit.timeit(lambda: py_hillshade(dem.raster, dem.XDIM), number=NTESTS) print(f'python hillshade averaged {time/NTESTS:.3f} seconds')
Time hillshade computation using fasterraster for num-threads
numthreads = [1,2,4,8]
for numt in numthreads:
time = timeit.timeit(lambda: fr.hillshadefastermp(dem.raster, numt), number=NTESTS)
print(f'hillshade averaged {time/NTESTS:.3f} seconds for {numt} threads')
Example output:
console
python hillshade averaged 2.880 seconds
hillshade averaged 0.081 seconds for 1 threads
hillshade averaged 0.041 seconds for 2 threads
hillshade averaged 0.034 seconds for 4 threads
hillshade averaged 0.024 seconds for 8 threads
```
Owner
- Login: asenogles
- Kind: user
- Repositories: 3
- Profile: https://github.com/asenogles
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Senogles" given-names: "Andrew" orcid: "https://orcid.org/0000-0002-6607-2934" title: "fasterraster: A fast multi-threaded python library for performing raster operations with simple IO" version: 0.0.1 doi: 10.5281/zenodo.6350746 date-released: 2022-03-13 url: "https://github.com/asenogles/fasterraster"
GitHub Events
Total
- Fork event: 1
Last Year
- Fork event: 1
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 13
- Total Committers: 2
- Avg Commits per committer: 6.5
- Development Distribution Score (DDS): 0.154
Top Committers
| Name | Commits | |
|---|---|---|
| asenogles | s****a@o****u | 11 |
| asenogles | 4****s@u****m | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 8 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 5
- Total maintainers: 1
pypi.org: fasterraster
Fast multi-threaded raster operations with simple IO
- Homepage: https://github.com/asenogles/fasterraster
- Documentation: https://fasterraster.readthedocs.io/
- License: BSD
-
Latest release: 0.0.5
published about 3 years ago
Rankings
Maintainers (1)
Dependencies
- cython >=0.29.21
- numpy >=1.19.0
- scipy >=1.7.0
- tifffile *