From 54c0b17f3484cfbe3402d8916c841f0994d62ca7 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 13 Aug 2017 19:37:03 +0800 Subject: clusters/main.py: Add method "_outfilepath()" Signed-off-by: Aaron LI --- fg21sim/extragalactic/clusters/main.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'fg21sim/extragalactic/clusters') diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index 2361635..15a9dcd 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -321,6 +321,27 @@ class GalaxyClusters: hdict["template"] = template logger.info("Done drawn halo template images.") + def _outfilepath(self, frequency, **kwargs): + """ + Generate the path/filename to the output file for writing + the simulate sky images. + + Parameters + ---------- + frequency : float + The frequency of the output sky image. + Unit: [MHz] + + Returns + ------- + filepath : str + The generated filepath for the output sky file. + """ + filename = self.filename_pattern.format( + prefix=self.prefix, frequency=frequency, **kwargs) + filepath = os.path.join(self.output_dir, filename) + return filepath + def preprocess(self): """ Perform the preparation procedures for the later simulations. -- cgit v1.2.2