From ad917c048b04aae4383708859e828593610e135e Mon Sep 17 00:00:00 2001 From: arjunsavel Date: Thu, 6 Mar 2025 12:24:28 -0500 Subject: [PATCH] actually test the etc...for crires+! --- src/scope/calc_quantities.py | 4 +++- src/scope/input.txt | 8 +++++--- src/scope/input_output.py | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/scope/calc_quantities.py b/src/scope/calc_quantities.py index 7c4fb5a..ab036af 100644 --- a/src/scope/calc_quantities.py +++ b/src/scope/calc_quantities.py @@ -93,12 +93,14 @@ def calc_snr(param, args, data): data["P_rot"] * (data["phase_end"] - data["phase_start"]) * 24 * 3600 ) # in seconds exptime = duration / n_exposures - detector_reset_time + teff = data["Teff_star"] + logg = data["logg_star"] # ok this is pretty good lol if instrument == "IGRINS": snr = scrape_igrins_etc(kmag, exptime) elif instrument == "CRIRES+": - snr = scrape_crires_plus_etc(kmag, exptime) + snr = scrape_crires_plus_etc(kmag, teff, logg, exptime) else: logger.error(f"Unknown instrument {instrument}!") # need to construct a JSON object to send to the CRRIES+ SNR calculator. diff --git a/src/scope/input.txt b/src/scope/input.txt index 487a52c..da4f5fc 100644 --- a/src/scope/input.txt +++ b/src/scope/input.txt @@ -10,11 +10,11 @@ #·······································: Created: 2024-08-15 Author: Arjun Savel! -Planet name: WASP-76 b +Planet name: WASP-166 b # Simulation setup -modelname wasp_166_150seed_ld # name of the model. used for saving the output files. +modelname wasp166_test # name of the model. used for saving the output files. seed 150 # seed for the random number generator when generating noisy data. set to None for a random seed. log_level DEBUG # logging level above which statements are printed. Supported levels are ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR``, and ``CRITICAL``. @@ -33,6 +33,8 @@ b DATABASE # impact parameter of the planet's orbi Rstar DATABASE # stellar radius, in solar radii. [DB] Mstar DATABASE # stellar mass, in solar masses. [DB] Kmag DATABASE # K-band magnitude of the star. [DB] +Teff_star DATABASE # effective temperature of the star, in K. [DB] +logg_star DATABASE # surface gravity of the star, in cm/s^2. [DB] kp 128.1 # expected planetary orbital velocity assuming circular orbit, in km/s. input NULL if you'd like to calculate from orbital parameters. v_sys 0.0 # systemic velocity, in km/s. [DB] v_rot NULL # equatorial rotational velocity. input NULL if you'd like to calculate from orbital parameters. @@ -48,7 +50,7 @@ lambda_misalign 0 # misalignment angle of the planet's or inc 90.0 # inclination of the planet's orbit with respect to the line of sight, in degrees. only matters if include_rm is set to True. and observation is set to transmission. # Instrument Parameters -instrument IGRINS # name of the spectrograph to simulate. currently spectrographs are ``IGRINS`` and ``CRIRES+``. +instrument CRIRES+ # name of the spectrograph to simulate. currently spectrographs are ``IGRINS`` and ``CRIRES+``. blaze True # whether to include a blaze function or not. wav_error False # whether to include wavelength solution errors or not. order_dep_throughput True # whether to include order-dependent throughput variations. diff --git a/src/scope/input_output.py b/src/scope/input_output.py index 3f2d2f5..244a5cb 100644 --- a/src/scope/input_output.py +++ b/src/scope/input_output.py @@ -43,6 +43,8 @@ def __init__(self, message="scope input file error:"): "v_rot_star": "st_vsin", "b": "pl_imppar", "Kmag": "sy_kmag", + "Teff_star": "st_teff", + "logg_star": "st_logg", } @@ -215,6 +217,8 @@ def parse_input_file( "Mp", "peri", "Kmag", + "Teff_star", + "logg_star", ] # Convert values to appropriate types