Skip to content

Instantly share code, notes, and snippets.

View lstagner's full-sized avatar

Luke Stagner lstagner

View GitHub Profile
@lstagner
lstagner / polyharmonic_splines.ipynb
Last active February 14, 2023 19:04
Polyharmonic Splines
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lstagner
lstagner / Compressed Sensing.ipynb
Created February 25, 2020 00:20
Compressed Sensing in Julia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lstagner
lstagner / Runaway Electron Orbits.ipynb
Created February 4, 2020 21:51
Runaway Electron Orbits + Bremsstrahlung
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lstagner
lstagner / Callback MWE.ipynb
Last active October 18, 2018 19:30
Callback MWE
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
! Module libfida defined in file fidasim.f90
subroutine f90wrap_interpolcoeffs1d__get__i(this, f90wrap_i)
use libfida, only: interpolcoeffs1d
implicit none
type interpolcoeffs1d_ptr_type
type(interpolcoeffs1d), pointer :: p => NULL()
end type interpolcoeffs1d_ptr_type
integer, intent(in) :: this(2)
type(interpolcoeffs1d_ptr_type) :: this_ptr
@everywhere push!(LOAD_PATH, "/home/stagnerl/")
import InterpolatingFunctions; @everywhere using InterpolatingFunctions
import GuidingCenterOrbits; @everywhere using GuidingCenterOrbits
import HDF5; @everywhere using HDF5
import Clustering; @everywhere using Clustering
import Iterators; @everywhere using Iterators
import StaticArrays; @everywhere using StaticArrays
import FastKmeans; @everywhere using FastKmeans
function make_clustered_distribution_file(M,wall,nkk)
@lstagner
lstagner / read_ncdf.py
Last active May 25, 2016 22:39
Reads a NetCDF 3 file and returns a dict with its variables
#The MIT License (MIT)
#Copyright (c) 2016 Luke Stagner
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software
#and associated documentation files (the "Software"), to deal in the Software without restriction,
#including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
#and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
#subject to the following conditions:
LoadError: PyError (:PyObject_Call) <class 'AttributeError'>
AttributeError("'PathCollection' object has no attribute 'do_3d_projection'",)
File "/home/lstagner/anaconda3/lib/python3.5/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 2273, in scatter
patches = Axes.scatter(self, xs, ys, s=s, c=c, *args, **kwargs)
File "/home/lstagner/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py", line 1812, in inner
return func(ax, *args, **kwargs)
File "/home/lstagner/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py", line 3922, in scatter
self.add_collection(collection)
File "/home/lstagner/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py", line 1676, in add_collection
collection.set_clip_path(self.patch)
#=
The MIT License (MIT)
Copyright (c) 2015 Luke Stagner
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@lstagner
lstagner / ijulia_python2.log
Created June 12, 2015 20:01
IJulia python 2 error
SENDING IPython Msg [ idents pyerr ] {
header = Dict("msg_id"=>"d3543821-d811-4529-b786-ce4128bb9015","msg_type"=>"pyerr","username"=>"username","session"=>"937AFEA751D3466C8BF47EA8C7C66E2A"),
metadata = Dict{AbstractString,Any}(),
content = Dict{ASCIIString,Any}("traceback"=>UTF8String["PyError (:PyObject_Call) <type 'exceptions.AttributeError'>\nAttributeError(\"'Path' object has no attribute '_vertices'\",)\n File \"/home/lstagner/anaconda3/envs/python2/lib/python2.7/site-packages/matplotlib/backend_bases.py\", line 2158, in print_figure\n **kwargs)\n File \"/home/lstagner/anaconda3/envs/python2/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py\", line 521, in print_png\n FigureCanvasAgg.draw(self)\n File \"/home/lstagner/anaconda3/envs/python2/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py\", line 469, in draw\n self.figure.draw(self.renderer)\n File \"/home/lstagner/anaconda3/envs/python2/lib/python2.7/site-packages/matplotlib/artist.py\", line 59, in draw_