⚡ tweaking PSFmachine to play with the K2 implementation#47
⚡ tweaking PSFmachine to play with the K2 implementation#47christinahedges wants to merge 2 commits intomasterfrom
Conversation
| upper_radius_limit=36.0, | ||
| lower_radius_limit=4.5, | ||
| upper_flux_limit=2e5, | ||
| lower_flux_limit=100, | ||
| lower_flux_limit=40, |
There was a problem hiding this comment.
this makes the rough mask more generous, good when scene motion is considerable, and allows for fainter pixels
jorgemarpa
left a comment
There was a problem hiding this comment.
I like the small tweaks you add to the API. Only a few of them change the default values, the rest only makes the API more robust. I don't think the first ones will make big changes for Kepler data.
We need to update the tutorials to reflect the new keyword arguments we are introducing here. I saw the tutorials in christinatweaks branch aren't updated to the last version in master.
Also, the change to superstamp.py will make the computing times in the SSMachine tutorials a bit longer.
I will run the Tutorials as a way to check things are consistent with the master branch, I'll report back when it's done.
| # mask out non finite values and background pixels | ||
| k = (np.isfinite(wgts)) & ( | ||
| self.uncontaminated_source_mask.multiply(self.flux[t]).data > 100 | ||
| self.uncontaminated_source_mask.multiply(self.flux[t]).data > 10 |
There was a problem hiding this comment.
I agree this value should be more generous.
Let's add a comment that this value works well for Kepler/K2 background-subtracted pixels.
| lower_flux_limit=40, | ||
| correct_centroid_offset=True, | ||
| plot=False, | ||
| frame_index="mean", |
There was a problem hiding this comment.
add docstring for this argument.
Using main keeps the original behavior, right?
|
|
||
| def build_shape_model( | ||
| self, plot=False, flux_cut_off=1, frame_index="mean", **kwargs | ||
| self, plot=False, flux_atol=1, flux_rtol=0.001, frame_index="mean", **kwargs |
There was a problem hiding this comment.
I think these new arguments are better than the ones we had before.
I'm taking a look at PSFmachine for ruprecht, and making a few tweaks. I'm opening this issue to discuss these tweaks.
Here's a rough log of changes:
_update_source_mask...function so that it more aggressively clips out the faint edges of the PSF_get_source_masknow puts the centroid to the centroid of theframe_index, making sure that per cadence PSFs are always centered at zero.build_frame_shape_modelrecalculates the source mask at every stepThe last point makes sure that the PSF is always centered at 0,0 when we fit it. This is important, as our model is only valid if the PSF it's modeling is centered.
However, the way it is currently set up, this becomes quite intractable for large datasets...!