Skip to content

Instantly share code, notes, and snippets.

View mikofski's full-sized avatar
😎
Solving solar

Mark Mikofski mikofski

😎
Solving solar
View GitHub Profile
import os
import pvlib
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
sns.set()
plt.ion()
INVERTERS = pvlib.pvsystem.retrieve_sam('CECInverter')
INVERTER_10K = INVERTERS['SMA_America__SB10000TL_US__240V_']
@mikofski
mikofski / ez_Notebook.py
Last active November 12, 2020 09:06
Python 2 version of ttk Notebook Demo by courtesy of Jane
#! /usr/bin/env python
from Tkinter import *
from ttk import *
root = Tk() # create a top-level window
master = Frame(root, name='master') # create Frame in "root"
master.pack(fill=BOTH) # fill both sides of the parent
"""
An open PV system specification
"""
import json
import pathlib
import yaml
def get_pv_spec(pv_spec_pathlib_file_or_buffer):
@mikofski
mikofski / compare_tabular_data.ipynb
Created September 2, 2020 22:42
Python tabular data formats face-off
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikofski
mikofski / dualtilt.ipynb
Last active October 21, 2020 00:18
Comparison of Dual-Tilt vs. Fixed-Tilt
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikofski
mikofski / dcloss.ipynb
Last active March 24, 2020 03:13
dcloss
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikofski
mikofski / keyfile.json
Last active March 13, 2020 20:27
use Requests with OAuth 1.0 and Netflix REST API 1.5
{
"key": "<your-netflix-key>",
"secret": "<your-netflix-secret>"
}
@mikofski
mikofski / polyDer2D.m
Last active March 13, 2020 20:26
horners method in 2-D
function [fx,fy] = polyDer2D(p,x,y,n,m)
%POLYDER2D Evaluate derivatives of 2-D polynomial using Horner's method.
% F = POLYDER2D(P,X,Y,N,M) evaluates the derivatives of 2-D polynomial P at
% the points specified by X and Y, which must have the same dimensions. The
% outputs FX and FY will have the same dimensions as X and Y. N and M specify
% the order of X and Y respectively. Polynomial coefficients are in the
% following order.
%
% F(X,Y) = P_1 * X^N * Y^M + P_2 * X^{N-1} * Y^M + ... + P_{N+1} * Y^M + ...
% P_{N+2} * X^N * Y^{M-1} + P_{N+3} * X^{N-1} * Y^{M-1} + ... + P_{2*(N+1)} * Y^{M-1} + ...
%% initialize workspace
close('all'),clear('all'),clc
rmdir('keys','s') % delete old keys
%% test encryption
PANGRAM = 'The quick brown fox jumped over the lazy dog.';
EncryptionUtil.testJschSECSH(PANGRAM) % run test
%% make SSH keys in workspace
keyFactory = java.security.KeyFactory.getInstance('RSA'); % make a key factory
% read public OpenSSH key
[keyln, totlines] = EncryptionUtil.readJschKeyFile('keys/publicJschSECSH.key',7);