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
Speech Enhancement Generative Adversarial Network Based on Asymmetric AutoEncoder

ASEGAN: Speech Enhancement Generative Adversarial Network Based on Asymmetric AutoEncoder 中文版简介 Readme with English Version 介绍 基于SEGAN模型的改进版本,使用自主设计的非

Nitin 53 Nov 17, 2022
Github Traffic Insights as Prometheus metrics.

github-traffic Github Traffic collects your repository's traffic data and exposes it as Prometheus metrics. Grafana dashboard that displays the metric

Grafana Labs 34 Oct 27, 2022
Reinforcement Learning for Portfolio Management

qtrader Reinforcement Learning for Portfolio Management Why Reinforcement Learning? Learns the optimal action, rather than models the market. Adaptive

Angelos Filos 406 Jan 01, 2023
Rainbow is all you need! A step-by-step tutorial from DQN to Rainbow

Do you want a RL agent nicely moving on Atari? Rainbow is all you need! This is a step-by-step tutorial from DQN to Rainbow. Every chapter contains bo

Jinwoo Park (Curt) 1.4k Dec 29, 2022
Deep Unsupervised 3D SfM Face Reconstruction Based on Massive Landmark Bundle Adjustment.

(ACMMM 2021 Oral) SfM Face Reconstruction Based on Massive Landmark Bundle Adjustment This repository shows two tasks: Face landmark detection and Fac

BoomStar 51 Dec 13, 2022
This Repostory contains the pretrained DTLN-aec model for real-time acoustic echo cancellation.

This Repostory contains the pretrained DTLN-aec model for real-time acoustic echo cancellation.

Nils L. Westhausen 182 Jan 07, 2023
A code generator from ONNX to PyTorch code

onnx-pytorch Generating pytorch code from ONNX. Currently support onnx==1.9.0 and torch==1.8.1. Installation From PyPI pip install onnx-pytorch From

Wenhao Hu 94 Jan 06, 2023
This program can detect your face and add an Christams hat on the top of your head

Auto_Christmas This program can detect your face and add a Christmas hat to the top of your head. just run the Auto_Christmas.py, then you can see the

3 Dec 22, 2021
Justmagic - Use a function as a method with this mystic script, like in Nim

justmagic Use a function as a method with this mystic script, like in Nim. Just

witer33 8 Oct 08, 2022
Cartoon-StyleGan2 🙃 : Fine-tuning StyleGAN2 for Cartoon Face Generation

Fine-tuning StyleGAN2 for Cartoon Face Generation

Jihye Back 520 Jan 04, 2023
Finding Biological Plausibility for Adversarially Robust Features via Metameric Tasks

Adversarially-Robust-Periphery Code + Data from the paper "Finding Biological Plausibility for Adversarially Robust Features via Metameric Tasks" by A

Anne Harrington 2 Feb 07, 2022
Code for project: "Learning to Minimize Remainder in Supervised Learning".

Learning to Minimize Remainder in Supervised Learning Code for project: "Learning to Minimize Remainder in Supervised Learning". Requirements and Envi

Yan Luo 0 Jul 18, 2021
SAPIEN Manipulation Skill Benchmark

ManiSkill Benchmark SAPIEN Manipulation Skill Benchmark (abbreviated as ManiSkill, pronounced as "Many Skill") is a large-scale learning-from-demonstr

Hao Su's Lab, UCSD 107 Jan 08, 2023
Voila - Voilà turns Jupyter notebooks into standalone web applications

Rendering of live Jupyter notebooks with interactive widgets. Introduction Voilà turns Jupyter notebooks into standalone web applications. Unlike the

Voilà Dashboards 4.5k Jan 03, 2023
some classic model used to segment the medical images like CT、X-ray and so on

github_project This is a project for medical image segmentation. This project includes common medical image segmentation models such as U-net, FCN, De

2 Mar 30, 2022
Sky Computing: Accelerating Geo-distributed Computing in Federated Learning

Sky Computing Introduction Sky Computing is a load-balanced framework for federated learning model parallelism. It adaptively allocate model layers to

HPC-AI Tech 72 Dec 27, 2022
Styleformer - Official Pytorch Implementation

Styleformer -- Official PyTorch implementation Styleformer: Transformer based Generative Adversarial Networks with Style Vector(https://arxiv.org/abs/

Jeeseung Park 159 Dec 12, 2022
You Only Hypothesize Once: Point Cloud Registration with Rotation-equivariant Descriptors

You Only Hypothesize Once: Point Cloud Registration with Rotation-equivariant Descriptors In this paper, we propose a novel local descriptor-based fra

Haiping Wang 80 Dec 15, 2022
Scalable Multi-Agent Reinforcement Learning

Scalable Multi-Agent Reinforcement Learning 1. Featured algorithms: Value Function Factorization with Variable Agent Sub-Teams (VAST) [1] 2. Implement

3 Aug 02, 2022
NVIDIA container runtime

nvidia-container-runtime A modified version of runc adding a custom pre-start hook to all containers. If environment variable NVIDIA_VISIBLE_DEVICES i

NVIDIA Corporation 938 Jan 06, 2023