Skip to content

Instantly share code, notes, and snippets.

View keflavich's full-sized avatar

Adam Ginsburg keflavich

View GitHub Profile
@keflavich
keflavich / JWSTCoverageMaps.ipynb
Last active October 14, 2023 21:59
Example of how to make coverage maps using pysiaf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@keflavich
keflavich / download_almaimf_from_dataverse.py
Last active May 17, 2023 14:58
download ALMA-IMF data using dataverse API
import requests, os
# put your secret API key here:
api_key = <dataverse_API_key>
dataverse_server='https://dataverse.harvard.edu'
dataset_id = 6565108
persisentId = 'doi:10.7910/DVN/CJ3YXU'
url_list = f'{dataverse_server}/api/datasets/{dataset_id}/versions/:draft/files?key={api_key}'
@keflavich
keflavich / paper2arxiv.py
Last active April 19, 2023 21:13
paper2arxiv
from __future__ import print_function
import pdb
import re,os,time
import argparse
import shutil
from six import string_types as basestring
from os.path import join
from astropy import log
log.setLevel('DEBUG')
@keflavich
keflavich / pdfa.sh
Created February 4, 2023 22:26
PDFA creation
# one-liner to convert PDF to PDFA using ghostscript to meet NSF PAR requirements
gs -dPDFA -dNOOUTERSAVE -dBATCH -dNOPAUSE -sProcessColorModel=DeviceRGB -dUseCIEColor -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -sOutputFile=${fn/.pdf/_PDFA.pdf} $fn
# loop to do that to all files in a directory
for fn in *.pdf; do if [[ $fn != *pdfa* ]]; then if [ ! -f ${fn/.pdf/_PDFA.pdf} ]; then echo $fn; gs -dPDFA -dNOOUTERSAVE -dBATCH -dNOPAUSE -sProcessColorModel=DeviceRGB -dUseCIEColor -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -sOutputFile=${fn/.pdf/_PDFA.pdf} $fn; fi; fi; done
@keflavich
keflavich / IceModelingNotebook.ipynb
Created January 4, 2023 20:01
My first attempt at ice modeling
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@keflavich
keflavich / alma_finder_chart.py
Created March 19, 2022 18:56
Old code to make an ALMA finder chart
"""
Utilities for making finder charts and overlay images for ALMA proposing
"""
import string
import os
import numpy as np
from astropy import wcs
from astroquery import log
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from astropy import units as u
from astropy.convolution import Gaussian1DKernel, Gaussian2DKernel
import os
import glob
from spectral_cube import SpectralCube
for fn in [
"G001_13CO21_SEDIGISM_DR1c.fits",