Git Product home page Git Product logo

Comments (9)

wtbarnes avatar wtbarnes commented on July 19, 2024

from chiantipy.

kdere avatar kdere commented on July 19, 2024

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.

wtbarnes avatar wtbarnes commented on July 19, 2024

@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.

 avatar commented on July 19, 2024

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.

kdere avatar kdere commented on July 19, 2024

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.

wtbarnes avatar wtbarnes commented on July 19, 2024

@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.

kdere avatar kdere commented on July 19, 2024

I just pulled the upstream master and that problem remains

from chiantipy.

wtbarnes avatar wtbarnes commented on July 19, 2024

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.

kdere avatar kdere commented on July 19, 2024

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)

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.