Function make_data
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
def make_data(
scale,
wlgrid,
wl_model,
Fp_conv,
Function write_input_file
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
def write_input_file(data, output_file_path="input.txt"):
categories = {
"Filepaths": [
Function add_tellurics_atran
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def add_tellurics_atran(
wl_cube_model, flux_cube_model, n_order, n_exp, vary_airmass=False
):
if vary_airmass:
Function parse_arguments
has 39 lines of code (exceeds 25 allowed). Consider refactoring.
def parse_arguments():
parser = argparse.ArgumentParser(description="Simulate observation")
parser.add_argument(
Function doppler_shift_planet_star
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
def doppler_shift_planet_star(
model_flux_cube,
n_exposure,
phases,
rv_planet,
Function add_quadratic_noise
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
def add_quadratic_noise(flux_cube_model, wl_grid, SNR, IGRINS=False, **kwargs):
"""
Currently assumes that there are two bands: A and B.
Inputs
Function get_rot_ker
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
def get_rot_ker(
v_sin_i: Union[float, np.ndarray, jnp.ndarray],
wavelengths: Union[np.ndarray, jnp.ndarray, list],
observation: str = "emission",
) -> jnp.ndarray:
Function add_tellurics
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def add_tellurics(
wl_cube_model,
flux_cube_model,
n_order,
n_exp,
Function make_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
def make_data(
scale,
wlgrid,
wl_model,
Fp_conv,
Function detrend_cube
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def detrend_cube(cube, n_order, n_exp, blaze=False):
"""
Detrends the cube by dividing each order by its maximum value.
Inputs
Avoid deeply nested control flow statements.
if isinstance(value, bool):
value = str(value)
elif isinstance(value, float):
if np.isnan(value):
value = "NULL"
Function scrape_igrins_etc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def scrape_igrins_etc(kmag, exposure_time):
"""
pings the IGRINS exposure time calculator.
Parameters
Function unpack_lines
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def unpack_lines(content):
"""
Unpack lines from a file, removing comments and joining lines that are split.
Parameters
Function simulate_observation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def simulate_observation(
planet_spectrum_path=".",
star_spectrum_path=".",
data_cube_path=".",
phase_start=0,