RickKessler / SNANA

Supernova Analysis package
36 stars 23 forks source link

ELAsTiCC round 2, unexpected values for some host galaxy fields in stream #1210

Closed ale-munozarancibia closed 11 months ago

ale-munozarancibia commented 12 months ago

Hi, I was inspecting the objects we (ALeRCE) have ingested in ELAsTiCC2 and found some weird things. I wanted to ask if they match what was sent in alerts, and if they do, confirm if they were intended or not. Things found affect only some objects (not full columns as in e.g. hostgal_zphot_q070):

distrib_hostgal_zphot_q000 distrib_hostgal_magerr_u

RickKessler commented 12 months ago

for the first issue regarding hostgal_ellipticity and hostgal_sqradius, -9999 means that the variables were not defined in the HOSTLIB (e.g., Galactic transients), but I am not sure where -999 is from. Values of -9 mean the variable is defined, but has no host match. These different null values are used to help analysis codes know what to read or ignore.

Can you provide a few SNIDs that have -9999 and -999 values?

For second issue (hostgal2_zphot_q000), please provide a few SNIDs where hostgal2_zphot_q000 is near -9. My hunch is that these events have no host-match, and the undefined quantiles (-9 value) are getting scaled by zSN/zGAL.

RickKessler commented 12 months ago

For third issue (crazy u-band error), this is indeed from the HOSTLIB, so I passed a few examples to Alex Gagliano. Not sure if it's a translation error or an issue in CosmoDC2 that we didn't notice.

ale-munozarancibia commented 12 months ago

Thanks @RickKessler! Here I list some SNIDs:

hostgal_ellipticity=hostgal_sqradius=-9999: 30193464, 55444095, 111565674 hostgal_ellipticity=hostgal_sqradius=-999: 34432060, 107067312, 152847047

RickKessler commented 12 months ago

sqradius = -9999 means that this variable never defined SNID model comment 30193464 EB expect sqradius = -9999 since there is never a host 111565674 d-Sct expect sqradius = -9999 since there is never a host 55444095 AGN no DLR match, but expect -9 since AGN has host <== BUG?

sqradius = -999 : 34432060, 107067312, 152847047 are all AGN; the sqradius = -999 value is from UNMATCHED_COSMODC2_GHOST.HOSTLIB, and thus likely an artifact passed from DC2. LOGMASS values are reasonable and r mag is 25-26 range. A naive hypothesis is that these galaxies failed the fit profile fit, but a0 and b0 Sersic params have reasonable values, which contradicts the failed fit hypothesis.

GALID ELLIPTICITY SQRADIUS LOGMASS r_obs a0_Sersic b0_Sersic 10388686378 -999.0 -999.0 9.6731 26.36355 0.5402 0.2467 6067270670 -999.0 -999.0 8.1327 25.26386 0.1282 0.1209 7829141059 -999.0 -999.0 10.049 25.07678 0.2248 0.2240

RickKessler commented 12 months ago

The crazy u-band error seem to be from very faint (mag~30) events where there is no significant flux. Will fix SNANA to set magerr= 9.0 for negative magerr or magerr<9.

ale-munozarancibia commented 11 months ago

Hi @RickKessler, I just noticed I didn't include SNIDs about the hostgal_zphot_q000 issue, here they are:

11934165, hostgal_zphot_q000=-12.560043334960938 41902133, hostgal_zphot_q000=-12.394664764404297 72154970, hostgal_zphot_q000=-11.587726593017578

RickKessler commented 11 months ago

For the q000 issue, the first event (SNID= 11934165 ) has the following HOSTLIB information: GALID = 7937500077 ZTRUE = 0.05045 ZPHOT = 2.95926 ZPHOT_Q000 ZPHOT_Q010 ZPHOT_Q020 = -9.0 2.92666 2.93481

The photo-z estimate here is clearly catastrophic and the photo-z quantile code returned -9 in the zero-prob quantile bin. The true SN redshift for this event is 0.07041, and it picked host ZTRUE=0.05045 as within redshift tolerance of 0.02 + 0.01z + 0.007z^2. To match the SN redshift, the quantile redshifts are all scaled by 0.07041/0.05045 = 1.396, and the -9 value that means NULL is scaled to the bizarre value of -12.56.

A proper fix would be in the quantile-generation code, but here I fixed the SNANA simulation to preserved the -9 value so that it can be clearly interpreted as NULL. Each broker will need to figure out how to handle this situation for ELASTICC, and hopefully there will be an upstream PZ fix before commissioning.

The fix is in function GEN_SNHOST_ZPHOT_QUANTILE (sntools_host.c),

RickKessler commented 11 months ago

gonna close this issue for now, but re-open of new ELASTICC sim has similar problems