Coder Social home page Coder Social logo

daniel-muthukrishna / astrodash Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 16.0 1.1 GB

Deep learning for the automated spectral classification of supernovae

Home Page: http://astrodash.readthedocs.io

License: MIT License

Python 100.00%
supernovae deep-learning deep-neural-networks tensorflow machine-learning classification transients pypi astronomy cosmology

astrodash's People

Contributors

daniel-muthukrishna avatar wkerzendorf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

astrodash's Issues

Problem with restore_model

When I attempt to run dash on some spectra, I get the following error message:
Traceback (most recent call last): File "check_type_with_dash.py", line 1, in <module> import dash File "/Users/uqdpark7/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/dash/__init__.py", line 3, in <module> from classify import Classify File "/Users/uqdpark7/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/dash/classify.py", line 7, in <module> from restore_model import LoadInputSpectra, BestTypesListSingleRedshift ImportError: No module named restore_model

Add age prior option

training three separate models trained with different age bins: 1.) less than -2 days; 2.) more than +2days; 3.) -5 to +10 days. Then, an option to allow the user to select which model to use should act like an age prior.
As requested by Mat Smith.

New Installation - Missing file?

Hi there. I'm trying to install and followed the README but have run into the following error

Traceback (most recent call last):
  File "/usr/local/Caskroom/miniconda/base/envs/astrodash/bin/astrodash", line 8, in <module>
    sys.exit(run_gui())
  File "/usr/local/Caskroom/miniconda/base/envs/astrodash/lib/python3.8/site-packages/astrodash/__init__.py", line 39, in run_gui
    form = MainApp(inputFilename=filepath)
  File "/usr/local/Caskroom/miniconda/base/envs/astrodash/lib/python3.8/site-packages/astrodash/gui_main.py", line 24, in __init__
    self.templates()
  File "/usr/local/Caskroom/miniconda/base/envs/astrodash/lib/python3.8/site-packages/astrodash/gui_main.py", line 100, in templates
    pars = get_training_parameters()
  File "/usr/local/Caskroom/miniconda/base/envs/astrodash/lib/python3.8/site-packages/astrodash/restore_model.py", line 15, in get_training_parameters
    with open(os.path.join(scriptDirectory, data_files, "models/zeroZ/training_params.pickle"), 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/Caskroom/miniconda/base/envs/astrodash/lib/python3.8/site-packages/astrodash/models_v06/models/zeroZ/training_params.pickle'

Many thanks in advance for your help,
Dillon

Wavelength Scale

  • Add a wavelength scale to the horizontal axis on the lower plot
  • Display rest wavelengths and observer wavelengths
  • Add a quit button to the GUI

Error when trying to export plot.

When using the option to save the plot (Export -> Plot -> Image file) the program crashes without saving the plots.
The error output :

Traceback (most recent call last):
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/exporters/Exporter.py", line 77, in fileSaveFinished
self.export(fileName=fileName, **self.fileDialog.opts)
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/exporters/ImageExporter.py", line 70, in export
bg = np.empty((self.params['width'], self.params['height'], 4), dtype=np.ubyte)

TypeError: 'float' object cannot be interpreted as an integer

When trying to export with the option 'Matplotlib Window' it also crashes.

Error output :


Traceback (most recent call last):
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/GraphicsScene/exportDialog.py", line 132, in exportClicked
self.currentExporter.export()
File "/home/dustspeck/miniconda3/lib/python3.7/site-packages/pyqtgraph/exporters/Matplotlib.py", line 109, in export
raise Exception("Matplotlib export currently only works with plot items")
Exception: Matplotlib export currently only works with plot items

When selecting the 'Entire scene' instead of 'Plot', saving in image format and SVG seems to work fine.

Adding own supernova and galaxy templates

Hi Daniel,

Thanks for developing such a powerful software package. In issue #16 you mention a future feature to add your own SN templates to the library. Is this feature added? If yes, Is it possible to define my own class of transients?

A related question, if I would have the spectrum/SED of the host galaxy of a particular supernova, can this be used instead of the generic galaxy templates?

Cheers,

Steve

download models_v06.zip during astrodash install

Hi,
I'm installing astrodash in a shared software installation. When running a simple test, I see there is a data file that is downloaded. Is there a suggested way to handle this during the installation process rather than waiting for the need of this file to trigger the download?

 python classify.py -h
Downloading data files from https://github.com/daniel-muthukrishna/astrodash/blob/master/astrodash/models_v06.zip?raw=true... 
This download contains the Tensorflow models trained using deep learning. 
The file to be downloaded is ~200MB. However, this is a one time download, and will only occur
the very first time that this version of DASH is installed.

Failing on two column spectrum file

Tried out this one: https://raw.githubusercontent.com/astrocatalogs/sne-external-spectra/master/CfA_SNIbc/sn1998dt/sn1998dt-19980919.flm

Which is at a redshift of 0.0153. I had installed the latest version into a fresh Python 2.7 environment via python setup.py install.

My test.py:

import dash

classification = dash.Classify(["/path/to/sn1998dt-19980919.flm"], [0.0153])
print(classification.list_best_matches(n=1))

The error:

Invalid Input File
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    print(classification.list_best_matches(n=1))
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/classify.py", line 58, in list_best_matches
    bestTypes, softmaxes = self._input_spectra_info()
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/classify.py", line 48, in _input_spectra_info
    inputImage, typeNamesList, nw, nBins = self._get_images(f, z, trainParams)
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/classify.py", line 36, in _get_images
    loadInputSpectra = LoadInputSpectra(filename, redshift, redshift, self.smooth, trainParams)
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/restore_model.py", line 43, in __init__
    self.inputImages, self.inputFilenames, self.inputRedshifts, self.typeNamesList = self.inputSpectra.redshifting()
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/input_spectra.py", line 38, in redshifting
    tempwave, tempflux, tminindex, tmaxindex = readSpectra.input_spectrum(z, self.smooth)
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/create_arrays.py", line 137, in input_spectrum
    wave, flux, minIndex, maxIndex = self.data.two_column_data(z, smooth)
  File "/Users/james/miniconda3/envs/py27/lib/python2.7/site-packages/dash/sn_processing.py", line 44, in two_column_data
    self.wave, self.flux = self.spectrum
TypeError: 'int' object is not iterable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.