Skip to content

Instantly share code, notes, and snippets.

View sariths's full-sized avatar

Sarith Subramaniam sariths

View GitHub Profile
# 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
# 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
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)],
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
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.
##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
@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()
# coding=utf-8
"""
id,
country,
station_name,
data_source,
lat,
lon,
http_link,
host,
# coding=utf-8
doeStr="""603900,DZA,ALGIERS,IWEC Data,36.72,3.25,https://energyplus.net/weather-download/africa_wmo_region_1/DZA//DZA_Algiers.603900_IWEC/all,doe,18,517,1718,5800,374,267,66
623870,EGY,Al_Minya,ETMY,28.08,30.73,https://energyplus.net/weather-download/africa_wmo_region_1/EGY//EGY_Al.Minya.623870_ETMY/all,doe,0,47,1136,5462,592,813,710
623180,EGY,Alexandria,ETMY,31.2,29.95,https://energyplus.net/weather-download/africa_wmo_region_1/EGY//EGY_Alexandria.623180_ETMY/all,doe,0,136,1270,6405,606,302,41
624140,EGY,Aswan,ETMY,23.97,32.78,https://energyplus.net/weather-download/africa_wmo_region_1/EGY//EGY_Aswan.624140_ETMY/all,doe,12,183,1212,4181,591,834,1747
624140,EGY,ASWAN,IWEC Data,23.97,32.78,https://energyplus.net/weather-download/africa_wmo_region_1/EGY//EGY_Aswan.624140_IWEC/all,doe,3,141,1385,4103,579,913,1636
623930,EGY,Asyut,ETMY,27.05,31.02,https://energyplus.net/weather-download/africa_wmo_region_1/EGY//EGY_Asyut.623930_ETMY/all,doe,4,304,1476,4956,577,709,734
623660,EGY,CAIRO,IWEC Data,3
@sariths
sariths / perforationTest.py
Last active October 24, 2017 17:17
Test perforate.cal with accurate direct settings.
# coding=utf-8
import os,multiprocessing
#Create octree for the scene.
os.system("oconv materials.rad room.rad skies/NYC.sky> octrees/scene.oct")
commands1=[]
commands2=[]
commands3=[]
commands4=[]