Ah, okay. I was thinking we’d use Gaia for all of this since we get good star/galaxy separation from morphology (and, of course, great astrometry) for stars that should be bright and faint enough to serve as our “PSF stars”. Is there a reason that might not be the case?
Either way it’ll be good to have the capability to make our own list of PSF stars.
I updated CalibrateTask and DetectAndMeasureTask to handle catalog-based star selectors. It was a small change, though it requires a small RFC for adding a usesMatches method to StarSelector.
I am now trying to identify all measurement algorithms needed. CharacterizeImageTask should make all measurements required to determine a PSF. What measurements are those? Beyond centroid, this seems to depend on which star selector and PSF determiner are used by MeasurePsfTask.
Star selector options include:
CatalogStarSelector: hard-coded to use PSF flux
ObjectSizeStarSelector: configurable; defaults to base_GaussianFlux_flux
PsfStarSelector: configurable, defaults to base_PsfFlux
SecondMomentStarSelector (the default, despite using PSF flux): which is hard-coded to use PSF flux
(SizeMagnitudeStarSelector: I’m not sure, but we doubt it works in any case)
PSF determiner options include:
PcaPsfDeterminer (the default): no additional measurements used
PsfexPsfDeterminer: uses prefs.getPhotfluxRkey(), but I have not found any preference files, so I’m not sure what values this usually takes
In any case, it looks to me as if CharacterizeImageTask must measure base_PsfFlux (despite the incongruity) and base_GaussianFlux_flux (in addition to a centroid, of course). Does anything else come to mind?
Another consideration is what users expect to find in the icSrc data product. We can add more measurement algorithms if there is a need for them.
I think we want to run at least the following (there’s nothing else I can think of now, but that doesn’t mean this list is complete):
SdssCentroid: requires a Psf attached to the exposure, but we’ll have an initial guess one at least.
SdssShape: I expect this to be the primary input for most morphological star selectors.
PixelFlags: always need to run this.
GaussianFlux: we probably want something like a galaxy model flux, but we don’t want to run CModel until we have a pretty good Psf, as it’s slow. So someday, when we can configure later stages differently and actually use the Psf from the previous iteration, we’ll want to switch from GaussianFlux to CModel.
PsfFlux: like CModel, will only do a good job once we have a good Psf, but unlike CModel is fast enough to run regardless. And it seems to be bizarrely required by one of our StarSelectors (maybe file an issue on that?).
CircularApertureFlux: I can certainly imagine star selectors wanting a sequence of aperture fluxes, so even if the current set doesn’t need them, I think these are worth running (and they’re fast enough to not be a performance concern).
Also, the default StarSelector should be switched to ObjectSizeStarSelector, which was what we use on the HSC side. It’s received all the recent updates, as we’ve not really used SecondMomentStarSelector since it was introduced.
@jbosch thank you very much. For the record, here are the default algorithms run by SingleFrameMeasurementTask:
base_PixelFlags
base_SdssCentroid
base_GaussianCentroid
base_NaiveCentroid
base_SdssShape
base_GaussianFlux
base_PsfFlux
base_CircularApertureFlux
base_ClassificationExtendedness
base_SkyCoord
base_Variance
Comparing this to your suggested list I see the following that are not on your list:
base_GaussianCentroid
base_NaiveCentroid
base_ClassificationExtendedness
base_SkyCoord
base_Variance
Of these, I would think base_ClassificationExtendedness might be of interest to star selectors (though I don’t think it is presently used). I’m not sure about the last two, but they look innocuous, as do the two extra measures of centroid. Unless any of these is particularly slow I wonder if I should not simply use the default set?
ClassificationExtendedness is only as good as your Psf model, and even then it’s a fairly trivial combination of slot_ModelFlux and slot_PsfFlux that I’d guess any StarSelector that used it would want to re-do more carefully.
SkyCoord cannot be run unless we have a Wcs (and all it does is set the Coord fields from the slot centroid). I don’t think we need to run Variance at this stage, or the two other centroiders.
@jbosch thank you. Do you happen to know the syntax for changing the values for a RegistryField that accepts multiple values? I’ve tried the following in CharacterizeImageConfig.setDefaults(self) and neither works:
It’s best to think of .plugins behaves like a dict, with a .namesset-like object that controls which items in the dict are active. There may be some syntactic sugar that sometimes allows the .plugins to act like .plugins.names, but I think that may have always been a bad idea (I think I recall Martin and I disagreeing on the merits of that, but I don’t remember who was on which side).
the former appears in a unit test I’m trying to debug and I have no idea what “value” is (it doesn’t show up in the task config), but it may be having the same affect as the latter.
Thanks. I guess “value” is returning some interesting object that is then being modified. It’s used a lot in that unit test, alas, e.g.: many lines such as:
....measurement.value.slots.shape = None
but just removing the value. seems to work, so I’ll do that.
Excellent suggestion! That basically solved the problem I was having in CharacterizeImageTask with PSF iteration not converging (it still wanders around slightly, but not nearly as badly). I also added a config parameter that controls the iteration, to allow replacing the fit PSF with a simplified version at the start of each iteration or not.