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
e00e0e13
Commit
e00e0e13
authored
Dec 03, 2018
by
dreamdragon
Browse files
Merge remote-tracking branch 'upstream/master'
parents
b915db4e
402b561b
Changes
205
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
52 additions
and
50 deletions
+52
-50
research/astronet/light_curve/fast_ops/normalize.cc
research/astronet/light_curve/fast_ops/normalize.cc
+2
-2
research/astronet/light_curve/fast_ops/normalize.h
research/astronet/light_curve/fast_ops/normalize.h
+3
-3
research/astronet/light_curve/fast_ops/normalize_test.cc
research/astronet/light_curve/fast_ops/normalize_test.cc
+2
-2
research/astronet/light_curve/fast_ops/phase_fold.cc
research/astronet/light_curve/fast_ops/phase_fold.cc
+1
-1
research/astronet/light_curve/fast_ops/phase_fold.h
research/astronet/light_curve/fast_ops/phase_fold.h
+3
-3
research/astronet/light_curve/fast_ops/phase_fold_test.cc
research/astronet/light_curve/fast_ops/phase_fold_test.cc
+2
-2
research/astronet/light_curve/fast_ops/python/median_filter.clif
...h/astronet/light_curve/fast_ops/python/median_filter.clif
+2
-2
research/astronet/light_curve/fast_ops/python/median_filter_test.py
...stronet/light_curve/fast_ops/python/median_filter_test.py
+1
-1
research/astronet/light_curve/fast_ops/python/phase_fold.clif
...arch/astronet/light_curve/fast_ops/python/phase_fold.clif
+2
-2
research/astronet/light_curve/fast_ops/python/phase_fold_test.py
...h/astronet/light_curve/fast_ops/python/phase_fold_test.py
+1
-1
research/astronet/light_curve/fast_ops/python/postproc.py
research/astronet/light_curve/fast_ops/python/postproc.py
+1
-1
research/astronet/light_curve/fast_ops/python/view_generator.clif
.../astronet/light_curve/fast_ops/python/view_generator.clif
+3
-3
research/astronet/light_curve/fast_ops/python/view_generator_test.py
...tronet/light_curve/fast_ops/python/view_generator_test.py
+1
-1
research/astronet/light_curve/fast_ops/test_util.h
research/astronet/light_curve/fast_ops/test_util.h
+3
-3
research/astronet/light_curve/fast_ops/view_generator.cc
research/astronet/light_curve/fast_ops/view_generator.cc
+4
-4
research/astronet/light_curve/fast_ops/view_generator.h
research/astronet/light_curve/fast_ops/view_generator.h
+7
-6
research/astronet/light_curve/fast_ops/view_generator_test.cc
...arch/astronet/light_curve/fast_ops/view_generator_test.cc
+3
-3
research/astronet/light_curve/kepler_io.py
research/astronet/light_curve/kepler_io.py
+1
-1
research/astronet/light_curve/kepler_io_test.py
research/astronet/light_curve/kepler_io_test.py
+10
-9
research/astronet/light_curve/median_filter.py
research/astronet/light_curve/median_filter.py
+0
-0
No files found.
research/astronet/light_curve
_util/cc
/normalize.cc
→
research/astronet/light_curve
/fast_ops
/normalize.cc
View file @
e00e0e13
...
@@ -12,12 +12,12 @@ See the License for the specific language governing permissions and
...
@@ -12,12 +12,12 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#include "light_curve
_util/cc
/normalize.h"
#include "light_curve
/fast_ops
/normalize.h"
#include <algorithm>
#include <algorithm>
#include "absl/strings/substitute.h"
#include "absl/strings/substitute.h"
#include "light_curve
_util/cc
/median.h"
#include "light_curve
/fast_ops
/median.h"
using
absl
::
Substitute
;
using
absl
::
Substitute
;
using
std
::
vector
;
using
std
::
vector
;
...
...
research/astronet/light_curve
_util/cc
/normalize.h
→
research/astronet/light_curve
/fast_ops
/normalize.h
View file @
e00e0e13
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_NORMALIZE_H_
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_NORMALIZE_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_NORMALIZE_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_NORMALIZE_H_
#include <iostream>
#include <iostream>
...
@@ -41,4 +41,4 @@ bool NormalizeMedianAndMinimum(const std::vector<double>& x,
...
@@ -41,4 +41,4 @@ bool NormalizeMedianAndMinimum(const std::vector<double>& x,
}
// namespace astronet
}
// namespace astronet
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_NORMALIZE_H_
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_NORMALIZE_H_
research/astronet/light_curve
_util/cc
/normalize_test.cc
→
research/astronet/light_curve
/fast_ops
/normalize_test.cc
View file @
e00e0e13
...
@@ -12,11 +12,11 @@ See the License for the specific language governing permissions and
...
@@ -12,11 +12,11 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#include "light_curve
_util/cc
/normalize.h"
#include "light_curve
/fast_ops
/normalize.h"
#include "gmock/gmock.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "light_curve
_util/cc
/test_util.h"
#include "light_curve
/fast_ops
/test_util.h"
using
std
::
vector
;
using
std
::
vector
;
using
testing
::
Pointwise
;
using
testing
::
Pointwise
;
...
...
research/astronet/light_curve
_util/cc
/phase_fold.cc
→
research/astronet/light_curve
/fast_ops
/phase_fold.cc
View file @
e00e0e13
...
@@ -12,7 +12,7 @@ See the License for the specific language governing permissions and
...
@@ -12,7 +12,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#include "light_curve
_util/cc
/phase_fold.h"
#include "light_curve
/fast_ops
/phase_fold.h"
#include <math.h>
#include <math.h>
#include <algorithm>
#include <algorithm>
...
...
research/astronet/light_curve
_util/cc
/phase_fold.h
→
research/astronet/light_curve
/fast_ops
/phase_fold.h
View file @
e00e0e13
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_PHASE_FOLD_H_
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_PHASE_FOLD_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_PHASE_FOLD_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_PHASE_FOLD_H_
#include <iostream>
#include <iostream>
...
@@ -65,4 +65,4 @@ bool PhaseFoldAndSortLightCurve(std::vector<double> time,
...
@@ -65,4 +65,4 @@ bool PhaseFoldAndSortLightCurve(std::vector<double> time,
}
// namespace astronet
}
// namespace astronet
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_PHASE_FOLD_H_
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_PHASE_FOLD_H_
research/astronet/light_curve
_util/cc
/phase_fold_test.cc
→
research/astronet/light_curve
/fast_ops
/phase_fold_test.cc
View file @
e00e0e13
...
@@ -12,11 +12,11 @@ See the License for the specific language governing permissions and
...
@@ -12,11 +12,11 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#include "light_curve
_util/cc
/phase_fold.h"
#include "light_curve
/fast_ops
/phase_fold.h"
#include "gmock/gmock.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "light_curve
_util/cc
/test_util.h"
#include "light_curve
/fast_ops
/test_util.h"
using
std
::
vector
;
using
std
::
vector
;
using
testing
::
Pointwise
;
using
testing
::
Pointwise
;
...
...
research/astronet/light_curve
_util/cc
/python/median_filter.clif
→
research/astronet/light_curve
/fast_ops
/python/median_filter.clif
View file @
e00e0e13
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
#
#
# See https://github.com/google/clif
# See https://github.com/google/clif
from light_curve
_util.cc
.python.postproc import ValueErrorOnFalse
from light_curve
.fast_ops
.python.postproc import ValueErrorOnFalse
from "third_party/tensorflow_models/astronet/light_curve
_util/cc
/median_filter.h":
from "third_party/tensorflow_models/astronet/light_curve
/fast_ops
/median_filter.h":
namespace `astronet`:
namespace `astronet`:
def `MedianFilter` as median_filter (x: list<float>,
def `MedianFilter` as median_filter (x: list<float>,
y: list<float>,
y: list<float>,
...
...
research/astronet/light_curve
_util/cc
/python/median_filter_test.py
→
research/astronet/light_curve
/fast_ops
/python/median_filter_test.py
View file @
e00e0e13
...
@@ -21,7 +21,7 @@ from __future__ import print_function
...
@@ -21,7 +21,7 @@ from __future__ import print_function
from
absl.testing
import
absltest
from
absl.testing
import
absltest
import
numpy
as
np
import
numpy
as
np
from
light_curve
_util.cc
.python
import
median_filter
from
light_curve
.fast_ops
.python
import
median_filter
class
MedianFilterTest
(
absltest
.
TestCase
):
class
MedianFilterTest
(
absltest
.
TestCase
):
...
...
research/astronet/light_curve
_util/cc
/python/phase_fold.clif
→
research/astronet/light_curve
/fast_ops
/python/phase_fold.clif
View file @
e00e0e13
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
#
#
# See https://github.com/google/clif
# See https://github.com/google/clif
from light_curve
_util.cc
.python.postproc import ValueErrorOnFalse
from light_curve
.fast_ops
.python.postproc import ValueErrorOnFalse
from "third_party/tensorflow_models/astronet/light_curve
_util/cc
/phase_fold.h":
from "third_party/tensorflow_models/astronet/light_curve
/fast_ops
/phase_fold.h":
namespace `astronet`:
namespace `astronet`:
def `PhaseFoldTime` as phase_fold_time (time: list<float>,
def `PhaseFoldTime` as phase_fold_time (time: list<float>,
period: float,
period: float,
...
...
research/astronet/light_curve
_util/cc
/python/phase_fold_test.py
→
research/astronet/light_curve
/fast_ops
/python/phase_fold_test.py
View file @
e00e0e13
...
@@ -21,7 +21,7 @@ from __future__ import print_function
...
@@ -21,7 +21,7 @@ from __future__ import print_function
from
absl.testing
import
absltest
from
absl.testing
import
absltest
import
numpy
as
np
import
numpy
as
np
from
light_curve
_util.cc
.python
import
phase_fold
from
light_curve
.fast_ops
.python
import
phase_fold
class
PhaseFoldTimeTest
(
absltest
.
TestCase
):
class
PhaseFoldTimeTest
(
absltest
.
TestCase
):
...
...
research/astronet/light_curve
_util/cc
/python/postproc.py
→
research/astronet/light_curve
/fast_ops
/python/postproc.py
View file @
e00e0e13
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
"""Postprocessing utility function for CLIF."""
"""Postprocessing utility function
s
for CLIF."""
# CLIF postprocessor for a C++ function with signature:
# CLIF postprocessor for a C++ function with signature:
...
...
research/astronet/light_curve
_util/cc
/python/view_generator.clif
→
research/astronet/light_curve
/fast_ops
/python/view_generator.clif
View file @
e00e0e13
...
@@ -16,10 +16,10 @@
...
@@ -16,10 +16,10 @@
#
#
# See https://github.com/google/clif
# See https://github.com/google/clif
from light_curve
_util.cc
.python.postproc import ValueErrorOnFalse
from light_curve
.fast_ops
.python.postproc import ValueErrorOnFalse
from light_curve
_util.cc
.python.postproc import ValueErrorOnNull
from light_curve
.fast_ops
.python.postproc import ValueErrorOnNull
from "third_party/tensorflow_models/astronet/light_curve
_util/cc
/view_generator.h":
from "third_party/tensorflow_models/astronet/light_curve
/fast_ops
/view_generator.h":
namespace `astronet`:
namespace `astronet`:
class ViewGenerator:
class ViewGenerator:
def `GenerateView` as generate_view (self,
def `GenerateView` as generate_view (self,
...
...
research/astronet/light_curve
_util/cc
/python/view_generator_test.py
→
research/astronet/light_curve
/fast_ops
/python/view_generator_test.py
View file @
e00e0e13
...
@@ -21,7 +21,7 @@ from __future__ import print_function
...
@@ -21,7 +21,7 @@ from __future__ import print_function
from
absl.testing
import
absltest
from
absl.testing
import
absltest
import
numpy
as
np
import
numpy
as
np
from
light_curve
_util.cc
.python
import
view_generator
from
light_curve
.fast_ops
.python
import
view_generator
class
ViewGeneratorTest
(
absltest
.
TestCase
):
class
ViewGeneratorTest
(
absltest
.
TestCase
):
...
...
research/astronet/light_curve
_util/cc
/test_util.h
→
research/astronet/light_curve
/fast_ops
/test_util.h
View file @
e00e0e13
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_TEST_UTIL_H_
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_TEST_UTIL_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_TEST_UTIL_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_TEST_UTIL_H_
#include <vector>
#include <vector>
...
@@ -42,4 +42,4 @@ inline std::vector<double> range(double start, double stop, double step) {
...
@@ -42,4 +42,4 @@ inline std::vector<double> range(double start, double stop, double step) {
}
// namespace astronet
}
// namespace astronet
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_TEST_UTIL_H_
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_TEST_UTIL_H_
research/astronet/light_curve
_util/cc
/view_generator.cc
→
research/astronet/light_curve
/fast_ops
/view_generator.cc
View file @
e00e0e13
...
@@ -12,12 +12,12 @@ See the License for the specific language governing permissions and
...
@@ -12,12 +12,12 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#include "light_curve
_util/cc
/view_generator.h"
#include "light_curve
/fast_ops
/view_generator.h"
#include "absl/memory/memory.h"
#include "absl/memory/memory.h"
#include "light_curve
_util/cc
/median_filter.h"
#include "light_curve
/fast_ops
/median_filter.h"
#include "light_curve
_util/cc
/normalize.h"
#include "light_curve
/fast_ops
/normalize.h"
#include "light_curve
_util/cc
/phase_fold.h"
#include "light_curve
/fast_ops
/phase_fold.h"
using
std
::
vector
;
using
std
::
vector
;
...
...
research/astronet/light_curve
_util/cc
/view_generator.h
→
research/astronet/light_curve
/fast_ops
/view_generator.h
View file @
e00e0e13
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
...
@@ -12,8 +12,8 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_VIEW_GENERATOR_H_
#ifndef TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_VIEW_GENERATOR_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_VIEW_GENERATOR_H_
#define TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_VIEW_GENERATOR_H_
#include <memory>
#include <memory>
#include <string>
#include <string>
...
@@ -24,9 +24,10 @@ namespace astronet {
...
@@ -24,9 +24,10 @@ namespace astronet {
// Helper class for phase-folding a light curve and then generating "views" of
// Helper class for phase-folding a light curve and then generating "views" of
// the light curve using a median filter.
// the light curve using a median filter.
//
//
// This class wraps the functions in light_curve_util.h for intended use as a
// This class wraps functions for phase folding, median filtering, and
// a Python extension. It keeps the phase-folded light curve in the class state
// normalizing for efficient use as a Python extension. It keeps the
// to minimize expensive copies between the language barrier.
// phase-folded light curve in the class state to minimize expensive copies
// between the language barrier.
class
ViewGenerator
{
class
ViewGenerator
{
public:
public:
// Factory function to create a new ViewGenerator.
// Factory function to create a new ViewGenerator.
...
@@ -96,4 +97,4 @@ class ViewGenerator {
...
@@ -96,4 +97,4 @@ class ViewGenerator {
}
// namespace astronet
}
// namespace astronet
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
UTIL_CC
_VIEW_GENERATOR_H_
#endif // TENSORFLOW_MODELS_ASTRONET_LIGHT_CURVE_
FAST_OPS
_VIEW_GENERATOR_H_
research/astronet/light_curve
_util/cc
/view_generator_test.cc
→
research/astronet/light_curve
/fast_ops
/view_generator_test.cc
View file @
e00e0e13
...
@@ -12,11 +12,11 @@ See the License for the specific language governing permissions and
...
@@ -12,11 +12,11 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
==============================================================================*/
==============================================================================*/
#include "light_curve
_util/cc
/view_generator.h"
#include "light_curve
/fast_ops
/view_generator.h"
#include "gmock/gmock.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "light_curve
_util/cc
/test_util.h"
#include "light_curve
/fast_ops
/test_util.h"
using
std
::
vector
;
using
std
::
vector
;
using
testing
::
Pointwise
;
using
testing
::
Pointwise
;
...
@@ -49,7 +49,7 @@ TEST(ViewGenerator, GenerateViews) {
...
@@ -49,7 +49,7 @@ TEST(ViewGenerator, GenerateViews) {
vector
<
double
>
result
;
vector
<
double
>
result
;
// Error: t_max <= t_min. We do not test all failure cases here since they
// Error: t_max <= t_min. We do not test all failure cases here since they
// are
tested in light_curve_util_
test
.cc
.
// are
covered by the median filter's
test
s
.
EXPECT_FALSE
(
generator
->
GenerateView
(
10
,
1
,
-
1
,
-
1
,
false
,
&
result
,
&
error
));
EXPECT_FALSE
(
generator
->
GenerateView
(
10
,
1
,
-
1
,
-
1
,
false
,
&
result
,
&
error
));
EXPECT_FALSE
(
error
.
empty
());
EXPECT_FALSE
(
error
.
empty
());
error
.
clear
();
error
.
clear
();
...
...
research/astronet/light_curve
_util
/kepler_io.py
→
research/astronet/light_curve/kepler_io.py
View file @
e00e0e13
...
@@ -23,7 +23,7 @@ import os.path
...
@@ -23,7 +23,7 @@ import os.path
from
astropy.io
import
fits
from
astropy.io
import
fits
import
numpy
as
np
import
numpy
as
np
from
light_curve
_util
import
util
from
light_curve
import
util
from
tensorflow
import
gfile
from
tensorflow
import
gfile
# Quarter index to filename prefix for long cadence Kepler data.
# Quarter index to filename prefix for long cadence Kepler data.
...
...
research/astronet/light_curve
_util
/kepler_io_test.py
→
research/astronet/light_curve/kepler_io_test.py
View file @
e00e0e13
...
@@ -24,16 +24,17 @@ from absl import flags
...
@@ -24,16 +24,17 @@ from absl import flags
from
absl.testing
import
absltest
from
absl.testing
import
absltest
import
numpy
as
np
import
numpy
as
np
from
light_curve
_util
import
kepler_io
from
light_curve
import
kepler_io
FLAGS
=
flags
.
FLAGS
FLAGS
=
flags
.
FLAGS
_DATA_DIR
=
"light_curve
_util
/test_data/"
_DATA_DIR
=
"light_curve/test_data/"
class
KeplerIoTest
(
absltest
.
TestCase
):
class
KeplerIoTest
(
absltest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
KeplerIoTest
,
self
).
setUp
()
self
.
data_dir
=
os
.
path
.
join
(
FLAGS
.
test_srcdir
,
_DATA_DIR
)
self
.
data_dir
=
os
.
path
.
join
(
FLAGS
.
test_srcdir
,
_DATA_DIR
)
def
testScrambleLightCurve
(
self
):
def
testScrambleLightCurve
(
self
):
...
@@ -49,8 +50,8 @@ class KeplerIoTest(absltest.TestCase):
...
@@ -49,8 +50,8 @@ class KeplerIoTest(absltest.TestCase):
gold_flux
=
[[
41
,
42
],
[
np
.
nan
,
np
.
nan
,
33
],
[
11
,
12
],
[
21
]]
gold_flux
=
[[
41
,
42
],
[
np
.
nan
,
np
.
nan
,
33
],
[
11
,
12
],
[
21
]]
gold_time
=
[[
101
,
102
],
[
201
,
301
,
302
],
[
303
,
401
],
[
402
]]
gold_time
=
[[
101
,
102
],
[
201
,
301
,
302
],
[
303
,
401
],
[
402
]]
self
.
assert
Equal
(
l
en
(
gold_flux
)
,
len
(
scr_flux
))
self
.
assert
L
en
(
gold_flux
,
len
(
scr_flux
))
self
.
assert
Equal
(
l
en
(
gold_time
)
,
len
(
scr_time
))
self
.
assert
L
en
(
gold_time
,
len
(
scr_time
))
for
i
in
range
(
len
(
gold_flux
)):
for
i
in
range
(
len
(
gold_flux
)):
np
.
testing
.
assert_array_equal
(
gold_flux
[
i
],
scr_flux
[
i
])
np
.
testing
.
assert_array_equal
(
gold_flux
[
i
],
scr_flux
[
i
])
...
@@ -60,7 +61,7 @@ class KeplerIoTest(absltest.TestCase):
...
@@ -60,7 +61,7 @@ class KeplerIoTest(absltest.TestCase):
# All quarters.
# All quarters.
filenames
=
kepler_io
.
kepler_filenames
(
filenames
=
kepler_io
.
kepler_filenames
(
"/my/dir/"
,
1234567
,
check_existence
=
False
)
"/my/dir/"
,
1234567
,
check_existence
=
False
)
self
.
assert
Items
Equal
([
self
.
assert
Count
Equal
([
"/my/dir/0012/001234567/kplr001234567-2009131105131_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009131105131_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009166043257_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009166043257_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009259160929_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009259160929_llc.fits"
,
...
@@ -85,7 +86,7 @@ class KeplerIoTest(absltest.TestCase):
...
@@ -85,7 +86,7 @@ class KeplerIoTest(absltest.TestCase):
# Subset of quarters.
# Subset of quarters.
filenames
=
kepler_io
.
kepler_filenames
(
filenames
=
kepler_io
.
kepler_filenames
(
"/my/dir/"
,
1234567
,
quarters
=
[
3
,
4
],
check_existence
=
False
)
"/my/dir/"
,
1234567
,
quarters
=
[
3
,
4
],
check_existence
=
False
)
self
.
assert
Items
Equal
([
self
.
assert
Count
Equal
([
"/my/dir/0012/001234567/kplr001234567-2009350155506_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009350155506_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2010078095331_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2010078095331_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2010009091648_llc.fits"
"/my/dir/0012/001234567/kplr001234567-2010009091648_llc.fits"
...
@@ -99,7 +100,7 @@ class KeplerIoTest(absltest.TestCase):
...
@@ -99,7 +100,7 @@ class KeplerIoTest(absltest.TestCase):
injected_group
=
"inj1"
,
injected_group
=
"inj1"
,
check_existence
=
False
)
check_existence
=
False
)
# pylint:disable=line-too-long
# pylint:disable=line-too-long
self
.
assert
Items
Equal
([
self
.
assert
Count
Equal
([
"/my/dir/0012/001234567/kplr001234567-2009350155506_INJECTED-inj1_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009350155506_INJECTED-inj1_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2010078095331_INJECTED-inj1_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2010078095331_INJECTED-inj1_llc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2010009091648_INJECTED-inj1_llc.fits"
"/my/dir/0012/001234567/kplr001234567-2010009091648_INJECTED-inj1_llc.fits"
...
@@ -113,7 +114,7 @@ class KeplerIoTest(absltest.TestCase):
...
@@ -113,7 +114,7 @@ class KeplerIoTest(absltest.TestCase):
long_cadence
=
False
,
long_cadence
=
False
,
quarters
=
[
0
,
1
],
quarters
=
[
0
,
1
],
check_existence
=
False
)
check_existence
=
False
)
self
.
assert
Items
Equal
([
self
.
assert
Count
Equal
([
"/my/dir/0012/001234567/kplr001234567-2009131110544_slc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009131110544_slc.fits"
,
"/my/dir/0012/001234567/kplr001234567-2009166044711_slc.fits"
"/my/dir/0012/001234567/kplr001234567-2009166044711_slc.fits"
],
filenames
)
],
filenames
)
...
@@ -126,7 +127,7 @@ class KeplerIoTest(absltest.TestCase):
...
@@ -126,7 +127,7 @@ class KeplerIoTest(absltest.TestCase):
"0114/011442793/kplr011442793-{}_llc.fits"
.
format
(
q
))
"0114/011442793/kplr011442793-{}_llc.fits"
.
format
(
q
))
for
q
in
[
"2009350155506"
,
"2010009091648"
,
"2010174085026"
]
for
q
in
[
"2009350155506"
,
"2010009091648"
,
"2010174085026"
]
]
]
self
.
assert
Items
Equal
(
expected_filenames
,
filenames
)
self
.
assert
Count
Equal
(
expected_filenames
,
filenames
)
def
testReadKeplerLightCurve
(
self
):
def
testReadKeplerLightCurve
(
self
):
filenames
=
[
filenames
=
[
...
...
research/astronet/light_curve
_util
/median_filter.py
→
research/astronet/light_curve/median_filter.py
View file @
e00e0e13
File moved
Prev
1
2
3
4
5
6
7
8
…
11
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