Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
11430a0
Merge pull request #142 from LSSTDESC/v3.0.3
jeremyneveu Dec 19, 2023
3d0558e
Merge pull request #147 from LSSTDESC/v3.0.3
jeremyneveu Dec 20, 2023
c85d82f
typo
jeremyneveu Dec 23, 2023
89e01c6
add flat and star_field attributes
jeremyneveu Jan 23, 2024
0974e3d
rename stat_errors and stat_errors_rotated attributes in err and err_…
jeremyneveu Jan 23, 2024
e107961
rename spectrogram in spectrogram_data
jeremyneveu Jan 23, 2024
54bccd8
rename spectrogram in spectrogram_data
jeremyneveu Jan 23, 2024
7fd2301
remove right_edge option
jeremyneveu Jan 23, 2024
de7b913
initialize spectrogram starfield and flat
jeremyneveu Jan 23, 2024
8157815
initialize spectrogram starfield and flat
jeremyneveu Jan 23, 2024
2837c60
cleaning
jeremyneveu Jan 23, 2024
c297b34
cleaning
jeremyneveu Jan 23, 2024
a41a3a5
robust ndof optimal estimate
jeremyneveu Jan 24, 2024
cda87ed
add Astar
jeremyneveu Jan 24, 2024
871783c
deflat before estimate background and before fit chromatic psf
jeremyneveu Jan 24, 2024
6cf4eb6
increase min bounds for Moffat gamma parameter from 0.1 to 0.5 pixel
jeremyneveu Jan 24, 2024
7189b32
debug saving of parameters after FFM
jeremyneveu Jan 24, 2024
cb4042f
debug saving of parameters after FFM
jeremyneveu Jan 24, 2024
b24458f
implement flat and star field in ffm simulate
jeremyneveu Jan 24, 2024
3bef660
add mock flat full of ones for CTIO
jeremyneveu Jan 24, 2024
9456f10
add flat to image simulation
jeremyneveu Jan 25, 2024
185afc0
add flat to full chain
jeremyneveu Jan 25, 2024
ef1b2a7
cleaning
jeremyneveu Jan 25, 2024
827fa4d
move Astar parameter position after B
jeremyneveu Jan 25, 2024
7dc7191
remove B from SpectrogramModel and SpectrumModel: these classes compu…
jeremyneveu Jan 25, 2024
161792f
add flat and starfield fits in fit_spectrogram
jeremyneveu Jan 25, 2024
eba2234
debug save and load of flats and star fields
jeremyneveu Jan 25, 2024
5676a68
cleaning and comments
jeremyneveu Jan 26, 2024
90ef963
remove starfield before 1D and 2D extractions
jeremyneveu Jan 26, 2024
67d261d
better starfield simulation: amplitude and ref position is set by mai…
jeremyneveu Jan 26, 2024
f543de2
include flat and starfield in test_fullchain
jeremyneveu Jan 28, 2024
ea07482
merge with master v3.0.3
jeremyneveu Jan 28, 2024
e9bf965
repair make starfield
jeremyneveu Jan 28, 2024
1e69134
repair make starfield
jeremyneveu Jan 28, 2024
ea5019b
repiar test
jeremyneveu Jan 28, 2024
71f25cb
introduce SPECTRACTOR_SIMULATE_STARFIELD parameter; introduce Image.s…
jeremyneveu Jan 29, 2024
2817a1d
cleaning
jeremyneveu Jan 29, 2024
e5a7b99
repair full chain test
jeremyneveu Jan 29, 2024
f6dde98
if flat exists, flatten the image for the plot
jeremyneveu Feb 14, 2024
9f46399
correct log message
jeremyneveu Feb 14, 2024
ef4485b
typo in SPECTRACTOR_ATMOSPHERE_SIM
jeremyneveu Feb 14, 2024
fcd058a
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Feb 14, 2024
81fa189
auxtel gain is 1.3
jeremyneveu Feb 16, 2024
9a21aff
new __repr__ for FitParameters
jeremyneveu Feb 16, 2024
b74926c
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Feb 16, 2024
2fe685c
debug rebinning of flat flield
jeremyneveu Feb 19, 2024
5d80062
add mask in Image class and spectractor extraction
jeremyneveu Feb 19, 2024
dcb9d52
plot mask in debug plot
jeremyneveu Feb 19, 2024
3652a21
crop spectrogram mask
jeremyneveu Feb 19, 2024
6f85ee1
debug plot
jeremyneveu Feb 19, 2024
08b4267
rebin mask
jeremyneveu Feb 19, 2024
19e1f98
don't save None spectrogram mask
jeremyneveu Feb 19, 2024
08a6f6b
debug rebinning of mask
jeremyneveu Feb 19, 2024
e5d30b4
debug saving of None spectrogram_mask
jeremyneveu Feb 19, 2024
e93e7e0
debug saving of None spectrogram_mask
jeremyneveu Feb 19, 2024
fdbb5f7
debug saving of None spectrogram_mask
jeremyneveu Feb 19, 2024
afcbd9b
better printing of parameters
jeremyneveu Feb 20, 2024
56adb25
debug background box
jeremyneveu Feb 20, 2024
c5005c4
don't crop spectrogram_data if already cropped
jeremyneveu Feb 22, 2024
c17a971
fix Yc params for order 2 and 3 but Yc0; mask spectrogram region fit …
jeremyneveu Feb 23, 2024
31e960b
mask spectrogram region fit edges when not the maximum number of shee…
jeremyneveu Feb 23, 2024
29f738c
mask spectrogram region fit edges when not the maximum number of shee…
jeremyneveu Feb 23, 2024
ebc2a5f
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Feb 23, 2024
9a1e1e6
image simulation adapted for auxtel
jeremyneveu Feb 23, 2024
2b62bbe
load_auxtel adapted for data and simulations
jeremyneveu Feb 23, 2024
20a4b59
change REBIN key into CCD_REBIN key
jeremyneveu Feb 23, 2024
9a6e861
imshow with no interpolation for better plot analysis
jeremyneveu Feb 23, 2024
9d3b201
cleaning
jeremyneveu Feb 23, 2024
34773e7
auxtel full chain simulation
jeremyneveu Feb 23, 2024
539e601
auxtel full chain simulation
jeremyneveu Feb 23, 2024
44e85cf
argh with ratio files
jeremyneveu Feb 23, 2024
fbb3354
merge
jeremyneveu Feb 23, 2024
3fbc609
ratio files with extrapolation from hologram transmission fit
jeremyneveu Feb 23, 2024
3acb808
rename more explicitely get_boundaries into set_rectangular_boundarie…
jeremyneveu Mar 6, 2024
3acf878
change arguments of get_sparse_indices to use boundaries (faster and …
jeremyneveu Mar 6, 2024
3c187b8
image simulation using non squares images and rebinned spectra
jeremyneveu Mar 6, 2024
9c8faf0
enlarge the next diffraction order footprints to fit inside main orde…
jeremyneveu Mar 7, 2024
f1bafc8
possibility to choose between different parametrisation: legendre or …
jeremyneveu Mar 7, 2024
f5caf63
possibility to choose between different parametrisation: legendre or …
jeremyneveu Mar 7, 2024
bd2ee6b
possibility to choose between different parametrisation: legendre or …
jeremyneveu Mar 7, 2024
f69284e
possibility to choose between different parametrisation: legendre or …
jeremyneveu Mar 7, 2024
4368bd9
extrapolate ratios for holo4_003 in UV with hologram transmission model
jeremyneveu Mar 7, 2024
11d95a3
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Mar 7, 2024
7b1363b
enlarge boundaries for next diffraction order footprints, free shift_…
jeremyneveu Mar 7, 2024
e70f5e1
set_bounds adapted to polynomial parametrisation
jeremyneveu Mar 8, 2024
9600215
set_bounds adapted to polynomial parametrisation
jeremyneveu Mar 8, 2024
98ce0fc
cancel A3
jeremyneveu Mar 8, 2024
97d10e6
fix only y_c_0_1 and y_c_1_1
jeremyneveu Mar 8, 2024
542175c
more robust way to save LBDAS_T and AMPLI_T
jeremyneveu Mar 8, 2024
2730108
fix shift_y and angle but fit all y_c parameters (works better for fi…
jeremyneveu Mar 8, 2024
8c8e4a7
allow for negative y_c values with bounds
jeremyneveu Mar 8, 2024
fb6573c
initialize bounds for chromaticpsf1d
jeremyneveu Mar 8, 2024
afec03f
rescale abscissa x for polynoms event when they are canonical (better…
jeremyneveu Mar 14, 2024
5bda1fb
fix wavelength evolution for PSF parameters of higher order diffracti…
jeremyneveu Mar 14, 2024
0b14777
reorder paramaters to have all fixed psf parameters together
jeremyneveu Mar 14, 2024
d926400
fit shift_x
jeremyneveu Mar 14, 2024
56de744
fit A1, angle and shift_y first to prepare the fit
jeremyneveu Mar 14, 2024
8ffb1d0
change unit of reso parameter in labels (nm)
jeremyneveu Mar 14, 2024
d0f987b
more robust way to set weight of outliers to zero
jeremyneveu Mar 14, 2024
b8423ea
restrict bounds for moffat parameters alpha=(1.1,10) and gamma > 1 pixel
jeremyneveu Mar 14, 2024
c1459e9
fit temporarily A1 to help finding the trace of the spectrogram with …
jeremyneveu Mar 14, 2024
27d1e51
set very high uncertainties below 380nm and above 1000nm to ease the …
jeremyneveu Mar 14, 2024
9aa2545
SDSS g filter
jeremyneveu Mar 14, 2024
ff1bd72
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Mar 14, 2024
99becf5
debug position of B, Astar
jeremyneveu Mar 14, 2024
43b1a7f
sketch of auxtel full chain test
jeremyneveu Mar 14, 2024
956d835
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Mar 14, 2024
138e880
keep tentative to set bounds for polynomial parameters
jeremyneveu Mar 15, 2024
f89d3a2
for CTIO PSF_POLY_ORDER=2
jeremyneveu Mar 15, 2024
5d4de72
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into v3.1.0
jeremyneveu Mar 15, 2024
9ebe370
PSF_POLY_ORDER=2
jeremyneveu Apr 9, 2024
e0a7051
repair runAstrometry.py
jeremyneveu Apr 9, 2024
8d1f441
output_filename as argument of ImageSim
jeremyneveu Apr 9, 2024
58cce5a
stardice load image with detrend and load WCS if there
jeremyneveu Apr 9, 2024
e4e0f63
add stardice full chain test
jeremyneveu Apr 9, 2024
185fdce
red circle for target position in plot_image_simple
jeremyneveu Apr 9, 2024
9da2cec
TODO: add good pressure temp and humiduty values if available in header
jeremyneveu Apr 9, 2024
3ee9a7a
merge with v3.1.0
jeremyneveu Apr 9, 2024
e9de2e0
merge with v3.1.0
jeremyneveu Apr 9, 2024
42ee3ac
add good pressure temp and humidity values if available in header
jeremyneveu Apr 10, 2024
6e62664
Add hd111980_stis_006.fits to test cache.
erykoff Apr 15, 2024
9786564
Fix scipy.signal.windows.gaussian import
erykoff Apr 15, 2024
e662836
Fix deprecation warning for use_gaussian_derivatives.
erykoff Apr 15, 2024
5c67ca4
Merge pull request #150 from erykoff/u/erykoff/test006
jeremyneveu Apr 15, 2024
624f189
pin pytest version <8.1
jeremyneveu Apr 15, 2024
8d72713
pin version of pytest<8.1
jeremyneveu Apr 15, 2024
cea30f1
pin version pytest=8.0.0
jeremyneveu Apr 15, 2024
07d9510
Merge pull request #152 from LSSTDESC/151-coverage-from-pytest-is-broken
jeremyneveu Apr 15, 2024
06c7cfc
Merge branch 'master' of https://github.com/LSSTDESC/Spectractor into…
jeremyneveu Apr 15, 2024
be71913
psf_fit_reg_param = 1
jeremyneveu Apr 15, 2024
efa12f7
SPECTRACTOR_SIMULATE_STARFIELD = False
jeremyneveu Apr 15, 2024
5c5f03d
plot spectrum at the end of psf1d
jeremyneveu Apr 15, 2024
4621f97
save trials to improve stardice reduction months after I have written…
jeremyneveu Aug 7, 2024
7231206
default pst poly type to polynomial
jeremyneveu Aug 8, 2024
43870ac
repair fit_spectrum.plot_fit concerning outliers
jeremyneveu Aug 8, 2024
8df4e4b
include model err for outlier sigma clipping
jeremyneveu Aug 8, 2024
030f024
use integrate.simpson instead of simps (deprecated)
jeremyneveu Aug 8, 2024
8095a97
Merge branch 'v3.1.0' of https://github.com/LSSTDESC/Spectractor into…
jeremyneveu Aug 8, 2024
844f599
use integrate.simpson instead of simps (deprecated)
jeremyneveu Aug 8, 2024
10d1bd9
use integrate.simpson instead of simps (deprecated)
jeremyneveu Aug 8, 2024
ed5f3b1
Merge branch 'v3.1.0' into adr
jeremyneveu Aug 8, 2024
f4ad171
add DoubleMoffat PSF model
jeremyneveu Aug 8, 2024
ebcf9a0
Merge pull request #155 from LSSTDESC/adr
jeremyneveu Aug 8, 2024
326f747
add DoubleMoffat PSF model
jeremyneveu Aug 8, 2024
dd199ae
add DoubleMoffat PSF model
jeremyneveu Aug 8, 2024
fe1a5ed
typos
jeremyneveu Aug 14, 2024
643db63
debug set_mask() to not accumulate masked pixels iteration after iter…
jeremyneveu Aug 14, 2024
b5bacb6
reshape spectrogram_fit and speectrogram_residuals as 2D array
jeremyneveu Aug 14, 2024
df0dbfa
remove some unseen cosmics with FFM residuals
jeremyneveu Aug 14, 2024
889e31e
add mask_cosmics function
jeremyneveu Aug 23, 2024
eb5ebcb
for doublemoffat class change eta upper bound to 1
jeremyneveu Aug 23, 2024
e2ce07a
at the end transverse_fit_profile function outliers are detected usin…
jeremyneveu Aug 23, 2024
f3226e6
use ratio 2/1 for holo4_003 where a hologram transmission model is fi…
jeremyneveu Aug 23, 2024
3f533f1
Free pressure parameter for ADR; y_c parameters fixed; only zeroth or…
jeremyneveu Aug 23, 2024
4eeabcb
Free pressure for ADR only (not for Rayleigh), free angle and shiftds…
jeremyneveu Aug 23, 2024
c7c6079
fix A1, higher upper bound for VAOD
jeremyneveu Aug 23, 2024
1a65d73
new auxtel transmission using latest ratio 2/1 (BG40 data rescaled by…
jeremyneveu Aug 23, 2024
fc7e20c
new auxtel transmission using latest ratio 2/1 (BG40 data rescaled by…
jeremyneveu Aug 23, 2024
81a0b82
merge mask_cosmics
jeremyneveu Aug 23, 2024
5570042
loosen test on A2 for fit_spectrum
jeremyneveu Aug 23, 2024
d1558d8
repair tests on A2 for fit_spectrum
jeremyneveu Aug 23, 2024
bdda67d
repair extraction CTIO test with rebin=1
jeremyneveu Aug 23, 2024
7bb9af6
debug
jeremyneveu Aug 23, 2024
37fc9b3
adapt to pytest>=8.3 suite
jeremyneveu Aug 23, 2024
a72f6e5
cosmetics
jeremyneveu Aug 23, 2024
e21056e
repair test_atmosphere test
jeremyneveu Aug 26, 2024
c0fd560
Merge pull request #157 from LSSTDESC/156-switch-nose-to-pytest
jeremyneveu Aug 26, 2024
5322c06
merge with master
jeremyneveu Aug 26, 2024
a1658c4
Merge branch 'v3.1.0' of github.com:LSSTDESC/Spectractor into stardic…
jeremyneveu Aug 27, 2024
085700d
include masked data in get_bad_indices; better use of self.mask; rese…
jeremyneveu Sep 5, 2024
a61ef53
use scipy.simpsons
jeremyneveu Sep 5, 2024
ce2e7af
add mask in fit_transverse_PSF1D_profile
jeremyneveu Sep 5, 2024
7341b46
add mask in fit_transverse_PSF1D_profile
jeremyneveu Sep 5, 2024
ff7ff7d
adapt gaia catalogs to masked array
jeremyneveu Sep 5, 2024
9ac2a28
test masking of star fields for extraction
jeremyneveu Sep 5, 2024
3698c59
merge
jeremyneveu Sep 5, 2024
b2df62c
new config for g191b2b extraction
jeremyneveu Feb 19, 2025
58be1b7
repaired astrometry
jeremyneveu Feb 19, 2025
4ee8aae
deal with inner==0 case
jeremyneveu Feb 19, 2025
830797f
exclude_percentile=80 for sextractor background when multiple sources…
jeremyneveu Feb 19, 2025
d404959
cleaning
jeremyneveu Feb 19, 2025
1e385ad
add hgamma and hdelta to calibrte
jeremyneveu Feb 19, 2025
56e1678
debug rotation
jeremyneveu Feb 24, 2025
3d97167
set ymax excluding empty columns at the right edge of the spectrogram
jeremyneveu Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Might be quicker to install rubin-env plus any necessary additions.
shell: bash -l {0}
run: |
mamba install -y "numpy>1.15" scipy "matplotlib>3.1" pandas llvmlite numba "astropy>=3.2" "photutils>=1.7" astroquery coloredlogs scikit-image>=0.20 h5py emcee tqdm mpi4py schwimmbad "iminuit>=2" "coverage>=3.6" configparser coveralls deprecated pyyaml pytest pytest-cov rubin-libradtran "getCalspec>=2.0.0"
mamba install -y "numpy>1.15" scipy "matplotlib>3.1" pandas llvmlite numba "astropy>=3.2" "photutils>=1.7" astroquery coloredlogs scikit-image>=0.20 h5py emcee tqdm mpi4py schwimmbad "iminuit>=2" "coverage>=3.6" configparser coveralls deprecated pyyaml "pytest==8.0.0" pytest-cov rubin-libradtran "getCalspec>=2.0.0"
# python -c "from getCalspec.rebuild import rebuild_tables; rebuild_tables()"
pip install lsst.utils
pip install git+https://github.com/LSSTDESC/getObsAtmo.git@main
Expand Down
8 changes: 5 additions & 3 deletions config/auxtel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ SPECTRACTOR_FIT_TIMEOUT_PER_ITER = 1200
# maximum time per gradient descent before TimeoutError in seconds
SPECTRACTOR_FIT_TIMEOUT = 7200
# library to compute atmospheric transmission: none, libradtran, getobsatmo
SPECTRACTOR_ATMOSPHERE_SIM = getobstamo
SPECTRACTOR_ATMOSPHERE_SIM = getobsatmo
# simulate star field with Gaia catalog: False, True
SPECTRACTOR_SIMULATE_STARFIELD = False

[instrument]
# instrument name
Expand Down Expand Up @@ -55,7 +57,7 @@ CCD_PIXEL2ARCSEC = 0.0952
# approximate maximum ADU output of the CCD
CCD_MAXADU = 170000
# electronic gain : elec/ADU
CCD_GAIN = 1.1
CCD_GAIN = 1.3
# rebinning of the image in pixel
CCD_REBIN = 2

Expand Down Expand Up @@ -107,7 +109,7 @@ PIXWIDTH_BACKGROUND = 40
PIXWIDTH_BOXSIZE = 20

[PSF]
# the PSF model: Gauss, Moffat or MoffatGauss
# the PSF model: Gauss, Moffat, DoubleMoffat or MoffatGauss
PSF_TYPE = Moffat
# the order of the polynomials to model wavelength dependence of the PSF shape parameters
PSF_POLY_ORDER = 2
Expand Down
6 changes: 4 additions & 2 deletions config/ctio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ SPECTRACTOR_DECONVOLUTION_PSF2D = True
SPECTRACTOR_DECONVOLUTION_FFM = True
# library to compute atmospheric transmission: none, libradtran, getobsatmo
SPECTRACTOR_ATMOSPHERE_SIM = none
# simulate star field with Gaia catalog: False, True
SPECTRACTOR_SIMULATE_STARFIELD = True

[instrument]
# instrument name
Expand Down Expand Up @@ -99,10 +101,10 @@ PIXWIDTH_BACKGROUND = 100
PIXWIDTH_BOXSIZE = 40

[PSF]
# the PSF model: Gauss, Moffat or MoffatGauss
# the PSF model: Gauss, Moffat, DoubleMoffat, or MoffatGauss
PSF_TYPE = Moffat
# the order of the polynomials to model wavelength dependence of the PSF shape parameters
PSF_POLY_ORDER = 4
PSF_POLY_ORDER = 2
# regularisation parameter for the chisq minimisation to extract the spectrum
PSF_FIT_REG_PARAM = 0.04
# step size in pixels for the first transverse PSF1D fit
Expand Down
6 changes: 5 additions & 1 deletion config/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ SPECTRACTOR_FIT_TIMEOUT_PER_ITER = 600
SPECTRACTOR_FIT_TIMEOUT = 3600
# library to compute atmospheric transmission: none, libradtran, getobsatmo
SPECTRACTOR_ATMOSPHERE_SIM = none
# simulate star field with Gaia catalog: False, True
SPECTRACTOR_SIMULATE_STARFIELD = False

[instrument]
# instrument name
Expand Down Expand Up @@ -113,12 +115,14 @@ PIXWIDTH_BACKGROUND = 40
PIXWIDTH_BOXSIZE = 20

[PSF]
# the PSF model: Gauss, Moffat or MoffatGauss
# the PSF model: Gauss, Moffat, DoubleMoffat 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 = 0.01
# polynomial type: must be polynomial or legendre
PSF_POLY_TYPE = polynomial

[detection line algorithm parameters]
# order of the background polynome to fit
Expand Down
24 changes: 13 additions & 11 deletions config/stardice.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ THROUGHPUT_DIR = simulation/StarDiceThroughput/

[pipeline]
# method to get target centroid, choose among: guess, fit, WCS
SPECTRACTOR_FIT_TARGET_CENTROID = WCS
SPECTRACTOR_FIT_TARGET_CENTROID = fit
# method to get image rotation angle: False, disperser, hessian
SPECTRACTOR_COMPUTE_ROTATION_ANGLE = disperser
# parameter to prevent from background subtraction
Expand All @@ -19,6 +19,8 @@ SPECTRACTOR_DECONVOLUTION_FFM = True
SPECTRACTOR_DECONVOLUTION_SIGMA_CLIP = 100
# library to compute atmospheric transmission: none, libradtran, getobsatmo
SPECTRACTOR_ATMOSPHERE_SIM = getobsatmo
# simulate star field with Gaia catalog: False, True
SPECTRACTOR_SIMULATE_STARFIELD = False

[instrument]
# instrument name
Expand Down Expand Up @@ -59,9 +61,9 @@ CCD_REBIN = 1

[spectrograph]
# distance between hologram and CCD in mm
DISTANCE2CCD = 33.3
DISTANCE2CCD = 33.5
# uncertainty on distance between hologram and CCD in mm
DISTANCE2CCD_ERR = 0.1
DISTANCE2CCD_ERR = 0.06
# default value for order 2 over order 1 transmission ratio
GRATING_ORDER_2OVER1 = 0.1

Expand All @@ -75,7 +77,7 @@ XWINDOW_ROT = 30
# window y size to search for the targeted object
YWINDOW_ROT = 30
# prior on the reliability of the centroid estimate in pixels
PIXSHIFT_PRIOR = 0.5
PIXSHIFT_PRIOR = 0.2

[rotation parameters]
# must be set to true, otherwise create residuals and correlated noise
Expand All @@ -96,21 +98,21 @@ SPEC_ORDER = 1

[background subtraction parameters]
# half transverse width of the signal rectangular window in pixels
PIXWIDTH_SIGNAL = 10
PIXWIDTH_SIGNAL = 30
# distance from dispersion axis to analyse the background in pixels
PIXDIST_BACKGROUND = 20
PIXDIST_BACKGROUND = 30
# transverse width of the background rectangular window in pixels
PIXWIDTH_BACKGROUND = 80
# box size for sextractor evaluation of the background
PIXWIDTH_BOXSIZE = 40
PIXWIDTH_BOXSIZE = 80

[PSF]
# 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 = 4
PSF_POLY_ORDER = 2
# regularisation parameter for the chisq minimisation to extract the spectrum
PSF_FIT_REG_PARAM = 0.1
PSF_FIT_REG_PARAM = 1
# step size in pixels for the first transverse PSF1D fit
PSF_PIXEL_STEP_TRANSVERSE_FIT = 1
# PSF is not evaluated outside a region larger than max(PIXWIDTH_SIGNAL, PSF_FWHM_CLIP*fwhm) pixels
Expand All @@ -120,9 +122,9 @@ PSF_FWHM_CLIP = 2
# order of the background polynome to fit
CALIB_BGD_ORDER = 3
# half range to look for local extrema in pixels around tabulated line values
CALIB_PEAK_WIDTH = 7
CALIB_PEAK_WIDTH = 3
# size of the peak sides to use to fit spectrum base line
CALIB_BGD_WIDTH = 15
CALIB_BGD_WIDTH = 5
# window size for the savgol filter in pixels
CALIB_SAVGOL_WINDOW = 5
# polynom order for the savgol filter
Expand Down
6 changes: 3 additions & 3 deletions runAstrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from spectractor.astrometry import Astrometry
from spectractor.logbook import LogBook
from spectractor.config import load_config, apply_rebinning_to_parameters
from spectractor.extractor.images import Image


if __name__ == "__main__":
Expand Down Expand Up @@ -50,7 +51,6 @@

logbook = LogBook(logbook=args.logbook)
for file_name in file_names:
disperser_label = args.disperser_label
if parameters.OBS_NAME == "CTIO":
tag = file_name.split('/')[-1]
tag = tag.replace('sim_', 'reduc_')
Expand All @@ -66,8 +66,8 @@
ypos = float(ypos)
guess = [xpos, ypos]
target_label = args.target_label
a = Astrometry(file_name, target_label=target_label, disperser_label=disperser_label,
output_directory=args.output_directory)
image = Image(file_name, config=args.config)
a = Astrometry(image, output_directory=args.output_directory)
extent = ((int(max(0, xpos - radius)), int(min(xpos + radius, parameters.CCD_IMSIZE))),
(int(max(0, ypos - radius)), int(min(ypos + radius, parameters.CCD_IMSIZE))))
gaia_min_residuals = a.run_full_astrometry(extent=extent, maxiter=int(args.maxiter))
Expand Down
2 changes: 1 addition & 1 deletion runImageSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
continue

image = ImageSim(file_name, spectrum_file_name, args.output_directory, A2=1,
psf_poly_params=psf_poly_params, with_stars=False)
psf_poly_params=psf_poly_params, with_starfield=False)
2 changes: 1 addition & 1 deletion runSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
atmgrid = AtmosphereGrid(file_name)
image = ImageSim(file_name, spectrum_file_name, args.output_directory, A1=1, A2=1,
pwv=5, ozone=300, aerosols=0.03,
psf_poly_params=None, with_stars=True)
psf_poly_params=None, with_starfield=True)
sim_file_name = args.output_directory + tag.replace('reduc_', 'sim_')
Spectractor(sim_file_name, args.output_directory, target, [xpos, ypos], disperser_label, args.config)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool:pytest]
exclude=test_(extractor_ctio_planetary_nebula|astrometry|mcmc|multispectra)
addopts = --ignore=tests/test_astrometry.py --ignore=tests/test_mcmc.py --ignore=tests/test_extractor_ctio_planetary_nebula.py

[coverage:run]
omit=spectractor/fit/mcmc.py
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
version=current_version,
packages=['spectractor', 'spectractor.extractor', 'spectractor.simulation', 'spectractor.fit'],
install_requires=reqs,
test_suite='nose.collector',
tests_require=['nose'],
package_dir={'spectractor': './spectractor'},
package_data={'spectractor': ['../config/*.ini'],
'spectractor.extractor': ['dispersers/HoloPhAg/*.txt', 'dispersers/HoloPhP/*.txt',
Expand Down
2 changes: 1 addition & 1 deletion spectractor/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = '3.0.3'
__version__ = '3.1.0'
__version_info__ = tuple(map(int, __version__.split('.')))
2 changes: 1 addition & 1 deletion spectractor/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def __init__(self, image, wcs_file_name="", gaia_file_name="", output_directory=
self.gaia_radec_positions_after_pm = None
if os.path.isfile(self.gaia_file_name):
self.my_logger.info(f"\n\tLoad Gaia catalog from {self.gaia_file_name}.")
self.gaia_catalog = ascii.read(self.gaia_file_name, format="ecsv")
self.gaia_catalog = Table(ascii.read(self.gaia_file_name, format="ecsv"), masked=True)
self.gaia_radec_positions_after_pm = get_gaia_coords_after_proper_motion(self.gaia_catalog, self.image.date_obs)
self.sources = None
self.sources_radec_positions = None
Expand Down
4 changes: 4 additions & 0 deletions spectractor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def load_config(config_filename, rebin=True):
if parameters.PIXWIDTH_BOXSIZE > parameters.PIXWIDTH_BACKGROUND:
raise ValueError(f'parameters.PIXWIDTH_BOXSIZE must be smaller than parameters.PIXWIDTH_BACKGROUND (or equal).')

# check consistency
if parameters.PSF_POLY_TYPE not in ["polynomial", "legendre"]:
raise ValueError(f'parameters.PSF_POLY_TYPE must be either "polynomial" or "legendre". Got {parameters.PSF_POLY_TYPE=}')

# check presence of atmospheric simulation packages
if parameters.SPECTRACTOR_ATMOSPHERE_SIM.lower() not in ["none", "libradtran", "getobsatmo"]:
raise ValueError(f'parameters.SPECTRACTOR_ATMOSPHERE_SIM must be either ["none", "libradtran", "getobsatmo"]. '
Expand Down
6 changes: 3 additions & 3 deletions spectractor/extractor/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def make_source_mask(data, nsigma, npixels, mask=None, sigclip_sigma=3.0,

Parameters
----------
data : 2D `~numpy.ndarray`
data : np.ndarray
The 2D array of the image.
nsigma : float
The number of standard deviations per pixel above the ``background``
Expand Down Expand Up @@ -236,7 +236,7 @@ def extract_spectrogram_background_sextractor(data, err, ws=(20, 30), mask_signa
>>> from spectractor import parameters
>>> parameters.DEBUG = True
>>> psf = MoffatGauss()
>>> s0 = ChromaticPSF(psf, Nx=100, Ny=200, saturation=1000)
>>> s0 = ChromaticPSF(psf, Nx=100, Ny=300, saturation=1000)
>>> params = s0.generate_test_poly_params()
>>> saturation = params[-1]
>>> data = s0.evaluate(s0.set_pixels(mode="1D"), poly_params=params)
Expand Down Expand Up @@ -275,7 +275,7 @@ def extract_spectrogram_background_sextractor(data, err, ws=(20, 30), mask_signa
bkg = Background2D(data, (parameters.PIXWIDTH_BOXSIZE, parameters.PIXWIDTH_BOXSIZE),
filter_size=(filter_size, filter_size),
sigma_clip=sigma_clip, bkg_estimator=bkg_estimator,
mask=mask)
mask=mask, exclude_percentile=80)
# reset at zero the edges
bkg.background[data == 0] = 0
bgd_model_func_interp = RegularGridInterpolator((np.arange(Nx), np.arange(Ny)), bkg.background.T, method='linear',
Expand Down
Loading
Loading