thusser / spexxy Goto Github PK
View Code? Open in Web Editor NEWspexxy spectrum fitting framework
License: Other
spexxy spectrum fitting framework
License: Other
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])
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]
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.
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
.
Line 489 in 14a8d12
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.
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))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.