Comments (2)
Summary: desitarget.test.test_cuts function test_single_cuts is incorrectly testing that QSO target selection does not depend upon deltaChi2 nor wise_snr. Fix that.
Background: originally cuts.isQSO allowed primary and objtype (psftype) to be optional parameters as a minor convenience for template generation so that it could focus on the fluxes and not have to also pass in arrays of primary=True and objtype='PSF'. A test confirmed that the selection would work with or without them.
Current problem: Since then, cuts.isQSO gained two more optional parameters deltaChi2 and wise_snr. The tests were expanded to include those as optional, but incorrectly is testing that they don't make any difference:
qso1 = cuts.isQSO(gflux=gflux, rflux=rflux, zflux=zflux, w1flux=w1flux, w2flux=w2flux, objtype=psftype, primary=primary, deltaChi2=deltaChi2, wise_snr=wise_snr) qso2 = cuts.isQSO(gflux=gflux, rflux=rflux, zflux=zflux, w1flux=w1flux, w2flux=w2flux, objtype=None, primary=None, deltaChi2=None, wise_snr=None) self.assertTrue(np.all(qso1==qso2))
As the test the tests on deltaChi2 and wise_snr are not mandatory and as we just want to see the effect of requiring PSF type object, I would be in favor of just testing PSF (we can remove the primary object test because primary seems to be deprecated…) Therefore we just need:
qso2 = cuts.isQSO(gflux=gflux, rflux=rflux, zflux=zflux, w1flux=w1flux, w2flux=w2flux,
objtype=None, primary=primary, deltaChi2=deltaChi2, wise_snr=wise_snr)
This accidentally passes for some but not all of the test sweep files in test/t. It turns out that our tests use os.walk under the hood to grab the first sweep file it finds, and which file gets selected depends upon where the code is installed. I accidentally tripped over this yesterday when I found that the identical code installed on edison $SCRATCH failed tests while it worked when installed under $HOME... :(
Also note that cuts.isQSO uses wise_snr but cuts.isQSO_randomforest does not.
wise_snr is not used with random forest algorithm…
Christophe.
from desitarget.
The templates aren't properly using these cuts anyway since the QSO templates don't extend into the mid-IR (see desihub/desisim#152), but it seems like this issue could be resolved if we segregated the color-cuts (whether the "pure" color-cuts or those based on the Random Forest) from the other catalog-level cuts on morphology (aka deltaChi2
) and wise_snr
.
For example, the templates code could call an isQSO_colors()
function whereas isQSO()
could take the output Boolean array from isQSO_colors()
and apply any additional catalog-level cuts. Doing this refactor (@Cyeche?) and fixing the tests should then be trivial. Thoughts?
from desitarget.
Related Issues (20)
- ragged array deprecation warning with numpy 1.20.3 HOT 3
- Override ledgers don't seem to be backwards-compatible with SV3 HOT 8
- test_mtl mid-z QSO test failure (intermittent?) HOT 6
- deprecated np.int and np.float HOT 1
- code to trace TARGETIDs back to original target files
- Ensure future secondary programs can't add bright objects to the ledgers
- Never let high priority TOOs for fiber overrides HOT 1
- Coverage of sv1, sv2, sv3 has dropped dramatically HOT 13
- Add "columns" option to desitarget.io.read_mtl_in_hp HOT 1
- Clean up unit tests and photutils dependency HOT 1
- Add sanity check that archiving is correct HOT 1
- Prevent override ledgers from recording negative numbers of observations HOT 1
- geomask.match(): check for duplicates HOT 3
- Y4 Y5 MWS program selection HOT 3
- main_cmx_or_sv() may incorrectly report 'main' instead of 'special' HOT 4
- Refactor setup.py installation method
- pkg_resources is deprecated HOT 1
- Include an option to read the MTLs using "ascii.ecsv" instead of "ascii.basic" HOT 1
- remove or fix desitarget.lyazcat
- select_targets can select north (south) targets for objects with south (north) photometry HOT 1
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 desitarget.