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
EgoNN: Egocentric Neural Network for Point Cloud Based 6DoF Relocalization at the City Scale

EgonNN: Egocentric Neural Network for Point Cloud Based 6DoF Relocalization at the City Scale Paper: EgoNN: Egocentric Neural Network for Point Cloud

19 Sep 20, 2022
Automatically measure the facial Width-To-Height ratio and get facial analysis results provided by Microsoft Azure

fwhr-calc-website This project is to automatically measure the facial Width-To-Height ratio and get facial analysis results provided by Microsoft Azur

SoohyunPark 1 Feb 07, 2022
This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CNPs), Neural Processes (NPs), Attentive Neural Processes (ANPs).

The Neural Process Family This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CN

DeepMind 892 Dec 28, 2022
DIT is a DTLS MitM proxy implemented in Python 3. It can intercept, manipulate and suppress datagrams between two DTLS endpoints and supports psk-based and certificate-based authentication schemes (RSA + ECC).

DIT - DTLS Interception Tool DIT is a MitM proxy tool to intercept DTLS traffic. It can intercept, manipulate and/or suppress DTLS datagrams between t

52 Nov 30, 2022
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation. Training python train.py --c

Rishikesh (ऋषिकेश) 55 Dec 26, 2022
An Straight Dilated Network with Wavelet for image Deblurring

SDWNet: A Straight Dilated Network with Wavelet Transformation for Image Deblurring(offical) 1. Introduction This repo is not only used for our paper(

FlyEgle 41 Jan 04, 2023
Deep Learning and Logical Reasoning from Data and Knowledge

Logic Tensor Networks (LTN) Logic Tensor Network (LTN) is a neurosymbolic framework that supports querying, learning and reasoning with both rich data

171 Dec 29, 2022
This code is a near-infrared spectrum modeling method based on PCA and pls

Nirs-Pls-Corn This code is a near-infrared spectrum modeling method based on PCA and pls 近红外光谱分析技术属于交叉领域,需要化学、计算机科学、生物科学等多领域的合作。为此,在(北邮邮电大学杨辉华老师团队)指导下

Fu Pengyou 6 Dec 17, 2022
List of content farm sites like g.penzai.com.

内容农场网站清单 Google 中文搜索结果包含了相当一部分的内容农场式条目,比如「小 X 知识网」「小 X 百科网」。此种链接常会 302 重定向其主站,页面内容为自动生成,大量堆叠关键字,揉杂一些爬取到的内容,完全不具可读性和参考价值。 尤为过分的是,该类网站可能有成千上万个分身域名被 Goog

WDMPA 541 Jan 03, 2023
PyTorch implementation of EigenGAN

PyTorch Implementation of EigenGAN Train python train.py [image_folder_path] --name [experiment name] Test python test.py [ckpt path] --traverse FFH

62 Nov 12, 2022
Pytorch implementation of FlowNet by Dosovitskiy et al.

FlowNetPytorch Pytorch implementation of FlowNet by Dosovitskiy et al. This repository is a torch implementation of FlowNet, by Alexey Dosovitskiy et

Clément Pinard 762 Jan 02, 2023
Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation (CVPR 2022)

CCAM (Unsupervised) Code repository for our paper "CCAM: Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localizati

Computer Vision Insitute, SZU 113 Dec 27, 2022
Learning to Stylize Novel Views

Learning to Stylize Novel Views [Project] [Paper] Contact: Hsin-Ping Huang ([ema

34 Nov 27, 2022
Stable Neural ODE with Lyapunov-Stable Equilibrium Points for Defending Against Adversarial Attacks

Stable Neural ODE with Lyapunov-Stable Equilibrium Points for Defending Against Adversarial Attacks Stable Neural ODE with Lyapunov-Stable Equilibrium

Kang Qiyu 8 Dec 12, 2022
CARL provides highly configurable contextual extensions to several well-known RL environments.

CARL (context adaptive RL) provides highly configurable contextual extensions to several well-known RL environments.

AutoML-Freiburg-Hannover 51 Dec 28, 2022
[NeurIPS 2021] Deceive D: Adaptive Pseudo Augmentation for GAN Training with Limited Data

Deceive D: Adaptive Pseudo Augmentation for GAN Training with Limited Data (NeurIPS 2021) This repository will provide the official PyTorch implementa

Liming Jiang 238 Nov 25, 2022
Iterative Normalization: Beyond Standardization towards Efficient Whitening

IterNorm Code for reproducing the results in the following paper: Iterative Normalization: Beyond Standardization towards Efficient Whitening Lei Huan

Lei Huang 21 Dec 27, 2022
Random-Afg - Afghanistan Random Old Idz Cloner Tools

AFGHANISTAN RANDOM OLD IDZ CLONER TOOLS Install $ apt update $ apt upgrade $ apt

MAHADI HASAN AFRIDI 5 Jan 26, 2022
MILK: Machine Learning Toolkit

MILK: MACHINE LEARNING TOOLKIT Machine Learning in Python Milk is a machine learning toolkit in Python. Its focus is on supervised classification with

Luis Pedro Coelho 610 Dec 14, 2022
Entity-Based Knowledge Conflicts in Question Answering.

Entity-Based Knowledge Conflicts in Question Answering Run Instructions | Paper | Citation | License This repository provides the Substitution Framewo

Apple 35 Oct 19, 2022