Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about camera_config.cfg #8

Open
dneise opened this issue Apr 24, 2018 · 5 comments
Open

question about camera_config.cfg #8

dneise opened this issue Apr 24, 2018 · 5 comments
Assignees

Comments

@dneise
Copy link

dneise commented Apr 24, 2018

I found a discrepancy between camera_config.cfg here (and its copy in digigcampipe) and the file named Digicam.geomcam.fits.gz in ctapipe, here:
https://github.com/cta-observatory/ctapipe-extra/blob/master/ctapipe_resources/DigiCam.camgeom.fits.gz

positions

Here you see a plot of the positions. I used plt.plot(pix_x, pix_y) for our own config file and plot(-pix_y, -pix_x) for the pixel I found in ctapipe in order to make the images look most similar.

image

ids

Okay this plot is a bit busy ...

plotted with

plt.scatter(
    x=cg['pix_y']*1000, 
    y=-cg['pix_x']*1000, # only y is inverted
    c=cg['pix_id'], 
)

image

I plotted the pixel positions I found in digicampipe and the pixel positions I found in ctapipe both in one figure (similar to the picture above) .. The facecolor of the circles colorcodes the pix_id. The colormap is viridis. So dark-purple is close to zero .. bright-yellow is close to 1296.

We see both the coordinates from ctapipe and from digicampipe seem to agree quite well with their pix_ids, yellow is up and dark is down .. for both of them .. very nice.

The black lines connect pixels having the same pix_ids


Question:

Can anyone enlighten a bit this situation? Do we know where the ctapipe geometry definition comes from or where it is used? Since I am pretty much an outsider, I even have the question: Which one is correct? I of course trust more our own config file .. but still ctapipe did not just invent these numbers ...

My assumption would be, that at some point in the history, somebody gave some information about the camera layout to ctapipe ... since then the layout changed a bit ... and we updated our config files accordingly, but ctapipe did not .. so their configuration is outdated and ours is correct.

Is my assumption correct?

@dneise dneise assigned dneise, cocov and calispac and unassigned dneise Apr 24, 2018
@dneise
Copy link
Author

dneise commented Apr 24, 2018

Here I plotted the last plots again with both x and y inverted:

plt.scatter(
    x=-cg['pix_y']*1000, 
    y=-cg['pix_x']*1000, 
    c=cg['pix_id'], 
)

image

This results in a reflection of pixel ids at the vertical line of symmetry (not the y-axis).

@dneise
Copy link
Author

dneise commented Apr 24, 2018

@dneise
Copy link
Author

dneise commented Apr 24, 2018

Ah and just for your entertainment .. this is the plot, when I simply plot pix_x on the x axis and pix_y on the y axis ...

image

@calispac
Copy link
Collaborator

Can anyone enlighten a bit this situation?
Do we know where the ctapipe geometry definition comes from or where it is used?

The one used in ctapipe probably refers to a geometry that was used in sim_telarray so touching it could mess up latest MC analysis

Which one is correct? I of course trust more our own config file .. but still ctapipe did not just invent these numbers ...

None is correct since it all depends on how you define xy coordinate in the cameraframe. I think there was some discussion about frames in ctapipe and that they should be changed. But in the end it all depends on how we/they define it.

Concerning both mappings:

  1. ctapipe
  • wrong orientation as you showed you need to invert x and y axis
  • pixel id seems correct if orientation is corrected
  • Is this shift in xy coordinates included by you such that we can see it?
  1. digicampipe
    • This is the latest mapping file we have produced
    • Similarly used in CARE

@dneise
Copy link
Author

dneise commented Apr 24, 2018

Is this shift in xy coordinates included by you such that we can see it?

Noooo! This is exactly how I found it

Please have a look at the pdf I attached above. On page 1 I show the coordiates of the first 3 pixels.
Even when I re-orient (i.e. swap x and y, and invert their signs) there is still a difference of ~14mm in their possition. Also the pix_area is slightly different. digicampipe says: 400mm^2 and ctapipe says 482mm^2. A difference in 20%, resulting in 20% more photons resulting in 20% different energy .. and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants