Skip to content

Commit

Permalink
Merge pull request #45 from lsst/tickets/DM-40514
Browse files Browse the repository at this point in the history
DM-40514: Integrate Spectractor speedups
  • Loading branch information
mfisherlevine committed Sep 13, 2023
2 parents 9037a42 + 5795091 commit 537c14d
Show file tree
Hide file tree
Showing 34 changed files with 35,754 additions and 34,040 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ conda install -c conda-forge astrometry
and then download and move [index files](http://astrometry.net/doc/readme.html#getting-index-files) in the `$CONDA_PREFIX/data` folder.
- compile it from [sources](https://astrometrynet.readthedocs.io/en/latest/): it needs the installation of [netpbm](https://netpbm.sourceforge.net/) and [wcslib](https://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/); `solve-field` executable must in the user `$PATH` or the user has to set an environmental variable `$ASTROMETRYNET_DIR` pointing to the install directory.

For faster matrix multiplications, if available for a given computer configuration, one can install [sparse_dot_mkl](https://anaconda.org/conda-forge/sparse_dot_mkl):
```
conda install -c conda-forge sparse_dot_mkl
```

Spectractor is able to perform parameter fits using the MCMC library [emcee](https://emcee.readthedocs.io/en/stable/) (optional) with [mpi4py](https://mpi4py.readthedocs.io/en/stable/) and [h5py](https://www.h5py.org/). The latter might be better installed using `conda install ...` command to get their own dependencies (openmp and hdf5).

## Basic extraction
Expand Down
4 changes: 2 additions & 2 deletions config/auxtel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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 = False
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
Expand All @@ -34,7 +34,7 @@ OBS_OBJECT_TYPE = STAR
# telescope transmission file
OBS_TELESCOPE_TRANSMISSION = multispectra_holo4_003_HD142331_AuxTel_throughput.txt
# full instrument transmission file
OBS_FULL_INSTRUMENT_TRANSMISSON = multispectra_holo4_003_HD142331_AuxTel_throughput.txt
OBS_FULL_INSTRUMENT_TRANSMISSON = multispectra_holo4_003_multi_AuxTel_throughput.txt
# quantum efficiency of the detector file
OBS_QUANTUM_EFFICIENCY = multispectra_holo4_003_HD142331_AuxTel_throughput.txt
# Camera (x,y) rotation angle with respect to (north-up, east-left) system
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ h5py #==2.8.0
emcee #==3.0rc2
tqdm
schwimmbad
iminuit>=2
# iminuit>=2
coverage>=3.6 # <5
configparser
coveralls
Expand Down
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[nosetests]
exclude=test_(extractor_ctio_planetary_nebula|astrometry)
exclude=test_(extractor_ctio_planetary_nebula|astrometry|mcmc|multispectra)

[coverage:run]
omit=spectractor/fit/mcmc.py
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
license='BSD',
python_requires='>=3.7',
author='J. Neveu, S. Dagoret-Campagne',
author_email='jneveu@lal.in2p3.fr',
author_email='jeremy.neveu@universite-paris-saclay.fr',
description='',
long_description=long_description,
)
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__ = '2.5'
__version__ = '3.0'
__version_info__ = tuple(map(int, __version__.split('.')))
6 changes: 3 additions & 3 deletions spectractor/extractor/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def extract_spectrogram_background_fit1D(data, err, deg=1, ws=(20, 30), pixel_st
>>> s0 = ChromaticPSF(psf, Nx=100, Ny=100, saturation=1000)
>>> params = s0.generate_test_poly_params()
>>> saturation = params[-1]
>>> data = s0.evaluate(params, mode="1D")
>>> data = s0.evaluate(s0.set_pixels(mode="1D"), params)
>>> bgd = 10*np.ones_like(data)
>>> data += bgd
>>> data = np.random.poisson(data)
Expand Down Expand Up @@ -239,7 +239,7 @@ def extract_spectrogram_background_sextractor(data, err, ws=(20, 30), mask_signa
>>> s0 = ChromaticPSF(psf, Nx=100, Ny=200, saturation=1000)
>>> params = s0.generate_test_poly_params()
>>> saturation = params[-1]
>>> data = s0.evaluate(params, mode="1D")
>>> data = s0.evaluate(s0.set_pixels(mode="1D"))
>>> bgd = 10*np.ones_like(data)
>>> data += bgd
>>> data = np.random.poisson(data)
Expand Down Expand Up @@ -383,7 +383,7 @@ def extract_spectrogram_background_poly2D(data, deg=1, ws=(20, 30), pixel_step=1
>>> s0 = ChromaticPSF(psf, Nx=100, Ny=100, saturation=1000)
>>> params = s0.generate_test_poly_params()
>>> saturation = params[-1]
>>> data = s0.evaluate(params, mode="1D")
>>> data = s0.evaluate(s0.set_pixels(mode="1D"), params)
>>> bgd = 10.*np.ones_like(data)
>>> xx, yy = np.meshgrid(np.arange(s0.Nx), np.arange(s0.Ny))
>>> bgd += 1000*np.exp(-((xx-20)**2+(yy-10)**2)/(2*2))
Expand Down

0 comments on commit 537c14d

Please sign in to comment.