Skip to content

Instantly share code, notes, and snippets.

@smaret
smaret / test-mode.el
Created August 15, 2014 14:40
Polymode with Python Emacs crash
(require 'polymode)
(defcustom pm-host/test
(pm-bchunkmode "test"
:mode 'fundamental-mode)
"Test host chunkmode"
:group 'hostmodes
:type 'object)
(defcustom pm-inner/pytest
@smaret
smaret / convolve.py
Last active August 29, 2015 14:09
Convolve a FITS data cube with a Gaussian beam
#!/usr/bin/env python
# convolve - convolve a FITS cube with a gaussian beam
import sys
import os
import getopt
import gzip
from numpy import *
from astropy.convolution import convolve_fft, Gaussian2DKernel
from astropy.io import fits as pyfits
@smaret
smaret / fitscat
Last active August 29, 2015 14:16
Concatenate FITS spectra together
#!/usr/bin/env python
# fitscat -- concatenate several FITS spectra together
import sys
import os
import getopt
from astropy.io import fits as pyfits
from numpy import *
from scipy import interpolate
@smaret
smaret / gist:dc41d4ed05da4b7d0cb8
Created March 12, 2015 09:18
Download ALMA HL Tau band 6 data
wget -r --no-parent --cut-dirs=2 --no-host-directories --reject "index.html*" -N -e robots=off http://almasciencedl.eso.org/almadata/sciver/HLTauBand6
@smaret
smaret / authorea.csl
Last active August 29, 2015 14:17
Authorea style file
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
<info>
<title>Authorea</title>
<id>http://www.authorea.com</id>
<author>
<name>Sébastien Maret</name>
<email>sebastien.maret@icloud.com</email>
</author>
<category field="generic-base"/>
@smaret
smaret / vamdc_query.py
Created June 18, 2015 21:30
A attempt to make a query in the CDMS through the VAMDC interface
# vamdc_query.py -- Search for lines in the CDMS through VAMDC
import urllib2
import xml.etree.ElementTree as ET
species = "CO"
fmin = 109e9
fmax = 111e9
einstein = - 1
energy = -1
@smaret
smaret / input.ini
Created July 8, 2015 14:25
Input files
[files]
source = source.mdl
chem = osu2009.chm
# Physical paramaters
[phys]
grain_size = 0.1
grain_gas_mass_ratio = 0.0001
# Solver parameters
[solver]
ti = 1e-6
@smaret
smaret / input.ini
Created July 9, 2015 16:21
Input files for astrochem issue #42
[files]
source = source.mdl
chem = network.chm
# Initial abundances
[abundances]
H2 = 0.5
CO = 1e-6
#grain = 1.0e-12
# Output
[output]
@smaret
smaret / Ice monolayers.ipynb
Last active November 5, 2020 12:48
Compute the number of ice monolayers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smaret
smaret / astrochem_bug51.py
Last active June 30, 2016 15:14
Astrochem Python interface segfault bug
from astrochem.wrapper import *
import numpy as np
p = phys()
initial_abundances = {}
c = cell(av=20, nh=1e3, tgas=10, tdust=10)
s = solver(c, "network.chm", p , 1e-15, 1e-6, initial_abundances, 1e3, 0)