Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
763663de
Commit
763663de
authored
Oct 16, 2018
by
Chris Shallue
Committed by
Christopher Shallue
Oct 16, 2018
Browse files
Project import generated by Copybara.
PiperOrigin-RevId: 217341274
parent
ca2db9bd
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
research/astronet/light_curve_util/util_test.py
research/astronet/light_curve_util/util_test.py
+8
-20
No files found.
research/astronet/light_curve_util/util_test.py
View file @
763663de
...
...
@@ -280,23 +280,11 @@ class LightCurveUtilTest(absltest.TestCase):
util
.
reshard_arrays
(
xs
,
[
np
.
array
([
10
,
20
,
30
]),
np
.
array
([
40
,
50
])])
def
testUniformCadenceLightCurve
(
self
):
all_cadence_no
=
[
np
.
array
([
13
]),
np
.
array
([
4
,
5
,
6
]),
np
.
array
([
8
,
9
,
11
,
12
]),
]
all_time
=
[
np
.
array
([
130
]),
np
.
array
([
40
,
50
,
60
]),
np
.
array
([
80
,
90
,
110
,
120
]),
]
all_flux
=
[
np
.
array
([
1300
]),
np
.
array
([
400
,
500
,
600
]),
np
.
array
([
800
,
np
.
nan
,
1100
,
1200
]),
]
input_cadence_no
=
np
.
array
([
13
,
4
,
5
,
6
,
8
,
9
,
11
,
12
])
input_time
=
np
.
array
([
130
,
40
,
50
,
60
,
80
,
90
,
110
,
120
])
input_flux
=
np
.
array
([
1300
,
400
,
500
,
600
,
800
,
np
.
nan
,
1100
,
1200
])
cadence_no
,
time
,
flux
,
mask
=
util
.
uniform_cadence_light_curve
(
all
_cadence_no
,
all
_time
,
all
_flux
)
input
_cadence_no
,
input
_time
,
input
_flux
)
np
.
testing
.
assert_array_equal
([
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
],
cadence_no
)
np
.
testing
.
assert_array_equal
([
40
,
50
,
60
,
0
,
80
,
0
,
0
,
110
,
120
,
130
],
...
...
@@ -306,11 +294,11 @@ class LightCurveUtilTest(absltest.TestCase):
np
.
testing
.
assert_array_equal
([
1
,
1
,
1
,
0
,
1
,
0
,
0
,
1
,
1
,
1
],
mask
)
# Add duplicate cadence number.
all
_cadence_no
.
append
(
np
.
array
([
13
,
14
,
15
]))
all_time
.
append
(
np
.
array
([
130
,
140
,
150
]))
all_flux
.
append
(
np
.
array
([
1300
,
1400
,
1500
]))
input
_cadence_no
=
np
.
concatenate
([
input_cadence_no
,
np
.
array
([
13
,
14
])
]
)
input_time
=
np
.
concatenate
([
input_time
,
np
.
array
([
130
,
140
])
]
)
input_flux
=
np
.
concatenate
([
input_flux
,
np
.
array
([
1300
,
1400
])
]
)
with
self
.
assertRaisesRegexp
(
ValueError
,
"Duplicate cadence number"
):
util
.
uniform_cadence_light_curve
(
all
_cadence_no
,
all
_time
,
all
_flux
)
util
.
uniform_cadence_light_curve
(
input
_cadence_no
,
input
_time
,
input
_flux
)
def
testCountTransitPoints
(
self
):
time
=
np
.
concatenate
([
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment