This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import paho.mqtt.client as mqtt | |
from influxdb import InfluxDBClient | |
TOPIC = "/sensors/#" | |
DB_SRV = { | |
"host": "#.#.#.#", | |
"username": "#", | |
"password": "#", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Text.Parsec | |
import Text.Parsec.String | |
import Text.Parsec.Char | |
import Control.Monad | |
import Data.List | |
import Data.Either |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import paho.mqtt.client as mqtt | |
from influxdb import InfluxDBClient | |
from math import isnan | |
MQTT_ADDR = 'raspi' | |
TOPIC = "/sensors/#" | |
DB_SRV = { | |
"host": "###", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gefry3 # My model code | |
import pymc | |
import numpy as np | |
import seaborn as sb | |
from scipy.stats import multivariate_normal | |
# P is an object that encompasses the geometry and problem, can be | |
# called to compute detector response |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.optimize import minimize | |
def least_squares(A, b, x0): # Least-squares solution for Ax=b, initial guess of x0 | |
return minimize( | |
lambda x: np.linalg.norm(A.dot(x) - b), | |
x0, | |
) | |
def least_squares_tikhonov(A, b, alpha, x0): # Least squares for Ax=b with simple Tikhonov regularization |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################## | |
# Copyright (c) 2018, Jason M. Hite | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright notice, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyftdi as F | |
from pyftdi import i2c | |
from ctypes import c_short | |
from time import sleep | |
import atexit | |
### Some utility functions |