jvines / astroARIADNE

Easy stellar SED fitting!
MIT License
54 stars 7 forks source link

"Missing flux value" when fitting tutorial example #58

Open jgagneastro opened 2 months ago

jgagneastro commented 2 months ago

I am running ariadne on a native conda+python install on a M1 macbook, using macOS Monterey v12.3, and cannot complete the default fitting shown in the tutorial, as shown below:

from astroARIADNE.star import Star ra = 75.795 dec = -30.399 starname = 'NGTS-6' gaia_id = 4875693023844840448

s = Star(starname, ra, dec, g_id=gaia_id)

from astroARIADNE.fitter import Fitter

out_folder = '/Users/jonathan/Documents/Python/Python_Packages/ariadne_outputs/tutorial'

engine = 'dynesty' nlive = 500 dlogz = 0.5 bound = 'multi' sample = 'rwalk' threads = 4 dynamic = False

setup = [engine, nlive, dlogz, bound, sample, threads, dynamic]

models = [ 'phoenix', 'btsettl', 'btnextgen', 'btcond', 'kurucz', 'ck04' ]

f = Fitter() f.star = s f.setup = setup f.av_law = 'fitzpatrick' f.out_folder = out_folder f.bma = True f.models = models f.n_samples = 100000

f.prior_setup = { 'teff': ('default'), 'logg': ('default'), 'z': ('default'), 'dist': ('default'), 'rad': ('default'), 'Av': ('default') }

f.initialize() f.fit_bma()

        FITTING MODEL : phoenix

Holoviews not imported. Some visualizations will not be available. Holoviews not imported. Some visualizations will not be available. Holoviews not imported. Some visualizations will not be available. Holoviews not imported. Some visualizations will not be available. Exception while calling prior_transform function: params: [0.39603199 0.09485932 0.43925884 0.19655701 0.00309658 0.86452559 0.13842111 0.92673291 0.12505732 0.94489648 0.01144328 0.90315004 0.16627253 0.70405485 0.33309957 0.68312831] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.22268088 0.17677657 0.69588512 0.36069374 0.12208618 0.47505249 0.03019026 0.82108493 0.4750874 0.35491347 0.2252055 0.84701354 0.86567129 0.14691318 0.5199689 0.09667235] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.85506082 0.12566758 0.47188664 0.13901015 0.0962302 0.46990006 0.16259984 0.9976851 0.96748612 0.18401679 0.88266627 0.39076429 0.55452271 0.53592946 0.66307548 0.84181399] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.44255938 0.84496378 0.07466507 0.00386896 0.24156496 0.95862185 0.83288242 0.01831539 0.84482526 0.96711156 0.37996373 0.41450257 0.33612406 0.96744476 0.29516887 0.18517861] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.06837007 0.68360607 0.50440683 0.83824858 0.23812411 0.94772254 0.92176188 0.89168724 0.6215123 0.50196635 0.44309877 0.77993664 0.39457159 0.38651693 0.17706499 0.59927201] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.29708286 0.42898992 0.908238 0.47240457 0.63522846 0.68509039 0.80882285 0.23707937 0.42105728 0.2541867 0.34015398 0.09814584 0.14850056 0.63465725 0.19525426 0.19825185] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.95113014 0.74734437 0.96067432 0.23853812 0.48341043 0.27368637 0.77349367 0.82677713 0.19298881 0.44823913 0.14452308 0.21468684 0.58757916 0.72702251 0.14460475 0.50995364] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.9154899 0.46653902 0.90594811 0.12597127 0.3804186 0.5631833 0.2870856 0.88953977 0.92700217 0.33200867 0.44581503 0.90297739 0.25200782 0.14461671 0.06812992 0.02452867] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.60092114 0.19755549 0.35227223 0.26146756 0.67977142 0.98912053 0.53613492 0.85881202 0.35378672 0.15199706 0.78924978 0.84341721 0.36126889 0.45627438 0.73852016 0.07811069] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.44494038 0.23303208 0.01370717 0.20814798 0.83787526 0.32006465 0.25482201 0.02412807 0.83565531 0.22491708 0.79217061 0.3147361 0.82531919 0.90252204 0.55496989 0.12025343] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.08828247 0.32157629 0.03037976 0.49743765 0.57392193 0.36712184 0.54748878 0.11869211 0.52685326 0.87472074 0.54021451 0.63324225 0.2769998 0.84185626 0.72470907 0.93531432] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.90629952 0.07049288 0.28596167 0.96733165 0.7525199 0.97052856 0.77593102 0.86297219 0.9118277 0.16210689 0.70854681 0.29926505 0.01620135 0.49916857 0.49669492 0.38042493] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.37644703 0.48926722 0.65844418 0.87968801 0.67861102 0.38343499 0.16223559 0.43237445 0.40450207 0.91265733 0.9383418 0.41220952 0.11524782 0.6391591 0.6601956 0.74075183] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.21935743 0.88204235 0.55259507 0.41625704 0.0180696 0.28731656 0.52945306 0.86575093 0.15805881 0.23899213 0.80751505 0.97365118 0.13458586 0.69556004 0.9039686 0.04803873] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.01838459 0.6262579 0.18099482 0.72566616 0.98509518 0.66446042 0.16132079 0.45802635 0.2801436 0.23957871 0.57203068 0.69882169 0.76485463 0.8756731 0.27005357 0.29091003] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined Exception while calling prior_transform function: params: [0.88686968 0.46129235 0.94211308 0.67750492 0.41699898 0.45678565 0.33420794 0.81903688 0.30863799 0.45745282 0.10890228 0.88367946 0.50490833 0.42253135 0.16183545 0.51468937] args: [] kwargs: {} exception: Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), *self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/multiprocessing/pool.py", line 125, in worker result = (True, func(args, kwds)) ^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/multiprocessing/pool.py", line 48, in mapstar return list(map(args)) ^^^^^^^^^^^^^^^^ File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 910, in call return self.func(np.asarray(x).copy(), self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 1483, in pt_dynesty return prior_transform_dynesty(cube, flux, flux_er, filts, prior_dict, ^^^^ NameError: name 'flux' is not defined """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 1, in File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 572, in fit_bma self.fit_dynesty(out_file=out_file) File "/Users/jonathan/astroARIADNE/astroARIADNE/fitter.py", line 713, in fit_dynesty self.sampler = dynesty.NestedSampler( ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynesty.py", line 677, in new live_points, logvol_init, init_ncalls = _initialize_live_points( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/site-packages/dynesty/dynamicsampler.py", line 434, in _initialize_live_points cur_live_v = M(prior_transform, np.asarray(cur_live_u)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/multiprocessing/pool.py", line 367, in map return self._map_async(func, iterable, mapstar, chunksize).get() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3-native/anaconda3/envs/ariadne/lib/python3.12/multiprocessing/pool.py", line 774, in get raise self._value NameError: name 'flux' is not defined

More info on my Python version:

(ariadne) Mizar jonathan jonathan $ python Python 3.12.3 | packaged by Anaconda, Inc. | (main, May 6 2024, 14:46:42) [Clang 14.0.6 ] on darwin Type "help", "copyright", "credits" or "license" for more information.

import platform

print(platform.processor()) arm

mdredyanahmed commented 3 weeks ago

How did you install dustmaps? Is it working properly in mac M1

jvines commented 3 weeks ago

I installed it following the instructions in the dustmaps website, which is linked in the README. It does work with M1.

On 04-07-2024, at 14:58, Md Redyan Ahmed @.***> wrote:

How did you install dustmaps? Is it working properly in mac M1

— Reply to this email directly, view it on GitHub https://github.com/jvines/astroARIADNE/issues/58#issuecomment-2209462200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6RPXA4BEDXYM6YG3QOJTTZKWLLXAVCNFSM6AAAAABH2RT66GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGQ3DEMRQGA. You are receiving this because you are subscribed to this thread.