Giter VIP home page Giter VIP logo

spexxy's People

Contributors

bischoff94 avatar thusser avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bischoff94

spexxy's Issues

Spectrum.extract_index() drops valid array

When the spectrum.valid property is not None, the information is lost when running the method. One fix would be to add the following before returning the new spectrum.

if self.valid is not None:
    spec.valid = np.copy(self.valid[i1:i2])

Resampling spectra with NANs

When resampling a spectrum that contains NANs using Spectrum.resample() and changing the number of pixels, the output will contain NANs in wavelength regions that were valid before. A possible fix would be to replace the following statement in Spectra.resample().

output.flux[start_index:start_index+len(ip)] = ip[start_index:start_index+len(ip)]

with

i_min, i_max = output.indices_of_wave_range(part.wave.min(), part.wave.max())
output.flux[i_min:i_max] = ip[i_min:i_max]

Cannot create grid.csv file

Hi, I have installed spexxy and all its dependencies, but I am having a problem with spexxytools as I can't seem to produce any grid.csv output. Testing out the program, the code seems to run (using the commands from the documentation: spexxytools grid create test_spexxy_fits, where test_spexxy_fits contains a FITS file) and produces no error, but I get no output. Is this a known problem? Apologies if I am missing something. I have tried it with several different FITS formats (the spexxy example in tests/testdata/specta/, an example from ULySS, and another from my own simulations) and get the same result for each.

I am hoping to use spexxy as a python alternative to ULySS, as a way to get stellar parameters from spectra, so any further advice on how to achieve this would be greatly appreciated.

Many thanks.

Spectrum.index_of_wave() returns None when exception should be raised

An exception should be return when either of the following conditions is fulfilled.

if wave < 0.5 * (w[1] + w[0]):
    raise spexxyValueTooLowException()
if wave >= 0.5 * (w[-1] + w[-2]):
    raise spexxyValueTooHighException()

Otherwise Spectrum.indices_of_wave_range() throws an error as it receives None.

Issue when convolving with empirical LSF

if self.crval1 > 0:

The line should be changed to if self.crval2 > 0: - Because self.crval1 refers to the sampling of the LSF at a given wavelength, which is centred on zero, this condition is probably never fulfilled. So even if the LSF changes with wavelength, only a constant LSF is used.

Spectrum.redshift() returns wrong result for log10-sampled spectra

Should expand if clause:

        if self._wave_mode == PyCrocoSpectrum.Mode.LAMBDA:
            # wavelength in AA means a multiplication
            self._wavelength = self.wave * (1. + vrad / 299792.458)
            # and non-constant step size
            self._wave_step = 0
        elif self._wave_mode == PyCrocoSpectrum.Mode.LOGLAMBDA:
            # wavelength in log domain is simpler
            self._wavelength = self.wave + math.log(1. + vrad / 299792.458)
            self._wave_start = self._wavelength[0]
        elif self._wave_mode == Spectrum.Mode.LOG10LAMBDA:
            self._wavelength = self.wave + math.log10(1. + vrad / 299792.458)
            self._wave_start = self._wavelength[0]
        else:
            raise NotImplementedError('Unsupported wave mode: {}'.format(self._wave_mode))

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.