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

major refactor of select_mock_targets #264

Merged
merged 120 commits into from
Feb 27, 2018
Merged

major refactor of select_mock_targets #264

merged 120 commits into from
Feb 27, 2018

Conversation

moustakas
Copy link
Member

This PR (which would close #261) includes a near-total rewrite of select_mock_targets (which really just calls mock.build.targets_truth) and introduces target-specific classes (in mock.mockmaker) which make it much easier, transparent, and extendable to connect mock catalogs to spectra. There are still a variety of outstanding issues (see below), but I'd like to get the current (functional) code merged nowish and go from there.

I have tried to demonstrate some of the core functionality in this notebook, which I'm hopeful will be used by various Working Groups to build smaller spectroscopic datasets. Suggestions for additional tutorials or demonstrations of capabilities are welcome.

I tested this at NERSC with a single healpixel (using the fix-densities branch of desitarget):

salloc -N 1 -C haswell -t 00:60:00 --qos interactive -L SCRATCH,project
source /project/projectdirs/desi/software/desi_environment.sh master
package=desitarget
module unload $package
export PATH=/global/cscratch1/sd/ioannis/repos/$package/bin:${PATH}
export PYTHONPATH=/global/cscratch1/sd/ioannis/repos/$package/py:${PYTHONPATH}

then

cd /global/cscratch1/sd/ioannis/refactor
time select_mock_targets -c refactor.yaml --verbose --seed 123 \
  --healpixels 6507 --nside 32 --overwrite --nproc 32
join_mock_targets --mockdir . --force
run_target_qa ./targets.fits /project/projectdirs/cosmo/www/temp/ioannis/refactor \
  --nside 64 --mocks

which took about 7 minutes, with QA output here:
http://portal.nersc.gov/project/cosmo/temp/ioannis/refactor

Major improvements include:

  • Incorporated a new (but still simplistic) target density fluctuations model (new density fluctuations model #254).
  • Full utilization of healpixel organization; only reference to bricks is when generating the imaging-like targets catalog.
  • Significantly better speed and memory usage. I don't have numbers handy but this should be noticeably faster and scale much better to, e.g., the 2% footprint.
  • Better documentation. streamlined functionality.

In addition:

Known issues / problems / shortcomings:

Additional missing features:

@moustakas
Copy link
Member Author

This is nearly ready to merge, although I have not yet tested at NERSC. On my laptop (with 4 cores) generating roughly 23k targets (of all types) in a single nside=32 healpixel took 14m42s, or roughly 65s/deg^2/cpu.

@moustakas
Copy link
Member Author

OK, I think all conflicts have been fixed -- thanks for the off-list help, @geordie666!

@sbailey once your tests have completed (and hopefully Travis tests pass and the documentation builds successfully!) please feel free to merge, otherwise post any crashes or bugs here or off-list.

Copy link
Contributor

@sbailey sbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, verily, let us be done with this PR and merge it (and face the consequences of our rash deeds)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants