tabsim 0.0.10__tar.gz → 0.0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tabsim-0.0.10 → tabsim-0.0.12}/PKG-INFO +1 -1
- {tabsim-0.0.10 → tabsim-0.0.12}/pyproject.toml +1 -1
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/config.py +60 -73
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/sim_vis.py +36 -28
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim.egg-info/PKG-INFO +1 -1
- {tabsim-0.0.10 → tabsim-0.0.12}/LICENSE +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/README.md +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/docs/conf.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/setup.cfg +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/__init__.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/dask/__init__.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/dask/coordinates.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/dask/extras.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/dask/interferometry.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/dask/observation.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/__init__.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/config/sim_config_base.yaml +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/config/tab_config_base.yaml +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/norad_satellite.rfimodel +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/satellite.ole +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/satellite.rfimodel +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/stationary.loc +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/stationary.rfimodel +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/tles/2023-02-21-navstar.json +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/tles/2024-01-15-1T78VE.json +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/rfi/tles/2024-01-15-ISS.json +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/sky/calibrator.skymodel +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/telescopes/EDA2.itrf.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/telescopes/MWA.itrf.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/telescopes/MeerKAT.itrf.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/data/telescopes/_telescopes.yaml +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/jax/__init__.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/jax/coordinates.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/jax/interferometry.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/jax/utils.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/plot.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/read_ms.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/__init__.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/ast_region.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/flag_data.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/import_tle_files.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/setup_spacetrack_login.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/tle_sat_region.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/scripts/write_config_from_ms.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/sky.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/tle.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/tools.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim/write.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim.egg-info/SOURCES.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim.egg-info/dependency_links.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim.egg-info/entry_points.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim.egg-info/requires.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tabsim.egg-info/top_level.txt +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tests/test_basic.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tests/test_sim-vis.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tests/test_tle_api.py +0 -0
- {tabsim-0.0.10 → tabsim-0.0.12}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tabsim
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
4
4
|
Summary: Trajectory-based Radio Frequency Interference (RFI) simulations for radio interferometeric data.
|
|
5
5
|
Author-email: Chris Finlay <christopher.finlay@epfl.ch>
|
|
6
6
|
Maintainer-email: Chris Finlay <christopher.finlay@epfl.ch>
|
|
@@ -240,11 +240,11 @@ def sigma_value(value: Union[str, float, int], obs: Observation):
|
|
|
240
240
|
raise ValueError()
|
|
241
241
|
|
|
242
242
|
|
|
243
|
-
def load_obs(
|
|
243
|
+
def load_obs(sim_config: dict) -> Observation:
|
|
244
244
|
|
|
245
|
-
tel_ =
|
|
246
|
-
obs_ =
|
|
247
|
-
dask_ =
|
|
245
|
+
tel_ = sim_config["telescope"]
|
|
246
|
+
obs_ = sim_config["observation"]
|
|
247
|
+
dask_ = sim_config["dask"]
|
|
248
248
|
|
|
249
249
|
def arange(start: float, delta: float, n: int):
|
|
250
250
|
x = da.arange(start, start + n * delta, delta)[:n]
|
|
@@ -342,14 +342,14 @@ def add_power_spectrum_sources(obs: Observation, ps_rand: dict) -> None:
|
|
|
342
342
|
obs.addAstro(I[:, None, :], ra, dec)
|
|
343
343
|
|
|
344
344
|
|
|
345
|
-
def add_astro_sources(obs: Observation,
|
|
345
|
+
def add_astro_sources(obs: Observation, sim_config: dict) -> None:
|
|
346
346
|
"""Add astronomical sources from the simulation config file to the observation object.
|
|
347
347
|
|
|
348
348
|
Parameters
|
|
349
349
|
----------
|
|
350
350
|
obs : Observation
|
|
351
351
|
Observation object instance.
|
|
352
|
-
|
|
352
|
+
sim_config : dict
|
|
353
353
|
Simulation config dictionary.
|
|
354
354
|
"""
|
|
355
355
|
|
|
@@ -358,7 +358,7 @@ def add_astro_sources(obs: Observation, obs_spec: dict) -> None:
|
|
|
358
358
|
"gauss": obs.addAstroGauss,
|
|
359
359
|
"exp": obs.addAstroExp,
|
|
360
360
|
}
|
|
361
|
-
ast_ =
|
|
361
|
+
ast_ = sim_config["ast_sources"]
|
|
362
362
|
|
|
363
363
|
if ast_["pow_spec"]["random"]["type"]:
|
|
364
364
|
add_power_spectrum_sources(obs, ast_["pow_spec"]["random"])
|
|
@@ -467,9 +467,9 @@ def generate_spectra(spec_df: pd.DataFrame, freqs: Array, id_key: str) -> tuple:
|
|
|
467
467
|
return np.array(ids), da.atleast_2d(spectra)
|
|
468
468
|
|
|
469
469
|
|
|
470
|
-
def add_satellite_sources(obs: Observation,
|
|
470
|
+
def add_satellite_sources(obs: Observation, sim_config: dict) -> None:
|
|
471
471
|
|
|
472
|
-
sat_ =
|
|
472
|
+
sat_ = sim_config["rfi_sources"]["satellite"]
|
|
473
473
|
|
|
474
474
|
# Circular path based Satellites
|
|
475
475
|
if len(sat_["sat_ids"]) > 0:
|
|
@@ -513,10 +513,10 @@ def add_satellite_sources(obs: Observation, obs_spec: dict) -> None:
|
|
|
513
513
|
|
|
514
514
|
|
|
515
515
|
def add_tle_satellite_sources(
|
|
516
|
-
obs: Observation,
|
|
516
|
+
obs: Observation, sim_config: dict, spacetrack_path: str
|
|
517
517
|
) -> None:
|
|
518
518
|
|
|
519
|
-
sat_ =
|
|
519
|
+
sat_ = sim_config["rfi_sources"]["tle_satellite"]
|
|
520
520
|
|
|
521
521
|
# TLE path based Satellites
|
|
522
522
|
tle_cond = [
|
|
@@ -525,22 +525,9 @@ def add_tle_satellite_sources(
|
|
|
525
525
|
len(sat_["sat_names"]) > 0,
|
|
526
526
|
]
|
|
527
527
|
if np.any(tle_cond):
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
# Load from specified path if file exists
|
|
532
|
-
st_ = yaml_load(spacetrack_path)
|
|
533
|
-
username = st_["username"]
|
|
534
|
-
password = st_["password"]
|
|
535
|
-
else:
|
|
536
|
-
# Try loading from standard locations
|
|
537
|
-
from tabsim.tle import load_spacetrack_credentials
|
|
538
|
-
username, password = load_spacetrack_credentials()
|
|
539
|
-
|
|
540
|
-
if username is None or password is None:
|
|
541
|
-
print("Warning: No SpaceTrack credentials found. Skipping TLE satellite sources.")
|
|
542
|
-
print("To set up credentials, run: tabsim-setup-spacetrack")
|
|
543
|
-
return
|
|
528
|
+
|
|
529
|
+
from tabsim.tle import load_spacetrack_credentials
|
|
530
|
+
username, password = load_spacetrack_credentials()
|
|
544
531
|
|
|
545
532
|
if sat_["norad_ids_path"] is None:
|
|
546
533
|
norad_ids = sat_["norad_ids"]
|
|
@@ -601,9 +588,9 @@ def add_tle_satellite_sources(
|
|
|
601
588
|
print("No NORAD IDs matching in 'norad_spec_model' file given.")
|
|
602
589
|
|
|
603
590
|
|
|
604
|
-
def add_stationary_sources(obs: Observation,
|
|
591
|
+
def add_stationary_sources(obs: Observation, sim_config: dict) -> None:
|
|
605
592
|
|
|
606
|
-
stat_ =
|
|
593
|
+
stat_ = sim_config["rfi_sources"]["stationary"]
|
|
607
594
|
if len(stat_["loc_ids"]) > 0:
|
|
608
595
|
ids = stat_["loc_ids"]
|
|
609
596
|
path_ids = []
|
|
@@ -650,9 +637,9 @@ def add_stationary_sources(obs: Observation, obs_spec: dict) -> None:
|
|
|
650
637
|
print("No locations IDs matching in 'spec_model' file given.")
|
|
651
638
|
|
|
652
639
|
|
|
653
|
-
def add_gains(obs: Observation,
|
|
640
|
+
def add_gains(obs: Observation, sim_config: dict) -> None:
|
|
654
641
|
|
|
655
|
-
gains_ =
|
|
642
|
+
gains_ = sim_config["gains"]
|
|
656
643
|
gain_offset = gains_["G0_mean"] != 1 or gains_["G0_std"] != 0
|
|
657
644
|
gain_var = gains_["Gt_std_amp"] != 0 or gains_["Gt_std_phase"] != 0
|
|
658
645
|
if gain_offset or gain_var:
|
|
@@ -672,11 +659,11 @@ def add_gains(obs: Observation, obs_spec: dict) -> None:
|
|
|
672
659
|
print("No gains added ...")
|
|
673
660
|
|
|
674
661
|
|
|
675
|
-
def plot_diagnostics(obs: Observation,
|
|
662
|
+
def plot_diagnostics(obs: Observation, sim_config: dict, save_path: str) -> None:
|
|
676
663
|
|
|
677
664
|
from tabsim.plot import plot_uv, plot_src_alt, plot_angular_seps
|
|
678
665
|
|
|
679
|
-
diag_ =
|
|
666
|
+
diag_ = sim_config["diagnostics"]
|
|
680
667
|
|
|
681
668
|
if diag_["src_alt"]:
|
|
682
669
|
print()
|
|
@@ -726,29 +713,29 @@ def write_to_zarr(obs: Observation, zarr_path: str, overwrite: bool) -> None:
|
|
|
726
713
|
print(f"zarr Write Time : {end - start}")
|
|
727
714
|
|
|
728
715
|
|
|
729
|
-
def save_data(obs: Observation,
|
|
716
|
+
def save_data(obs: Observation, sim_config: dict, zarr_path: str, ms_path: str) -> None:
|
|
730
717
|
|
|
731
|
-
if
|
|
718
|
+
if sim_config["output"]["zarr"] or sim_config["output"]["ms"]:
|
|
732
719
|
print()
|
|
733
720
|
print("Calculating visibilities ...")
|
|
734
|
-
obs.calculate_vis(flags=
|
|
721
|
+
obs.calculate_vis(flags=sim_config["output"]["flag_data"])
|
|
735
722
|
|
|
736
|
-
overwrite =
|
|
723
|
+
overwrite = sim_config["output"]["overwrite"]
|
|
737
724
|
|
|
738
|
-
if
|
|
725
|
+
if sim_config["output"]["zarr"] and sim_config["output"]["ms"]:
|
|
739
726
|
write_to_zarr(obs, zarr_path, overwrite)
|
|
740
727
|
xds = xr.open_zarr(zarr_path)
|
|
741
728
|
write_to_ms(xds, ms_path, overwrite)
|
|
742
729
|
print_signal_specs(
|
|
743
730
|
xds.vis_rfi.data, xds.vis_ast.data, xds.noise_data.data, xds.flags.data
|
|
744
731
|
)
|
|
745
|
-
elif
|
|
732
|
+
elif sim_config["output"]["zarr"]:
|
|
746
733
|
write_to_zarr(obs, zarr_path, overwrite)
|
|
747
734
|
xds = xr.open_zarr(zarr_path)
|
|
748
735
|
print_signal_specs(
|
|
749
736
|
xds.vis_rfi.data, xds.vis_ast.data, xds.noise_data.data, xds.flags.data
|
|
750
737
|
)
|
|
751
|
-
elif
|
|
738
|
+
elif sim_config["output"]["ms"]:
|
|
752
739
|
write_to_ms(obs.dataset, ms_path, overwrite)
|
|
753
740
|
xds = xds_from_ms(ms_path)
|
|
754
741
|
print_signal_specs(
|
|
@@ -763,15 +750,15 @@ def save_data(obs: Observation, obs_spec: dict, zarr_path: str, ms_path: str) ->
|
|
|
763
750
|
)
|
|
764
751
|
|
|
765
752
|
|
|
766
|
-
def save_inputs(obs: Observation,
|
|
753
|
+
def save_inputs(obs: Observation, sim_config: dict, save_path: str) -> None:
|
|
767
754
|
|
|
768
755
|
for key in ["enu_path", "itrf_path"]:
|
|
769
|
-
path =
|
|
756
|
+
path = sim_config["telescope"][key]
|
|
770
757
|
if path is not None:
|
|
771
758
|
shutil.copy(path, save_path)
|
|
772
759
|
|
|
773
|
-
for key in
|
|
774
|
-
path =
|
|
760
|
+
for key in sim_config["ast_sources"].keys():
|
|
761
|
+
path = sim_config["ast_sources"][key]["path"]
|
|
775
762
|
if path is not None:
|
|
776
763
|
shutil.copy(path, save_path)
|
|
777
764
|
|
|
@@ -785,14 +772,14 @@ def save_inputs(obs: Observation, obs_spec: dict, save_path: str) -> None:
|
|
|
785
772
|
"spec_model",
|
|
786
773
|
]
|
|
787
774
|
for key1, key2 in zip(key, subkey):
|
|
788
|
-
path =
|
|
775
|
+
path = sim_config["rfi_sources"][key1][key2]
|
|
789
776
|
if path is not None:
|
|
790
777
|
shutil.copy(path, save_path)
|
|
791
778
|
|
|
792
779
|
np.savetxt(os.path.join(save_path, "norad_ids.yaml"), obs.norad_ids, fmt="%i")
|
|
793
780
|
|
|
794
781
|
with open(os.path.join(save_path, "sim_config.yaml"), "w") as fp:
|
|
795
|
-
yaml.dump(
|
|
782
|
+
yaml.dump(sim_config, fp)
|
|
796
783
|
|
|
797
784
|
|
|
798
785
|
def print_fringe_freq_sat(obs: Observation):
|
|
@@ -889,7 +876,7 @@ def check_telescope_defintion(tel_def: dict):
|
|
|
889
876
|
|
|
890
877
|
|
|
891
878
|
def run_sim_config(
|
|
892
|
-
|
|
879
|
+
sim_config: Optional[dict] = None,
|
|
893
880
|
config_path: Optional[str] = None,
|
|
894
881
|
spacetrack_path: Optional[str] = None,
|
|
895
882
|
) -> Tuple[Observation, str]:
|
|
@@ -905,24 +892,24 @@ def run_sim_config(
|
|
|
905
892
|
print(datetime.now())
|
|
906
893
|
|
|
907
894
|
if config_path:
|
|
908
|
-
|
|
909
|
-
elif
|
|
910
|
-
raise ValueError("
|
|
895
|
+
sim_config = load_config(config_path, config_type="sim")
|
|
896
|
+
elif sim_config is None:
|
|
897
|
+
raise ValueError("sim_config or config_path must be defined.")
|
|
911
898
|
|
|
912
899
|
rfi_def = get_rfi_definitions()
|
|
913
|
-
|
|
900
|
+
sim_config["rfi_sources"] = deep_update(sim_config["rfi_sources"], rfi_def)
|
|
914
901
|
|
|
915
|
-
if not check_telescope_defintion(
|
|
916
|
-
tel_def = get_telescope_definitions(
|
|
917
|
-
|
|
902
|
+
if not check_telescope_defintion(sim_config["telescope"]):
|
|
903
|
+
tel_def = get_telescope_definitions(sim_config["telescope"]["name"])
|
|
904
|
+
sim_config["telescope"] = deep_update(sim_config["telescope"], tel_def)
|
|
918
905
|
|
|
919
|
-
obs = load_obs(
|
|
920
|
-
add_astro_sources(obs,
|
|
921
|
-
add_satellite_sources(obs,
|
|
922
|
-
if
|
|
923
|
-
add_tle_satellite_sources(obs,
|
|
924
|
-
add_stationary_sources(obs,
|
|
925
|
-
add_gains(obs,
|
|
906
|
+
obs = load_obs(sim_config)
|
|
907
|
+
add_astro_sources(obs, sim_config)
|
|
908
|
+
add_satellite_sources(obs, sim_config)
|
|
909
|
+
if sim_config["rfi_sources"]["tle_satellite"]["max_n_sat"] != 0 and spacetrack_path:
|
|
910
|
+
add_tle_satellite_sources(obs, sim_config, spacetrack_path)
|
|
911
|
+
add_stationary_sources(obs, sim_config)
|
|
912
|
+
add_gains(obs, sim_config)
|
|
926
913
|
|
|
927
914
|
# Change this for calculating all RFI sources
|
|
928
915
|
if obs.n_rfi_satellite > 0:
|
|
@@ -933,39 +920,39 @@ def run_sim_config(
|
|
|
933
920
|
print(obs)
|
|
934
921
|
|
|
935
922
|
obs_name = mk_obs_name(
|
|
936
|
-
|
|
923
|
+
sim_config["output"]["prefix"], obs, sim_config["output"]["suffix"]
|
|
937
924
|
)
|
|
938
925
|
save_path, zarr_path, ms_path = mk_obs_dir(
|
|
939
|
-
|
|
926
|
+
sim_config["output"]["path"], obs_name, sim_config["output"]["overwrite"]
|
|
940
927
|
)
|
|
941
928
|
|
|
942
929
|
input_path = os.path.join(save_path, "input_data")
|
|
943
930
|
|
|
944
931
|
os.makedirs(input_path, exist_ok=True)
|
|
945
|
-
save_inputs(obs,
|
|
932
|
+
save_inputs(obs, sim_config, input_path)
|
|
946
933
|
|
|
947
934
|
print()
|
|
948
935
|
print(f"Writing data to : {save_path}")
|
|
949
936
|
|
|
950
937
|
plot_cond = np.array(
|
|
951
938
|
[
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
939
|
+
sim_config["diagnostics"]["rfi_seps"],
|
|
940
|
+
sim_config["diagnostics"]["src_alt"],
|
|
941
|
+
sim_config["diagnostics"]["uv_cov"],
|
|
955
942
|
]
|
|
956
943
|
)
|
|
957
944
|
if np.any(plot_cond):
|
|
958
|
-
plot_diagnostics(obs,
|
|
945
|
+
plot_diagnostics(obs, sim_config, save_path)
|
|
959
946
|
else:
|
|
960
947
|
print("\nNo diagnostic plots.")
|
|
961
948
|
|
|
962
|
-
save_data(obs,
|
|
949
|
+
save_data(obs, sim_config, zarr_path, ms_path)
|
|
963
950
|
|
|
964
|
-
if
|
|
951
|
+
if sim_config["output"]["accumulate_ms"] is not None:
|
|
965
952
|
from tabsim.write import add_to_ms
|
|
966
953
|
|
|
967
954
|
xds = xr.open_zarr(zarr_path)
|
|
968
|
-
add_to_ms(xds,
|
|
955
|
+
add_to_ms(xds, sim_config["output"]["accumulate_ms"])
|
|
969
956
|
|
|
970
957
|
end = datetime.now()
|
|
971
958
|
print()
|
|
@@ -979,8 +966,8 @@ def run_sim_config(
|
|
|
979
966
|
sys.stdout = backup
|
|
980
967
|
|
|
981
968
|
if (
|
|
982
|
-
not
|
|
983
|
-
and
|
|
969
|
+
not sim_config["output"]["keep_sim"]
|
|
970
|
+
and sim_config["output"]["accumulate_ms"] is not None
|
|
984
971
|
):
|
|
985
972
|
shutil.rmtree(save_path)
|
|
986
973
|
return obs, save_path
|
|
@@ -29,6 +29,11 @@ def main():
|
|
|
29
29
|
required=True,
|
|
30
30
|
help="File path to the observation config file.",
|
|
31
31
|
)
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"-sp",
|
|
34
|
+
"--save_path",
|
|
35
|
+
help="Output directory path of simulation files.",
|
|
36
|
+
)
|
|
32
37
|
parser.add_argument(
|
|
33
38
|
"-r",
|
|
34
39
|
"--rfi_amp",
|
|
@@ -72,6 +77,7 @@ def main():
|
|
|
72
77
|
rfi_amp = args.rfi_amp
|
|
73
78
|
spacetrack_path = args.spacetrack
|
|
74
79
|
config_path = Path(args.config_path)
|
|
80
|
+
save_path = Path(args.save_path)
|
|
75
81
|
|
|
76
82
|
if not config_path.is_file():
|
|
77
83
|
print(f"Error: config file not found: {config_path}", file=sys.stderr)
|
|
@@ -80,69 +86,71 @@ def main():
|
|
|
80
86
|
config_path = os.path.abspath(args.config_path)
|
|
81
87
|
work_dir = os.path.split(config_path)[0]
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
sim_config = load_config(config_path, config_type="sim")
|
|
90
|
+
|
|
91
|
+
sim_config["output"]["path"] = save_path
|
|
84
92
|
|
|
85
93
|
if args.ra is not None:
|
|
86
|
-
|
|
94
|
+
sim_config["observation"]["ra"] = args.ra
|
|
87
95
|
|
|
88
|
-
config_st_path =
|
|
96
|
+
config_st_path = sim_config["rfi_sources"]["tle_satellite"]["spacetrack_path"]
|
|
89
97
|
if spacetrack_path:
|
|
90
|
-
|
|
98
|
+
sim_config["rfi_sources"]["tle_satellite"]["spacetrack_path"] = os.path.abspath(
|
|
91
99
|
os.path.join(work_dir, spacetrack_path)
|
|
92
100
|
)
|
|
93
101
|
elif config_st_path:
|
|
94
102
|
config_st_path = get_abs_path(config_st_path, work_dir)
|
|
95
|
-
|
|
103
|
+
sim_config["rfi_sources"]["tle_satellite"]["spacetrack_path"] = config_st_path
|
|
96
104
|
spacetrack_path = config_st_path
|
|
97
105
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
sim_config["rfi_sources"]["tle_satellite"]["power_scale"] *= rfi_amp
|
|
107
|
+
sim_config["rfi_sources"]["satellite"]["power_scale"] *= rfi_amp
|
|
108
|
+
sim_config["rfi_sources"]["stationary"]["power_scale"] *= rfi_amp
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
sim_config["output"]["overwrite"] = args.overwrite
|
|
103
111
|
|
|
104
112
|
if args.n_ant is not None:
|
|
105
|
-
|
|
113
|
+
sim_config["telescope"]["n_ant"] = args.n_ant
|
|
106
114
|
|
|
107
115
|
if args.n_int is not None:
|
|
108
|
-
|
|
116
|
+
sim_config["observation"]["n_int"] = args.n_int
|
|
109
117
|
|
|
110
|
-
suffix =
|
|
118
|
+
suffix = sim_config["output"]["suffix"]
|
|
111
119
|
if suffix:
|
|
112
120
|
suffix = f"{rfi_amp:.1e}RFI_" + suffix
|
|
113
121
|
else:
|
|
114
122
|
suffix = f"_{rfi_amp:.1e}RFI"
|
|
115
|
-
|
|
123
|
+
sim_config["output"]["suffix"] = f"{rfi_amp:.1e}RFI"
|
|
116
124
|
|
|
117
125
|
if args.SEFD is not None:
|
|
118
|
-
|
|
126
|
+
sim_config["observation"]["SEFD"] = args.SEFD
|
|
119
127
|
|
|
120
128
|
if args.int_time is not None:
|
|
121
|
-
|
|
129
|
+
sim_config["observation"]["int_time"] = args.int_time
|
|
122
130
|
|
|
123
131
|
if args.n_time is not None:
|
|
124
|
-
|
|
132
|
+
sim_config["observation"]["n_time"] = args.n_time
|
|
125
133
|
|
|
126
134
|
for ast in ["exp", "gauss", "point", "pow_spec"]:
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
sim_config["ast_sources"][ast]["path"] = get_abs_path(
|
|
136
|
+
sim_config["ast_sources"][ast]["path"], work_dir
|
|
129
137
|
)
|
|
130
138
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
sim_config["output"]["path"] = get_abs_path(sim_config["output"]["path"], work_dir)
|
|
140
|
+
sim_config["rfi_sources"]["tle_satellite"]["norad_ids_path"] = get_abs_path(
|
|
141
|
+
sim_config["rfi_sources"]["tle_satellite"]["norad_ids_path"], work_dir
|
|
134
142
|
)
|
|
135
|
-
|
|
136
|
-
|
|
143
|
+
sim_config["rfi_sources"]["tle_satellite"]["norad_spec_model"] = get_abs_path(
|
|
144
|
+
sim_config["rfi_sources"]["tle_satellite"]["norad_spec_model"], work_dir
|
|
137
145
|
)
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
sim_config["telescope"]["enu_path"] = get_abs_path(
|
|
147
|
+
sim_config["telescope"]["enu_path"], work_dir
|
|
140
148
|
)
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
sim_config["telescope"]["itrf_path"] = get_abs_path(
|
|
150
|
+
sim_config["telescope"]["itrf_path"], work_dir
|
|
143
151
|
)
|
|
144
152
|
|
|
145
|
-
return run_sim_config(
|
|
153
|
+
return run_sim_config(sim_config=sim_config, spacetrack_path=spacetrack_path)
|
|
146
154
|
|
|
147
155
|
|
|
148
156
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tabsim
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
4
4
|
Summary: Trajectory-based Radio Frequency Interference (RFI) simulations for radio interferometeric data.
|
|
5
5
|
Author-email: Chris Finlay <christopher.finlay@epfl.ch>
|
|
6
6
|
Maintainer-email: Chris Finlay <christopher.finlay@epfl.ch>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|