Skip to content

Instantly share code, notes, and snippets.

View sariths's full-sized avatar

Sarith Subramaniam sariths

View GitHub Profile
@sariths
sariths / ipAddressTutorial.py
Created February 23, 2018 05:03
Plot the unique download locations for the tutorial on the world map
# coding=utf-8
from geoip import geolite2
from collections import Counter
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
with open(r'/home/sarith/Desktop/ips.txt') as somefile:
data = somefile.read().split()
##Create sun primitive definition for solar calculations.
echo "void light solar 0 0 3 1e6 1e6 1e6" > skies/suns.rad
##Create solar discs and corresponding modifiers for 5185 suns corresponding to a Reinhart MF:6 subdivision.
##Windows users, who are unlikely to be able to run a MF:6 simulation, should set "cnt 5185" to "cnt 145" and "MF:6" to "MF:1".
cnt 145 | rcalc -e MF:1 -f reinsrc.cal -e Rbin=recno -o 'solar source sun 0 0 4 ${Dx} ${Dy} ${Dz} 0.533' >> skies/suns.rad
##Create an octree black octree, shading device with proxy BSDFs and solar discs.
oconv -f materials.rad room.rad skies/suns.rad > octrees/sunCoefficientsN.oct
echo Create octree
oconv materials.rad room.rad objects/Glazing.rad > octrees/roomDC.oct
echo Steps for creating daylight coefficients for images
vwrays -vf views/south.vf -x 400 -y 400 -pj 0.7 -c 4 -ff > matrices/south.rays
vwrays -vf views/south.vf -x 400 -y 400 -d > matrices/southDimensions.txt
import PySimpleGUI as sg
layout = [[sg.Text("Channel ID")],
[sg.InputText(key="url")],
[sg.Text("Storage location")],
[sg.InputText(default_text=r"C:\Users\Sarith\Desktop\music", key="loc")],
[sg.Checkbox("Include uploads", key="includeUploads", default=True)],
[sg.Checkbox("Return videos uploaded by channel only", key="channelUploadsOnly",
default=True)],
def changeEPWData(oldEpwFilePath,newEpwFilePath,dataIndex,dataList):
"""
:param oldEpwFilePath: Path of the original epw file.
:param newEpwFilePath: Path to which the new file should be written to.
:param dataIndex: Index of the data which is to be changed. Refer notes below.
:param dataList: A list of 8760 values that will replace the original data.
# obj2rad -f C:\ladybug\man2\unnamed\MSH2RADFiles\unnamed.obj
# OBJ file written by TurtlePyMesh
void plastic man2 0 0 5 0.7 0.7 0.7 0 0
man2 polygon object_1.1
0
0
9
4.06137 1.71116 0.672556
4.02568 1.7062 0.738104
# obj2rad -f C:\ladybug\man1\unnamed\MSH2RADFiles\unnamed.obj
# OBJ file written by TurtlePyMesh
void plastic man1 0 0 5 0.7 0.7 0.7 0 0
man1 polygon object_1.1
0
0
9
0.719486 1.42862 1.1045
0.719487 1.44317 1.1045
0.830367 1.44317 1.1045