Skip to content

Instantly share code, notes, and snippets.

@smaret
smaret / shell.nix
Created September 25, 2025 13:46
Nix shell to build Gildas (to be placed in gildas source directory)
with import
(fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/nixos-25.05.tar.gz";
})
{ };
let
python3Env = pkgs.python3.withPackages (ps: with ps; [ numpy setuptools ]);
in
pkgs.mkShell rec {
@smaret
smaret / beam.py
Last active January 8, 2025 21:06
Compute the primary beam of the ALMA 12m telescope.
"""
Compute the primary beam of the ALMA 12m telescope.
See: https://help.almascience.org/kb/articles/how-do-i-model-the-alma-primary-beam-and-how-can-i-use-that-model-to-obtain-the-sensitivity-pr
"""
import numpy as np
from scipy.special import j1
from astropy import units as u
@smaret
smaret / documentation.yaml
Created December 23, 2024 16:34
GH workflow to build the documentation and push it to GH pages
# Build and deploy documentation on GitHub pages
name: Build and deploy documentation
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
# This files creates a development environment using the Nix package
# manager.
#
# The environment is isolated (i.e. it does not use any system
# librairies or binaries) and pinned (the version of each packages is
# fixed), which ensures reproducibility (i.e. system updates will not
# break things).
#
# Usage: run `nix-shell` in the same directory than this file.
@smaret
smaret / input.ini
Created January 28, 2022 11:20
Network with tabs with bug
# Example model for Astrochem, command-line interface version
# Input parameter file
# See the "Using Astrochem" section in the documentation manual for details.
[files]
source = source.mdl
chem = network_with_tabs.chm
# Physical parameters
[phys]
chi = 1.0
cosmic = 1.3e-17
@smaret
smaret / tcltk-Ex.Rout.fail
Created November 15, 2021 14:41
R tcltk test log
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin21.1.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
@smaret
smaret / multiple_dust_species.para
Last active December 14, 2020 11:25
Pymcfost issue #24
3.0 mcfost version
#Number of photon packages
1.28e5 nbr_photons_eq_th : T computation
1.28e3 nbr_photons_lambda : SED computation
1.28e5 nbr_photons_image : images computation
#Wavelength
50 0.1 3000.0 n_lambda, lambda_min, lambda_max [mum] Do not change this line unless you know what you are doing
T T T compute temperature?, compute sed?, use default wavelength grid for output ?
@smaret
smaret / h2o.chm
Created January 16, 2017 10:03
Astrochem issue #64
#H2O + uv-photon -> OH + H 3.28e-10 0.00e+00 1.63e+00 13 4314
H2O -> H2O(ice) 1.00e+00 1.80e+01 0.00e+00 20 6238
H2O(ice) -> H2O 0.00e+00 1.80e+01 5.70e+03 21 6239
#H2O(ice) + cosmic-ray -> H2O 4.40e-17 0.00e+00 0.00e+00 22 6240
@smaret
smaret / input.ini
Created July 11, 2016 13:27
Astrochem issue #53
[files]
source = source.mdl
chem = osu2009.chm
# Physical paramaters
[phys]
chi = 1.0
cosmic = 1e-15
# Solver parameters
[solver]
ti = 1e-6
@smaret
smaret / astrochem_bug52.py
Last active November 5, 2020 12:45
Astrochem issue #52
from astrochem.wrapper import *
import numpy as np
p = phys()
initial_abundances = {
"H2": 0.5,
"He": 0.14,
"N": 2.14e-5,
"O": 1.76e-4,
"C(+)": 7.30e-5,