<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Barbara,<div class=""><br class=""></div><div class="">Sorry to hear you’re having trouble at the moment. I have a few other questions. </div><div class=""><br class=""></div><div class="">1) Can you post the entire script? Use <a href="http://paste.yt-project.org" class="">http://paste.yt-project.org</a> and send a link. </div><div class="">2) Can you give me a sense of what the mass and temperature of your cluster is? It sounds like it is fairly large. And the radius? </div><div class="">3) What code did the simulation come from?</div><div class=""><br class=""></div><div class="">After knowing these, I think we can get somewhere. I have some ideas. </div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">John </div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 15, 2015, at 10:59 AM, Barbara Ramirez <<a href="mailto:Barbara.Ramirez-Mosquera@uibk.ac.at" class="">Barbara.Ramirez-Mosquera@uibk.ac.at</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  

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

_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br class=""></div></blockquote></div><br class=""></div></body></html>