Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: new SDSS V datatype loaders (#1107)
* add: sdss_v.py working on loaders * add: test.py for testing things, fix ordered method for apVisit * feat: apStar/apVisit functionality, new helper funcs new helper funcs: - _fetch_metadata to perform grab of common metadata - _fetch_flux_unit to get flux unit from the given HDU and convert it to an astropy unit object * add: astra_readers.py pulled from https://raw.githubusercontent.com/sdss/astra/298a73ce600db428cf0a2ed8a707a56c2182ae57/python/astra/tools/spectrum/readers.py * feat: BOSS specFull loaders can fully load boss files now other changes: - commented out abstract @ things to make it so ipython autoreloads notes: - flux unit where for BOSS files? - what the heck are spAll, zAll, and zList HDUs? - does the InverseVariance need a unit? * feat: mwmVisit, mwmStar loaders added mwmVisit and mwmStar loaders. updated demonstration notebook accordingly and output to PDF del: test.pdf and test.ipynb del: secret SDSS-V data * feat: specLite and other BOSS REDUX loader functionality able to now load all BOSS spec directly with the same underlying code. required refactoring methods into BOSS_spec loaders * chore: identifier + documentation * add: test_implementation.py going to now write implementation test add * feat: partial implementation of loaders mwm confirmed working still todo: - add HDU not-specified message - merge the mwm types into a single 2 loaders - confirm all other loaders work and add to __all__ * feat: functioning loaders (+refactoring & chore: docs) - refactored BOSS spec methods and mwm spec methods into single functions for simplicity - all loaders WORKING!! (except apStar multi) - all the documentation + type hinting (excluding outputs) - changed variable names to standard types used in specutils - TODO: the apStar multi-loader is confusing, so it remains unimplemented for now. - CHECK: do I need to clean the files of zero vals? - TODO: BUNIT pulls for spec and mwm files - TODO: check with data team what mwm files are needed * add: test_implementation jupyter notebook - currently non-functional because of zero values in x-axis - deleted test_implementation.ipynb for policy reasons * fix: jdaviz nan and zero flux bug - jdaviz hates nan and zero flux, so they have to be removed - TODO: open issue on jdaviz repo about nan and zero flux bug the bug originates in the x_min x_max values used for the redshift slider for line_lists (somehow) on nan and zero flux values in the Spectrum object. * feat: all multiloaders functional apStar loader not yet tested because file is of length 1 (no visits) mwm loaders will SKIP any DATASUM=0 because Spectrum1D cannot be instantiated with zero data * fix: Astropy units warning + warning format -> print * ignore: demonstration and test files * fix: jdaviz specviz 1D in 2D array handling fixes a jdaviz issue regarding a 1D flux in a 2D object, where it gets confused and explodes i will put an issue in for it this fix is different from the previous as it keeps all zero and NaN flux points * fix: header method -> .get() + other minor fixes * feat: unit tests on dummy data (excl. MWM) need someone to help me write a BinTableHDU for mwm files... * feat: unit tests with assertions still need to write mwm dummy file for the tests there's also a foobar variable check for the metadata * chore: docustrings * fix: header fetch method -> specutils standard now obtains header from PrimaryHDU in the HDUList, any data that was previously accessed through it has been removed too * del: mpl_preamble.py * feat: individual identifiers + unit tests update * fix: .gitignore list keeping .jukit incase anyone else uses vim-jukit during dev * add: bitmasks to Spectrum object outputs Spectrum1D intializer converts any 0 to valid values. I'm assuming that zeroes in the bitmask means that its valid, as per manga.py * fix: spec mask, AND_MASK -> OR_MASK fix as per @Sean-Morrison 's suggestion in astropy pull req [#1107](#1107) could be reverted in future, in which case this commit can just be deleted * fix: spec file identify OBSERVAT column OBSERVAT column not in everything so i changed it, also adding another LOGLAM check to the coadd HDU check. * fix: hdu spec -> find 1st hdu with data instead of specifying a hdu on Spectrum1D loaders for spec and mwm types, it will not find the first HDU with data, or in the case of spec, just use the coadd. this means that it works directly with jdaviz for those two datatypes correctly now. there are no user facing methods, and I don't want to break anything, but it should be noted that these datafiles can contain several spectra, which inherently limits this. in theory, I could put everything as a Spectrum1D nD flux object, but I'm pretty sure that breaks sometimes for jdaviz. * add: mwm dummy file tests + mask fixes - force masks to be boolean prior to entering initializer - add mwm file tests based on dummy file (credit to @andycasey for those dummy file generators) - add more mwm file tests for failures - added checks to see if file is empty for mwm files based on datasum (failsafe) * Fix codestyle errors --------- Co-authored-by: Ricky O'Steen <[email protected]>
- Loading branch information