Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoughlin committed Apr 27, 2024
1 parent 4939469 commit 19f3c57
Show file tree
Hide file tree
Showing 10 changed files with 6,725 additions and 3,724 deletions.
7 changes: 4 additions & 3 deletions gwemopt/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from gwemopt.utils import angular_distance


def get_altaz_tiles(ra, dec, observer, obstime):
def get_altaz_tile(ra, dec, observer, obstime):

observer.date = ephem.Date(obstime.iso)

Expand Down Expand Up @@ -219,9 +219,10 @@ def get_order(
for ii in np.arange(len(exposurelist)):
# first, create an array of airmass-weighted probabilities
t = Time(exposurelist[ii][0], format="mjd")
alts, azs = [
altazs = [
get_altaz_tile(ra, dec, observer, t) for ra, dec in zip(ras, decs)
]
alts = np.array([altaz[0] for altaz in altazs])
horizon = config_struct["horizon"]
horizon_mask = alts <= horizon
airmass = 1 / np.cos((90.0 - alts) * np.pi / 180.0)
Expand Down Expand Up @@ -507,7 +508,7 @@ def scheduler(params, config_struct, tile_struct):

# calculate airmass for each tile at the start of its exposure:
t = Time(mjd_exposure_start, format="mjd")
alt, az = get_altaz_tiles(
alt, az = get_altaz_tile(
tile_struct_hold["ra"], tile_struct_hold["dec"], observer, t
)
airmass = 1 / np.cos((90.0 - alt) * np.pi / 180)
Expand Down
5 changes: 1 addition & 4 deletions gwemopt/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ def get_segments(params, config_struct):
if date_set > date_rise:
date_set = observer.previous_setting(sun, start=date_start)

astropy_rise = Time(date_rise.datetime(), scale="utc").mjd
astropy_set = Time(date_set.datetime(), scale="utc").mjd

segment = segments.segment(astropy_set, astropy_rise)
segment = segments.segment(date_rise + MJD_TO_DJD, date_set + MJD_TO_DJD)
nightsegmentlist = nightsegmentlist + segments.segmentlist([segment])
nightsegmentlist.coalesce()

Expand Down
4,002 changes: 2,001 additions & 2,001 deletions gwemopt/tests/data/expected_results/catalog_glade.csv

Large diffs are not rendered by default.

356 changes: 178 additions & 178 deletions gwemopt/tests/data/expected_results/coverage_KPED.dat
Original file line number Diff line number Diff line change
@@ -1,178 +1,178 @@
0 0.0302928641 1 1
7 0.0295213749 1 1
1 0.0280819837 1 1
2 0.0276213338 1 1
3 0.0233460911 1 1
4 0.0232143523 1 1
8 0.0220374872 1 1
17 0.0212078103 1 1
6 0.0210696896 1 1
18 0.0205220202 1 1
27 0.0201430609 1 1
9 0.0189606155 1 1
5 0.0170655065 1 1
21 0.0158574202 1 1
10 0.0149083741 1 1
22 0.0134429490 1 1
16 0.0124712075 1 1
11 0.0121943898 1 1
12 0.0118344504 1 1
37 0.0103046920 1 1
13 0.0099712057 1 1
45 0.0099311221 1 1
14 0.0098946326 1 1
15 0.0095826253 1 1
36 0.0094570131 1 1
53 0.0092757006 1 1
31 0.0089064814 1 1
32 0.0089012813 1 1
25 0.0088426668 1 1
19 0.0086959706 1 1
20 0.0084549729 1 1
41 0.0083153214 1 1
26 0.0080605056 1 1
42 0.0080216034 1 1
23 0.0074860460 1 1
24 0.0074829227 1 1
28 0.0072042891 1 1
35 0.0071830385 1 1
62 0.0071459848 1 1
44 0.0069485386 1 1
76 0.0068902020 1 1
29 0.0068119980 1 1
30 0.0067999566 1 1
33 0.0061954681 1 1
46 0.0060863928 1 1
34 0.0060788906 1 1
56 0.0058085908 1 1
59 0.0057339704 1 1
49 0.0052733153 1 1
88 0.0051728741 1 1
38 0.0050831957 1 1
39 0.0050408282 1 1
68 0.0050128720 1 1
40 0.0049501575 1 1
43 0.0047593481 1 1
95 0.0046121082 1 1
47 0.0046021461 1 1
48 0.0045505576 1 1
50 0.0043638403 1 1
58 0.0043125102 1 1
51 0.0040210802 1 1
52 0.0039479157 1 1
84 0.0039047046 1 1
54 0.0037643338 1 1
55 0.0037605077 1 1
57 0.0036238149 1 1
94 0.0036165771 1 1
97 0.0034664517 1 1
90 0.0033155384 1 1
63 0.0032447773 1 1
60 0.0032171767 1 1
61 0.0031635661 1 1
123 0.0031588093 1 1
109 0.0030631282 1 1
77 0.0030118239 1 1
71 0.0029924936 1 1
64 0.0029537866 1 1
65 0.0029496469 1 1
102 0.0029435575 1 1
129 0.0029379019 1 1
66 0.0029174452 1 1
67 0.0029150408 1 1
93 0.0028204457 1 1
75 0.0028068085 1 1
69 0.0027008160 1 1
70 0.0026723834 1 1
80 0.0026384172 1 1
73 0.0025996196 1 1
74 0.0025990248 1 1
72 0.0025968389 1 1
124 0.0025669124 1 1
105 0.0025287586 1 1
78 0.0024298877 1 1
79 0.0023934103 1 1
104 0.0023605618 1 1
86 0.0023562412 1 1
81 0.0023256315 1 1
92 0.0023146611 1 1
111 0.0023097137 1 1
110 0.0023024330 1 1
82 0.0022896428 1 1
83 0.0022260838 1 1
117 0.0022100527 1 1
99 0.0021799210 1 1
140 0.0021697292 1 1
128 0.0021171286 1 1
115 0.0021088905 1 1
137 0.0021080072 1 1
85 0.0020662908 1 1
87 0.0020355535 1 1
103 0.0020195127 1 1
208 0.0019978358 1 1
89 0.0019728187 1 1
91 0.0019428633 1 1
135 0.0018955007 1 1
149 0.0018818937 1 1
130 0.0018651966 1 1
100 0.0018455585 1 1
150 0.0018455279 1 1
98 0.0018434990 1 1
96 0.0018366088 1 1
101 0.0017177326 1 1
146 0.0017135196 1 1
145 0.0016903558 1 1
112 0.0016618371 1 1
139 0.0016359968 1 1
106 0.0016097723 1 1
121 0.0016095387 1 1
114 0.0016087873 1 1
107 0.0016010616 1 1
108 0.0015770829 1 1
172 0.0015442645 1 1
131 0.0015035835 1 1
113 0.0014670616 1 1
134 0.0014522291 1 1
116 0.0014140147 1 1
118 0.0014023336 1 1
119 0.0013860255 1 1
181 0.0013740680 1 1
127 0.0013737900 1 1
142 0.0013696629 1 1
215 0.0013597679 1 1
120 0.0013580013 1 1
229 0.0013514795 1 1
138 0.0013196903 1 1
148 0.0012886521 1 1
122 0.0012773786 1 1
220 0.0012720972 1 1
192 0.0012700662 1 1
250 0.0012686803 1 1
126 0.0012541223 1 1
243 0.0012306659 1 1
164 0.0012175242 1 1
184 0.0012167913 1 1
222 0.0011921171 1 1
132 0.0011775361 1 1
133 0.0011744670 1 1
166 0.0011732100 1 1
136 0.0011650038 1 1
152 0.0011374408 1 1
194 0.0011218145 1 1
161 0.0011217086 1 1
160 0.0011112155 1 1
258 0.0010841690 1 1
141 0.0010826734 1 1
223 0.0010627716 1 1
143 0.0010551584 1 1
144 0.0010529390 1 1
198 0.0010424024 1 1
228 0.0010370347 1 1
147 0.0010187494 1 1
203 0.0009893340 1 1
151 0.0009848426 1 1
153 0.0009821694 1 1
227 0.0009795075 1 1
154 0.0009768538 1 1
168 0.0008437203 1 1
213 0.0006069812 0 1
0 0.0465378779 1 1
1 0.0402247012 1 1
5 0.0356842995 1 1
2 0.0325496266 1 1
3 0.0312539172 1 1
8 0.0258489281 1 1
4 0.0242680407 1 1
6 0.0224916673 1 1
7 0.0222180370 1 1
12 0.0207573647 1 1
24 0.0181768065 1 1
9 0.0165753933 1 1
36 0.0152967863 1 1
23 0.0148210156 1 1
10 0.0147876985 1 1
11 0.0147330794 1 1
13 0.0141169770 1 1
14 0.0139952222 1 1
15 0.0129470393 1 1
16 0.0127856048 1 1
17 0.0123939346 1 1
41 0.0119388785 1 1
18 0.0119253888 1 1
19 0.0114672691 1 1
43 0.0113705133 1 1
20 0.0106183452 1 1
21 0.0105591114 1 1
32 0.0103824061 1 1
22 0.0102762503 1 1
25 0.0096948466 1 1
40 0.0094337458 1 1
37 0.0091500256 1 1
26 0.0090819922 1 1
27 0.0090310087 1 1
28 0.0089964061 1 1
29 0.0088269543 1 1
30 0.0087371235 1 1
33 0.0086458275 1 1
45 0.0084772760 1 1
48 0.0083434382 1 1
34 0.0083355762 1 1
35 0.0082674117 1 1
46 0.0077663218 1 1
51 0.0075851678 1 1
38 0.0075122846 1 1
39 0.0071812794 1 1
56 0.0069248293 1 1
42 0.0064726443 1 1
72 0.0059788282 1 1
44 0.0059045362 1 1
63 0.0055916638 1 1
47 0.0053229565 1 1
54 0.0049203479 1 1
49 0.0047591335 1 1
70 0.0047122402 1 1
50 0.0045860802 1 1
52 0.0043533822 1 1
53 0.0043188309 1 1
55 0.0040491821 1 1
61 0.0037364099 1 1
117 0.0037145856 1 1
64 0.0035426903 1 1
57 0.0033823788 1 1
59 0.0033717646 1 1
58 0.0033684299 1 1
73 0.0033623236 1 1
81 0.0033384889 1 1
84 0.0033015882 1 1
60 0.0032635323 1 1
93 0.0032330228 1 1
62 0.0031477612 1 1
75 0.0031280182 1 1
82 0.0031159666 1 1
65 0.0030052426 1 1
107 0.0030019255 1 1
113 0.0029395392 1 1
66 0.0029058988 1 1
67 0.0029047043 1 1
68 0.0028976559 1 1
69 0.0028366368 1 1
76 0.0027227700 1 1
31 0.0026626768 1 1
88 0.0026566029 1 1
112 0.0026344918 1 1
71 0.0026091897 1 1
74 0.0025718578 1 1
118 0.0025250640 1 1
78 0.0024887992 1 1
97 0.0024401767 1 1
77 0.0024394263 1 1
79 0.0024118421 1 1
86 0.0023867562 1 1
80 0.0023800642 1 1
115 0.0023007850 1 1
111 0.0023000581 1 1
148 0.0022800913 1 1
83 0.0022166857 1 1
85 0.0021326208 1 1
116 0.0021077219 1 1
87 0.0020811817 1 1
125 0.0020811038 1 1
96 0.0020126155 1 1
89 0.0019433047 1 1
90 0.0019383143 1 1
91 0.0018575720 1 1
92 0.0018411230 1 1
99 0.0018106583 1 1
94 0.0018083837 1 1
95 0.0017901713 1 1
108 0.0017392912 1 1
98 0.0017373564 1 1
100 0.0017140495 1 1
101 0.0017137062 1 1
102 0.0016839795 1 1
103 0.0016392850 1 1
142 0.0016386415 1 1
104 0.0016321287 1 1
105 0.0016316701 1 1
106 0.0016237516 1 1
127 0.0015730792 1 1
114 0.0014979805 1 1
137 0.0014667016 1 1
109 0.0014605493 1 1
110 0.0014507755 1 1
151 0.0014349776 1 1
134 0.0014052586 1 1
164 0.0013861600 1 1
157 0.0013640005 1 1
120 0.0013403700 1 1
143 0.0013114654 1 1
156 0.0012757036 1 1
119 0.0012651160 1 1
149 0.0012594342 1 1
121 0.0012282309 1 1
155 0.0012212640 1 1
122 0.0011819022 1 1
123 0.0011596560 1 1
173 0.0011288507 1 1
124 0.0011196148 1 1
126 0.0010999163 1 1
128 0.0010911400 1 1
129 0.0010890244 1 1
146 0.0010783008 1 1
130 0.0010751829 1 1
167 0.0010585201 1 1
131 0.0010475244 1 1
132 0.0010471228 1 1
133 0.0010363011 1 1
135 0.0010183305 1 1
136 0.0010152518 1 1
138 0.0009979338 1 1
139 0.0009854470 1 1
140 0.0009449427 1 1
141 0.0009439848 1 1
192 0.0009300975 1 1
144 0.0009043588 1 1
145 0.0008923953 1 1
147 0.0008798907 1 1
150 0.0008646305 1 1
198 0.0008553574 1 1
201 0.0008520322 1 1
152 0.0008277560 1 1
153 0.0008241527 1 1
154 0.0008015946 1 1
170 0.0007958760 1 1
158 0.0007756951 1 1
159 0.0007724625 1 1
160 0.0007708099 1 1
161 0.0007540851 1 1
162 0.0007476359 1 1
180 0.0007444053 1 1
163 0.0007274333 1 1
165 0.0007011670 1 1
166 0.0006897825 1 1
197 0.0006890637 1 1
168 0.0006812669 1 1
176 0.0006333556 1 0
195 0.0004927698 1 1

0 comments on commit 19f3c57

Please sign in to comment.