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

Update to new specsim v0.3 API #80

Closed
dkirkby opened this issue Feb 14, 2016 · 5 comments
Closed

Update to new specsim v0.3 API #80

dkirkby opened this issue Feb 14, 2016 · 5 comments
Assignees

Comments

@dkirkby
Copy link
Member

dkirkby commented Feb 14, 2016

I am in the middle of some substantial changes to specsim that move all of the hardcoded desimodel dependencies into a yaml configuration file, with some unavoidable API changes. These changes lay the groundwork for simulating other instruments (eBOSS, for example) and also running Travis tests without desimodel.

This issue is to update desisim's usage of specsim when v0.3 is released with the new API. I believe that the only affected code is bin/quickgen and bin/quickbrick. A version requirement specsim >= 0.3 will also need to be imposed, but I'm not sure how to do that (it looks like specsim is not mentioned at all in the current requirements.txt).

@dkirkby
Copy link
Member Author

dkirkby commented Feb 17, 2016

I am using the output generated by the following command, with specsim v0.2 installed, as my baseline for working on this issue:

quickbrick -b original --objtype qso -n 10 -o . -s 123

Note that DESI_BASIS_TEMPLATES and DESISIM must be set appropriately. This generates some warnings which I will ignore:

INFO:io.py:457:read_basis_templates: Reading /Data/DESI/basis_templates/v1.1/qso_templates_v1.1.fits
/Users/david/Cosmo/DESI/code/desisim/py/desisim/filterfunc.py:68: RuntimeWarning: invalid value encountered in double_scalars
  flux /= np.trapz(self.interp(wave1)*wave1,wave1)

@moustakas
Copy link
Member

This is the old filter code complaining (since the desisim branch I've been developing which uses speclite.filters) has not yet been merged. However, this code is also producing non-catastrophic warnings which I've decided to not yet suppress while we're still vetting & testing these ~major changes.

@dkirkby
Copy link
Member Author

dkirkby commented Feb 17, 2016

Using branch speclite_api and the specsim release candidate (with the new API) I now get identical contents for HDUs 0-4 in all three brick files using:

quickbrick -b updated --objtype qso -n 10 -o . -s 123

There are now some new warnings from astropy (via specsim) but these are a separate issue (deishub/desimodel#4):

WARNING: UnitsWarning: The unit 'Angstrom' has been deprecated in the FITS standard. Suggested: 10**-1 nm. [astropy.units.format.utils]
WARNING: UnitsWarning: 'Angstrom/row' did not parse as fits unit: At col 9, Unit 'row' not supported by the FITS standard.  [astropy.units.core]
INFO:io.py:457:read_basis_templates: Reading /Data/DESI/basis_templates/v1.1/qso_templates_v1.1.fits
/Users/david/Cosmo/DESI/code/desisim/py/desisim/filterfunc.py:68: RuntimeWarning: invalid value encountered in double_scalars
  flux /= np.trapz(self.interp(wave1)*wave1,wave1)

I am declaring success with quickbrick and moving on to quickgen now.

@dkirkby
Copy link
Member Author

dkirkby commented Feb 17, 2016

I am using the output generated by the following command, with specsim v0.2 installed, as my baseline for updating quickgen:

export PRODNAME=original
export DESI_SPECTRO_REDUX=redux
quickgen --simspec simspec-00000002.fits --fibermap fibermap-00000002.fits --nspec 7

The simspec and fibermap files are taken from #57. Note that DESI_BASIS_TEMPLATES, DESISIM and DESI_SPECTRO_REDUX must be set appropriately. The output is:

Reading fibermap file fibermap-00000002.fits
Now Reading the input file simspec-00000002.fits
Wavelength range: 3533.0 to 9912.99999999
Simulating spectra 0 to 7
************************************************
Initializing SpecSim
Simulating spectrum 6,  object type=STAR
writing files for channel: b , spectrograph: 0 , spectra: 0 to 7
writing files for channel: r , spectrograph: 0 , spectra: 0 to 7
writing files for channel: z , spectrograph: 0 , spectra: 0 to 7
Wrote files to redux/prodname/exposures/20151201/00000002

@dkirkby
Copy link
Member Author

dkirkby commented Feb 18, 2016

Using branch speclite_api and the specsim release candidate I now get identical results for HDUs 0-4 in the frame-[b,r,z]0-00000002.fits files using:

export PRODNAME=updated
quickgen --simspec simspec-00000002.fits --fibermap fibermap-00000002.fits --nspec 7

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

No branches or pull requests

2 participants