@@ -270,74 +270,6 @@ def output_subplot(self, filename_suffix: str = ""):
270270 )
271271 plotter .close_subplot_figure ()
272272
273- def output_to_fits (
274- self ,
275- func_name_list : List [str ],
276- figure_name_list : List [str ],
277- filename : str ,
278- tag_list : Optional [List [str ]] = None ,
279- remove_fits_first : bool = False ,
280- ** kwargs ,
281- ):
282- """
283- Outputs a list of figures of the plotter objects in the `plotter_list` to a single .fits file.
284-
285- This function takes as input lists of function names and figure names and then calls them via
286- the `plotter_list` with an interface that outputs each to a .fits file.
287-
288- For example, if you have multiple `ImagingPlotter` objects and want to output the `data` and `noise_map` of
289- each to a single .fits files, you would input:
290-
291- - `func_name_list=['figures_2d', 'figures_2d']` and
292- - `figure_name_list=['data', 'noise_map']`.
293-
294- The implementation of this code is hacky, with it using a specific interface in the `Output` object
295- which sets the format to `fits_multi` to call a function which outputs the .fits files. A major visualuzation
296- refactor is required to make this more elegant.
297-
298- Parameters
299- ----------
300- func_name_list
301- The list of function names that are called to plot the figures on the subplot.
302- figure_name_list
303- The list of figure names that are plotted on the subplot.
304- filenane
305- The filename that the .fits file is output to.
306- tag_list
307- The list of tags that are used to set the `EXTNAME` of each hdu of the .fits file.
308- remove_fits_first
309- If the .fits file already exists, it is removed before the new .fits file is output, else it is updated
310- with the figure going into the next hdu.
311- kwargs
312- Any additional keyword arguments that are passed to the function that plots the figure on the subplot.
313- """
314-
315- output_path = self .plotter_list [0 ].mat_plot_2d .output .output_path_from (
316- format = "fits_multi"
317- )
318- output_fits_file = Path (output_path ) / f"{ filename } .fits"
319-
320- if remove_fits_first :
321- output_fits_file .unlink (missing_ok = True )
322-
323- for i , plotter in enumerate (self .plotter_list ):
324- plotter .mat_plot_2d .output ._format = "fits_multi"
325-
326- plotter .set_filename (filename = f"{ filename } " )
327-
328- for j , (func_name , figure_name ) in enumerate (
329- zip (func_name_list , figure_name_list )
330- ):
331- if tag_list is not None :
332- plotter .mat_plot_2d .output ._tag_fits_multi = tag_list [j ]
333-
334- self .plot_via_func (
335- plotter = plotter ,
336- figure_name = figure_name ,
337- func_name = func_name ,
338- kwargs = kwargs ,
339- )
340-
341273
342274class MultiYX1DPlotter :
343275 def __init__ (
0 commit comments