In [ ]:
import numpy as np
from pylab import *
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')

Trying to reconstruct how to run the simulations. There are two python scripts:

LCSgalfitsim.py
LCSrungalfitsimall.py

The second scripts runs the simulations for all the clusters. To run on just one cluster:

LCSgalfitsim.py MKW11

This calls calls the function:

  • rungalfit_sim_24
    • this sets up the model parameters
    • then calls rungalfit_sim_part2
  • rungalfit_sim_part2
    • this loops through the number of simulation galaxies, which is set by npoints
    • runs just_get_images24(i,make_mask_flag=1)
    • then runs get_images24(i,0)
      • commenting out first pass which is run without convolution
    • runs measure_SEsnr24()
    • runs *write_galfit_sersic_parameters_24()

Trying to run through the simulation for MKW11.

Some issues:

  • Before running simulations, delete any existing files that are in sim/CLUSTER/24um/ directory.
  • coverage images weren't copied to new laptop

    • cp /Volumes/My\ Passport\ for\ Mac/research/LocalClusters/Images/MKW11/24umWCS/MKW11-WCS-mosaic_cov.fits /Users/rfinn/research/LocalClusters/Images/MKW11/24umWCS/.
    • need to repeat for each cluster: MKW8, AWM4, NGC6107, A2052, A2063, A1367, Hercules, Coma
  • changed max Re of model to 10 pixels (consistent with our max size cut of 20 arcsec)

  • seems like program is not overwriting the existing masks - keeps saying kill imcopy
    • oops - not an issue. the killing imcopy is because I first try to copy segmentation.fits[1], and if this doesn't work, I try segmentation.fits. Looks like it is working as intended - the first option doesn't work, but the second does.
  • ds9 is a little flaky - often doesn't open in time

Important Changes as of 1/14/2016 (yes, 2016!)

  • currently galfit is run first without convolution - getting rid of this to reflect new procedure
  • keeping BA and PA fixed, as I do with real images. This might overestimate our accuracy because 24um BA and PA might not be the same as the r-band values. Oh well...
  • Rerunning for all clusters, using 200 sim galaxies/cluster, on 1/14/2016

Checking Results

need to run this from the command line because ds9 is not playing nice with notebook

%run ~/Dropbox/pythonCode/LCSgalfitsim.py MKW11

Once simulation has finished, you can read in the simulation results and make some plots.


In [28]:
%run ~/Dropbox/pythonCode/LCSgalfitsim.py


Running on Rose's mac pro
no cluster name given
----------------------
loading all clusters
Auto-detected table type: fits

In [29]:
mkw11=simresults('MKW11')


Auto-detected table type: fits

In [30]:
mkw11.plotsample()



In [31]:
mkw11.plotresultsv2(usesb=1)


got here!

In [32]:
mkw11.plotsizeRe()


Number w/successful fits =  6

In [33]:
mkw11.plotsizesb()


Once all the simulations are re-run


In [59]:
%run ~/Dropbox/pythonCode/LCSgalfitsim.py


no cluster name given
----------------------
loading all clusters
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits

In [56]:
plotsizesball()



In [55]:
plotsizeReall()


Number w/successful fits =  110
Number w/successful fits =  125
Number w/successful fits =  137
Number w/successful fits =  123
Number w/successful fits =  122
Number w/successful fits =  117
Number w/successful fits =  135
Number w/successful fits =  93
Number w/successful fits =  122

What is up with Hercules???

Need to figure this out or drop it from the sample.


In [60]:
herc.plotresultsv2()


got here!

In [62]:
herc.plotsizeRe()
axis([1,20,.2,10])


Number w/successful fits =  93
Out[62]:
[1, 20, 0.2, 10]

The Problem with Hercules

going back to square one with Hercules. For some reason, it something is very wrong with the size measurements.

I'm assuming this is a problem with the PRF.

     self.psf_image='/Users/rfinn/research/LocalClusters/PRF/'+self.prefix+'/'+self.prefix+'psf_starv2.fits'

In [63]:
from astropy.io import fits
prf=fits.getdata('/Users/rfinn/research/LocalClusters/PRF/Hercules/Herculespsf_starv2.fits')
imshow(prf)


Out[63]:
<matplotlib.image.AxesImage at 0x110dae610>

In [64]:
# here is MKW11
prf=fits.getdata('/Users/rfinn/research/LocalClusters/PRF/MKW11/MKW11psf_starv2.fits')
imshow(prf)


Out[64]:
<matplotlib.image.AxesImage at 0x110d977d0>

In [66]:
# the default mips psf
# oversampled by a factor of 4
prf=fits.getdata('/Users/rfinn/research/LocalClusters/GalfitAnalysis/MIPSpsf/mips24_prf_mosaic_2.45_4x.fits')
imshow(prf)


Out[66]:
<matplotlib.image.AxesImage at 0x110b39e10>

Trying mips default PRF

  • removing old sim data
  • adjusting LCSrungalfitsim.py to change PRF for Hercules (and oversampling factor)

In [71]:
%run ~/Dropbox/pythonCode/LCSgalfitsim.py


no cluster name given
----------------------
loading all clusters
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits
Auto-detected table type: fits

In [72]:
herc.plotsizeRe()


Number w/successful fits =  112

well that certainly seems better! Going to run for 100 galaxies now to see if fitted size is better.


In [73]:
plotsizeReall()


Number w/successful fits =  110
Number w/successful fits =  125
Number w/successful fits =  137
Number w/successful fits =  123
Number w/successful fits =  122
Number w/successful fits =  117
Number w/successful fits =  135
Number w/successful fits =  112
Number w/successful fits =  122

Does this mean I have to redo galfit on the Hercules galaxies???


In [74]:
plotsizesball()


Redid fits for all Hercules galaxies and the generic mips PRF worked much better. Yay!


In [ ]: