- <a rel="me" href="https://ottawa.place/@dan613">ottawa.place/@dan613</a>
- @[email protected]
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
""" | |
Derive Earth system response from atmospheric composition and | |
temperature record using Fourier Ttansform to perform a deconvolution. | |
Created on Thu Feb 24 18:42:31 2022 | |
@author: dan | |
""" |
This file contains hidden or 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
from sympy import * | |
init_session(quiet=True) | |
from sympy.abc import epsilon, sigma, c, w | |
var('P1 P2 P12 Pin T1 T2') | |
const = dict(sigma=5.67e-8, # Stefan-Boltzmann constant | |
epsilon=1.0, # emissivity of flat black paint | |
c = 401.) # W/mK, conductivity of copper plate | |
# In[111]: |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Jun 25 18:45:37 2019 | |
@author: dan | |
https://www.ncdc.noaa.gov/crn/qcdatasets.html | |
Change `filebase` for your local storage location |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
""" | |
Wrapping arbitrary text to a defined box is not supported at least up to | |
Matplotlib 3.1. This is because the wrap width is hardwired to the Figure box. | |
A way around this is to override the _get_wrap_line_width method, either with | |
a new function, or by subclassing the matplotlib.text.Text class. Both | |
methods are shown below. |
This file contains hidden or 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
Pronoms relatifs | |
Est-ce que les enfants veulent des biscuits? | |
Oui, Ils en veulent. | |
Est-ce que Annie va terminer le rapport dans une demi-heure? | |
Oui, elle va le terminer dans une demi-heure. | |
Est-ce que tu es allé au restaurant La Belle marquise vendredi? | |
Oui, J'y suis allé vendredi. |
This file contains hidden or 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
<!DOCTYPE html> | |
<!-- | |
Simple html page that creates a clock for old phones with old browsers. | |
Save this file in a folder (eg. as clock.html) on your computer, then | |
start a web server in a terminal window from that folder. | |
A simple way to do this is open a terminal window and move to the folder | |
holding the script (don't type '$', that's your prompt): | |
$ cd path/to/folder |
This file contains hidden or 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 matplotlib.pyplot as plt | |
import matplotlib.ticker as tk | |
def Mirror(prec=1): | |
"""Adds y-axis that's a mirror of the y-axis on left. | |
Parameters | |
---------- | |
prec : int (opt) Default=1 | |
Number of significant digits (precision) to use on scale |
This file contains hidden or 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 | |
import pandas as pd | |
def Hanning(size): | |
w = np.hanning(size+2) | |
w = np.array(w[1:-1]) # remove zeros at endpoints | |
return (w / max(w)) | |
def WeightedMovingAverage(fs, size, pad=True, winType=Hanning, wts=None): | |
"""Apply a weighted moving average on the supplied series. |
This file contains hidden or 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 | |
import pandas as pd | |
def Lowess(data, f=2./3., pts=None, itn=3, order=1): | |
"""Fits a nonparametric regression curve to a scatterplot. | |
Parameters | |
---------- | |
data : pandas.Series | |
Data points in the scatterplot. The |