diff --git a/srttools/simulate.py b/srttools/simulate.py index f0f6205f..2558c55d 100644 --- a/srttools/simulate.py +++ b/srttools/simulate.py @@ -727,6 +727,7 @@ def simulate_map( nbin=1, debug=False, start_time=0, + radec_labels_in_srcname=False, ): """Simulate a map. @@ -757,6 +758,8 @@ def simulate_map( put RA and DEC scans in the two directories. channel_ratio : float Ratio between the counts in the two channels + radec_labels_in_srcname : bool + If True, add RA and Dec labels to source name """ if isinstance(outdir, str): @@ -787,6 +790,11 @@ def simulate_map( if HAS_MPL and debug: fig = plt.figure() + ralabel = declabel = "" + if radec_labels_in_srcname: + ralabel = "_RA" + declabel = "_Dec" + delta_decs = np.arange(-width_dec / 2, width_dec / 2 + spacing, spacing) / 60 logging.info("Simulating dec scans...") for i_d, delta_dec in enumerate(tqdm(delta_decs)): @@ -815,7 +823,7 @@ def simulate_map( other_keywords=other_keywords, src_ra=mean_ra, src_dec=mean_dec, - srcname=srcname, + srcname=srcname + ralabel, counts_to_K=(COUNTS_TO_K, COUNTS_TO_K / channel_ratio), ) if HAS_MPL and debug: @@ -853,7 +861,7 @@ def simulate_map( filename=os.path.join(outdir_dec, "Dec{}.fits".format(i_r)), src_ra=mean_ra, src_dec=mean_dec, - srcname=srcname, + srcname=srcname + declabel, ) if HAS_MPL and debug: diff --git a/srttools/tests/__init__.py b/srttools/tests/__init__.py index 5bfe1639..ec8ddf00 100644 --- a/srttools/tests/__init__.py +++ b/srttools/tests/__init__.py @@ -82,6 +82,10 @@ def sim_config_file(filename, add_garbage=False, prefix=None, label=""): pixel_size : 0.8 +ignore_suffix : + _RA + _Dec + [debugging] debug_file_format : png @@ -199,6 +203,7 @@ def prepare_simulated_data(simdir): srcname="Dummy", channel_ratio=0.8, baseline="flat", + radec_labels_in_srcname=True, ) config_file = os.path.abspath(os.path.join(simdir, "test_config_sim_small.ini"))