Skip to content

added ares optimizer and helper funcs#1

Open
woodykang wants to merge 2 commits into
mainfrom
optimize_ares_siq
Open

added ares optimizer and helper funcs#1
woodykang wants to merge 2 commits into
mainfrom
optimize_ares_siq

Conversation

@woodykang

Copy link
Copy Markdown

Added optimize_ares_siq and its helper functions.
It biases KIDs to a_nl ~ 0.7 by examining the spacing in the IQ circle and determining if a KID is bifurcated or not.

@shubhagrawal30
shubhagrawal30 self-requested a review April 27, 2026 21:06
Comment thread citkid/primecam/procedures.py
Comment thread citkid/primecam/procedures.py Outdated
Comment thread citkid/primecam/procedures.py Outdated
phi = np.angle(S21) # phase of S21

# normalize to same baseline amplitude
S21 /= np.mean(mag_lin[:20])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

put 20 as a input to function

Comment thread citkid/primecam/procedures.py Outdated

# remove linear phase
phi = np.angle(S21)
phi_1 = phi[10]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

put 10 as input to func

Comment thread citkid/primecam/procedures.py Outdated
phi = np.angle(S21) # phase of S21

# normalize to same baseline amplitude
S21 /= np.mean(mag_lin[:20])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

have 20 as a function argument

Comment thread citkid/primecam/procedures.py Outdated
# remove linear phase
phi = np.angle(S21)
phi_1 = phi[10]
phi_2 = phi[-10]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same as abvoe

Comment thread citkid/primecam/procedures.py
Comment thread citkid/primecam/procedures.py
df = f[1]-f[0]
dI = np.diff(I)/df
dQ = np.diff(Q)/df
dIQ = np.sqrt(dI**2 + dQ**2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you end up using any information about a quality factor in here? You should be able to get a quick estimate of the line width without curve fitting?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I do not use any information about the quality factor. Do we need to have a quick estiamte?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I remember talking about this once, where you scale the threshold by a quality factor to make it robust? I guess if it works, it works

Comment thread citkid/primecam/procedures.py
@shubhagrawal30
shubhagrawal30 self-requested a review July 9, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants