Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astromodels.functions.function import Function1D, FunctionMeta | |
class MyCustomModel(Function1D): | |
r""" | |
description : | |
A custom power law model | |
latex : $ 10^{K}~\frac{x}{piv}^{index} $ | |
parameters : | |
K : | |
desc : Normalization (log of differential flux at the pivot value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsps = [] | |
phas = [] | |
baks = [] | |
for interval in intervals: | |
this_rsp = my_instrument_response_set.weight_by_counts(...) | |
this_pha = [this is what you are doing] | |
this_bak = [this is what you are doing] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LAT light curve fit | |
one = LATLike(...) | |
two = LATLike(...) | |
three = LATLike(...) | |
data = DataList(one, two, three) | |
model = Model(...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class EventList(object): | |
def __init__(self, arrival_times, energies, ra=None, dec=None): | |
self._arrival_times = np.asarray(arrival_times) | |
self._energies = np.asarray(energies) | |
assert self._arrival_times.shape[0] == self._energies.shape[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
electrons (particle source): | |
spectrum: | |
main: | |
log_parabola: | |
K: {value: 1.0000000000000002e+38, desc: Normalization, min_value: null, max_value: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_1 (point source): | |
position: | |
ra: {value: 125.6, desc: Right Ascension, min_value: 0.0, max_value: 360.0, unit: deg, | |
delta: 37.68, free: false} | |
dec: {value: -75.3, desc: Declination, min_value: -90.0, max_value: 90.0, unit: deg, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FuncFactory | |
# Create the text file with the energies and the fluxes (which can be whatever at this stage) | |
source_name = 'a' | |
tempName = "__%s.txt" % source_name | |
with open(tempName, "w+") as f: | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder