Skip to content

Instantly share code, notes, and snippets.

View dmentipl's full-sized avatar

Daniel Mentiplay dmentipl

View GitHub Profile
@dmentipl
dmentipl / phantom-mcfost-post-processing.rst
Last active April 28, 2025 05:09
Post-processing Phantom dump files with MCFOST
@dmentipl
dmentipl / phantom-hdf5.md
Last active July 4, 2019 02:09
Reading and writing Phantom output files in HDF5 format

Reading and writing Phantom output files in HDF5 format

From Wikipedia:

Hierarchical Data Format (HDF) is a set of file formats (HDF4, HDF5) designed to store and organize large amounts of data. Originally developed at the National Center for Supercomputing Applications, it is supported by The HDF Group, a non-profit corporation whose mission is to ensure continued development of HDF5 technologies and the continued accessibility of data stored in HDF.

HDF5 has the following nice features.

  • It is widely available.
@dmentipl
dmentipl / Fortran-issues-renaming-use.md
Last active June 28, 2019 07:24
Fortran issues with renaming subroutines when using from modules

Fortran issues with renaming subroutines when using from modules

There are issues with naming a subroutine the same as a subroutine that is used from another module but is renamed. See the code for details.

Instructions

Download all files in this gist.

@dmentipl
dmentipl / hdf5_utils.f90
Created July 2, 2019 00:49
Utilities for reading and writing HDF5 files in Fortran.
! ---------------------------------------------------------------------------- !
!
! MODULE: hdf5_utils
!
! DESCRIPTION: Utilities for reading and writing HDF5 files in Fortran.
!
! AUTHORS: Daniel Mentiplay, David Liptai, Conrad Chan
!
! YEAR: 2019
!

Phantom dump size comparison

Phantom dump size comparison between pb, ie. Price-Bate Fortran binary format, and HDF5, both with and without compression. The compression is gzip with the highest level of compression (level 9).

Gas only

Gas disc.

@dmentipl
dmentipl / ADS-BibDesk.md
Last active August 5, 2019 00:05
Installing BibDesk and ADS
@dmentipl
dmentipl / make-short-bib.sh
Created July 11, 2019 00:34
Make a shortened .bib file from citations in a tex file
#!/bin/bash
#
# Takes a .tex file and finds citations of the form:
#
# \cite{mentiplay:2018}
# \citet{mentiplay:2018}
# \citep{mentiplay:2018}
# \cite{mentiplay:2018a}
# \citet{mentiplay:2018b}
# \citep{mentiplay:2018c}
@dmentipl
dmentipl / make_bibtex_from_citations.py
Last active August 24, 2019 03:29
Make a bibtex file from citations found in a latex file using a "master" bibtex file
#!/usr/bin/env python
"""
Generate bibtex from citations in tex using a master bibtex.
It uses the following regex to find citations in the tex file:
regex = re.compile(r'\\|no|cite[a-z]*\*?{(.*?)}')
This regex matches citations like \cite{}, \citet{}, \citep{},
\citeauthor{}, \citet*{}, and so on, and returns the captured citekey.
@dmentipl
dmentipl / Makefile
Last active July 15, 2019 03:08
Phantom HDF5 at Disc-ussions workshop, Monash University, July 15, 2019
#
# Make notebook, html, slides from markdown
.PHONY:
help:
@echo "Usage:"
@echo " make <target>"
@echo
@echo " notebook Make .ipynb notebook"
@echo " html Make .html notebook"
@dmentipl
dmentipl / fix_bibdesk_file_links.py
Last active August 8, 2019 08:17
Fix BibDesk file links