Exposure Time Calculator (ETC) and radial velocity precision estimator for the Near InfraRed Planet Searcher (NIRPS) spectrograph

Overview

NIRPS-ETC

Exposure Time Calculator (ETC) and radial velocity precision estimator for the Near InfraRed Planet Searcher (NIRPS) spectrograph

February 2022 - Before NIRPS on sky

Original NIRPS ETC code by Bruno L. Canto Martins 2018-2019

Additional edits by Nolan Grieves (University of Geneva) 2020-2022

Overview

  • The NIRPS ETC uses spectra from the NASA Infrared Telescope Facility (IRTF) as SEDs to get estimated flux values for different spectral types: http://irtfweb.ifa.hawaii.edu/~spex/IRTF_Spectral_Library/
  • The ETC calculates efficiency at different wavelengths using seeing, atmospheric efficiency from TAPAS (http://cds-espri.ipsl.fr/tapas/), and the measured global efficiency of the instrument
  • The signal to noise ratio (SNR) at each pixel or bin is calculated from the fiber diameter, sampling, readout noise, resolution, efficiency, and flux in the pixel or bin from the IRTF template (flux=(10.**(0.4*(Ho-H)))*flux_st)
  • RV precisions are calculated using, dRV=c/(Q*sqrt(Ne-)), equation 12 of Bouchy et al. (2001: https://ui.adsabs.harvard.edu/abs/2001A%26A...374..733B/abstract). The quality factors Q for spectra are calculated with ENIRIC from Phoenix simulated spectra or from spectral templates from the Spirou spectrograph
    • -> see: NIRPS-ETC/intermediate_preparation/update_RV_estimates/README_update_RV_estimates

Use

$ python NIRPS_ETC.py

  • change observing options within the code at the top
    • Observation Mode (HA/HE)
    • Seeing, in arcsec (range 0.7-1.2)
    • Airmass (range 1.0-2.0)
    • Object magnitude (H band)
    • Exposure time (in sec)
    • Spectral type (F0V/F5V/G0V/G5V/G8V/K0V/K3V/K7V/M0V/M1V/M2V/M3V/M4V/M5V/M6V/M7V/M8V/M9V/L1V/L2V/L3V/L4V/L5V/L6V/L8V/T2V)
    • bandpass ('CFHT' or 'Eniric') #YJH bandpasses that will affect the range of the spectra used to calculate RV precision
  • outputs mean SNR, in YJH, and each order, and RV precisisons for certain spectral types

OR use script version:

$ python NIRPS_ETC_script.py

  • change inputs for each target in a space separated text file with columns:
    • target st obs_mode seeing airmass H t_exp bandpass
  • change input and output text files within code to desired option
  • outputs to file the mean SNR, YJH SNRs, and RV precisions

Contents

  • inputs/
    • NIRPS_STAR_templates.txt
      • SEDs from IRTF (update with intermediate_preparation/update_effs/update_effs.py)
    • NIRPS_effs.txt
      • global efficiency of instrument (update with intermediate_preparation/update_effs/update_effs.py)
    • NIRPS_tapas.txt
      • atmospheric efficiency from TAPAS (update with intermediate_preparation/update_effs/update_effs.py)
    • NIRPS_wave_range.txt
      • wavelength range of echelle orders (update with intermediate_preparation/update_effs/update_effs.py)
    • phoenix_Q_conversions_CFHT-bandpass.txt
      • Q factor conversions for different resolutions in CFHT defined YJH bandpasses (update with intermediate_preparation/update_RV_estimates/phoenix_qfactor_resolution_conversion.py)
    • phoenix_Q_conversions_eniric-bandpass.txt
      • Q factor conversions for different resolutions in Eniric defined YJH bandpasses (update with intermediate_preparation/update_RV_estimates/phoenix_qfactor_resolution_conversion.py)
    • phoenix_eniric_Qfactors_CFHT-bandpass.csv
      • Q factors from Eniric in CFHT defined YJH bandpasses (update with eniric using command in intermediate_preparation/update_RV_estimates/README_update_RV_estimates)
    • phoenix_eniric_Qfactors_eniric-bandpass.csv
      • Q factors from Eniric in Eniric defined YJH bandpasses (update with eniric using command in intermediate_preparation/update_RV_estimates/README_update_RV_estimates)
    • spirou_fit_Qvalues_CFHT-bandpass.txt
      • Q factors from Spirou templates in CFHT defined YJH bandpasses (update with intermediate_preparation/update_RV_estimates/fit_spirou_qfactors.py)
    • spirou_fit_Qvalues_eniric-bandpass.txt.
      • Q factors from Spirou templates in Eniric defined YJH bandpasses (update with intermediate_preparation/update_RV_estimates/fit_spirou_qfactors.py)
  • intermediate_preparation/
    • ETC_v3.0_CantoMartins/
      • original ETC by Bruno Canto Martins
    • add_stellar_templates/
      • add and update stellar templates
    • update_RV_estimates/
      • update RV estimates and Q values
    • update_effs/
      • update efficiency files and resample wavelength grid for tapas, effs, and star_templates
  • outputs/
    • outputs SNR for each order and wavelength vs SNR plot from NIRPS_ETC.py
  • NIRPS_ETC.py
    • main ETC code for a single star
  • NIRPS_ETC_script.py
    • script that runs ETC for stars in etc_targets_input.txt and outputs to etc_targets_output.txt
  • etc_targets_input.txt
    • example input file for NIRPS_ETC_script.py
  • etc_targets_output.txt
    • example ouput file for NIRPS_ETC_script.py
  • nirps_etc_lib.py
    • definitions for fucntions in ETC code
Comments
  • Reorganize duplicate code in `NIRPS_ETC.py`and `NIRPS_ETC_script.py`

    Reorganize duplicate code in `NIRPS_ETC.py`and `NIRPS_ETC_script.py`

    There seems to be a lot of duplicate code between the two scripts. This does not affect the results, but to make the code easier to maintain, I can try to put the code common to both in a separate file in the next few weeks.

    opened by vandalt 1
  • Add gitignore

    Add gitignore

    Hi Nolan,

    Thanks for posting the ETC! This just adds a standard Python gitignore. Since the __pycache__ dir is usually ignored I removed it from the tree. I also removed outputs as this will change with every run (I added a line to create it if needed).

    opened by vandalt 1
  • Add max saturation % to summaries

    Add max saturation % to summaries

    This makes the max saturation % an output of the ETC driver function, prints it to the screen, and saves it to the summary of the NIRPS_ETC_script.py file.

    Depends on the changes in #4.

    opened by vandalt 0
  • Refactor duplicate code

    Refactor duplicate code

    This reorganizes the code so that:

    • Functions used to calculate specific quantities are all grouped in a separate file
    • The main code to run the ETC (which was in the two scripts) is in a separate "driver" file, inside a function, and called by the scripts. This fixes #2.
    • Some formatting updates (spaces around comments, equal signs, commas, line spacing, and other minor formatting changes)
    • Plots can now be saved even when running the script in a loop, but the option is off by default.

    This is mainly to make the code easier to edit and debug. The changes seemed to improve a bit execution time (but just by ~ 0.1 s). The results with the default settings seem to be the same as in the main branch.

    @ngrieves let me know if you have comments or suggestions.

    opened by vandalt 0
  • Add gitignore for Python files

    Add gitignore for Python files

    Hi Nolan,

    I saw the gitignore file was remove recently. Was it because it was ignoring the outputs directory as well? I can send another one that only ignore the Python files, to allow committing the outputs dir, but prevent pushing files/directories like __pycache__, for example.

    Another option could be to create an example directory and put example input/output files as well as an example output directory. This would keep the examples on the repo, but would not track user configs (for example if I change my local input txt file and do git add ., I probably don't want to push this file with my user configuration).

    Let me know what you think, I can send a PR with either of the two proposed changes.

    opened by vandalt 1
Owner
Nolan Grieves
Postdoctoral Research Scientist [email protected]
Nolan Grieves
Quantization library for PyTorch. Support low-precision and mixed-precision quantization, with hardware implementation through TVM.

HAWQ: Hessian AWare Quantization HAWQ is an advanced quantization library written for PyTorch. HAWQ enables low-precision and mixed-precision uniform

Zhen Dong 293 Dec 30, 2022
BitPack is a practical tool to efficiently save ultra-low precision/mixed-precision quantized models.

BitPack is a practical tool that can efficiently save quantized neural network models with mixed bitwidth.

Zhen Dong 36 Dec 2, 2022
DR-GAN: Automatic Radial Distortion Rectification Using Conditional GAN in Real-Time

DR-GAN: Automatic Radial Distortion Rectification Using Conditional GAN in Real-Time Introduction This is official implementation for DR-GAN (IEEE TCS

Kang Liao 18 Dec 23, 2022
MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research

MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research

Facebook Research 338 Dec 29, 2022
Code of Classification Saliency-Based Rule for Visible and Infrared Image Fusion

CSF Code of Classification Saliency-Based Rule for Visible and Infrared Image Fusion Tips: For testing: CUDA_VISIBLE_DEVICES=0 python main.py For trai

Han Xu 14 Oct 31, 2022
Paper Title: Heterogeneous Knowledge Distillation for Simultaneous Infrared-Visible Image Fusion and Super-Resolution

HKDnet Paper Title: "Heterogeneous Knowledge Distillation for Simultaneous Infrared-Visible Image Fusion and Super-Resolution" Email: 18186470991@163.

wasteland 11 Nov 12, 2022
AI Virtual Calculator: This is a simple virtual calculator based on Artificial intelligence.

AI Virtual Calculator: This is a simple virtual calculator that works with gestures using OpenCV. We will use our hand in the air to click on the calc

Md. Rakibul Islam 1 Jan 13, 2022
CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification (ICCV2021)

CM-NAS Official Pytorch code of paper CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification in ICCV2021. Vis

JDAI-CV 40 Nov 25, 2022
LLVIP: A Visible-infrared Paired Dataset for Low-light Vision

LLVIP: A Visible-infrared Paired Dataset for Low-light Vision Project | Arxiv | Abstract It is very challenging for various visual tasks such as image

CVSM Group -  email: czhu@bupt.edu.cn 377 Jan 7, 2023
FrankMocap: A Strong and Easy-to-use Single View 3D Hand+Body Pose Estimator

FrankMocap pursues an easy-to-use single view 3D motion capture system developed by Facebook AI Research (FAIR). FrankMocap provides state-of-the-art 3D pose estimation outputs for body, hand, and body+hands in a single system. The core objective of FrankMocap is to democratize the 3D human pose estimation technology, enabling anyone (researchers, engineers, developers, artists, and others) can easily obtain 3D motion capture outputs from videos and images.

Facebook Research 1.9k Jan 7, 2023
JumpDiff: Non-parametric estimator for Jump-diffusion processes for Python

jumpdiff jumpdiff is a python library with non-parametric Nadaraya─Watson estimators to extract the parameters of jump-diffusion processes. With jumpd

Rydin 28 Dec 10, 2022
An energy estimator for eyeriss-like DNN hardware accelerator

Energy-Estimator-for-Eyeriss-like-Architecture- An energy estimator for eyeriss-like DNN hardware accelerator This is an energy estimator for eyeriss-

HEXIN BAO 2 Mar 26, 2022
SweiNet is an uncertainty-quantifying shear wave speed (SWS) estimator for ultrasound shear wave elasticity (SWE) imaging.

SweiNet SweiNet is an uncertainty-quantifying shear wave speed (SWS) estimator for ultrasound shear wave elasticity (SWE) imaging. SweiNet takes as in

Felix Jin 3 Mar 31, 2022
Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal, multi-exposure and multi-focus image fusion.

U2Fusion Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal (VIS-IR, medical), multi

Han Xu 129 Dec 11, 2022
Outlier Exposure with Confidence Control for Out-of-Distribution Detection

OOD-detection-using-OECC This repository contains the essential code for the paper Outlier Exposure with Confidence Control for Out-of-Distribution De

Nazim Shaikh 64 Nov 2, 2022
We propose a new method for effective shadow removal by regarding it as an exposure fusion problem.

Auto-exposure fusion for single-image shadow removal We propose a new method for effective shadow removal by regarding it as an exposure fusion proble

Qing Guo 146 Dec 31, 2022
Deep Anomaly Detection with Outlier Exposure (ICLR 2019)

Outlier Exposure This repository contains the essential code for the paper Deep Anomaly Detection with Outlier Exposure (ICLR 2019). Requires Python 3

Dan Hendrycks 464 Dec 27, 2022
Python implementation of cover trees, near-drop-in replacement for scipy.spatial.kdtree

This is a Python implementation of cover trees, a data structure for finding nearest neighbors in a general metric space (e.g., a 3D box with periodic

Patrick Varilly 28 Nov 25, 2022
Near-Duplicate Video Retrieval with Deep Metric Learning

Near-Duplicate Video Retrieval with Deep Metric Learning This repository contains the Tensorflow implementation of the paper Near-Duplicate Video Retr

null 2 Jan 24, 2022