Implement profile table format
@@ -385,6 +385,26 @@ class FluxPoints(FluxMaps):
data = getattr(self, quantity, None)
if data:
table[quantity] = data.quantity.squeeze()
+ elif format == "profile":
+ x_axis = self.geom.axes["projected-distance"]
+
+ tables = []
+ for idx, (x_min, x_max) in enumerate(x_axis.iter_by_edges):
+ table_flat = Table()
+ table_flat["x_min"] = [x_min]
+ table_flat["x_max"] = [x_max]
+ table_flat["x_ref"] = [(x_max + x_min) / 2]
+
+ fp = self.slice_by_idx(slices={"projected-distance": idx})
+ table = fp.to_table(sed_type=sed_type, format="gadf-sed")
+
+ for column in table.columns:
+ table_flat[column] = table[column][np.newaxis]
+
+ tables.append(table_flat)
+
+ table = vstack(tables)
+
else:
raise ValueError(f"Not a supported format {format}")
