Skip to content

Commit

Permalink
Units fixes for EmissionlineRatioTest (LSSTDESC#190)
Browse files Browse the repository at this point in the history
* Removed lines of code that converted to cgs units and fluxes nedlessly

* Fixed simulation subsampling

* Removed unused variables

* Removed unneeded variables containing redshift and galaxy ID from catalog

* Moved plotting to after drawing SDSS galaxies so that plots accurately reflect compared distributions

* Fixed data filepath to make it more flexible
  • Loading branch information
adam-broussard committed Nov 22, 2019
1 parent 19b8d18 commit d7ac1d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions descqa/EmlineRatioTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def __init__(self, **kwargs):
self.kwargs = kwargs
self.emline_ratio1 = kwargs.get('emline_ratio1', 'oii/oiii') # Currently does not support other emission line ratios
self.emline_ratio2 = kwargs.get('emline_ratio2', 'hb/oiii') # Currently does not support other emission line ratios
sdss_file = kwargs.get('sdss_file', 'sdss_emission_lines/sdss_query_snr10_ew.csv')
sdss_file = kwargs.get('sdss_file', 'descqa/data/sdss_emission_lines/sdss_query_snr10_ew.csv')
# self.sdsscat = sdsscat(self.data_dir + '/' + sdss_file)
self.sdsscat = sdsscat('descqa/data/' + sdss_file)
self.sdsscat = sdsscat(sdss_file)

# The magnitude cuts for galaxies pulled from the catalog. These numbers correspond to
# a 5-sigma cut based on https://arxiv.org/pdf/0912.0201.pdf
Expand Down Expand Up @@ -268,14 +268,14 @@ def makeplot(self, catalog_name):
dist1 = np.array(dist1)
dist2 = np.array(dist2)

sp1.hist2d(*dist1, bins=50, range=[[-1.2, 1.2], [-1.25, 1]], norm=LogNorm(), cmap='plasma_r')
sp2.hist2d(*dist2, bins=50, range=[[-1.2, 1.2], [-1.25, 1]], norm=LogNorm(), cmap='plasma_r')

# Draw a number of SDSS galaxies equal to self.sdss_drawnum

sdss_draw_inds = np.random.choice(np.arange(len(dist1[0])), size=self.sdss_drawnum)
dist1 = dist1[:, sdss_draw_inds]

sp1.hist2d(*dist1, bins=50, range=[[-1.2, 1.2], [-1.25, 1]], norm=LogNorm(), cmap='plasma_r')
sp2.hist2d(*dist2, bins=50, range=[[-1.2, 1.2], [-1.25, 1]], norm=LogNorm(), cmap='plasma_r')

# Shift the median of the simulated galaxies to match that of the SDSS galaxies
# before performing the comparison

Expand Down
2 changes: 1 addition & 1 deletion descqa/configs/EmlineLuminosityRatios.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
subclass_name: EmlineRatioTest.EmlineRatioTest
emline_ratio1: 'oii/oiii'
emline_ratio2: 'hb/oiii'
sdss_file: 'sdss_emission_lines/sdss_query_snr10_ew.csv'
sdss_file: 'descqa/data/sdss_emission_lines/sdss_query_snr10_ew.csv'
sdss_drawnum: 30000
sim_drawnum: 30000
mag_u_cut: 26.3
Expand Down

0 comments on commit d7ac1d1

Please sign in to comment.