-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from radionets-project/sampling_masks
Sampling masks
- Loading branch information
Showing
31 changed files
with
2,480 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
# make | ||
*_done | ||
*/build | ||
*/*/build | ||
|
||
*.ipynb_checkpoints | ||
*.pyc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[sampling_options] | ||
mode = "basic" | ||
layout = "vlba" | ||
img_size = 64 | ||
fov_center_ra = [00:00:00.0, 23:59:59.59] | ||
fov_center_dec = [00:00:00.0, 11:59:59.59] | ||
fov_size = 0.0064 # max res 0.1 | ||
corr_int_time = 10.0 | ||
scan_start = ["01-01-2020 00:00:01", "31-12-2021 23:59:59"] | ||
scan_duration = [50, 300] | ||
scans = [30, 72] | ||
interval_length = 1200 | ||
base_freq = 15.21e9 | ||
frequsel = [0e8, 0.8e8, 1.44e8, 2.08e8] | ||
bandwidths = [6.4e7, 6.4e7, 6.4e7, 6.4e7] | ||
|
||
[bundle_options] | ||
num_bundles = 5 | ||
size_bundles = 10 | ||
in_path = "../../../test_radiosim/build/test_data" | ||
out_path = "./build" | ||
|
||
[cluster_options] | ||
num_jobs = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import numpy as np | ||
from astropy.io import fits | ||
from pathlib import Path | ||
|
||
|
||
class fits_data: | ||
def __init__(self, data_path): | ||
"""Handle h5 files simulated with radiosim package. | ||
Parameters | ||
---------- | ||
data_path: str | ||
path to fits data directory | ||
""" | ||
self.path = data_path | ||
self.files = self.get_files(Path(data_path)) | ||
self.num_files = len(self.files) | ||
|
||
def __call__(self): | ||
return print("This is the pyvisgen fits files data set class.") | ||
|
||
def __len__(self): | ||
""" | ||
Returns the total number of fits files in this dataset. | ||
""" | ||
return self.num_files | ||
|
||
def __getitem__(self, i): | ||
return self.open_file(i) | ||
|
||
def get_files(self, path): | ||
return np.sort(np.array([x for x in path.iterdir()])) | ||
|
||
def get_uv_data(self, i): | ||
with fits.open(self.files[i]) as hdul: | ||
uv_data = hdul[0].data | ||
hdul.close() | ||
return uv_data | ||
|
||
def get_freq_data(self, i): | ||
with fits.open(self.files[i]) as hdul: | ||
base_freq = hdul[0].header["CRVAL4"] | ||
freq_data = hdul[2].data | ||
hdul.close() | ||
return freq_data, base_freq | ||
|
||
def open_file(self, i): | ||
if isinstance(i, np.ndarray): | ||
print("Only one file can be open at the same time!") | ||
return | ||
|
||
with fits.open(self.files[i]) as hdul: | ||
fits_file = hdul | ||
hdul.close() | ||
return fits_file.info() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.