Git Product home page Git Product logo

pyimfit's People

Contributors

perwin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyimfit's Issues

Return fit parameters as dictionary

At the moment, fit parameters obtained via getRawParameters are returned as a np.array object. This is not particularly convenient as the names of the parameters aren't necessarily known, and I can't see nice way of mapping array indices to parameter names.

I would suggest that getRawParameters should return a (nested) dictionary, like:

{component_1: 
    {par_name1: val1, par_name2: val2},
component_2: 
    {par_name1: val1, par_name2: val2},
...}

Apologies if this functionality already exists.

Unable to install due to keyword error

Hi,

I tried to install Pyimfit onto my Ubuntu machine via the pip3 install command, but I'm getting this error when compiling: check_gcc_version() got an unexpected keyword argument 'getVersion'

I checked through your setup.py and believe the error is in line 212 ( gccVersionNum = check_gcc_version(getVersion=True)). In the definition of check_gcc_version, the keyword is getVersionNum. I believe this is what is causing the compilation error when installing on Linux when the gcc version is checked.

pip install is throwing "ModuleNotFoundError: No module named 'numpy'" error even though numpy is installed

Hello,

I'm trying to install pyimfit on my Windows 10 machine through Anaconda. Even though I have updated my current version on numpy, running the command:

pip install pyimfit --use-pep517

Gives me following output:

Collecting pyimfit
Using cached pyimfit-0.12.0.tar.gz (10.7 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
Note: you may need to restart the kernel to use updated packages.
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

[17 lines of output]
Traceback (most recent call last):
File "C:\Users*\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users*
\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(hook_input['kwargs'])
File "C:\Users*
\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users*\AppData\Local\Temp\pip-build-env-zbj5j6jk\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "C:\Users*
\AppData\Local\Temp\pip-build-env-zbj5j6jk\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "C:\Users*\AppData\Local\Temp\pip-build-env-zbj5j6jk\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users*
\AppData\Local\Temp\pip-build-env-zbj5j6jk\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
exec(code, locals())
File "", line 25, in
ModuleNotFoundError: No module named 'numpy'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

Model image pixel offset

Generating a model image results in a 1-pixel offset in both x and y. I assumed that (x, y) pixel coordinates are 0-indexed (i.e., Python convention). Are they actually 1-indexed? I couldn't find anything in documentation about the pixel coordinate convention.

import pyimfit

shape = (101, 101)
x0 = 50
y0 = 50
pa = 90.0
ell = 0.2
n = 4
I_e = 1
r_e = 25 

model = pyimfit.SimpleModelDescription()
model.x0.setValue(x0, [x0 - 5, x0 + 5])
model.y0.setValue(y0, [y0 - 5, y0 + 5])
gal = pyimfit.make_imfit_function('Sersic', label='galaxy')
gal.PA.setValue(pa, [0, 180])
gal.ell.setValue(ell, [0, 1])
gal.n.setValue(n, [0.5, 5])
gal.I_e.setValue(I_e, [0, 10*I_e])
gal.r_e.setValue(r_e, [0, 10*r_e])

model.addFunction(gal)
imfitter = pyimfit.Imfit(model)
data = imfitter.getModelImage(shape=shape)

I expected this model image to be centered at (x, y) = (50, 50) (the input x0, y0), but it's actually centered at (49, 49):

>>> np.unravel_index(np.argmax(data), data.shape)
(49, 49)

plt.imshow(data)
ls = 'dashed'
color = 'w'
alpha = 0.5
plt.axhline(49, ls=ls, color=color, alpha=alpha)
plt.axvline(49, ls=ls, color=color, alpha=alpha)

sersic_offset

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.