Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lris2-mascgen/LICENSE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno if we use this license or a different one?
Either case it shouldn't live here, the license lives in top level of the repo

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions lris2-mascgen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# lris2-mascgen

Mask generation algorithm for LRIS2 CSU.


11 changes: 11 additions & 0 deletions lris2-mascgen/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Configuration file for CSU parameters for LRIS2 (currently same as MOSFIRE)

instrument: LRIS2
num_bar_pairs: 46
arcsec_per_mm: 1.38028
single_slit_height_mm: 5.082
overlap_mm: 0.698
csu_fp_radius: 207.0
csu_slit_tilt_angle: 4.0
csu_zero_pt: 137.4
star_edge_distance: 20.0
105 changes: 105 additions & 0 deletions lris2-mascgen/example.ipynb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we convert the Jupiter notebook into a test file with test cases?

Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"cells": [
{
"cell_type": "code",
"id": "initial_id",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2025-09-11T18:04:17.445154Z",
"start_time": "2025-09-11T18:04:16.883236Z"
}
},
"source": "%run lris2_csulava/magma_algorithm.py --xrange 3 --xcenter 0 --slitwidth 0.7 --ditherspace 2.5 --centerpa 0 --xsteps 1 --xstepsize 1.0 --ysteps 1 --ystepsize 1.0 --pasteps 1 --pastepsize 1.0 --min_alignment_stars 0 --star-edge-buffer 2.0 --runcop ../Mascgen\\ Folder-\\ MAGMA\\ Development\\ history/q1700.coords",
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:__main__:Center coordinates: RA=255.226286 Dec=64.205267 degrees\n",
"INFO:__main__:Total iterations: 27, xsteps: 3, ysteps: 3, pasteps: 3\n",
"INFO:__main__:*** STARTING OPTIMIZATION ***\n",
"INFO:__main__:New optimal found at run 1, best score so far is 5700.0\n",
"INFO:__main__:New optimal found at run 8, best score so far is 6150.0\n",
"INFO:__main__:New optimal found at run 17, best score so far is 6150.0\n",
"INFO:__main__:New optimal found at run 26, best score so far is 6150.0\n",
"INFO:__main__:*** OPTIMIZATION COMPLETE ***\n",
"INFO:__main__:Optimal solution found at run 26 with total priority 6150.0.\n",
"INFO:__main__:Final Center: RA=255.229485, Dec=64.205545, PA=1.00\n",
"INFO:__main__:Number of legal alignment stars: 0\n",
"INFO:__main__:Number of targets in optimal solution: 28\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Function 'optimize' executed in 0.4102 seconds.\n",
"Function 'optimize' executed in 0.0055 seconds.\n",
"Function 'optimize' executed in 0.0045 seconds.\n",
"Function 'optimize' executed in 0.0044 seconds.\n",
"Function 'optimize' executed in 0.0044 seconds.\n",
"Function 'optimize' executed in 0.0043 seconds.\n",
"Function 'optimize' executed in 0.0043 seconds.\n",
"Function 'optimize' executed in 0.0044 seconds.\n",
"Function 'optimize' executed in 0.0049 seconds.\n",
"Function 'optimize' executed in 0.0042 seconds.\n",
"Function 'optimize' executed in 0.0043 seconds.\n",
"Function 'optimize' executed in 0.0042 seconds.\n",
"Function 'optimize' executed in 0.0042 seconds.\n",
"Function 'optimize' executed in 0.0042 seconds.\n",
"Function 'optimize' executed in 0.0041 seconds.\n",
"Function 'optimize' executed in 0.0041 seconds.\n",
"Function 'optimize' executed in 0.0044 seconds.\n",
"Function 'optimize' executed in 0.0048 seconds.\n",
"Function 'optimize' executed in 0.0050 seconds.\n",
"Function 'optimize' executed in 0.0055 seconds.\n",
"Function 'optimize' executed in 0.0046 seconds.\n",
"Function 'optimize' executed in 0.0041 seconds.\n",
"Function 'optimize' executed in 0.0040 seconds.\n",
"Function 'optimize' executed in 0.0041 seconds.\n",
"Function 'optimize' executed in 0.0041 seconds.\n",
"Function 'optimize' executed in 0.0041 seconds.\n",
"Function 'optimize' executed in 0.0049 seconds.\n",
"Script executed in 0.55 seconds.\n"
]
}
],
"execution_count": null
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-09-11T17:56:37.942927Z",
"start_time": "2025-09-11T17:56:37.940699Z"
}
},
"cell_type": "code",
"source": "",
"id": "a793e10dbfecd011",
"outputs": [],
"execution_count": null
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading