<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello John!<br>
    <br>
    Thanks for your detailed answer. I tried your second suggestion
    first because it was striaghtforward and it worked! No more memory
    errors.  Now that you specify your machine capabilities I can see
    why I was having problems, since I only have 8 GB of RAM.<br>
    In the future I will try to make it run parallel since we do have a
    small cluster in our department.<br>
    <br>
    So I have succesfully generated a photonlist with the following
    parameters:<br>
    <br>
    (photons_per_chunk=50E6)<br>
    <br>
        A = 2000.<br>
        exp_time = 100.0e2<br>
        redshift = 0.05<br>
        cosmo = Cosmology()<br>
    <br>
    (I just generated one single list, not quite sure how to do the
    merging yet!)<br>
    <br>
    Now, going further on the code, I'm trying to project those photons
    using the following code:<br>
    <br>
        ARF =
    "/home/barbara/yt-x86_64/xray_data/chandra_ACIS-S3_onaxis_arf.fits"<br>
        RMF =
    "/home/barbara/yt-x86_64/xray_data/chandra_ACIS-S3_onaxis_rmf.fits"<br>
        normal = [0.0,0.0,1.0]<br>
        events = photons.project_photons(normal, exp_time_new=1.0e4,
    redshift_new=0.07,             dist_new=None,<br>
                                     absorb_model=None,
    sky_center=(187.5,12.333), responses=[ARF,RMF],<br>
                                     convolve_energies=True,
    no_shifting=False, north_vector=None,<br>
                                     psf_sigma=None)<br>
    <br>
    Which produces the following output+traceback:<br>
    <font color="#666666"><br>
      <br>
    </font><font color="#666666"> [INFO     ] 2015-09-24 15:40:51,932
      Using energy-dependent effective area:
      /home/barbara/yt-x86_64/xray_data/chandra_ACIS-S3_onaxis_arf.fits<br>
      yt : [INFO     ] 2015-09-24 15:40:52,134 Total number of photons
      to use: 7776596<br>
      yt : [INFO     ] 2015-09-24 15:41:01,217 Applying energy-dependent
      effective area.<br>
      yt : [INFO     ] 2015-09-24 15:41:02,016 Total number of observed
      photons: 4518817<br>
      yt : [WARNING  ] 2015-09-24 15:41:02,017 This routine has not been
      tested to work with all RMFs. YMMV.<br>
      yt : [INFO     ] 2015-09-24 15:41:02,017 Reading response matrix
      file (RMF):
      /home/barbara/yt-x86_64/xray_data/chandra_ACIS-S3_onaxis_rmf.fits<br>
      yt : [INFO     ] 2015-09-24 15:41:02,032 Number of energy bins in
      RMF: 2340<br>
      yt : [INFO     ] 2015-09-24 15:41:02,032 Energy limits: 0.3 12<br>
      yt : [INFO     ] 2015-09-24 15:41:02,039 Number of channels in
      RMF: 1024<br>
---------------------------------------------------------------------------<br>
      ValueError                                Traceback (most recent
      call last)<br>
      /home/barbara/hires_final/photon_projection.py in <module>()<br>
           32                                  absorb_model=None,
      sky_center=(187.5,12.333), responses=[ARF,RMF],<br>
           33                                  convolve_energies=True,
      no_shifting=False, north_vector=None,<br>
      ---> 34                                  psf_sigma=None)<br>
           35 <br>
           36 print events<br>
      <br>
      /home/barbara/yt-x86_64/src/yt-hg/yt/analysis_modules/photon_simulator/photon_simulator.pyc
      in project_photons(self, normal, area_new, exp_time_new,
      redshift_new, dist_new, absorb_model, psf_sigma, sky_center,
      responses, convolve_energies, no_shifting, north_vector)<br>
          681 <br>
          682         if "RMF" in parameters and convolve_energies:<br>
      --> 683             events, info =
      self._convolve_with_rmf(parameters["RMF"], events)<br>
          684             for k, v in info.items(): parameters[k] = v<br>
          685 <br>
      <br>
      /home/barbara/yt-x86_64/src/yt-hg/yt/analysis_modules/photon_simulator/photon_simulator.pyc
      in _convolve_with_rmf(self, respfile, events)<br>
          765                 for q in range(fcurr,last):<br>
          766                     if phEE[q] >= low and phEE[q] <
      high:<br>
      --> 767                         channelInd =
      np.random.choice(len(weights), p=weights)<br>
          768                         fcurr +=1<br>
          769                        
      detectedChannels.append(trueChannel[channelInd])<br>
      <br>
      /home/barbara/yt-x86_64/lib/python2.7/site-packages/numpy/random/mtrand.so
      in mtrand.RandomState.choice
      (numpy/random/mtrand/mtrand.c:10565)()<br>
      <br>
      ValueError: probabilities do not sum to 1<br>
      <br>
       </font><br>
    I'm not sure what does that mean? Any ideas? Is this related to the
    small photon list I'm working with? <br>
    I have increased the observation redshift from 0.01 (as in the
    example) to 0.07 because I was obtaining another error that said: <br>
    <br>
    <font color="#666666">585             fak = Aratio*Tratio*Dratio<br>
          586             if fak > 1:<br>
      --> 587                 raise ValueError("Spectrum scaling
      factor = %g, cannot be greater than unity." % fak)<br>
          588             my_n_obs = np.uint64(n_ph_tot*fak)<br>
          589 <br>
      <br>
      ValueError: Spectrum scaling factor = 8.78099, cannot be greater
      than unity.</font><br>
    <br>
    But I'll admit I fixed that purely by chance and playing with the
    parameters... <br>
    <br>
    Thanks again for working through this with me. I hope the community
    benefits from this discussion!<br>
    <br>
    <br>
    PS: I'll send you anyway a private email with a copy of my dataset
    so you can have a better idea of the kind of errors I'm encountering<br>
    <pre class="moz-signature" cols="72">-- 
Barbara L. Ramirez MSc.
Institut für Astro- und Teilchenphysik
University of Innsbruck</pre>
  </body>
</html>