Commit 540738d7 authored by GZhao's avatar GZhao
Browse files

fix pysynphot import warning

parent 75154623
Pipeline #4582 passed with stage
in 0 seconds
# from .main import quick_run, observation_simulation from .main import quick_run_v2, vis_observation
from .optics import focal_mask from .optics import focal_mask
from .target import star_photlam, planet_contrast, extract_target_x_y, spectrum_generator from .target import star_photlam, planet_contrast, extract_target_x_y, spectrum_generator
from .camera import CosmicRayFrameMaker, sky_frame_maker from .camera import CosmicRayFrameMaker, sky_frame_maker
...@@ -12,4 +12,7 @@ __all__ = [ ...@@ -12,4 +12,7 @@ __all__ = [
"extract_target_x_y", "extract_target_x_y",
"spectrum_generator", "spectrum_generator",
"focal_mask", "focal_mask",
"quick_run_v2",
"vis_observation",
"__version__"
] ]
\ No newline at end of file
...@@ -126,7 +126,8 @@ with open(cpism_refdata + '/cpism_config.yaml', 'r') as f: ...@@ -126,7 +126,8 @@ with open(cpism_refdata + '/cpism_config.yaml', 'r') as f:
replace_cpism_refdata(new_config, None) replace_cpism_refdata(new_config, None)
config.update(new_config) config.update(new_config)
os.environ['PYSYN_CDBS'] = config['pysyn_refdata'] if os.environ.get('PYSYN_CDBS') is None:
os.environ['PYSYN_CDBS'] = config['pysyn_refdata']
__version__ = '2.0.0' __version__ = '2.0.0'
# we need to ignore the warning from pysynphot, because we only use the star models. # we need to ignore the warning from pysynphot, because we only use the star models.
......
...@@ -4,12 +4,12 @@ import numpy as np ...@@ -4,12 +4,12 @@ import numpy as np
from scipy import constants from scipy import constants
from astropy.io import fits from astropy.io import fits
from astropy.coordinates import SkyCoord from astropy.coordinates import SkyCoord
from pysynphot.renorm import StdRenorm
from .config import config
from .config import S # pysynphot from .config import S # pysynphot
from .config import config
from .optics import filter_throughput from .optics import filter_throughput
from .io import log from .io import log
from pysynphot.renorm import StdRenorm
PLANK_H = constants.h # ~6.62607015e-34 PLANK_H = constants.h # ~6.62607015e-34
...@@ -256,7 +256,7 @@ def star_photlam( ...@@ -256,7 +256,7 @@ def star_photlam(
return star_sp return star_sp
def standard_spectrum( def standard_spectrum(
magnitude: float) -> S.spectrum.Spectrum: magnitude: float) -> S.ArraySpectrum:
"""Standard spectrum of magnitude system. """Standard spectrum of magnitude system.
For example, the standard_spectrum of vega megnitude is vega spectrum. For example, the standard_spectrum of vega megnitude is vega spectrum.
The standard spectrum of ab magnitude is a flat spectrum. The standard spectrum of ab magnitude is a flat spectrum.
...@@ -308,7 +308,7 @@ def bcc_spectrum( ...@@ -308,7 +308,7 @@ def bcc_spectrum(
def hybrid_albedo_spectrum( def hybrid_albedo_spectrum(
coe_b: float, coe_b: float,
coe_r: float) -> S.spectrum.ArrayBandpass: coe_r: float) -> S.spectrum.ArraySpectralElement:
"""Albedo spectrum of planet using hybrid-jupiter-neptune model (Lacy et al. 2018) """Albedo spectrum of planet using hybrid-jupiter-neptune model (Lacy et al. 2018)
jupiter and neptune spectrum is from Karkoschka’s 1994 jupiter and neptune spectrum is from Karkoschka’s 1994
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment