Skip to content

Commit

Permalink
squashme: reverse logic to reduce indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed Jul 15, 2024
1 parent 63b2d53 commit be0b7b6
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions sourcespec2/source_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,33 +120,35 @@ def ssp_output(proc_st, spec_st, specnoise_st, weight_st, sspec_output):
from .config import config

# TODO: check (again) if outdir exists
if config.options.outdir:
# Save output
from .ssp_output import write_output, save_spectra
write_output(sspec_output)
save_spectra(spec_st)

# Save residuals
from .ssp_residuals import spectral_residuals
spectral_residuals(spec_st, sspec_output)

# Plotting
from .ssp_plot_traces import plot_traces
plot_traces(proc_st)
from .ssp_plot_spectra import plot_spectra
plot_spectra(spec_st, specnoise_st, plot_type='regular')
plot_spectra(weight_st, plot_type='weight')
from .ssp_plot_stacked_spectra import plot_stacked_spectra
plot_stacked_spectra(spec_st, weight_st, sspec_output)
from .ssp_plot_params_stats import box_plots
box_plots(sspec_output)
if config.plot_station_map:
from .ssp_plot_stations import plot_stations
plot_stations(sspec_output)

if config.html_report:
from .ssp_html_report import html_report
html_report(sspec_output)
if not config.options.outdir:
return

# Save output
from .ssp_output import write_output, save_spectra
write_output(sspec_output)
save_spectra(spec_st)

# Save residuals
from .ssp_residuals import spectral_residuals
spectral_residuals(spec_st, sspec_output)

# Plotting
from .ssp_plot_traces import plot_traces
plot_traces(proc_st)
from .ssp_plot_spectra import plot_spectra
plot_spectra(spec_st, specnoise_st, plot_type='regular')
plot_spectra(weight_st, plot_type='weight')
from .ssp_plot_stacked_spectra import plot_stacked_spectra
plot_stacked_spectra(spec_st, weight_st, sspec_output)
from .ssp_plot_params_stats import box_plots
box_plots(sspec_output)
if config.plot_station_map:
from .ssp_plot_stations import plot_stations
plot_stations(sspec_output)

if config.html_report:
from .ssp_html_report import html_report
html_report(sspec_output)


def main():
Expand Down

0 comments on commit be0b7b6

Please sign in to comment.