Chandra-MARX / marx

Chandra X-ray Observatory ray-trace simulator
http://space.mit.edu/cxc/marx/
5 stars 4 forks source link

Timing of SIMPUT photons #26

Closed hamogu closed 7 years ago

hamogu commented 8 years ago

I have some simput files that I have made for SIMX that I tried on the new MARX. They are of the “photon list” variety, meaning that the file has a binary table of RA, Dec, and energy.

MARX seemed to load the photons ok and generate them, but the photon times are way off—the dt between photons is much smaller than expected. I should note that I do not have a time column in the simput file, so I expect the simput library to generate times on its own assuming a time-independent source.

I was poking around in marx/libsrc/s-simput.c to see what was going on and I noticed this line (line 265 in simput_create_photons):

at->arrival_time -=pt->start_time;

Why do we need to subtract the start time off here? If I comment this line out I get times between photons that seem more sensible (though I have not completely verified them yet).

hamogu commented 8 years ago

I should also point out that the RA and Dec of the source are 30, 45 in degrees so that's what I set the source and nominal RA and Dec to in marx.par. (SIMPUT files received for debugging by email)

hamogu commented 8 years ago

I sent email to the sixte guys about what’s going on with the photon times in SIMPUT and they said this:

On 17.04.2016 19:11, John ZuHone wrote:

I had two questions about the “time” argument that is set by getSimputPhotonAnySource.

  1. What units is it in? seconds?
  2. What is the reference time? Is 0 the beginning of the exposure, and so “time” would range between 0 and the exposure time? Or is it something else?

the time is in seconds and counted from the beginning of the simulation.

So it looks like in MARX we shouldn’t need to subtract off the start time?

hamogu commented 7 years ago

Solved by #29. It turns out, this was a bug about memory allocation, not the calculation of photon times.