Approaches to modeling terrain and maps in python

Overview

topography 🌎

Python 3.8 Build Status Language grade: Python Total alerts

Contains different approaches to modeling terrain and topographic-style maps in python

image

Features

Inverse Distance Weighting (IDW)

A given point P(x, y) is determined by the values of its neighbors, inversely proportional to the distance of each neighbor.

P is more heavily influenced by nearer points via a weighting function w(x, y).

Steps

The value of P(x, y) is determined only by the closest raw data point.

This approach works best to get a "feel" for larger datasets. With few input points, the resulting map has little detail.

In the case of multiple equidistant points being closest, point values are stored, and averaged.

Bilinear

in progress 👷 🛠️

Bicubic

in progress 👷 🛠️

Install

pip install topography

Requirements

  • numpy
  • matplotlib

see the requirements.txt

Example

from topography.Map import Map
from topography.utils.io import getPointValuesFromCsv

# # make map from noise data
# noiseMaker = Noise((0, 50), (0, 50))
# noiseData = noiseMaker.getRandom(scaleFactor=1)
# M = Map(noiseData)

# make map from recorded data
rawData = getPointValuesFromCsv("tests/data/20x20.csv")
M = Map(rawData)

# # Display the inputted raw data values
M.showRawPointValues()

# interpolate the Map
M.idw(showWhenDone=True)

# Display the interpolated data values
M.showFilledPointValues()

# Save the data to a .csv file
# optionally, write to file as a matrix
# default is x, y, z
M.writeLastToCsv("idw_20x20", writeAsMatrix=True)
Comments
  • NN - Improvements and Possible Design Changes

    NN - Improvements and Possible Design Changes

    NN Improvements and Design Changes

    Consider breaking up the current implementation of NN

    • [x] current NN ➡️ Map.steps()
    • [ ] new NN via voroni tesselation ➡️ Map.voroni() or Map.nn()

    image

    feature 
    opened by XDwightsBeetsX 1
  • Noise Generation

    Noise Generation

    Add Noise Generators

    This will be nice for quickly making cool topography maps

    start with random noise, but ideas for later...

    feature 
    opened by XDwightsBeetsX 1
  • allows for user to input map size

    allows for user to input map size

    Custom Map Dimensions, closes #5

    Can now customize views of the Map by specifying a custom Map(rawData, xRange=(lower, upper), yRange=(lower, upper))

    This does not impact the determination of points by interpolation, but does give a "sliced" view of the Map

    feature 
    opened by XDwightsBeetsX 1
  • Add Surface Plotting

    Add Surface Plotting

    New Surface Plot

    • In addition to the heatmap-style plot, add a surface representation plot of the Map
    • It should be displayed alongside the 2D Heatmap in a horizontal subplot
    • This may require some refactoring of the Map PointValue storage so that it can be used as a series of X, Y, Z lists
    • See this documentation on matplotlib

    Something Like This:

    | image | image | | :-: | :-: |

    feature 
    opened by XDwightsBeetsX 1
  • IDW Improvement - Neighborhooding

    IDW Improvement - Neighborhooding

    Add Neighborhooding to IDW

    • only apply IDW to a minimum number of nearby neighbors
      • the point of interest is more likely to be similar to nearby points
    feature 
    opened by XDwightsBeetsX 0
  • Added NN Interpolation

    Added NN Interpolation

    New NN Interpolation

    This is going to work better with larger data sets to get a "feel" for the Map.

    • Should add some noise generator to see how this looks with larger data sets.
    • Also add some docs, mentioning above
    • can add sophistication by grouping within a nearby region
    feature 
    opened by XDwightsBeetsX 0
  • Allow User to Input Map Size

    Allow User to Input Map Size

    Currently

    The size of the Map is determined by the user input RawData:

    width = self.xMax - self.xMin + 1
    height = self.yMax - self.yMin + 1
    

    Desired

    This should be changed to allow for the Instantiation of a Map's size to be set in the constructor.

    • Something like Map(rawData, xRange=(lower, upper), yRange=(lower, upper)) where lower and upper are inclusive
    • This change will have to be accounted for when finding max values
    • Undecided on if interpolation approaches should still consider these points
    feature 
    opened by XDwightsBeetsX 0
  • Bicubic Interpolation

    Bicubic Interpolation

    Add Bicubic Interpolation Scheme

    • [ ] in interpolaion.py add bicubic(thisPt, rawPts)
    • [ ] in tests/test_interpolate add test_bicubic.py
    • [ ] in tests/visual/1d add test_visual_bicubic.py
    • [ ] in Map.py add Map.bicubic(showWhenDone=True)

    image

    also see wikipedia

    feature tests 
    opened by XDwightsBeetsX 0
  • Bilinear Interpolation

    Bilinear Interpolation

    Add Bilinear Interpolation Scheme

    • [ ] in interpolaion.py add bilinear(thisPt, rawPts)
    • [ ] in tests/test_interpolate add test_bilinear.py
    • [ ] in tests/visual/1d add test_visual_bilinear.py
    • [ ] in Map.py add Map.bilinear(showWhenDone=True)

    image

    also see wikipedia

    feature tests 
    opened by XDwightsBeetsX 3
Releases(1.0.0)
  • 1.0.0(Jun 27, 2021)

    check out the new topography package on pypi 🌎

    This package provides some visualization and interpolation for topography data using the Map data structure

    • read data from file into PointValues using topography.utils.io.getPointValuesFromCsv(filename)
    • make a map with M = Map(rawData) and perform some interpolation like Map.idw(showWhenDone=True)
    • write the results to a data file with M.writeLastToCsv("cool_idw_interpolation", writeAsMatrix=True)

    Current interpolation schemes:

    • inverse distance weighting
    • step function
    Source code(tar.gz)
    Source code(zip)
Owner
John Gutierrez
Texas A&M MEEN '22. CS minor. Texas Water Safari Finisher '19 '21
John Gutierrez
Federated_learning codes used for the the paper "Evaluation of Federated Learning Aggregation Algorithms" and "A Federated Learning Aggregation Algorithm for Pervasive Computing: Evaluation and Comparison"

Federated Distance (FedDist) This is the code accompanying the Percom2021 paper "A Federated Learning Aggregation Algorithm for Pervasive Computing: E

GETALP 8 Jan 03, 2023
EXplainable Artificial Intelligence (XAI)

EXplainable Artificial Intelligence (XAI) This repository includes the codes for different projects on eXplainable Artificial Intelligence (XAI) by th

4 Nov 28, 2022
Benchmark for evaluating open-ended generation

OpenMEVA Contributed by Jian Guan, Zhexin Zhang. Thank Jiaxin Wen for DeBugging. OpenMEVA is a benchmark for evaluating open-ended story generation me

25 Nov 15, 2022
Framework for Spectral Clustering on the Sparse Coefficients of Learned Dictionaries

Dictionary Learning for Clustering on Hyperspectral Images Overview Framework for Spectral Clustering on the Sparse Coefficients of Learned Dictionari

Joshua Bruton 6 Oct 25, 2022
An unofficial styleguide and best practices summary for PyTorch

A PyTorch Tools, best practices & Styleguide This is not an official style guide for PyTorch. This document summarizes best practices from more than a

IgorSusmelj 1.5k Jan 05, 2023
MusicYOLO framework uses the object detection model, YOLOx, to locate notes in the spectrogram.

MusicYOLO MusicYOLO framework uses the object detection model, YOLOX, to locate notes in the spectrogram. Its performance on the ISMIR2014 dataset, MI

Xianke Wang 2 Aug 02, 2022
PyTorch implementation of PNASNet-5 on ImageNet

PNASNet.pytorch PyTorch implementation of PNASNet-5. Specifically, PyTorch code from this repository is adapted to completely match both my implemetat

Chenxi Liu 314 Nov 25, 2022
This is official implementaion of paper "Token Shift Transformer for Video Classification".

This is official implementaion of paper "Token Shift Transformer for Video Classification". We achieve SOTA performance 80.40% on Kinetics-400 val. Paper link

VideoNet 60 Dec 30, 2022
GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond

GCNet for Object Detection By Yue Cao, Jiarui Xu, Stephen Lin, Fangyun Wei, Han Hu. This repo is a official implementation of "GCNet: Non-local Networ

Jerry Jiarui XU 1.1k Dec 29, 2022
The Balloon Learning Environment - flying stratospheric balloons with deep reinforcement learning.

Balloon Learning Environment Docs The Balloon Learning Environment (BLE) is a simulator for stratospheric balloons. It is designed as a benchmark envi

Google 87 Dec 25, 2022
An implementation of chunked, compressed, N-dimensional arrays for Python.

Zarr Latest Release Package Status License Build Status Coverage Downloads Gitter Citation What is it? Zarr is a Python package providing an implement

Zarr Developers 1.1k Dec 30, 2022
A High-Quality Real Time Upscaler for Anime Video

Anime4K Anime4K is a set of open-source, high-quality real-time anime upscaling/denoising algorithms that can be implemented in any programming langua

15.7k Jan 06, 2023
This package implements the algorithms introduced in Smucler, Sapienza, and Rotnitzky (2020) to compute optimal adjustment sets in causal graphical models.

optimaladj: A library for computing optimal adjustment sets in causal graphical models This package implements the algorithms introduced in Smucler, S

Facundo Sapienza 6 Aug 04, 2022
S-attack library. Official implementation of two papers "Are socially-aware trajectory prediction models really socially-aware?" and "Vehicle trajectory prediction works, but not everywhere".

S-attack library: A library for evaluating trajectory prediction models This library contains two research projects to assess the trajectory predictio

VITA lab at EPFL 71 Jan 04, 2023
Racing line optimization algorithm in python that uses Particle Swarm Optimization.

Racing Line Optimization with PSO This repository contains a racing line optimization algorithm in python that uses Particle Swarm Optimization. Requi

Parsa Dahesh 6 Dec 14, 2022
Omnidirectional Scene Text Detection with Sequential-free Box Discretization (IJCAI 2019). Including competition model, online demo, etc.

Box_Discretization_Network This repository is built on the pytorch [maskrcnn_benchmark]. The method is the foundation of our ReCTs-competition method

Yuliang Liu 266 Nov 24, 2022
This is the source code for our ICLR2021 paper: Adaptive Universal Generalized PageRank Graph Neural Network.

GPRGNN This is the source code for our ICLR2021 paper: Adaptive Universal Generalized PageRank Graph Neural Network. Hidden state feature extraction i

Jianhao 92 Jan 03, 2023
CVPR2021: Temporal Context Aggregation Network for Temporal Action Proposal Refinement

Temporal Context Aggregation Network - Pytorch This repo holds the pytorch-version codes of paper: "Temporal Context Aggregation Network for Temporal

Zhiwu Qing 63 Sep 27, 2022
Local-Global Stratified Transformer for Efficient Video Recognition

DualFormer This repo is the implementation of our manuscript entitled "Local-Global Stratified Transformer for Efficient Video Recognition". Our model

Sea AI Lab 19 Dec 07, 2022
ONNX Runtime Web demo is an interactive demo portal showing real use cases running ONNX Runtime Web in VueJS.

ONNX Runtime Web demo is an interactive demo portal showing real use cases running ONNX Runtime Web in VueJS. It currently supports four examples for you to quickly experience the power of ONNX Runti

Microsoft 58 Dec 18, 2022