Code and coordinates for Matt's 2021 xmas tree

Overview

xmastree2021

Code and coordinates for Matt's 2021 xmas tree

This repository contains the code and coordinates used for Matt's 2021 Christmas tree, as featured in "My 500-LED xmas tree got into Harvard.".

coords_2021.csv are the coordinates of Matt's 2021 tree in GIFT format. The first few entries are identically because they were scanned incorrectly and so were set to the same value as the first 'correct' LED.

light_fixer.py is the original source code from the video. It corrects coordinates in 'pixel space' but does not convert to GIFT.

Code in the examples folder has been provided by other contributors!

Most of what you need is probably over on the Harvard Graduate School of Design repository: "GSD-6338: Introduction to Computational Design"

Usage

Contributing

You're welcome to contribute! There are a few different places that your PR could target:

  • Small bug fixes, as well as small changes that significantly increase usability, will be accepted directly in to the original code.

  • The examples folder has been created as a place for any effects contained within a single CSV file. Files should be named based on the effect - fire.csv for example.

  • If you've done a bigger bit of work, consider keeping this in your own repository, and opening a PR to update the Further Work section below.

Further Work

Links to larger projects based on this one

Comments
  • Country flags and explosion

    Country flags and explosion

    I created an animation that displays flags of European countries on the tree, in alphabetical order. Each display was created by essentially overlaying a flag on the Y-Z plane, and setting each light's colours to the colour of the closest flag image pixel. The depth of the tree, i.e. the lights positions in the x-dimension, had no influence. Therefore, the animation is best viewed perpendicular to the Y-Z plane (so down the positive x-axis). As the tree is not rectangular, the top-left and top-right sections of the flags are not displayed on the tree. Unsurprisingly, flags with detailed imagery don't come into their own due to the low resolution, but most the more "simple" flags are quite easy to recognise. I started out creating an animation for all of the world's flags, but the CSV file became too large for GitHub.

    The scripts used in generating the CSV files can be found here: https://github.com/LuukvanKeeken/Country-Flags-Christmas-Tree. There it can also be seen which flags were used, and the order they appear in in the animation, by looking in the images_europe folder.

    opened by LuukvanKeeken 12
  • morse code examples

    morse code examples

    These examples flash the words "Merry Xmas" in morse code.

    The easiest to read as Morse code is morse-xmas-white.csv which blinks all of the lights together, coloured white. However this is probably also the most power hungry as I think last year you had some problems turning all the lights to full brightness together.

    I am also not sure of the hardware requirements. I have been basing my timings off of 60fps, but I don't know if the Raspberry Pi can drive at this frequency. Slower is probably fine, faster might be a problem for epilectics! (seriously - consider that a warning).

    The other 2 files are variations morse-xmas-random.csv randomly colors all of the lights each frame. This makes it harder to read the Morse.

    And morse-xmas-twinkle.csv gives each light a random colour and offsets the animation randomly per light. This is probably the most power friendly version, but also makes it look like random noise rather than being able to see the message.

    I created these using P5 - a Javascript version of Processing using their online editor. You can see the original code that generated the animation here:

    https://editor.p5js.org/rendermaniac/sketches/QmKh_KZMk

    I also verified that I could read all of these files using this Sketch. It also works with the MIT examples:

    https://editor.p5js.org/rendermaniac/sketches/yw-tkWRDPy

    I will probably post more details on my STEM / rockets facebook page here soon: https://www.facebook.com/pihighrockets/

    Thanks for putting all of this together - it's an interesting challenge!

    opened by rendermaniac 12
  • Rainbow patterns

    Rainbow patterns

    This example is a simple hue colour change based on the distance from the centre of the Christmas tree. This is animated by adding the frame number as an offset.

    Note that I just exported 500 frames - I did not bother to make it loopable.

    Created using this code:

    https://editor.p5js.org/rendermaniac/sketches/OLLuV7vm1

    Thanks

    Simon https://www.facebook.com/pihighrockets/

    opened by rendermaniac 10
  • Added Bad Apple

    Added Bad Apple

    Based on the famous touhou inspired black and white video (https://www.youtube.com/watch?v=FtutLA63Cp8), compared the coordinates of the LEDs to the pixels in the video to replicate it frame by frame. This was made trough a simple script i made in java to convert the images to csv frames for the tree.

    The full version didn't fit, as it was larger than the 25 GB permitted on GitHub, so a trimmed version was uploaded. The full version can be found here: https://drive.google.com/file/d/1Zy1kz8YrNmLj9zM24qycitdXuQlJFZLi/view

    opened by TheAgamer554 8
  • Add (my) MPTree project to Further Work on README

    Add (my) MPTree project to Further Work on README

    I am seeing others come up with similar projects for visualizing/simulating tree light sequences. Should we separate these into their own README section, or directory, or is the "Further Work" section fine?

    Apart from that, I'm also waiting for others to upload their sequences to have more random sequences to show since currently I'm only linking to a single one.

    opened by santiagodg 7
  • Online GIFT-Simulator

    Online GIFT-Simulator

    An online GIFT-Simulator that runs independent of the programming language used: https://leukipp.github.io/xmastree2021/simulator/

    A procedural tree is rendered and light coordinates/animation frames can be loaded from url`s or local csv files. GitHub pages can be used to host the static scripts, as everything runs on the client side.

    opened by leukipp 7
  • Viewer submission, video direction

    Viewer submission, video direction

    I really hope I didn't miss it in the video or these repos, but @thatmattparker what direction(s) will you be filming our visualizations from? I have a big idea, but will not make sense unless viewed from a specific direction.

    You mention in the video that I believe the XZ plane is in frame currently, but will that still be so during the video?

    Thanks!

    opened by dclunde 6
  • Twinkles

    Twinkles

    This is just running Perlin noise through the tree and thresholding the result.

    I'm not quite sure if I should leave it like this or make it more complex?

    https://editor.p5js.org/rendermaniac/sketches/4v1SoYlF1

    opened by rendermaniac 5
  • Brightness recommendations

    Brightness recommendations

    Hi, saw this YouTube comment from suncrasher, which hasn't been addressed yet and I was wondering too:

    Question regarding brightness: Last time you recommended to not go above (50, 50, 50) for large amounts of LEDs because (a) that was bright enough already and (b) your power supplies didn't manage more. Does that still apply?

    opened by connorf25 5
  • Simulator and helper code

    Simulator and helper code

    Hi, I am looking forward to this year's video.

    Over the last couple of days I have written a simulator and some utility code to help make users code a bunch simpler than last year.

    Are these things you would be interested including so that others can use them?

    They will probably need modifying a little to work with the CSV format and if anything else has changed.

    Simulator: https://github.com/gentlegiantJGC/xmastree2020/blob/main/simulator.py

    Utility code to import either the real tree or fall back to the simulator if it does not exist; a function to set up the LED interface that was imported and a context manager to control the frame time. https://github.com/gentlegiantJGC/xmastree2020/blob/main/matts_tree_helpers.py

    I also added a minimal template using this system https://github.com/gentlegiantJGC/xmastree2020/blob/main/template.py

    opened by gentlegiantJGC 5
  • Kind of quiet around here.

    Kind of quiet around here.

    The pull requests to this repo will be used in Matt's video, correct? There was a lot of activity and questions about frame rate, etc, but now it has been very quiet.

    opened by jtbowden 4
  • Animate lights with unknown/incorrect positions in red

    Animate lights with unknown/incorrect positions in red

    Lights are grouped into red and green lights. If a light's position was determined to be probably correct it glows green, positions of other lights were "corrected" to a position that may or may not be closer to the actual position in the real tree. These other lights show red and their intensity increases and decreases as two sine waves move through the string of lights.

    opened by huib 0
  • Add Game of Life animation

    Add Game of Life animation

    I've made a simulation of what somewhat resembles Game of Life in 3D.

    Lights will have different amount of neighbors - based on a fixed distance. State (alive/dead) of a light is calculated based on the portion of alive neighbors.

    This has some interesting properties, some areas go into loops; they repeat the same effect until another pattern intrudes it. I've no clue how this will look on the real tree, though.

    Currently working on making lights that were just "born" illuminate in a different color. -> Draft Request for now.

    I've followed the discussion about brightness. For this, I just assumed full brightness for all active lights. Around 120-180 are active simultaneously. If that is too much, let me know! Might share the code, but gotta clean it up first.

    Thanks for reading.

    opened by nukerxy 2
  • Add solar eclipse, carousel and rocket examples

    Add solar eclipse, carousel and rocket examples

    All animations designed for 30fps.

    • antarctic_solar_eclipse.csv
      • This is pretty much what the December 4 solar eclipse would have looked like on a sunny day (~100x speed).
      • It only makes sense to look on the x-z plane.
    • carousel_gallopers.csv
      • Four colored carousel spinning clockwise.
      • Two gallopers spinning counter clockwise.
    • rocket_launch.csv
      • Countdown followed by a rocket launch.
      • Experimental animation to test SVG to GIFT conversion.

    Coded with GIFT-Development (#32), source code and running examples available here:

    opened by leukipp 0
Owner
Stand-up Maths
Various bits of code from Matt Parker's projects
Stand-up Maths
This program analizes films database with adresses, and creates a folium map with closest films to the coordinates

Films-map-project UCU CS lab 1.2, 1st year This program analizes films database with adresses, and creates a folium map with closest films to the coor

Artem Moskovets 1 Feb 9, 2022
Python script that can be used to generate latitude/longitude coordinates for GOES-16 full-disk extent.

goes-latlon Python script that can be used to generate latitude/longitude coordinates for GOES-16 full-disk extent. ?? ??️ The grid files can be acces

Douglas Uba 3 Apr 6, 2022
Python 台灣行政區地圖 (2021)

Python 台灣行政區地圖 (2021) 以 python 讀取政府開放平台的 ShapeFile 地圖資訊。歡迎引用或是協作 另有縣市資訊、村里資訊與各種行政地圖資訊 例如: 直轄市、縣市界線(TWD97經緯度) 鄉鎮市區界線(TWD97經緯度) | 政府資料開放平臺: https://data

WeselyOng 12 Sep 27, 2022
Daily social mapping project in November 2021. Maps made using PyGMT whenever possible.

Daily social mapping project in November 2021. Maps made using PyGMT whenever possible.

Wei Ji 20 Nov 24, 2022
This is a simple python code to get IP address and its location using python

IP address & Location finder @DEV/ED : Pavan Ananth Sharma Dependencies: ip2geotools Note: use pip install ip2geotools to install this in your termin

Pavan Ananth Sharma 2 Jul 5, 2022
Get-countries-info - A python code that fetches data of any country

Country-info A python code getting countries information including country's map

CODE 2 Feb 21, 2022
OSMnx: Python for street networks. Retrieve, model, analyze, and visualize street networks and other spatial data from OpenStreetMap.

OSMnx OSMnx is a Python package that lets you download geospatial data from OpenStreetMap and model, project, visualize, and analyze real-world street

Geoff Boeing 4k Jan 8, 2023
Read and write rasters in parallel using Rasterio and Dask

dask-rasterio dask-rasterio provides some methods for reading and writing rasters in parallel using Rasterio and Dask arrays. Usage Read a multiband r

Dymaxion Labs 85 Aug 30, 2022
Location field and widget for Django. It supports Google Maps, OpenStreetMap and Mapbox

django-location-field Let users pick locations using a map widget and store its latitude and longitude. Stable version: django-location-field==2.1.0 D

Caio Ariede 481 Dec 29, 2022
A short term landscape evolution using a path sampling method to solve water and sediment flow continuity equations and model mass flows over complex topographies.

r.sim.terrain A short-term landscape evolution model that simulates topographic change for both steady state and dynamic flow regimes across a range o

Brendan Harmon 7 Oct 21, 2022
Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Ayush Mishra 3 May 6, 2022
A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1.2k Jan 3, 2023
Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Jazzband 765 Jan 6, 2023
Manipulation and analysis of geometric objects

Shapely Manipulation and analysis of geometric objects in the Cartesian plane. Shapely is a BSD-licensed Python package for manipulation and analysis

null 3.1k Jan 3, 2023
Python interface to PROJ (cartographic projections and coordinate transformations library)

pyproj Python interface to PROJ (cartographic projections and coordinate transformations library). Documentation Stable: http://pyproj4.github.io/pypr

null 832 Dec 31, 2022
Rasterio reads and writes geospatial raster datasets

Rasterio Rasterio reads and writes geospatial raster data. Geographic information systems use GeoTIFF and other formats to organize and store gridded,

Mapbox 1.9k Jan 7, 2023
Fiona reads and writes geographic data files

Fiona Fiona reads and writes geographic data files and thereby helps Python programmers integrate geographic information systems with other computer s

null 987 Jan 4, 2023
Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Jazzband 763 Dec 26, 2022
Documentation and samples for ArcGIS API for Python

ArcGIS API for Python ArcGIS API for Python is a Python library for working with maps and geospatial data, powered by web GIS. It provides simple and

Esri 1.4k Dec 30, 2022