Skip to content

Commit

Permalink
## [2.1.118] - 2023-05-27
Browse files Browse the repository at this point in the history
### Fixed
- deprecated np.float removed
- deprecated quantity interpreted as boolean
  • Loading branch information
LorenzoMugnai committed May 27, 2023
1 parent 847925d commit 9f4873d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 33 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.1.118] - 2023-05-27
### Fixed
- deprecated np.float removed
- deprecated quantity interpreted as boolean

## [2.1.116] - 2023-02-28
### Fixed
- exosim reference removed
Expand Down Expand Up @@ -242,6 +247,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Initial release

[Unreleased]: https://github.com/ExObsSim/ExoRad2.0
[2.1.118]: https://github.com/ExObsSim/ExoRad2-public/compare/v2.1.116...v2.1.118
[2.1.116]: https://github.com/ExObsSim/ExoRad2-public/compare/v2.1.115...v2.1.116
[2.1.115]: https://github.com/ExObsSim/ExoRad2-public/compare/v2.1.114...v2.1.115
[2.1.114]: https://github.com/ExObsSim/ExoRad2-public/compare/v2.1.113...v2.1.114
Expand Down
2 changes: 1 addition & 1 deletion exorad/models/instruments/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def build_optical_path(self):
)

self.opticalPath.chain()
if self.opticalPath.slit_width:
if self.opticalPath.slit_width is not None:
self._add_data_to_built(
"slit_width", self.opticalPath.slit_width.to(u.um)
)
Expand Down
11 changes: 11 additions & 0 deletions exorad/models/optics/opticalElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ def __init__(self, description, wl):
self.emissivity = self._get_emissivity()
self.temperature = self._get_temperature()
self.position = self._get_position()
self.angle = self._get_angle()

def _get_angle(self):
if "solid_angle" in self.description:
if hasattr(self.description["solid_angle"]["value"], "unit"):
return self.description["solid_angle"]["value"].to(u.sr)
else:
self.debug("Angle assumed to be in sr")
return self.description["solid_angle"]["value"] * u.sr
else: # if not specified, return None the get default value from the instrument
return None

def _get_position(self):
if self.type == "detector box":
Expand Down
49 changes: 21 additions & 28 deletions exorad/models/optics/opticalPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,36 +244,29 @@ def compute_signal(self, ch_table, ch_built_instr):
)
else:
self.debug("no slit found")
if rad.position == "detector":
self.debug("this is the detector box")
rad.data *= (
A
* np.pi
* u.sr
* qe.data
* (qe.wl_grid / const.c / const.h).to(1.0 / u.W / u.s)
* u.count
)
elif rad.position == "optics box":
self.debug("this is the optics box")
rad.data *= (
A
* (np.pi * u.sr - omega_pix)
* qe.data
* (qe.wl_grid / const.c / const.h).to(1.0 / u.W / u.s)
* u.count
)
rad.data *= (
A
* qe.data
* (qe.wl_grid / const.c / const.h).to(1.0 / u.W / u.s)
* u.count
)
if hasattr(rad, "angle") and rad.angle is not None:
self.debug("angle found")
rad.data *= rad.angle
else:
rad.data *= (
omega_pix
* A
* qe.data
* (qe.wl_grid / const.c / const.h).to(1.0 / u.W / u.s)
* u.count
if rad.position == "detector":
self.debug("this is the detector box")
rad.data *= np.pi * u.sr
elif rad.position == "optics box":
self.debug("this is the optics box")
rad.data *= np.pi * u.sr - omega_pix
else:
self.debug("this is the optical path")
rad.data *= omega_pix

max_signal_per_pix, signal = integrate_light(
rad, rad.wl_grid, ch_built_instr
)
max_signal_per_pix, signal = integrate_light(
rad, rad.wl_grid, ch_built_instr
)

self.signal_table["{} signal".format(item)] = signal
self.max_signal_per_pixel[item] = max_signal_per_pix
Expand Down
6 changes: 3 additions & 3 deletions exorad/models/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ def __get_phonix_model_filename(
sed_name_cleaned = [os.path.basename(k) for k in sed_name]

sed_T_list = np.array(
[np.float(name.split("-")[0][3:]) for name in sed_name_cleaned]
[float(name.split("-")[0][3:]) for name in sed_name_cleaned]
)
sed_Logg_list = np.array(
[np.float(name.split("-")[1]) for name in sed_name_cleaned]
[float(name.split("-")[1]) for name in sed_name_cleaned]
)
sed_Z_list = np.array(
[np.float(name.split("-")[2][:3]) for name in sed_name_cleaned]
[float(name.split("-")[2][:3]) for name in sed_name_cleaned]
)

temp_to_find = star_temperature.value / 100
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = exorad
version = 2.1.116
version = 2.1.118
author = Lorenzo V. Mugnai, Enzo Pascale
author_email = lorenzo.mugnai@uniroma1.it
description = The generic point source radiometric model
Expand Down

0 comments on commit 9f4873d

Please sign in to comment.