@@ -398,9 +398,10 @@ def simulate(shape, wcs, efftimes, filter_name, catalog, nexposures=1,
398398 # Set effective read noise
399399 if effreadnoise is None :
400400 readnoise = np .median (romanisim .parameters .reference_data ['readnoise' ])
401+ # read noise in DN
401402 gain = np .median (romanisim .parameters .reference_data ['gain' ])
402403 effreadnoise = (
403- np .sqrt (2 ) * readnoise * gain )
404+ np .sqrt (2 ) * readnoise * gain ) # electron, difference of two reads
404405 # sqrt(2) from subtracting one read from another
405406 effreadnoise /= (np .median (efftimes * pixscalefrac ** 2 ) / nexposures )
406407 # divided by the typical exposure length
@@ -412,10 +413,10 @@ def simulate(shape, wcs, efftimes, filter_name, catalog, nexposures=1,
412413 # note that we are ignoring all of the individual reads, which also
413414 # contribute to reducing the effective read noise. Pass --effreadnoise
414415 # if you want to do better than this!
415- effreadnoise = effreadnoise * etomjysr # electron -> MJy/sr
416+ effreadnoise = effreadnoise * etomjysr * pixscalefrac ** 2 # electron -> MJy/sr
417+ # factor of pixfrac ** 2 because etomjysr is per L3 pixel, but
418+ # this effreadnoise calculation is per native pixel
416419 # converting to MJy/sr units
417- else :
418- effreadnoise = 0
419420
420421 chromatic = False
421422 if (len (catalog ) > 0 and not isinstance (catalog , astropy .table .Table )
@@ -481,7 +482,7 @@ def simulate_cps(image, filter_name, efftimes, objlist=None, psf=None,
481482 xpos = None , ypos = None , coord = None , sky = 0 , bandpass = None ,
482483 effreadnoise = None , maggytoes = None , etomjysr = None ,
483484 rng = None , seed = None , ignore_distant_sources = 10 ,):
484- """Simulate average MegaJanskies per steradian in a single SCA.
485+ """Simulate average MJy/sr in a single SCA.
485486
486487 Parameters
487488 ----------
@@ -507,10 +508,10 @@ def simulate_cps(image, filter_name, efftimes, objlist=None, psf=None,
507508 effreadnoise : float
508509 Effective read noise for mosaic (MJy / sr)
509510 maggytoes: float
510- Factor to convert electrons to MJy / sr; one maggy makes
511+ Factor to convert e/s to MJy / sr; one maggy makes
511512 this many e/s.
512513 etomjysr : float
513- Factor to convert electron to MJy/ sr; one e/s/pix corresponds
514+ Factor to convert e/s to MJy / sr; one e/s/coadd pix corresponds
514515 to this MJy/sr.
515516 rng : galsim.BaseDeviate
516517 random number generator
0 commit comments