LSSTDESC / sims_GCRCatSimInterface

LSST sims interface to gcr-catalogs
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

Disable knots below a given magnitude cuts #62

Closed EiffL closed 6 years ago

EiffL commented 6 years ago

@danielsf @jchiang87 I have implemented a quick and dirty fix, I'm running out of time to refine it. Basically, it will not modify the flux of the disks if the galaxy is faint enough, and set 0 flux to the knots. I hope ImSim will be able to simply discard these 0 flux entries. @danielsf Do you think this will work ok ? Also, I would need you advice on the best way to pass the magnitude limit to the code, right now it's hardcoded.

This hasn't be tested yet!

danielsf commented 6 years ago

Would it be safer to edit the get_hasKnots() method in CatalogClass.py to be

def get_hasKnots(self):
    has_disk = self.column_by_name('hasDisk').astype(float)
    imag = self.column_by_name('mag_i_lsst')
    return np.where(np.logical_and(np.isfinite(has_disk), imag<=KNOTS_MAG_CUTOFF), has_disk, np.NaN)

I'm worried about what the InstanceCatalog will look like if hasDisk==1 but knot flux is zero. In theory the magNorm for the knots should come back as a NaN, in which case the knots would be omitted, but I'm not sure of that.

danielsf commented 6 years ago

Or is it that the disk SED fluxes in cosmoDC2_v0.1_image_addon_knots have already been adjusted and we need to undo that?

danielsf commented 6 years ago

@jchiang87 This is ready for you to look at. It works. Flux is conserved to one part in 10**7 in the case where knots are removed