desihub / desisurvey

Code for desi survey planning and implementation
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

surveyplan: use $(pwd) if $DESISURVEY isn't set #47

Closed sbailey closed 7 years ago

sbailey commented 7 years ago

When surveyplan runs, if $DESISURVEY isn't set, it defaults outputting into the installed code directory, e.g.

surveyplan --create --duration 100 --verbose --plots
INFO:utils.py:94:freeze_iers: Freezing IERS table used by astropy time, coordinates.
INFO:ephemerides.py:238:__init__: Saving ephemerides to /global/common/cori/contrib/desi/code/desisurvey/0.8.1/ephem_2019-08-28_2024-07-13.fits
INFO:schedule.py:612:initialize: Footprint contains 1154 pixels.
INFO:schedule.py:706:initialize: Starting Sep 2019 (completed 4/1781 nights)
INFO:schedule.py:706:initialize: Starting Oct 2019 (completed 34/1781 nights)
...
INFO:schedule.py:706:initialize: Starting Jul 2024 (completed 1769/1781 nights)
INFO:schedule.py:805:initialize: Plan initialization saved to /global/common/cori/contrib/desi/code/desisurvey/0.8.1/scheduler.fits
INFO:progress.py:262:save: Saved progress to /global/common/cori/contrib/desi/code/desisurvey/0.8.1/progress_2019-08-28.fits.

It is user error that I forgot to set $DESISURVEY before starting, but it seems that a better default would be to write into the pwd rather than the code installation directory (I'm surprised our NERSC installation directory permissions even allowed me to do that...).

sbailey commented 7 years ago

Correction: surveyplan will exit with an informative message if $DESISURVEY isn't set. The problem was that our modules at NERSC use the BOSS-era standard of setting an environment variable that indicates the install location of the code. For desisurvey, that is, well $DESISURVEY. So I forgot to set $DESISURVEY and inherited the default, which points to a code directory.

We should consider deprecating these environment variables. Originally they were to help code find their associated config data, but with the exception of $DESIMODEL, that is no longer used (AFAIK). But that is a non-desisurvey issue. I'll close this.