-
Notifications
You must be signed in to change notification settings - Fork 1
Initial commit of magma's mascgen algorithm in Python #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yashvi-Sharma
wants to merge
1
commit into
main
Choose a base branch
from
yashvi/mascgen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -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. |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # lris2-mascgen | ||
|
|
||
| Mask generation algorithm for LRIS2 CSU. | ||
|
|
||
|
|
This file contains hidden or 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 |
|---|---|---|
| @@ -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 |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
This file contains hidden or 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 |
|---|---|---|
| @@ -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 | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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