Skip to content

Instantly share code, notes, and snippets.

View rowanc1's full-sized avatar
🚀
Working on the future

Rowan Cockett rowanc1

🚀
Working on the future
View GitHub Profile
@rowanc1
rowanc1 / syntheticSeismogram.py
Created January 9, 2014 17:52
Generates a synthetic seismogram for a simple 1-D layered model.
import numpy as np
import matplotlib.pyplot as plt
def syntheticSeismogram(v, rho, d):
"""
function syntheticSeismogram()
syntheicSeismogram generates a synthetic seismogram for a simple 1-D
@rowanc1
rowanc1 / extension.mjs
Created October 5, 2023 05:39
myst-ext-points
/**
* Extension for adding up points in an assignment.
*
* No more need to stress that point totals don't add up!! 😰
*
* Defines one role:
*
* - `points` displays points and records number in total
*
* And one directives:
<ink-var name="r" value="0.35"></ink-var>
<ink-var name="points" value="5"></ink-var>
<ink-var name="inset" value="2.5"></ink-var>
<ink-var name="theta" value="0" format=".1f"></ink-var>
<ink-var name="xC" :value="getCoord(0, theta, 'x', 0, draw)[1] || (-0.5 + r)"></ink-var>
<ink-var name="yC" :value="getCoord(0, theta, 'y', 0, draw)[1] || 0.5"></ink-var>
<ink-var name="uX" value="-0.5"></ink-var>
<ink-var name="uY" value="0.5"></ink-var>
<ink-var name="zeroX" :value="getCoord(0, theta, 'x', 0, draw)[0]"></ink-var>
<ink-var name="zeroY" :value="getCoord(0, theta, 'y', 0, draw)[0]"></ink-var>
<ink-var name="r" value="0.35"></ink-var>
<ink-var name="theta" value="0" format=".1f"></ink-var>
<ink-var name="xC" :value="Math.cos(theta)*r-0.5"></ink-var>
<ink-var name="yC" :value="Math.sin(theta)*r+0.5"></ink-var>
<h3>Sin and Cos</h3>
<ink-dynamic bind="theta" min="0" step="0.01" :max="Math.PI*2" periodic="true" :transform="value*180/Math.PI" after="º"></ink-dynamic>
<ink-chart xlim="[-1, 2]" ylim="[-1, 1]" height="400" width="600" xAxisLocation="hidden" yAxisLocation="hidden">
<ink-chart-path :data="[[-1,0],[2, 0],[],[0, -1], [0, 1]]" stroke="#ddd" strokewidth="2"></ink-chart-path>
<ink-chart-path :data="[[-1, 0.5-r],[2, 0.5-r],[],[-1, 0.5], [2, 0.5],[],[-1, 0.5+r],[2, 0.5+r]]" stroke="#ddd" strokewidth="0.5"></ink-chart-path>
@rowanc1
rowanc1 / array-dynamic.js
Created May 15, 2019 04:53
Idyll Dynamic format array
const React = require('react');
const ReactDOM = require('react-dom');
const Format = require('d3-format');
const Drag = require('d3-drag');
const Selection = require('d3-selection');
class ArrayDynamic extends React.PureComponent {
componentDidMount() {
let node;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
import numpy as np
import scipy.sparse as sp
from SimPEG import Mesh, Maps, DataMisfit
from SimPEG.FLOW import Richards
plotIt = False
order = ['Ks', 'theta_r', 'theta_s', 'alpha', 'n']
soil = Richards.Empirical.VanGenuchtenParams().sandy_clay_loam
@rowanc1
rowanc1 / Exploring_julia_with_simpeg.md
Last active July 31, 2016 21:29
A first attempt at translating some of the SimPEG library into Julia.

:uid: exploring_julia_with_simpeg :title: Exploring Julia with SimPEG :description: A first attempt at translating some of the SimPEG library into Julia. :tooltip: /img/julia-logo.png :tag: julia :group: simpeg :license: CC-BY-4.0 :source: https://api.github.com/gists/23a83f05b5612388f9b4

I have been meaning to checkout Julia for a while, an open source (and real) alternative to Matlab for doing scientific computing.

@rowanc1
rowanc1 / description.md
Last active January 3, 2016 14:59
SimPEG Play - DC Resistivity Inversion

Working to incorporate DC resistivity inversions in the new SimPEG framework.

@rowanc1
rowanc1 / description.md
Last active January 2, 2016 18:48
SimPEG Tutorial - Creating a Mesh

In this tutorial we will go over creating a mesh, and the basics of numbering, counting, and naming conventions. With these skills you can move faster, and move between different meshes (hopefully) with ease!