-
Notifications
You must be signed in to change notification settings - Fork 39
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
New SSOPatch offset_from_sso option #810
Draft
AERAdler
wants to merge
3
commits into
toast3
Choose a base branch
from
scheduler_per_tube
base: toast3
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.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -416,6 +416,8 @@ def __init__( | |
el_min=0, | ||
el_max=np.pi / 2, | ||
elevations=None, | ||
offset_eta=0, | ||
offset_xi=0 | ||
): | ||
self.name = name | ||
self.weight = weight | ||
|
@@ -425,6 +427,8 @@ def __init__( | |
self.el_min = el_min | ||
self.el_max = el_max | ||
self.el_max0 = el_max | ||
self.offset_eta = offset_eta | ||
self.offset_xi = offset_xi | ||
self.parse_elevations(elevations) | ||
try: | ||
self.body = getattr(ephem, name)() | ||
|
@@ -439,6 +443,11 @@ def update(self, observer): | |
""" | ||
self.body.compute(observer) | ||
ra, dec = self.body.ra, self.body.dec | ||
if self.offset_eta !=0 or self.offset_xi !=0: | ||
delta_az = -self.offset_xi*np.cos(self.body.alt) | ||
delta_el = self.offset_eta | ||
ra, dec = observer.radec_of(self.body.az+delta_az, self.body.alt+delta_el) | ||
|
||
# Synthesize 8 corners around the center | ||
phi = ra | ||
theta = dec | ||
|
@@ -2643,7 +2652,7 @@ def parse_args(opts=None): | |
--patch name,weight,lon,lat,radius (center and radius) | ||
--patch name,weight,lon_min,lat_max,lon_max,lat_min (rectangle) | ||
--patch name,weight,lon1,lat1,lon2,lat2,...,lonN,latN (polygon, N>=3) | ||
--patch name,SSO,weight,radius (Solar System Object) | ||
--patch name,SSO,weight,radius,eta_off,xi_off (Solar System Object, last two optional offset for pointingnat specific place on fp) | ||
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 you add square brackets around the optional fields: There is also a missing space at |
||
--patch name,COOLER,weight,power,hold_time_min_h,hold_time_max_h, | ||
cycle_time_h,az,el (Cooler cycle) | ||
--patch name,HORIZONTAL,weight,azmin,azmax,el,scantime_min | ||
|
@@ -3001,13 +3010,23 @@ def parse_patch_sso(args, parts): | |
name = parts[0] | ||
weight = float(parts[2]) | ||
radius = float(parts[3]) * degree | ||
if len(parts)==6: | ||
offset_eta = float(parts[4]) | ||
offset_xi = float(parts[5]) | ||
log.info(f"SSO targeting offset by {offset_eta}, {offset_xi}") | ||
else: | ||
offset_eta = 0 | ||
offset_xi = 0 | ||
|
||
patch = SSOPatch( | ||
name, | ||
weight, | ||
radius, | ||
el_min=args.el_min_deg * degree, | ||
el_max=args.el_max_deg * degree, | ||
elevations=args.elevations_deg, | ||
offset_eta = offset_eta, | ||
offset_xi = offset_xi, | ||
) | ||
return patch | ||
|
||
|
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.
We can use this approximation for now, but you should add a comment about it.
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.
Looking at the sim-sso/run.lat.sh I am a bit confused by how the boresight_offset arguments gel with our new offset of patches
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.
This the the opposite of what you are doing since your offset applies to the target. If, for example, the scheduler was told to only schedule el=50 scans, applying boresight offset in the old implementation would lead to the boresight actually being at a different elevation.
The way you implemented the offset, elevation constaints will be observed and we can specify separate offsets for different targets.