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

Background subtraction fails on science frames #60

Open
gmbrandt opened this issue Mar 17, 2021 · 0 comments
Open

Background subtraction fails on science frames #60

gmbrandt opened this issue Mar 17, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gmbrandt
Copy link
Collaborator

We turned background subtraction off for all frames in PR #53 because it fails on science and traces. Some issue to do with negative fluxes.

As of PR #53, background subtraciton is only on for stacked lampflats.

Stack trace:

2021-03-17 14:25:14.453 INFO: stages: Running banzai.stages.TraceRefiner | {"filename": "lscnrs01-fa09-20190709-lampflat-bin1x1-110.fits", "site": "lsc", "instrument": "nres01", "epoch": "20190709", "request_num": "1854702", "obstype": "LAMPFLAT", "filter": null, "processName": "MainProcess"} 2021-03-17 14:25:14.807 INFO: traces: Fitting a polynomial to order 1 | {"filename": "lscnrs01-fa09-20190709-lampflat-bin1x1-110.fits", "site": "lsc", "instrument": "nres01", "epoch": "20190709", "request_num": "1854702", "obstype": "LAMPFLAT", "filter": null, "processName": "MainProcess"} 2021-03-17 14:25:14.819 ERROR: stages: ['Traceback (most recent call last):\n', ' File "/home/mjohnson/.conda/envs/condaforbanzai/lib/python3.8/site-packages/banzai/stages.py", line 47, in run\n processed_image = self.do_stage(image_set)\n', ' File "/home/mjohnson/Documents/astro/nres/banzai-nres-own/banzai-nres/banzai_nres/traces.py", line 109, in do_stage\n refine_traces(image, weights=image.data,\n', ' File "/home/mjohnson/Documents/astro/nres/banzai-nres-own/banzai-nres/banzai_nres/traces.py", line 51, in refine_traces\n best_fit = fit_polynomial(y_center, y_center_errors, mask=y_center_errors == 0, x=x_center, order=5)\n', ' File "/home/mjohnson/Documents/astro/nres/banzai-nres-own/banzai-nres/banzai_nres/fitting.py", line 25, in fit_polynomial\n best_fit = fitter(model, x_to_fit, y_to_fit, weights=weights)\n', ' File "/home/mjohnson/.conda/envs/condaforbanzai/lib/python3.8/site-packages/astropy/modeling/fitting.py", line 263, in wrapper\n return func(self, model, x, y, z=z, **kwargs)\n', ' File "/home/mjohnson/.conda/envs/condaforbanzai/lib/python3.8/site-packages/astropy/modeling/fitting.py", line 582, in __call__\n x = self._map_domain_window(model_copy, x)\n', ' File "/home/mjohnson/.conda/envs/condaforbanzai/lib/python3.8/site-packages/astropy/modeling/fitting.py", line 467, in _map_domain_window\n model.domain = [x.min(), x.max()]\n', ' File "/home/mjohnson/.conda/envs/condaforbanzai/lib/python3.8/site-packages/numpy/core/_methods.py", line 34, in _amin\n return umr_minimum(a, axis, None, out, keepdims, initial, where)\n', 'ValueError: zero-size array to reduction operation minimum which has no identity\n'] | {"processName": "MainProcess"}

@gmbrandt gmbrandt added the bug Something isn't working label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants