Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41500: Update to Spectractor v3.0.2 #39

Merged
merged 8 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 32 additions & 30 deletions config/auxtel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,44 @@ DISPERSER_DIR = extractor/dispersers/
# relative path to throughput directory
THROUGHPUT_DIR = simulation/AuxTelThroughput/

[pipeline]
# method to get target centroid, choose among: guess, fit, WCS
SPECTRACTOR_FIT_TARGET_CENTROID = fit
# method to get image rotation angle: False, disperser, hessian
SPECTRACTOR_COMPUTE_ROTATION_ANGLE = disperser
# deconvolve spectrogram with simple 2D PSF analysis: False, True
SPECTRACTOR_DECONVOLUTION_PSF2D = True
# deconvolve spectrogram with full forward model: False, True
SPECTRACTOR_DECONVOLUTION_FFM = True
# value of sigma clip parameter for the spectractor deconvolution process PSF2D and FFM
SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP = 100
# maximum time per gradient descent iteration before TimeoutError in seconds
SPECTRACTOR_FIT_TIMEOUT_PER_ITER = 1200
# maximum time per gradient descent before TimeoutError in seconds
SPECTRACTOR_FIT_TIMEOUT = 7200

[instrument]
# instrument name
OBS_NAME = AUXTEL
# observatory altitude in km
OBS_ALTITUDE = 2.66299616375123
# observatory latitude
OBS_LATITUDE = -30.2446389756252
# diameter of the telescope in meter
OBS_DIAMETER = 1.20
# effective surface of the telescope in cm**2 accounting for obscuration
OBS_SURFACE = 9636
# observation epoch
OBS_EPOCH = J2000.0
# systematics on the instrument transmission
OBS_TRANSMISSION_SYSTEMATICS = 0.005
# observed object to choose between STAR, HG-AR, MONOCHROMATOR
OBS_OBJECT_TYPE = STAR
# telescope transmission file
OBS_TELESCOPE_TRANSMISSION = calexp_2020031500162-EMPTY_ronchi90lpmm-det000_auxtel_transmission.txt
# full instrument transmission file
OBS_FULL_INSTRUMENT_TRANSMISSON = calexp_2020031500162-EMPTY_ronchi90lpmm-det000_auxtel_transmission.txt
# quantum efficiency of the detector file
OBS_QUANTUM_EFFICIENCY = calexp_2020031500162-EMPTY_ronchi90lpmm-det000_auxtel_transmission.txt
OBS_FULL_INSTRUMENT_TRANSMISSON = multispectra_holo4_003_HD142331_AuxTel_throughput.txt
# systematics on the instrument transmission
OBS_TRANSMISSION_SYSTEMATICS = 0.005
# Camera (x,y) rotation angle with respect to (north-up, east-left) system
OBS_CAMERA_ROTATION = 0
# Camera (x,y) flip signs with respect to (north-up, east-left) system
OBS_CAMERA_DEC_FLIP_SIGN = 1
OBS_CAMERA_RA_FLIP_SIGN = -1
OBS_CAMERA_RA_FLIP_SIGN = 1

[CCD]
# size of the image in pixel # MFL: this number is wrong, and the CCD is not square
Expand All @@ -45,23 +57,11 @@ CCD_GAIN = 1.1
# rebinning of the image in pixel
CCD_REBIN = 2

[dispersers]
[spectrograph]
# distance between hologram and CCD in mm
DISTANCE2CCD = 175
DISTANCE2CCD = 181
# uncertainty on distance between hologram and CCD in mm
DISTANCE2CCD_ERR = 0.75
# constructor wavelength to make holograms in mm
LAMBDA_CONSTRUCTOR = 639e-6
# approximate effective number of lines per millimeter of the hologram
GROOVES_PER_MM = 150
# plate center shift on x in mm in filter frame
PLATE_CENTER_SHIFT_X = -6.
# plate center shift on x in mm in filter frame
PLATE_CENTER_SHIFT_Y = -8.
# estimate uncertainty on plate center shift on x in mm in filter frame
PLATE_CENTER_SHIFT_X_ERR = 2.
# estimate uncertainty on plate center shift on x in mm in filter frame
PLATE_CENTER_SHIFT_Y_ERR = 2.
DISTANCE2CCD_ERR = 0.4
# default value for order 2 over order 1 transmission ratio
GRATING_ORDER_2OVER1 = 0.1

Expand Down Expand Up @@ -91,10 +91,12 @@ ROT_ANGLE_MAX = 10
LAMBDA_MIN = 300
# maximum wavelength for spectrum extraction (in nm)
LAMBDA_MAX = 1100
# spectrum order to extract
SPEC_ORDER = 1

[background subtraction parameters]
# half transverse width of the signal rectangular window in pixels
PIXWIDTH_SIGNAL = 40
PIXWIDTH_SIGNAL = 20
# distance from dispersion axis to analyse the background in pixels
PIXDIST_BACKGROUND = 140
# transverse width of the background rectangular window in pixels
Expand All @@ -103,16 +105,16 @@ PIXWIDTH_BACKGROUND = 40
PIXWIDTH_BOXSIZE = 20

[PSF]
# extraction mode: PSF_1D or PSF_2D
PSF_EXTRACTION_MODE = PSF_2D
# the PSF model: Moffat or MoffatGauss
# the PSF model: Gauss, Moffat or MoffatGauss
PSF_TYPE = Moffat
# the order of the polynomials to model wavelength dependence of the PSF shape parameters
PSF_POLY_ORDER = 2
# regularisation parameter for the chisq minimisation to extract the spectrum
PSF_FIT_REG_PARAM = 1
PSF_FIT_REG_PARAM = 0.1
# step size in pixels for the first transverse PSF1D fit
PSF_PIXEL_STEP_TRANSVERSE_FIT = 50
# PSF is not evaluated outside a region larger than max(PIXWIDTH_SIGNAL, PSF_FWHM_CLIP*fwhm) pixels
PSF_FWHM_CLIP = 2

[detection line algorithm parameters]
# order of the background polynome to fit
Expand Down
21 changes: 17 additions & 4 deletions python/lsst/atmospec/processStar.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ class ProcessStarTaskConfig(pipeBase.PipelineTaskConfig,
dtype=int,
doc="Window x size to search for the target object. Ignored if targetCentroidMethod in ('exact, wcs')"
"XWINDOW internally.",
default=100,
default=150,
)
yWindow = pexConfig.Field(
dtype=int,
doc="Window y size to search for the targeted object. Ignored if targetCentroidMethod in "
"('exact, wcs')"
"YWINDOW internally.",
default=100,
default=150,
)
xWindowRotated = pexConfig.Field(
dtype=int,
Expand Down Expand Up @@ -401,6 +401,18 @@ class ProcessStarTaskConfig(pipeBase.PipelineTaskConfig,
"CALIB_SAVGOL_ORDER internally.",
default=2,
)
transmissionSystematicError = pexConfig.Field(
dtype=float,
doc="The systematic error on the instrumental transmission. OBS_TRANSMISSION_SYSTEMATICS internally",
default=0.005
)
instrumentTransmissionOverride = pexConfig.Field(
dtype=str,
doc="File to use for the full instrumental transmission. Must be located in the"
" $SPECTRACTOR_DIR/spectractor/simulation/AuxTelThroughput/ directory."
" OBS_FULL_INSTRUMENT_TRANSMISSON internally.",
default="multispectra_holo4_003_HD142331_AuxTel_throughput.txt"
)
offsetFromMainStar = pexConfig.Field(
dtype=int,
doc="Number of pixels from the main star's centroid to start extraction",
Expand Down Expand Up @@ -851,6 +863,8 @@ def run(self, *, inputExp, inputCentroid, dataIdDict):
'CALIB_BGD_WIDTH': self.config.calibBackgroundWidth,
'CALIB_SAVGOL_WINDOW': self.config.calibSavgolWindow,
'CALIB_SAVGOL_ORDER': self.config.calibSavgolOrder,
'OBS_TRANSMISSION_SYSTEMATICS': self.config.transmissionSystematicError,
'OBS_FULL_INSTRUMENT_TRANSMISSON': self.config.instrumentTransmissionOverride,

# Hard-coded parameters
'OBS_NAME': 'AUXTEL',
Expand All @@ -860,11 +874,10 @@ def run(self, *, inputExp, inputCentroid, dataIdDict):
'OBS_NAME': 'AUXTEL',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't these inherit from the auxtel.ini values? I see they're "Hard coded," but I'm curious why these are special.

'OBS_ALTITUDE': 2.66299616375123, # XXX get this from / check with utils value
'OBS_LATITUDE': -30.2446389756252, # XXX get this from / check with utils value
'OBS_DIAMETER': 1.20,
'OBS_EPOCH': "J2000.0",
'OBS_CAMERA_DEC_FLIP_SIGN': 1,
'OBS_CAMERA_RA_FLIP_SIGN': 1,
'OBS_SURFACE': np.pi * 1.2 ** 2 / 4.,
'OBS_SURFACE': 9636,
'PAPER': False,
'SAVE': False,
'DISTANCE2CCD_ERR': 0.4,
Expand Down