<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello!<br>
    <br>
    I have written before about trying to implement the xray photon
    generator. <br>
    This time I've updated all the libraries, YT, Heasoft... etc. <br>
    <br>
    I'm just trying to generate a photon list for the moment but I'm
    getting two sorts of errors:<br>
    1) <br>
    <i><br>
    </i><i>---------------------------------------------------------------------------</i><i><br>
    </i><i>RuntimeError                              Traceback (most
      recent call last)</i><i><br>
    </i><i>/home/barbara/hires_final/photon_trial.py in <module>()</i><i><br>
    </i><i>     90 cosmo = Cosmology()</i><i><br>
    </i><i>     91 </i><i><br>
    </i><i>---> 92 photons = PhotonList.from_scratch(Roi, redshift,
      A, exp_time,thermal_model,center="center",cosmology=cosmo)</i><i><br>
    </i><i>     93 photons.write_h5_file("my_photons.h5")</i><i><br>
    </i><i>     94 </i><i><br>
    </i><i><br>
    </i><i>/home/barbara/yt-x86_64/src/yt-hg/yt/analysis_modules/photon_simulator/photon_simulator.pyc
      in from_scratch(cls, data_source, redshift, area, exp_time,
      photon_model, parameters, center, dist, cosmology)</i><i><br>
    </i><i>    329         parameters["Width"] =
      2.*width.in_units("kpc")</i><i><br>
    </i><i>    330 </i><i><br>
    </i><i>--> 331         photons = photon_model(data_source,
      parameters)</i><i><br>
    </i><i>    332 </i><i><br>
    </i><i>    333         mylog.info("Finished generating photons.")</i><i><br>
    </i><i><br>
    </i><i>/home/barbara/yt-x86_64/src/yt-hg/yt/analysis_modules/photon_simulator/photon_models.pyc
      in __call__(self, data_source, parameters)</i><i><br>
    </i><i>    188                     raise RuntimeError("Number of
      photons generated for this chunk "+</i><i><br>
    </i><i>    189                                        "exceeds
      photons_per_chunk (%d)! " % self.photons_per_chunk +</i><i><br>
    </i><i>--> 190                                        "Increase
      photons_per_chunk!")</i><i><br>
    </i><i>    191 </i><i><br>
    </i><i>    192                 if self.method == "invert_cdf":</i><i><br>
    </i><i><br>
    </i><i>RuntimeError: Number of photons generated for this chunk
      exceeds photons_per_chunk (1000000000)! Increase
      photons_per_chunk!</i><br>
    <br>
    <br>
    Ok, so I increase the number of photons per chunk and I get:<br>
    2)<br>
    <i>---------------------------------------------------------------------------</i><i><br>
    </i><i>MemoryError                               Traceback (most
      recent call last)</i><i><br>
    </i><i>/home/barbara/hires_final/photon_trial.py in <module>()</i><i><br>
    </i><i>     90 cosmo = Cosmology()</i><i><br>
    </i><i>     91 </i><i><br>
    </i><i>---> 92 photons = PhotonList.from_scratch(Roi, redshift,
      A, exp_time,thermal_model,center="center",cosmology=cosmo)</i><i><br>
    </i><i>     93 photons.write_h5_file("my_photons.h5")</i><i><br>
    </i><i>     94 </i><i><br>
    </i><i><br>
    </i><i>/home/barbara/yt-x86_64/src/yt-hg/yt/analysis_modules/photon_simulator/photon_simulator.pyc
      in from_scratch(cls, data_source, redshift, area, exp_time,
      photon_model, parameters, center, dist, cosmology)</i><i><br>
    </i><i>    329         parameters["Width"] =
      2.*width.in_units("kpc")</i><i><br>
    </i><i>    330 </i><i><br>
    </i><i>--> 331         photons = photon_model(data_source,
      parameters)</i><i><br>
    </i><i>    332 </i><i><br>
    </i><i>    333         mylog.info("Finished generating photons.")</i><i><br>
    </i><i><br>
    </i><i>/home/barbara/yt-x86_64/src/yt-hg/yt/analysis_modules/photon_simulator/photon_models.pyc
      in __call__(self, data_source, parameters)</i><i><br>
    </i><i>    156 </i><i><br>
    </i><i>    157             number_of_photons = np.zeros(num_cells,
      dtype="uint64")</i><i><br>
    </i><i>--> 158             energies =
      np.zeros(self.photons_per_chunk)</i><i><br>
    </i><i>    159 </i><i><br>
    </i><i>    160             start_e = 0</i><i><br>
    </i><i><br>
    </i><i>MemoryError: </i><br>
    <br>
    <br>
    This is just a trial, so I'm using almost a copy of the code that's
    on the documentation:<br>
    <br>
        Roi = ds.sphere("center",radius=width_half)<br>
        apec_model =
TableApecModel("/home/barbara/yt-x86_64/atomdb_v2.0.2",0.5,10.0,100,thermal_broad=False,apec_vers="2.0.2")<br>
        thermal_model = ThermalPhotonModel(apec_model,
    X_H=0.75,photons_per_chunk=1000000000, Zmet=0.3,method="invert_cdf")<br>
    <br>
        A = 6000.<br>
        exp_time = 100.0e3<br>
        redshift = 0.05<br>
        cosmo = Cosmology()<br>
    <br>
        photons = PhotonList.from_scratch(Roi, redshift, A,
    exp_time,thermal_model,center="center",cosmology=cosmo)<br>
        photons.write_h5_file("my_photons.h5")<br>
    <br>
    My snapshot information:<br>
    <br>
    length unit 0.999752515846 cm<br>
    time unit 1.0 s<br>
    mass unit 1.0 g<br>
    velocity unit 1.0 cm/s<br>
    Enter total Width of plot in Mpccm: 0.5<br>
    smallest cell: 14.6469091426 kpccm/h<br>
    minima and maxima 1.04339659244e-29 g/cm**3 1.5187912088e-24 g/cm**3<br>
    The simulation is [ 89.40546647  89.40546647  89.40546647] Mpccm<br>
    Centering region in:, [ 44.58268195  44.53902694  44.51719943] Mpccm<br>
    yt : [INFO     ] 2015-09-15 16:49:43,219 Cosmology: h = 0.71,
    omega_matter = 0.27, omega_lambda = 0.73<br>
    <br>
    <br>
    Am I just using wrong parameters to try to simulate the Xray
    emission of this simulated cluster?<br>
    <br>
    Thanks beforehand for the help!<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Barbara L. Ramirez MSc.
Institut für Astro- und Teilchenphysik
University of Innsbruck</pre>
  </body>
</html>