Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major update of Telescope class #631

Merged
merged 53 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6b2d2be
Warning properly formatted (no newline)
anawas Oct 29, 2024
b66dde5
Testing baseline functionality for OSKAR telescope :dvd:
anawas Oct 29, 2024
ae119f5
Added comment about which value for Earth radius astropy uses :beetle:
anawas Oct 29, 2024
ce8f34e
Added test for coordinate_helper functions :speech_balloon:
anawas Oct 29, 2024
e910983
Set Earth radius to more precise value :star:
anawas Oct 30, 2024
aff02b9
using build in conversions for rad <-> deg :tram:
anawas Oct 30, 2024
6e14340
Add test for east_north function :wedding:
anawas Oct 30, 2024
8668164
parametrized test :heavy_division_sign:
anawas Oct 30, 2024
694a8d5
removed print statement :grimacing:
anawas Oct 30, 2024
15f2886
Added documentation :two_women_holding_hands:
anawas Nov 1, 2024
f881dee
Make clear that backend is OSKAR :oncoming_automobile:
anawas Nov 1, 2024
eb8cbda
Must be able to set name of RASCIL telescope :fork_and_knife:
anawas Nov 1, 2024
ea96a8c
Add test to assert name can be set. :fax:
anawas Nov 1, 2024
21198dc
Fixed typo :neutral_face:
anawas Nov 1, 2024
43fe31d
Function to convert RASCIl to OSKAR :running_shirt_with_sash:
anawas Nov 1, 2024
5b4ad5a
Function creates KARABO telescope from RASCIL dataset :neutral_face:
anawas Nov 1, 2024
5d267ec
First test for new RASCIL functionality :small_red_triangle:
anawas Nov 1, 2024
d595dd1
Refactored to own method :boar:
anawas Nov 4, 2024
df047fd
Calculating combinations is easier with itertools :heavy_minus_sign:
anawas Nov 4, 2024
12ce08e
Better wording (a baseline has a length) :video_camera:
anawas Nov 4, 2024
fce940c
Renaming baselines -> stations because the values are coordinates of …
anawas Nov 4, 2024
bb29d21
Refactored baseline code :cn:
anawas Nov 4, 2024
f2b7fef
Edit comment :left_right_arrow:
anawas Nov 5, 2024
4621fc5
Must set delimiter or we get an error :sunflower:
anawas Nov 5, 2024
76984df
Must set delimiter or we cannot read in wit _get_station_infos() :lau…
anawas Nov 5, 2024
0ff4ad2
Function __read_layout_txt is more robust than np.loadtxt :family:
anawas Nov 6, 2024
a63d514
Using karabo functions to create tmp folder. This is consistent with …
anawas Nov 6, 2024
6dbbf8d
Edit test for create_baseline_cut_telescope :seedling:
anawas Nov 7, 2024
b4c77f7
Narrowing of type now done properly :baby:
anawas Nov 7, 2024
ba10f8e
Removed unnecessary f-string :phone:
anawas Nov 19, 2024
6225358
Edit comment to clarify dummy coordinates :revolving_hearts:
anawas Nov 19, 2024
4309a5a
Not ignoring fun-arg :arrows_clockwise:
anawas Nov 19, 2024
571a4fb
Uncommented test function. It tests if we get the proper number of ba…
anawas Nov 19, 2024
ef8fc25
Better wording :postal_horn:
anawas Nov 19, 2024
ad9f69c
Add type hints :v:
anawas Nov 19, 2024
c7f621f
Raising error to fail fast (avoid silent error). Requested in PR #631.
anawas Nov 19, 2024
b61765f
Set reference to discussion in PR #631 :loop:
anawas Nov 19, 2024
4824d65
Type hint removed. The return type can be deduced from the function d…
anawas Nov 20, 2024
6ffb29f
* Antennas are not plotted anymore. They clutter the plot
anawas Nov 21, 2024
6f1c0f6
Updated size. Imge is smaller now because antennas are not plotted an…
anawas Nov 21, 2024
47c2bcd
Fixed typo :curry:
anawas Nov 21, 2024
9575e36
Merge branch 'main' into aw_fix_telescope
anawas Nov 22, 2024
1525d66
* Add checking for negative index
anawas Nov 25, 2024
eed318d
Add files from last pull :cn:
anawas Nov 26, 2024
8857e0c
Excluding binary files that are written by OSKAR.
anawas Nov 26, 2024
3e59b3f
Not testing for specific file size anymore. But if file size > 0.
anawas Nov 26, 2024
01175d3
Add type hint :sleepy:
anawas Nov 26, 2024
09c52d4
np.isclose() is better code style in this case :green_heart:
anawas Nov 28, 2024
3c14024
Added some comment to clarify algorithm
anawas Nov 28, 2024
8593619
Using numpy.isclose() is smarter solution.
anawas Nov 28, 2024
608ead7
Merge branch 'main' into aw_fix_telescope
anawas Nov 28, 2024
073168c
Add comment to make purpose of function __convert_to_karabo_telescope…
anawas Nov 28, 2024
54b6779
addressed MR feedback regarding pdist :saxophone:
Lukas113 Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ karabo/examples/karabo/test/data/results/*
# Other (playground, experiment, ..)
.experiment/*
data_download/*

# files that are generated by OSKAR
karabo/data/meerkat.tm/element_pattern*
10 changes: 5 additions & 5 deletions karabo/simulation/coordinate_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def east_north_to_long_lat(
"""

# https://stackoverflow.com/questions/7477003/calculating-new-longitude-latitude-from-old-n-meters
r_earth = 6371000
new_latitude = lat + (east_relative / r_earth) * (180 / np.pi)
new_longitude = long + (north_relative / r_earth) * (180 / np.pi) / np.cos(
long * np.pi / 180
r_earth = 6378100 # from astropy (astropy.constants.R_earth.value)
anawas marked this conversation as resolved.
Show resolved Hide resolved
new_latitude = lat + np.rad2deg(east_relative / r_earth)
new_longitude = long + np.rad2deg(north_relative / r_earth) / np.cos(
np.deg2rad(long)
)
return new_longitude, new_latitude

Expand All @@ -31,7 +31,7 @@ def wgs84_to_cartesian(
lon: Union[float, NDArray[np.float64]],
lat: Union[float, NDArray[np.float64]],
alt: Union[float, NDArray[np.float64]],
radius: int = 6371000,
radius: int = 6378100,
) -> NDArray[np.float64]:
"""Transforms WGS84 to cartesian in meters.

Expand Down
6 changes: 3 additions & 3 deletions karabo/simulation/sky_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,14 +819,14 @@ def read_from_file(cls: Type[_TSkyModel], path: str) -> _TSkyModel:

if dataframe.shape[1] < 3:
raise KaraboSkyModelError(
f"CSV does not have the necessary 3 basic columns (RA, DEC and "
"CSV does not have the necessary 3 basic columns (RA, DEC and "
f"STOKES I), but only {dataframe.shape[1]} columns."
)

if dataframe.shape[1] > cls.SOURCES_COLS:
print(
f"""CSV has {dataframe.shape[1] - cls.SOURCES_COLS + 1}
too many rows. The extra rows will be cut off."""
f"CSV has {dataframe.shape[1] - cls.SOURCES_COLS + 1} "
"rows too many. The extra rows will be cut off."
)

return cls(dataframe)
Expand Down
Loading
Loading