Update spectral point code for HGPS catalog
@@ -80,7 +80,6 @@ class HGPSGaussComponent(object):
pars['amplitude'] = amplitude * 1 / (2 * np.pi * pars['x_stddev'] ** 2)
return Gaussian2D(**pars)
-
def __str__(self):
"""Pretty-print source data"""
d = self.data
@@ -346,7 +345,8 @@ class SourceCatalogObjectHGPS(SourceCatalogObject):
energy_cols = ['e_ref', 'e_min', 'e_max']
flux_cols = ['dnde', 'dnde_errn', 'dnde_errp', 'dnde_ul']
- flux_points = flux_points[energy_cols + flux_cols]
+ cols = energy_cols + flux_cols + ['is_ul']
+ flux_points = flux_points[cols]
for _ in energy_cols:
flux_points[_].format = '.3f'
@@ -426,9 +426,6 @@ class SourceCatalogObjectHGPS(SourceCatalogObject):
model.parameters.set_parameter_errors(errs)
return model
-
-
-
def spatial_model(self, emin=1 * u.TeV, emax=10 * u.TeV):
"""
Source spatial model.
@@ -486,7 +483,7 @@ class SourceCatalogObjectHGPS(SourceCatalogObject):
return model
else:
- raise ValueError('Not a valid spatial model{}'.format(morph_type))
+ raise ValueError('Not a valid spatial model{}'.format(spatial_model))
@property
def is_pointlike(self):
@@ -508,9 +505,10 @@ class SourceCatalogObjectHGPS(SourceCatalogObject):
table['e_max'] = self.data['Flux_Points_Energy_Max'][mask]
table['dnde'] = self.data['Flux_Points_Flux'][mask]
- table['dnde_errp'] = self.data['Flux_Points_Flux_Err_Hi'][mask]
table['dnde_errn'] = self.data['Flux_Points_Flux_Err_Lo'][mask]
+ table['dnde_errp'] = self.data['Flux_Points_Flux_Err_Hi'][mask]
table['dnde_ul'] = self.data['Flux_Points_Flux_UL'][mask]
+ table['is_ul'] = self.data['Flux_Points_Is_UL'][mask]
return FluxPoints(table)
