This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
import multiprocessing | |
from pathlib import Path | |
import shutil | |
from typing import Union, Optional | |
from astropy.io import fits | |
import click | |
import pandas | |
from tqdm.auto import tqdm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simulate the SCExAO pupil | |
""" | |
from argparse import ArgumentParser | |
import hcipy as hp | |
import numpy as np | |
from astropy.io import fits | |
__all__ = ["generate_pupil"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Glob | |
using SAOImageDS9 | |
function quickselect(glob_str; logscale=true) | |
# parse out the directory, if any | |
directory, globstr = splitdir(glob_str) | |
filelist = collect(glob(globstr, directory)) | |
N = length(filelist) | |
@info "Selecting through $N files" | |
# connect to ds9 and set up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy.io import fits | |
from astropy.time import Time | |
from astropy.coordinates import SkyCoord, EarthLocation | |
import astropy.units as u | |
subaru_loc = EarthLocation(lat=19.825504 * u.deg, lon=-155.4760187 * u.deg) | |
def get_pa_from_header(filename): | |
with fits.open(filename) as hdul: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy.io import fits | |
import numpy as np | |
from vampires_dpp.constants import SUBARU_LOC, PUPIL_OFFSET | |
import vampires_dpp.mueller_matrices as mm | |
def mueller_matrix_miles(filename): | |
header = fits.getheader(filename) | |
bs_ord = header["U_CAMERA"] == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from reproject import reproject_interp | |
from astropy.io import fits | |
from glob import glob | |
import numpy as np | |
# get the header for the file we want to reproject to | |
hdr = fits.getheader("NEP5281_r_0_new.fits") | |
# get the filenames as a list for each filter | |
rfiles = glob("*r*_new.fits") | |
ifiles = glob("*i*_new.fits") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
import tensorflow_probability as tfp | |
tfd = tfp.distributions | |
tfk = tfp.positive_semidefinite_kernels | |
from Starfish.emulator import PCAGrid | |
class InputTransformedKernel(tfk.PositiveSemidefiniteKernel): |