tomlouden / spiderman Goto Github PK
View Code? Open in Web Editor NEWA fast code to simulate secondary transits and phase curves
License: MIT License
A fast code to simulate secondary transits and phase curves
License: MIT License
Using LMFIT to fit sine waves to Spitzer data, I can usually fit the model to 60k data points in ~15 seconds with leastsq
as the method, and ~200 seconds with powell
as the method.
With SPIDERMAN, using leastsq
, it takes 650 seconds. I am still processing it with powell
, but the point is that it's not even close to done yet.
Do you have any suggestions to speed up the fitting process? Do we have to create a new Parameters every single time (I tried not doing that). Is there a 'fast' version with less options?
Thank you
Presently, Spiderman doesn't allow users to import brightness maps on a healpix grid which would be a super useful feature (likely requiring healpy as a dependency). As of right now I need to convert my healpix grids to spherical harmonics which loses a lot of information, and then spiderman converts those to the concentric-circle grid. If spiderman calculates the latitude-longitude grid somewhere, one could just do an interpolation between the nearest healpy coordinates. spiderman.format_grid()
currently does not accept healpix grids as they are not rectangular in latitude-longitude
I would be very grateful if you could help me fix this error.
Thank You
Mohammad
I just tried to install SPIDERMAN from the GitHub version, but get the following error. Is this a python version issue?
sudo python setup.py install
Password:
/opt/anaconda3/lib/python3.9/site-packages/setuptools/dist.py:772: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
writing spiderman_package.egg-info/PKG-INFO
Traceback (most recent call last):
File "/Users/jteske/Documents/GitHub/SPIDERMAN/setup.py", line 9, in
setup( name='spiderman-package',
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 177, in setup
return run_commands(dist)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 193, in run_commands
dist.run_commands()
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
super().run_command(command)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py", line 74, in run
self.do_egg_install()
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py", line 123, in do_egg_install
self.run_command('bdist_egg')
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
super().run_command(command)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 156, in run
self.run_command("egg_info")
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
super().run_command(command)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 301, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 665, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 1136, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 198, in write_pkg_file
write_field('License', rfc822_escape(license))
File "/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/util.py", line 518, in rfc822_escape
lines = header.split('\n')
AttributeError: 'list' object has no attribute 'split'
Hi there,
I ran into a problem when going through the Quickstart example in the documentation. When it came to this line,
lc = spider_params.lightcurve(t)
I receive this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python3.5/site-packages/spiderman_package-1.0.0-py3.5-macosx-10.6-x86_64.egg/spiderman/params.py", line 356, in lightcurve
return sp.lightcurve(t,self,**kwargs)
File "//anaconda/lib/python3.5/site-packages/spiderman_package-1.0.0-py3.5-macosx-10.6-x86_64.egg/spiderman/web.py", line 95, in lightcurve
star_grid = sp.stellar_grid.gen_grid(spider_params.l1,spider_params.l2,logg=logg,response=spider_params.filter, stellar_model = spider_params.stellar_model)
AttributeError: 'ModelParams' object has no attribute 'stellar_model'
When importing spiderman I also received this note, which might be of relevence?:
looking for spidermanrc file at ~/.spidermanrc
no spidermanrc file detected
Help would be appreciated, thanks!
With Python 3.5.2 and matplotlib version 2.2.2, I get an error saying that there is no ax.set_axis_bgcolor function. Apparently this has been deprecated since matplotlib 2.0 (https://matplotlib.org/2.1.2/api/_as_gen/matplotlib.axes.Axes.set_axis_bgcolor.html). As a result, all instances of "set_axis_bgcolor" should be changed to "set_facecolor" throughout the script plot.py
Might it be useful to have a short tutorial on retrieving parameters from an observed phase curve using something like emcee? If so, happy to make a relevant PR.
Thanks for a great package!
Hi there!
I'm experiencing a problem trying to import SPIDERMAN
. After a successful installation and following the Quickstart example, I immediately run in to trouble trying to import spiderman:
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import spiderman
looking for spidermanrc file at /home/nicholas/.spidermanrc
no spidermanrc file detected
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-be33eac7d0a5> in <module>
----> 1 import spiderman
/usr/local/lib/python3.8/dist-packages/spiderman_package-1.0.3-py3.8-linux-x86_64.egg/spiderman/__init__.py in <module>
21 rcParams = RcParams()
22
---> 23 from spiderman.params import *
24 from spiderman.web import *
25 from spiderman.plot import *
/usr/local/lib/python3.8/dist-packages/spiderman_package-1.0.3-py3.8-linux-x86_64.egg/spiderman/params.py in <module>
2 import spiderman as sp
3 import spiderman._web as _web
----> 4 import spiderman.plot as splt
5 import matplotlib.pyplot as plt
6 from scipy.optimize import minimize
/usr/local/lib/python3.8/dist-packages/spiderman_package-1.0.3-py3.8-linux-x86_64.egg/spiderman/plot.py in <module>
4 import numpy as np
5 import matplotlib.pyplot as plt
----> 6 from matplotlib._png import read_png
7 from matplotlib.offsetbox import TextArea, DrawingArea, OffsetImage, \
8 AnnotationBbox
ModuleNotFoundError: No module named 'matplotlib._png'
Hence, two problems seems so arise
Regarding the first issue, I tried to install SPIDERMAN
both with pip and directly from github, but unfortunately with the same outcome. As an extra note I have functional BATMAN
installation under Python 3.8.10.
Thanks for your help!
Nicholas
I have installed and can successfully import the module. But I get error on the first next line: spider_params = sp.ModelParams(brightness_model="zhang").
Hi Tom, Laura,
I noticed that the condition to calculate temperature for the Zhang & Showman model in the brigthness_maps.c file does not seem to account for negative xi values. This relates to line 224 and the condition :
if(xi < 0.01)
Their model allows for hotspot offsets eastward as well as wesward, so xi can be negative. I think that replacing the condition by
if(fabs(xi) < 0.01)
should do the trick.
Let me know what you think.
Vincent
I work with the Zhang model.
Can i add reflection term with
Ref = ARef*(1.0+np.cos(2.np.pi(time/p)+np.pi))
to the zhang model to reach amplitude of reflection and albedo?
Thank you
I am fitting a Spitzer phase curve with the SPIDERMAN model, but at every iteration of the LMFIT, the routine outputs this:
no stellar models provided, using blackbody approximation
How do I supply it with a stellar model? Or, how do I suppress this warning?
Thank you
Hi again,
I'm attempting to provide spiderman with a bandpass filter - but when I set spider_params.filter = 'filter.txt'
and attempt to run, I get this traceback:
Traceback (most recent call last):
File "spiderman_test.py", line 37, in <module>
lc = spider_params.lightcurve(t)
File "//anaconda/lib/python3.5/site-packages/spiderman/params.py", line 357, in lightcurve
return sp.lightcurve(t,self,**kwargs)
File "//anaconda/lib/python3.5/site-packages/spiderman/web.py", line 95, in lightcurve
star_grid = sp.stellar_grid.gen_grid(spider_params.l1,spider_params.l2,logg=logg,response=spider_params.filter, stellar_model = spider_params.stellar_model)
File "//anaconda/lib/python3.5/site-packages/spiderman/stellar_grid.py", line 56, in gen_grid
totals += [sum_flux(b_wvl,b_flux,l1,l2,filter)]
File "//anaconda/lib/python3.5/site-packages/spiderman/stellar_grid.py", line 94, in sum_flux
r = f(wvl)
File "//anaconda/lib/python3.5/site-packages/scipy/interpolate/polyint.py", line 79, in __call__
y = self._evaluate(x)
File "//anaconda/lib/python3.5/site-packages/scipy/interpolate/interpolate.py", line 663, in _evaluate
below_bounds, above_bounds = self._check_bounds(x_new)
File "//anaconda/lib/python3.5/site-packages/scipy/interpolate/interpolate.py", line 695, in _check_bounds
raise ValueError("A value in x_new is above the interpolation "
ValueError: A value in x_new is above the interpolation range.
So the filter gets set, but it looks like the grid is trying to go over the filter interpolation range.
A fix or a suggestion would be appreciated, thanks!
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.