Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
%config InlineBackend.figure_format = 'retina' | |
import numpy as np | |
import pandas as pd | |
from matplotlib import pyplot as plt | |
from matplotlib import rcParams | |
from sklearn.cluster import DBSCAN | |
from astroquery.jplhorizons import Horizons | |
from astropy.table import vstack | |
# We need to do it in a separate cell. See: |
This file contains hidden or 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 datetime | |
import time | |
import pandas as pd | |
import gspread | |
from oauth2client.service_account import ServiceAccountCredentials | |
from collections import namedtuple | |
GradStudent = namedtuple("GradStudent", ["name", "passcode", "email"]) |
This file contains hidden or 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
def is_list_like(*objs, allow_sets=True, func=all): | |
''' Check if inputs are list-like | |
Parameters | |
---------- | |
*objs : object | |
Objects to check. | |
allow_sets : bool, optional. | |
If this parameter is `False`, sets will not be considered list-like. |
This file contains hidden or 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 argparse | |
import datetime | |
import tempfile | |
import time | |
from pathlib import Path | |
import astropy | |
import fitsio | |
import numpy as np |
This file contains hidden or 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 ysfitsutilpy as yfu | |
import ysphotutilpy as ypu | |
import ysvisutilpy as yvu | |
from astropy.stats import sigma_clipped_stats | |
from photutils.aperture import CircularAperture, CircularAnnulus | |
import numpy as np | |
from matplotlib import pyplot as plt | |
from matplotlib import rcParams |
This file contains hidden or 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 | |
from astropy.nddata import CCDData | |
import ccdproc | |
from astropy.io import fits | |
from trim_ccd import trim_ccd | |
try: | |
import fitsio | |
HAS_FITSIO = True | |
except ImportError: |
This file contains hidden or 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 | |
def circular_mask(shape, center=None, radius=None, center_xyz=True): | |
''' Creates an N-D circular (circular, sphereical, ...) mask. | |
Parameters | |
---------- | |
shape : tuple | |
The pythonic shape (not xyz order). | |
center : tuple, None, optional. |
This file contains hidden or 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 import units as u | |
def change_to_quantity(x, desired='', to_value=False): | |
''' Change the non-Quantity object to astropy Quantity or vice versa. | |
Parameters | |
---------- | |
x : object changable to astropy Quantity | |
The input to be changed to a Quantity. If a Quantity is given, `x` is changed to the | |
`desired`, i.e., ``x.to(desired)``. |
This file contains hidden or 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 | |
def binning(arr, factor_x=None, factor_y=None, factors=None, order_xyz=True, binfunc=np.mean, trim_end=False): | |
''' Bins the given arr frame. | |
Paramters | |
--------- | |
arr: 2d array | |
The array to be binned |
NewerOlder