Comments (9)
from chiantipy.
It should be possible to use a float or an array for the temperature. While improving the free-free and free-bound, this got lost along the way. I will work on getting back to that state. In the meantime, the v0.7.0 release is available. I does not have that problem but it also does not have the improved continuum calculations.
from chiantipy.
@Astroprog we've recently merged #157 which fixes the problem where scalar inputs to the continuum methods were raising an IndexError. Try pulling down and installing the latest version (git pull && python setup.py install
) and seeing if the problem still persists.
from chiantipy.
With the same input as before (with scalar parameters), it now produces a value error:
ValueError Traceback (most recent call last)
<ipython-input-2-e123736b312e> in <module>()
3 wvl = 1. + 0.002*np.arange(4501)
4 emeas = 1.e+27
----> 5 s3 = ch.spectrum(temp, dens, wvl, filter = (chfilters.gaussian,.015), doContinuum=1, em=emeas,minAbund=1.e-5,verbose=0)
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ChiantiPy-0.7.dev550-py3.6.egg/ChiantiPy/core/Spectrum.py in __init__(self, temperature, eDensity, wavelength, filter, label, elementList, ionList, minAbund, doContinuum, em, keepIons, abundance, verbose, allLines)
162 FF = ChiantiPy.core.Continuum(akey, temperature, abundance=abundance, emission_measure=em)
163 FF.calculate_free_free_emission(wavelength)
--> 164 freeFree += FF.free_free_emission
165
166 if 'fb' in self.Todo[akey]:
ValueError: non-broadcastable output operand with shape (4501,) doesn't match the broadcast shape (1,4501)
Array-valued parameters however, are still working fine for me
from chiantipy.
I am sorry, but, for now, the continuum module can only be used by itself and not with any of the spectrum routines. Edits on continuum have been made and the corresponding edits have not been made to the spectrum classes. The solution will be to make the continuum class work as before. This will probably happen slowly. Sorry for the inconvenience.
from chiantipy.
@kdere I think this is a pretty minor issue. In #160 I've just added a commit that calls squeeze()
(consistent with how the freeFree
and freeBound
arrays are created) on the free_free_emission
and free_bound_emission
attributes. This seems to fix the problem.
I've also added some additional tests for spectrum
that should help to catch these problems in the future.
from chiantipy.
I just pulled the upstream master and that problem remains
from chiantipy.
Hmm that is surprising. It worked on my end and the new spectrum tests, which test both scalar and array inputs, are passing on Travis.
from chiantipy.
The spectrum class now works with a single or a multiple temperature array. There have also been a number of other changes.
It is now necessary to specify either a elementList, ionList or a minAbund to actually do anything. Also a doLInes (=1 default) to specify whether the spectral lines are also to be calculated
from chiantipy.
Related Issues (20)
- KeyError on windows 10 HOT 5
- Error on running provided jupyter notebooks in the repo HOT 3
- line identifications in spectrum plot HOT 13
- Ability to give custom abundance files HOT 8
- Error while using spectrum with elementList only when all the ions are not present in the masterlist HOT 7
- Unexpected behavior when setting minAbund lower than lowest abund HOT 3
- Error when giving "Zn" in elementlist HOT 2
- How much memory does the mspectrum process consumes? HOT 1
- Chianti is taking more threads than specified HOT 2
- Clarify emission measure units in the function documentations. HOT 2
- Question: Support for photons/keV completed? HOT 10
- Getting spectrum from Ch.spectrum without smoothing/filtering HOT 4
- IDL and ChiantiPy gives different results. HOT 4
- Possible typo in function's documentation HOT 1
- NaNs generated when calculating spectra under certain conditions HOT 9
- Upload 0.15.1 to PyPI HOT 3
- Non-ionization equilibrium? HOT 2
- Unable to load ioneq HOT 10
- Two-photon calculation? HOT 1
- Problem with mspectrum? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chiantipy.