RickKessler / SNANA

Supernova Analysis package
36 stars 23 forks source link

Retrieving spectral template information for 91bgs #1375

Closed MatSmithAstro closed 3 months ago

MatSmithAstro commented 3 months ago

Hi Rick, To inform spectroscopic follow-up, we're looking to connect simulated objects with their spectral templates.

This fairly straight-forward for the non-Ia population. For each sub-class, we can map the NON1A_INDEX column (output by the simulation to a DUMP file) to the corresponding SED.INFO file. However, this approach fails for the SNIa-91bg sub-class. These all have NON1A_INDEX==-9.

For each simulated 91bg, do you know how we can retrieve the SED file used to simulate it?

An example output can be found on Perlmutter in $SCRATCH_SIMDIR/MSTEST_LSSTDDFv34T_SNIa-91bg/. Looking at the DUMP file, the SED library is /pscratch/sd/d/desctd/cfs_mirror/SNANA/SURVEYS/LSST/ROOT/PLASTICC/model_libs_updates/SIMSED.SNIa-91bg, but all of the NON1A_INDEX's are -9. For a CART sample ($SCRATCH_SIMDIR/MSTEST_LSSTDDFv34T_CART/) this column is filled.

Comparing the two, there's no SNIa-91bg_INDEX column in the 91bg SED.INFO file. Could this be the problem? If so, is there a way for me to retrieve the input variables (stretch,color) or filename? I tried adding them to the DUMP file, but they are not available.

Many thanks

Mat

p.s. The launch file is /global/cfs/cdirs/lsst/groups/TD/SN/SNANA/SURVEYS/LSST/USERS/smithmat/tides_sims/inputs/REFAC_SIMGEN_MASTER_LSST_DDF_v34_TEST.INPUT if required

RickKessler commented 3 months ago

looking at SED.INFO for 91bg, it is a GRID that is interpolated from a continuous selection of stretch and color, and thus there is no unique template index describing each event. The "stretch" and "color" are written out in the data files and can be used to find which SEDs are close to the event's stretch and color.

The sim-input include file: /pscratch/sd/d/desctd/cfs_mirror/SNANA/SURVEYS/LSST/ROOT/PLASTICC/model_config/SIMGEN_INCLUDE_SNIa-91bg.INPUT shows that continuous distributions of color and stretch are used.

MatSmithAstro commented 3 months ago

Thanks Rick :)

When you say that "stretch" and "color" are written out in the data files, where can I find them? They don't seem to be an entry in the HEAD files and were not an apparent option to output to the DUMP file.

Many thanks

Mat

--

'SNID','IAUC','FAKE','RA','DEC','PIXSIZE','NXPIX','NYPIX','SNTYPE','NOBS','PTROBS_MIN','PTROBS_MAX','MWEBV','MWEBV_ERR','REDSHIFT_HELIO','REDSHIFT_HELIO_ERR','REDSHIFT_FINAL','REDSHIFT_FINAL_ERR','MASK_REDSHIFT_SOURCE','VPEC','VPEC_ERR','HOSTGAL_NMATCH','HOSTGAL_NMATCH2','HOSTGAL_OBJID','HOSTGAL_FLAG','HOSTGAL_PHOTOZ','HOSTGAL_PHOTOZ_ERR','HOSTGAL_SPECZ','HOSTGAL_SPECZ_ERR','HOSTGAL_RA','HOSTGAL_DEC','HOSTGAL_SNSEP','HOSTGAL_DDLR','HOSTGAL_CONFUSION','HOSTGAL_LOGMASS','HOSTGAL_LOGMASS_ERR','HOSTGAL_LOGSFR','HOSTGAL_LOGSFR_ERR','HOSTGAL_LOGsSFR','HOSTGAL_LOGsSFR_ERR','HOSTGAL_COLOR','HOSTGAL_COLOR_ERR','HOSTGAL_ELLIPTICITY','HOSTGAL_OBJID2','HOSTGAL_SQRADIUS','HOSTGAL_OBJID_UNIQUE','HOSTGAL_MAG_u','HOSTGAL_MAG_g','HOSTGAL_MAG_r','HOSTGAL_MAG_i','HOSTGAL_MAG_z','HOSTGAL_MAG_Y','HOSTGAL_MAGERR_u','HOSTGAL_MAGERR_g','HOSTGAL_MAGERR_r','HOSTGAL_MAGERR_i','HOSTGAL_MAGERR_z','HOSTGAL_MAGERR_Y','HOSTGAL2_OBJID','HOSTGAL2_FLAG','HOSTGAL2_PHOTOZ','HOSTGAL2_PHOTOZ_ERR','HOSTGAL2_SPECZ','HOSTGAL2_SPECZ_ERR','HOSTGAL2_RA','HOSTGAL2_DEC','HOSTGAL2_SNSEP','HOSTGAL2_DDLR','HOSTGAL2_LOGMASS','HOSTGAL2_LOGMASS_ERR','HOSTGAL2_LOGSFR','HOSTGAL2_LOGSFR_ERR','HOSTGAL2_LOGsSFR','HOSTGAL2_LOGsSFR_ERR','HOSTGAL2_COLOR','HOSTGAL2_COLOR_ERR','HOSTGAL2_ELLIPTICITY','HOSTGAL2_OBJID2','HOSTGAL2_SQRADIUS','HOSTGAL2_OBJID_UNIQUE','HOSTGAL2_MAG_u','HOSTGAL2_MAG_g','HOSTGAL2_MAG_r','HOSTGAL2_MAG_i','HOSTGAL2_MAG_z','HOSTGAL2_MAG_Y','HOSTGAL2_MAGERR_u','HOSTGAL2_MAGERR_g','HOSTGAL2_MAGERR_r','HOSTGAL2_MAGERR_i','HOSTGAL2_MAGERR_z','HOSTGAL2_MAGERR_Y','HOSTGAL_SB_FLUXCAL_u','HOSTGAL_SB_FLUXCAL_g','HOSTGAL_SB_FLUXCAL_r','HOSTGAL_SB_FLUXCAL_i','HOSTGAL_SB_FLUXCAL_z','HOSTGAL_SB_FLUXCAL_Y','PEAKMJD','MJD_TRIGGER','MJD_DETECT_FIRST','MJD_DETECT_LAST','SEARCH_TYPE','SIM_MODEL_NAME','SIM_MODEL_INDEX','SIM_GENTYPE','SIM_TYPE_INDEX','SIM_TYPE_NAME','SIM_TEMPLATE_INDEX','SIM_LIBID','SIM_NGEN_LIBID','SIM_NOBS_UNDEFINED','SIM_SEARCHEFF_MASK','SIM_REDSHIFT_HELIO','SIM_REDSHIFT_CMB','SIM_REDSHIFT_HOST','SIM_REDSHIFT_FLAG','SIM_VPEC','SIM_HOSTLIB_GALID','SIM_HOSTLIB(LOGMASS_TRUE)','SIM_HOSTLIB(LOG_SFR)','SIM_DLMU','SIM_LENSDMU','SIM_RA','SIM_DEC','SIM_MWEBV','SIM_PEAKMJD','SIM_MJD_EXPLODE','SIM_MAGSMEAR_COH','SIM_WGT_POPULATION','SIM_AV','SIM_RV','SIM_PEAKMAG_u','SIM_PEAKMAG_g','SIM_PEAKMAG_r','SIM_PEAKMAG_i','SIM_PEAKMAG_z','SIM_PEAKMAG_Y','SIM_EXPOSURE_u','SIM_EXPOSURE_g','SIM_EXPOSURE_r','SIM_EXPOSURE_i','SIM_EXPOSURE_z','SIM_EXPOSURE_Y','SIM_GALFRAC_u','SIM_GALFRAC_g','SIM_GALFRAC_r','SIM_GALFRAC_i','SIM_GALFRAC_z','SIM_GALFRAC_Y','SIM_SUBSAMPLE_INDEX'

--

From SIM-GENERATION: CID LIBID NGEN_LIBID IDSURVEY RA RA_SN DECL DEC DECL_SN DEC_SN FIELD NFIELD_OVP MWEBV MWEBVMAP MWEBV_TRUE MWEBVERR ZCMB_SMEAR ZCMB ZHELIO ZHELIO_ERR ZFLAG VPEC VPEC_SMEAR Z GENZ MU DLMAG LENSDMU SL_IDLENS SL_LENSID SL_MAGSHIFT STRONGLENS_MAGSHIFT GALNMATCH GALNMATCH2 GALID GALZTRUE GALZPHOT GALZERR GALZPHOTERR GALSNSEP GALSNDLR GALSNDDLR GALRANDOM_RADIUS GALRANDOM_PHI GALZDIF GALSNDM GALWGT LOGMASS_TRUE LOG_SFR HOSTMAG_u HOSTMAG_g HOSTMAG_r HOSTMAG_i HOSTMAG_z HOSTMAG_Y SBFLUX_u SBFLUX_g SBFLUX_r SBFLUX_i SBFLUX_z SBFLUX_Y SBMAG_u SBMAG_g SBMAG_r SBMAG_i SBMAG_z SBMAG_Y PEAKMJD DTSEASON_PEAK PEAKMJD_SMEAR MJD0 MJD_TRIGGER MJD_DETECT_FIRST MJD_DETECT_LAST MAGT0_u MAGT0_g MAGT0_r MAGT0_i MAGT0_z MAGT0_Y PEAKMAG_u PEAKMAG_g PEAKMAG_r PEAKMAG_i PEAKMAG_z PEAKMAG_Y WIDTH_u WIDTH_g WIDTH_r WIDTH_i WIDTH_z WIDTH_Y PERIOD WGT_POPULATION AV RV MAGSMEAR_COH MAGSMEAR_COH2 GENTYPE SNTYPE TYPE SIM_TEMPLATE_INDEX NON1A_INDEX NONIA_INDEX NOBS NOBS_UNDEFINED NOBS_SATURATE NOBS_NOSATURATE NOBSDIF NEPOCH

From CUTWIN-ANALYSIS: REDSHIFT_FINAL TRESTMIN TMIN TRESTMAX TMAX SNRMAX SNRMAX1 SNRMAX2 SNRMAX3 SNRMAX4 SNRMAX5 SNRMAX_u SNRMAX_g SNRMAX_r SNRMAX_i SNRMAX_z SNRMAX_Y TGAPMAX T0GAPMAX TIME_ABOVE_SNRMIN CUTMASK SIM_EFFMASK SIM_SEARCHEFF_MASK

RickKessler commented 3 months ago

This is a rather subtle feature that can be avoided. When using submit_batch_jobs.py, the default behavior is to suppress model-specific parameters. The reason is to avoid confusion in the analysis when reading data files in which model parameters suddenly change because GENMODEL changes. This suppression is done by automatically adding command line override WRFLAG_MODELPAR: 0

To undo this flag, add WRFLAG_MODELPAR : 1 under the GENOPT_GLOBAL block as illustrated in $SNANA_LSST_USERS/smithmat/tides_sims/inputs/RICK_SIMGEN_MASTER.INPUT

Next, make sure to remove "SIMGEN_DUMPADD: stretch,color" because stretch & color are automatically added to SIMGEN_DUMP, and requesting them explicitly results in abort on duplicate SIMGEN_DUMP variables.

MatSmithAstro commented 3 months ago

Thanks Rick: this is just what we were looking for.

Happy to say its all now works :).

Best wishes,

Mat