-
Notifications
You must be signed in to change notification settings - Fork 268
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
What is telescope type id? #1270
Comments
This is used in the dl1 writer. Right now it's jsut an integer hash of the telescope name, since there is no numbering or naming scheme yet. It's only for being able to do things like: parameters_dataframe.groupby("telescope_type") In the case of merged tables (where all events are in one table) |
If we can fix the telescope naming scheme, we could make that a string or Enum later. But that also requires adding support for strings in HDF5TableWriter (which also means adding a few attributes to Field to be able to set the storage length, etc). |
def tel_type_string_to_int(tel_type):
"""
convert a telescope type string (str(TelescopeDescription)) into an integer that
can be stored.
Parameters
----------
tel_type: str
telescope type string like "SST_ASTRI_CHEC"
Returns
-------
int:
hash value
"""
return np.int32(
int(hashlib.sha1(tel_type.encode("utf8")).hexdigest(), 16) % (10 ** 8)
) |
why not just |
it was just to get a shorter more readable number, and to make sure it comes out to the same number on all machines. I'm not sure hash() guarantees that. |
Is that function already in the current master? |
No, just in #1163 but I'm working to make some PRs to move those in. Now that we split the DL1 and other files by tel_id, even for things like parameters, that |
Tel type id was removed |
Why is there a telescope type id defined in the container for telescope_index ? What is this number supposed to mean and where to fill it?
The text was updated successfully, but these errors were encountered: