phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Automatically add labels if they're contained in .json files

Open andrewpap22 opened this issue 4 years ago • 13 comments

Hello there,

Based on our discussion today on the meeting, I opened this issue (hopefully it doesn't make any problem because it was in your TODO, otherwise just delete it) and I'll try to work on it on these 4 days coming that I'll have more free time! 😄

All the best,

Andreas Pappas

andrewpap22 avatar Mar 31 '21 13:03 andrewpap22

Hi Andreas, thanks for doing this! An example of a file with labels is: https://github.com/HSF/phoenix/pull/251/commits/8e6ffcb23c424d0e702a2c9eb0595be9fe33a20d

EdwardMoyse avatar Mar 31 '21 15:03 EdwardMoyse

Hello, can I work on this issue

Pratz2005 avatar Dec 16 '24 06:12 Pratz2005

Yes, you can (in general you are free to work on any issue which hasn't been assigned to someone)

EdwardMoyse avatar Dec 17 '24 08:12 EdwardMoyse

Ok will do thank you

Pratz2005 avatar Dec 18 '24 09:12 Pratz2005

Hello, are the json files being changed during runtime?

Pratz2005 avatar Jan 02 '25 09:01 Pratz2005

No, these will not change during runtime.

EdwardMoyse avatar Jan 02 '25 09:01 EdwardMoyse

I have added the labels as eta/phi for all objects in the atlas.json file but for the tracks, I'm a bit confused on how to go about the labelling can you help me with that

Pratz2005 avatar Jan 02 '25 20:01 Pratz2005

Hi @EdwardMoyse can I get an update on this?

Pratz2005 avatar Jan 05 '25 07:01 Pratz2005

Hi @Pratz2005 - sorry, I have been offline. Can you point me to your code?

Basically I would think you would follow the logic in private loadLabelsFile() {

EdwardMoyse avatar Jan 07 '25 13:01 EdwardMoyse

image So how I understood the problem was that in the json files there are no labels so I just wrote a python script to parse through the atlas.json file to add labels as eta/phi for all objects which have eta and phi as variables as shown in the example.

atlas.json

Pratz2005 avatar Jan 07 '25 14:01 Pratz2005

Aaah! No, sorry - that's not it. I don't care about what the actual content of the labels is - they are just placeholders.

What we want to do is to streamline adding labels to objects i.e. instead of this taking two steps:

  • loading an event data file (e.g. atlas.json, but it should work for all formats),
  • and then loading a labels.json file.

It should be one step: open the event data file, and then if the event data objects have a label attribute the we would automatically call this.three.addLabelToObject to put the labels into the 3D view.

EdwardMoyse avatar Jan 07 '25 14:01 EdwardMoyse

image

Hi @EdwardMoyse can you assist me on how to test the issue on the UI. Do you want me to add labels into the view when i import the ATLAS_calibration.json file?

Pratz2005 avatar Jan 13 '25 05:01 Pratz2005

@EdwardMoyse Can I get an update on this

Pratz2005 avatar Jan 21 '25 06:01 Pratz2005