-
Notifications
You must be signed in to change notification settings - Fork 3
/
traits.jl
65 lines (45 loc) · 2.35 KB
/
traits.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
Traits for the HARPS spectrograph.
https://www.eso.org/sci/facilities/lasilla/instruments/harps.html
Author: Alex Wise and collaborators
Created: April 2021
"""
""" Delegates loading of code specifying types essential to the package. """
import RvSpectMLBase: min_order, max_order, min_pixel_in_order, max_pixel_in_order, min_pixel, max_pixel
min_order(::HARPS2D) = 1
max_order(::HARPS2D) = 72
min_pixel_in_order(inst::HARPS2D) = 1
max_pixel_in_order(inst::HARPS2D) = 4096
min_pixel(::HARPS1D) = 1
max_pixel(::HARPS1D) = 300000 # TODO: Update once know size of HARPS's 1d extracted spectra
import RvSpectMLBase: bad_col_ranges
function bad_col_ranges(inst::HARPS2D, ord::Int)
[0:0]#placeholder function to be updated if/when we decide certain pixels should be excluded from analysis
end
import RvSpectMLBase: orders_to_use_default, min_col_default, max_col_default
orders_to_use_default(::HARPS2D) = 1:72 # avoid last order due to oxygen tellurics, first 7 due to poor SNR
min_col_default(::HARPS2D, ord::Integer) = 300 # Avoid where continuum normalization effected by edges/scattered light
max_col_default(::HARPS2D, ord::Integer) = 3800 # Avoid where continuum normalization effected by edges/scattered light
import RvSpectMLBase: get_pixel_range
function get_pixel_range(inst::HARPS2D, ord::Integer)
minc = max(min_col_default(inst, ord))
maxc = min(max_col_default(inst, ord))
return minc:maxc
end
import RvSpectMLBase: metadata_symbols_default, metadata_strings_default
# HARPS headers
metadata_symbols_default(::AnyHARPS) = Symbol[:bjd, :target, :exptime, :airmass, :ssb_rv_kmps, :wfile]
metadata_strings_default(::AnyHARPS) = String["MJD-OBS", "OBJECT", "EXPTIME", "AIRMASS", "ESO DRS BERV", "ESO DRS CAL TH FILE"]
import RvSpectMLBase: default_ccf_mask_v_width
default_ccf_mask_v_width(::AnyHARPS) = 820.0 #approx one HARPS pixel
import RvSpectMLBase: get_inst_module
get_inst_module(::AnyHARPS) = HARPS
#not sure what this does right now
import RvSpectMLBase: get_λ_range
function get_λ_range(data::CLT) where { T1<:Real, T2<:Real, T3<:Real, A1<:AbstractArray{T1,2}, A2<:AbstractArray{T2,2}, A3<:AbstractArray{T3,2},
IT<:AnyHARPS, CLT<:Spectra2DBasic{T1,T2,T3,A1,A2,A3,IT} }
(λmin, λmax) = NaNMath.extrema(data.λ)
return (min=λmin, max=λmax)
end
default_λmin = 3800.0
default_λmax = 6900.0