Skip to content

Commit

Permalink
Changed class name 'Observe' to 'Expose'
Browse files Browse the repository at this point in the history
  • Loading branch information
tcjansen committed Jul 30, 2019
1 parent b1dfd6e commit f9b5f10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions synphot/tests/test_wrapper.py
@@ -1,11 +1,11 @@
from synphot.models import BlackBody1D
from synphot.spectrum import SourceSpectrum, SpectralElement
from synphot.wrapper import Observe
from synphot.wrapper import Expose
import astropy.units as u
import numpy as np


class TestObserve:
class TestExpose:
""" Tests that each possible bandpass input returns a
SpectralElement object """
def setup_class(self):
Expand All @@ -17,32 +17,32 @@ def setup_class(self):

def test_bandpass_str(self):
bp = 'johnson_u'
result = Observe(self.source_spec, self.diameter, bandpass=bp).bandpass
result = Expose(self.source_spec, self.diameter, bandpass=bp).bandpass
assert type(result) == SpectralElement

def test_bandpass_list(self):
result = Observe(self.source_spec, self.diameter,
result = Expose(self.source_spec, self.diameter,
bandpass=self.test_throughput_list).bandpass
assert type(result) == SpectralElement

bp_flipped = [self.test_throughput_list[1], self.test_throughput_list[0]]
result_flipped = Observe(self.source_spec, self.diameter,
result_flipped = Expose(self.source_spec, self.diameter,
bandpass=bp_flipped).bandpass
assert type(result_flipped) == SpectralElement

def test_qe(self):
result = Observe(self.source_spec, self.diameter,
result = Expose(self.source_spec, self.diameter,
quantum_efficiency=self.test_throughput_list
).quantum_efficiency

assert type(result) == SpectralElement

def test_atmosphere(self):
result = Observe(self.source_spec, self.diameter,
result = Expose(self.source_spec, self.diameter,
atmospheric_transmission=self.test_throughput_list
).atmospheric_transmission

assert type(result) == SpectralElement

def test_snr(self):
result = Observe(self.source_spec, self.diameter, force='extrap').snr
result = Expose(self.source_spec, self.diameter, force='extrap').snr
10 changes: 5 additions & 5 deletions synphot/wrapper.py
Expand Up @@ -24,7 +24,7 @@
from .observation import Observation, ccd_snr, exptime_from_ccd_snr


class Observe:
class Expose:
"""
Parameters
----------
Expand Down Expand Up @@ -99,7 +99,7 @@ def _set_lists(self, _list, _list_str):
def _set_bandpass(self):

if type(self._bandpass) == list:
self.bandpass = _set_lists(self._bandpass, 'bandpass')
self.bandpass = self._set_lists(self._bandpass, 'bandpass')

elif type(self._bandpass) == str:
self.bandpass = SpectralElement.from_filter(self._bandpass)
Expand All @@ -116,11 +116,11 @@ def _set_bandpass(self):
self.throughput = self.bandpass

def _include_qe(self):
self.quantum_efficiency = _set_lists(self._qe, 'quantum_efficiency')
self.quantum_efficiency = self._set_lists(self._qe, 'quantum_efficiency')
self.throughput *= self.quantum_efficiency

def _include_atmosphere(self, _list=self._at):
self.atmospheric_transmission = _set_lists(self._at,
def _include_atmosphere(self):
self.atmospheric_transmission = self._set_lists(self._at,
'atmospheric_transmission')
self.throughput *= self.atmospheric_transmission

Expand Down

0 comments on commit f9b5f10

Please sign in to comment.