ObsData#
- class jetset.data_loader.ObsData(cosmo=None, data_table=None, dupl_filter=False, data_set_filter=None, UL_filtering=False, UL_value=None, UL_CL=0.95, **keywords)[source]#
Bases:
object
ObsData class
This class provides a powerful interface to load observational data stored in a file. The following parameters set the corresponding class members
Attributes Summary
Methods Summary
add_systematics
(syst[, nu_range, data_set])add systematics to errors
filter_UL
([val])remove the upper limits points from from data
filter_data_set
(filters[, exclude, silent])filter_freq
([nu_min, nu_max, exclude])filter the data, keeping all the data with nu_min <nu< nu_max if exclude=False (defualt).
filter_time
([T_min, T_max, exclude])filter the data, keeping all the data with T_min <T< T_max if exclude=False (defualt).
find_time_span
([data_set, silent, get_values])returns Tstart, Tstop, and Delta T for the full data set (if no dat_set is provided), or for a specific data_set
get_data_points
([log_log, skip_UL, frame, ...])Gives data point
get_time_span
([data_set])group_data
([N_bin, bin_width, ...])function to perform a spectral group of the data
lin_to_log
([val, err])load
(file_name)log_to_lin
([log_val, log_err])plot_sed
([plot_obj, frame, color, fmt, ms, ...])plot_time_spans
([save_as])remove_dupl_entries
(data)remove duplicate entries
save
(file_name)set_UL
([val])set_error
(error_value[, nu_range, data_set, ...])set all the paramters to same error
set_fake_error
(val)Sets the value for the fake error
set_zero_error
([val, replace_zero])show_time_span
([data_set])Attributes Documentation
- gammapy_table#
- metadata#
- table#
Methods Documentation
- add_systematics(syst, nu_range=None, data_set=None)[source]#
add systematics to errors
- Parameters:
syst – (float) systematic value (fractional)
nu_range – array_like of floats, [nu_min,nu_max], optional, range of frequencies to apply sistematics
- filter_UL(val=None)[source]#
remove the upper limits points from from data
- Parameters:
val – minimum value to set the upper limit. As default, negative errors indicates upper limits, hence val=0.
- Retruns msk:
a boolean array to mask the upper limits, i.e. all the data points with negative errors.
- filter_freq(nu_min=None, nu_max=None, exclude=False)[source]#
filter the data, keeping all the data with nu_min <nu< nu_max if exclude=False (defualt). The opposite if exclude=True
both nu_max and nu_min are in linear scale
- Parameters:
nu_min (float) – lower limit of the range (linear scale, in Hz)
nu_max (float) – upper limit of the range (linear scale, in Hz)
- filter_time(T_min=None, T_max=None, exclude=False)[source]#
filter the data, keeping all the data with T_min <T< T_max if exclude=False (defualt). The opposite if exclude=True
- Parameters:
T_min (float) – lower limit of the range (MJD)
T_max (float) – upper limit of the range (MJD)
- find_time_span(data_set=None, silent=True, get_values=False)[source]#
returns Tstart, Tstop, and Delta T for the full data set (if no dat_set is provided), or for a specific data_set
- group_data(N_bin=None, bin_width=None, correct_dispersions=True)[source]#
function to perform a spectral group of the data
- Parameters:
N_bin – (int)
bin_width – (float) logarthmic
Note
To perform a rebinning of the data has to be provided either
N_bin
orbin_width
.
- plot_sed(plot_obj=None, frame='obs', color=None, fmt='o', ms=4, mew=0.5, figsize=None, show_dataset=False, density=False)[source]#
- remove_dupl_entries(data)[source]#
remove duplicate entries
- Parameters:
data – (array) 2-dim array storing the the table of the data.
- Returns msk:
a boolean array to mask the duplicated entries
Note
One entry is flagged as duplicated as each comlum in a row of the data table is equal to the corresponding elements of another row