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 std / [strutils, strformat, tables, dynlib, os] | |
import noise, shell | |
import compiler/[llstream, renderer, types, magicsys, ast, | |
transf, # for code transformation (for -> while etc) | |
injectdestructors, # destructor injection | |
pathutils, # AbsoluteDir | |
modulegraphs] # getBody | |
import ./nimeval_dynlib_clean |
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 std / [strutils, strformat, tables, dynlib, os] | |
import noise, shell | |
import compiler/[llstream, renderer, types, magicsys, ast, | |
transf, # for code transformation (for -> while etc) | |
injectdestructors, # destructor injection | |
pathutils, # AbsoluteDir | |
modulegraphs] # getBody | |
import ./nimeval_dynlib |
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 noise, strutils, strformat, shell, tables, dynlib | |
proc printHelp() = echo "" | |
const procTmpl = """ | |
{.push cdecl, exportc, dynlib.} | |
$# | |
{.pop.} | |
""" | |
const exprTmpl = """ |
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 datamancer | |
import std / [math, complex] | |
const xn = 960 | |
const yn = 960 | |
const xmin = -2.0 | |
const xmax = 0.6 | |
const ymin = -1.5 | |
const ymax = 1.5 | |
const MAX_ITERS = 200 |
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
{"type":"Feature","geometry":{"type":"Point","coordinates":[18.9276,69.69,100]},"properties":{"meta":{"updated_at":"2022-12-22T14:42:02Z","units":{"air_pressure_at_sea_level":"hPa","air_temperature":"celsius","cloud_area_fraction":"%","precipitation_amount":"mm","relative_humidity":"%","wind_from_direction":"degrees","wind_speed":"m/s"}},"timeseries":[{"time":"2022-12-22T14:00:00Z","data":{"instant":{"details":{"air_pressure_at_sea_level":986.2,"air_temperature":-2.1,"cloud_area_fraction":86.7,"relative_humidity":81.6,"wind_from_direction":184.4,"wind_speed":6.1}},"next_12_hours":{"summary":{"symbol_code":"lightsnowshowers_day"}},"next_1_hours":{"summary":{"symbol_code":"lightsnow"},"details":{"precipitation_amount":0.2}},"next_6_hours":{"summary":{"symbol_code":"snow"},"details":{"precipitation_amount":2.2}}}},{"time":"2022-12-22T15:00:00Z","data":{"instant":{"details":{"air_pressure_at_sea_level":985.9,"air_temperature":-1.9,"cloud_area_fraction":84.9,"relative_humidity":80.7,"wind_from_direction":187.0,"wi |
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 ggplotnim, math | |
import arraymancer | |
const ε = 3 | |
proc φ(r: float): float = | |
result = exp(-pow((ε.float * r), 2.0)) | |
proc toMatrix(n: int, start, stop: float): Tensor[float] = | |
result = zeros[float]([n, n]) | |
let xs = linspace(start, stop, n) |
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
#[ | |
This code solves the unit conversion from system A to system B generically. | |
If natural units are involed, the remaining units (e.g. Energy in particle physics | |
natural units) are combined with the constants set to 1 that replace real units. | |
It solves the following system of linear equations which arises from: | |
`Π_i,α A_i^α = Π_i^β B_i^β` | |
where `A_i` is the i-th unit of unit system `A` and `α` the power needed to raise |
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
x | y | |
---|---|---|
702 | 376 | |
699 | 376 | |
703 | 376 | |
719 | 376 | |
723 | 376 | |
654 | 375 | |
656 | 375 | |
657 | 375 | |
660 | 375 |
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
## Super dump MC sampling over the entrance window using the Johanna's code from `raytracer2018.nim` | |
## to check the coverage of the strongback of the 2018 window | |
import ggplotnim, random, chroma | |
proc colorMe(y: float): bool = | |
const | |
stripDistWindow = 2.3 #mm | |
stripWidthWindow = 0.5 #mm | |
if abs(y) > stripDistWindow / 2.0 and | |
abs(y) < stripDistWindow / 2.0 + stripWidthWindow or | |
abs(y) > 1.5 * stripDistWindow + stripWidthWindow and |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | |
"description": "Vega-lite plot created by ggplotnim", | |
"title": "Energy loss of Muons in \\SI{3}{\\cm} Ar at CAST conditions", | |
"width": 640.0, | |
"height": 480.0, | |
"data": { | |
"values": [ | |
{ | |
"E_float": 0.01, |
NewerOlder