Skip to content

Commit

Permalink
Reduced dpi to 100 to further reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSwainston committed Feb 28, 2024
1 parent 2d8f6e0 commit f77fd2f
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions meerpipe/scripts/generate_images_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ def generate_dynamicspec_images(
label,
logger=None,
):
# Load logger if no provided
if logger is None:
logger = setup_logging(console=True)

ar = ps.Archive_load(archive_file)

# account for phase bin differences
Expand All @@ -166,15 +170,23 @@ def generate_dynamicspec_images(
# Work out what name of output psrflux file is
dynspec_file = f"{archive_file}.dynspec"

try:
dyn = Dynspec(dynspec_file, process=False, verbose=False)
dyn.plot_dyn(filename=f"{dynspec_file}.png", display=False, title=f"Dynamic Spectral ({label})", dpi=150)
logger.info("Refilling")
dyn.trim_edges()
dyn.refill(linear=False)
except Exception as e:
logger.error("Scintools failed. Dyanmic spectra couldn't be created do to :")
logger.error(e)
dynamic_spectra(dynspec_file, label, logger=logger)


def dynamic_spectra(
dynspec_file,
label,
logger=None,
):
# Load logger if no provided
if logger is None:
logger = setup_logging(console=True)

dyn = Dynspec(dynspec_file, process=False, verbose=False)
dyn.plot_dyn(filename=f"{dynspec_file}.png", display=False, title=f"Dynamic Spectral ({label})", dpi=100)
logger.info("Refilling")
dyn.trim_edges()
dyn.refill(linear=False)


def generate_images(
Expand Down

0 comments on commit f77fd2f

Please sign in to comment.