Skip to content

Instantly share code, notes, and snippets.

View keflavich's full-sized avatar

Adam Ginsburg keflavich

View GitHub Profile
@keflavich
keflavich / IRSATests.ipynb
Created September 7, 2024 18:01
Tests of spectral retrieval with IRSA
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@keflavich
keflavich / JWSTCoverageMaps.ipynb
Last active October 14, 2023 21:59
Example of how to make coverage maps using pysiaf
Loading
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
Loading
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.