Comments (4)
These lines will modify the input wave array under certain conditions:
validate_wavelength_array()
does not need to make a copy, e.g., to strip units or convert from python to numpy array.- the filter response is zero for some of the wavelengths in the input array.
However, I am also unable to reproduce this with a MWE, so there's something I still don't understand. For moving forwards with simqso, I suggest that you use the copy() for now, until I can spend more time getting to the bottom of this.
from speclite.
Hi,
This code will consistently corrupt the wavelength array
import speclite.filters
import numpy as np
filters = speclite.filters.load_filters('gaiadr2-BP', 'gaiadr2-RP',
'gaiadr2-G')
waves = np.arange(3000, 11000, 0.11)
waves0 = waves.copy()
flux = waves * 1.
filters[0].get_ab_magnitude(flux, waves)
print(np.nonzero(waves != waves0), waves[2249], waves0[2249])
Output:
(array([ 2249, 40932]),) 3247.4999999999995 3247.3900000002864
IMO validate_wavelength_array() must make a copy even at a performance cost, because
the current behaviour is dangerous as it leads to silent corruption (i've encountered this bug while working on stdstars DESI script)
S
from speclite.
Thanks for this @segasai. I will take care of this but presumably you can copy your wavelength array in the stdstars script so this is not blocking you?
from speclite.
Yes, that's what I did for the time being.
I just was suggesting that given the danger of the bug, it may be worth putting a stopgap copy() inside validate_wavelength_array() now before coming with a proper fix, but that's just IMO.
from speclite.
Related Issues (20)
- do the filter curves really have the atmosphere included? HOT 5
- add Gaia filter response functions HOT 1
- Infrastructure updates notice from Astropy Project
- Warning from future non-tuple HOT 3
- Euclid throughputs HOT 3
- speclite v0.9 installation problems HOT 4
- Is speclite.readthedocs.io updated? HOT 7
- AB magnitudes not correctly predicted HOT 1
- MNT: Stop using ci-helpers in appveyor.yml
- speclite v0.9 pip install failure HOT 17
- Padding method not propagated for filter group HOT 3
- SDSS filters missing atmospheric transmission factor? HOT 8
- module 'astropy.utils.data' has no attribute '_find_pkg_data_path' HOT 9
- accommodating a band_shifted filter curve? HOT 2
- Latest speclite release incompatible with setuptools>=58.0.2 HOT 3
- astropy and numpy warnings
- find_pkg_data_path deprecated in Astropy 5.0 HOT 2
- Citation instructions? HOT 5
- ReadTheDocs configuration HOT 1
- Add Gaia DR3 pass-bands
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speclite.