-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from lsst-ts/tickets/DM-28164
Tickets/dm 28164
- Loading branch information
Showing
92 changed files
with
12,898 additions
and
12,890 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
# This file is part of ts_wep. | ||
# | ||
# Developed for the LSST Telescope and Site Systems. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import numpy as np | ||
|
||
from lsst.ts.wep.SourceProcessor import SourceProcessor | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
# Set the 35 field points | ||
nArm = 6 | ||
armLen = [0.379, 0.841, 1.237, 1.535, 1.708] | ||
fieldWFSx = [1.176, -1.176, -1.176, 1.176] | ||
fieldWFSy = [1.176, 1.176, -1.176, -1.176] | ||
pointAngle = np.arange(nArm) * (2 * np.pi) / nArm | ||
fieldX = np.concatenate( | ||
[np.zeros(1), np.kron(armLen, np.cos(pointAngle)), fieldWFSx] | ||
) | ||
fieldY = np.concatenate( | ||
[np.zeros(1), np.kron(armLen, np.sin(pointAngle)), fieldWFSy] | ||
) | ||
|
||
fieldXY = np.array([fieldX, fieldY]).T | ||
|
||
# Do the mapping | ||
sourPro = SourceProcessor() | ||
mapping = sourPro.mapSensorAndFieldIdx(fieldXY) | ||
|
||
# Print the mapping | ||
for sensorName, idxField in mapping.items(): | ||
print(sensorName, idxField) | ||
# This file is part of ts_wep. | ||
# | ||
# Developed for the LSST Telescope and Site Systems. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import numpy as np | ||
|
||
from lsst.ts.wep.SourceProcessor import SourceProcessor | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
# Set the 35 field points | ||
nArm = 6 | ||
armLen = [0.379, 0.841, 1.237, 1.535, 1.708] | ||
fieldWFSx = [1.176, -1.176, -1.176, 1.176] | ||
fieldWFSy = [1.176, 1.176, -1.176, -1.176] | ||
pointAngle = np.arange(nArm) * (2 * np.pi) / nArm | ||
fieldX = np.concatenate( | ||
[np.zeros(1), np.kron(armLen, np.cos(pointAngle)), fieldWFSx] | ||
) | ||
fieldY = np.concatenate( | ||
[np.zeros(1), np.kron(armLen, np.sin(pointAngle)), fieldWFSy] | ||
) | ||
|
||
fieldXY = np.array([fieldX, fieldY]).T | ||
|
||
# Do the mapping | ||
sourPro = SourceProcessor() | ||
mapping = sourPro.mapSensorAndFieldIdx(fieldXY) | ||
|
||
# Print the mapping | ||
for sensorName, idxField in mapping.items(): | ||
print(sensorName, idxField) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
# This file is part of ts_wep. | ||
# | ||
# Developed for the LSST Telescope and Site Systems. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import numpy as np | ||
|
||
from lsst.ts.wep.Utility import getModulePath | ||
from lsst.ts.wep.SourceProcessor import SourceProcessor | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
# Set the 189 field points | ||
fieldPosFilePath = os.path.join(getModulePath(), "examples", "fieldPosLsst.txt") | ||
fieldXY = np.loadtxt(fieldPosFilePath) | ||
|
||
# Do the mapping | ||
sourPro = SourceProcessor() | ||
mapping = sourPro.mapSensorAndFieldIdx(fieldXY) | ||
|
||
# Print the mapping | ||
for sensorName, idxField in mapping.items(): | ||
print(sensorName, idxField) | ||
# This file is part of ts_wep. | ||
# | ||
# Developed for the LSST Telescope and Site Systems. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import numpy as np | ||
|
||
from lsst.ts.wep.Utility import getModulePath | ||
from lsst.ts.wep.SourceProcessor import SourceProcessor | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
# Set the 189 field points | ||
fieldPosFilePath = os.path.join(getModulePath(), "examples", "fieldPosLsst.txt") | ||
fieldXY = np.loadtxt(fieldPosFilePath) | ||
|
||
# Do the mapping | ||
sourPro = SourceProcessor() | ||
mapping = sourPro.mapSensorAndFieldIdx(fieldXY) | ||
|
||
# Print the mapping | ||
for sensorName, idxField in mapping.items(): | ||
print(sensorName, idxField) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
# This file is part of ts_wep. | ||
# | ||
# Developed for the LSST Telescope and Site Systems. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
|
||
class DefocalImage(object): | ||
def __init__(self, intraImg=None, extraImg=None): | ||
"""Initialize the DefocalImage class. | ||
Parameters | ||
---------- | ||
intraImg : numpy.ndarray, optional | ||
Intra-defocal image. (the default is None.) | ||
extraImg : numpy.ndarray, optional | ||
Extra-defocal image. (the default is None.) | ||
""" | ||
|
||
# Defocal images | ||
self.intraImg = intraImg | ||
self.extraImg = extraImg | ||
|
||
def setImg(self, intraImg=None, extraImg=None): | ||
"""Set the image. | ||
Parameters | ||
---------- | ||
intraImg : numpy.ndarray, optional | ||
Intra-defocal image. (the default is None.) | ||
extraImg : numpy.ndarray, optional | ||
Extra-defocal image. (the default is None.) | ||
""" | ||
|
||
self._setValIfNotNone("intraImg", intraImg) | ||
self._setValIfNotNone("extraImg", extraImg) | ||
|
||
def _setValIfNotNone(self, attrName, val): | ||
"""Set the value to the related class attribute if the value is not | ||
none. | ||
Parameters | ||
---------- | ||
attrName : str | ||
Attribute name. | ||
val : numpy.ndarray | ||
Assigned value. | ||
""" | ||
|
||
if val is not None: | ||
setattr(self, attrName, val) | ||
|
||
def getIntraImg(self): | ||
"""Get the intra-defocal image. | ||
Returns | ||
------- | ||
numpy.ndarray | ||
Intra-defocal image. | ||
""" | ||
|
||
return self.intraImg | ||
|
||
def getExtraImg(self): | ||
"""Get the extra-defocal image. | ||
Returns | ||
------- | ||
numpy.ndarray | ||
Extra-defocal image. | ||
""" | ||
|
||
return self.extraImg | ||
|
||
|
||
if __name__ == "__main__": | ||
pass | ||
# This file is part of ts_wep. | ||
# | ||
# Developed for the LSST Telescope and Site Systems. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
|
||
class DefocalImage(object): | ||
def __init__(self, intraImg=None, extraImg=None): | ||
"""Initialize the DefocalImage class. | ||
Parameters | ||
---------- | ||
intraImg : numpy.ndarray, optional | ||
Intra-defocal image. (the default is None.) | ||
extraImg : numpy.ndarray, optional | ||
Extra-defocal image. (the default is None.) | ||
""" | ||
|
||
# Defocal images | ||
self.intraImg = intraImg | ||
self.extraImg = extraImg | ||
|
||
def setImg(self, intraImg=None, extraImg=None): | ||
"""Set the image. | ||
Parameters | ||
---------- | ||
intraImg : numpy.ndarray, optional | ||
Intra-defocal image. (the default is None.) | ||
extraImg : numpy.ndarray, optional | ||
Extra-defocal image. (the default is None.) | ||
""" | ||
|
||
self._setValIfNotNone("intraImg", intraImg) | ||
self._setValIfNotNone("extraImg", extraImg) | ||
|
||
def _setValIfNotNone(self, attrName, val): | ||
"""Set the value to the related class attribute if the value is not | ||
none. | ||
Parameters | ||
---------- | ||
attrName : str | ||
Attribute name. | ||
val : numpy.ndarray | ||
Assigned value. | ||
""" | ||
|
||
if val is not None: | ||
setattr(self, attrName, val) | ||
|
||
def getIntraImg(self): | ||
"""Get the intra-defocal image. | ||
Returns | ||
------- | ||
numpy.ndarray | ||
Intra-defocal image. | ||
""" | ||
|
||
return self.intraImg | ||
|
||
def getExtraImg(self): | ||
"""Get the extra-defocal image. | ||
Returns | ||
------- | ||
numpy.ndarray | ||
Extra-defocal image. | ||
""" | ||
|
||
return self.extraImg | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
Oops, something went wrong.