Discussion:
[Meep-discuss] missing LDOS global variable (beginner question)
Christoph Kleinhans
2018-10-24 19:25:42 UTC
Permalink
Dear Meep users,

I calculate in py_meep the ldos for a Gaussian Source and when I
understand the documentation correct, I simply run it like this:


def ldos_calculation():
    sim = ...    #Simulation object with Gaussian Source and Bloch
periodicity
    sim.run(mp.dft_ldos(fcen,df,nfreq),
until_after_sources=mp.stop_when_fields_decayed(50, mp.Hz, pt, 1e-6))

if __name__ == '__main__':
    ldos_calcualtion()


I get the output in the console for nfreq, but there is no global
variable dft_ldos_data which I can access.
Tried it also in different ways in the newest official release and in
the nightly build - no global variable.

Hopefully someone got time to answer me that question.
Thanks.

Best Regards
Christoph
Christopher Hogan
2018-10-24 19:33:06 UTC
Permalink
Hi Christoph,

The documentation is incorrect. The data is actually stored in the
`ldos_data` member of the `Simulation` object. See
meep/python/tests/ldos.py for an example. I'll update the docs.

Thanks for catching this,

Chris

On Wed, Oct 24, 2018 at 2:25 PM, Christoph Kleinhans <
Post by Christoph Kleinhans
Dear Meep users,
I calculate in py_meep the ldos for a Gaussian Source and when I
sim = ... #Simulation object with Gaussian Source and Bloch
periodicity
sim.run(mp.dft_ldos(fcen,df,nfreq), until_after_sources=mp.stop_when_fields_decayed(50,
mp.Hz, pt, 1e-6))
ldos_calcualtion()
I get the output in the console for nfreq, but there is no global variable
dft_ldos_data which I can access.
Tried it also in different ways in the newest official release and in the
nightly build - no global variable.
Hopefully someone got time to answer me that question.
Thanks.
Best Regards
Christoph
_______________________________________________
meep-discuss mailing list
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
Christoph Kleinhans
2018-10-24 22:50:58 UTC
Permalink
Thanks for fixing it.
Now I have the ldos_data but I can't read the associated frequencies.
They get outputted in the console but when I try to get them from my
ldos object, I get the Error:

AttributeError:
'Simulation' object has no attribute 'omega_min'
or
'Source' object has no attribute 'omega_min'

What exactly is now my ldos object which the documentation is referring to?

Best
Christoph
Post by Christopher Hogan
Hi Christoph,
The documentation is incorrect. The data is actually stored in the
`ldos_data` member of the `Simulation` object. See
meep/python/tests/ldos.py for an example. I'll update the docs.
Thanks for catching this,
Chris
On Wed, Oct 24, 2018 at 2:25 PM, Christoph Kleinhans
Dear Meep users,
I calculate in py_meep the ldos for a Gaussian Source and when I
    sim = ...    #Simulation object with Gaussian Source and Bloch
periodicity
    sim.run(mp.dft_ldos(fcen,df,nfreq),
until_after_sources=mp.stop_when_fields_decayed(50, mp.Hz, pt, 1e-6))
    ldos_calcualtion()
I get the output in the console for nfreq, but there is no global
variable dft_ldos_data which I can access.
Tried it also in different ways in the newest official release and
in the nightly build - no global variable.
Hopefully someone got time to answer me that question.
Thanks.
Best Regards
Christoph
_______________________________________________
meep-discuss mailing list
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
<http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss>
Loading...