guillochon / MOSFiT

Modular Open Source Fitter for Transients
http://mosfit.readthedocs.io/
MIT License
41 stars 53 forks source link

Calling mosfit models as functions. #192

Open nikhil-sarin opened 3 years ago

nikhil-sarin commented 3 years ago

Hi. New user here.

Is there a way to evaluate a mosfit model as a function? I tried digging into the code but I can't figure out how to isolate the various modules/classes.

To elaborate, say if I want to evaluate the SLSN model. I can just do something like

import mosfit
model = mosfit.model('slsn')
model.evaluate(time, bands, **params)

Here time is an array of observation times, bands is an array of bands corresponding to the observation times and params is a dictionary of parameters corresponding to the SLSN model. The documentation suggests a workflow that is quite close but I don't actually want to load an observation and the associated array of data.