Closed chensihan1999 closed 3 years ago
Instead of using string manipulation to detect the overflow of the ns field, one might do the following:
Also it's a pretty common thing in csv files for the first row to contain column titles. You do something close to this, but instead of depending on the fact that the first column in the first row is blank, you can also just explicitly ignore the contents of the first row. (I imagine it's a pretty easy mistake to make, to leave a detector name blank somewhere, in which case I think your code will pick up the contents of that first row)
Instead of using string manipulation to detect the overflow of the ns field, one might do the following:
- normalize both times, i.e., make sure the ns field has values between 0 and 999999999 (inclusive), adjusting the sec fields appropriately; the absolute times should remain the same, just with the ns field in the proper range
- subtract to get the time difference
- now we know there's a limit to how big the difference in the ns fields is, so we can increment or decrement the difference in the sec field accordingly (basically, normalize the time difference just as you did for the absolute times in step 1)
I've updated the portion of the code where I normalize both the s and the ns fields.
I've replaced the old normalizing time code with the normlized_time function in the lib.py file.
Added a data file titled "detector location.csv" containing detector latitude, longitude, height, and time uncertainty. Added "NeutrinoArrivalTime.py" that generates the true neutrino arrival time for a list of detectors. Added "TimeOffset.py" that adds a Gaussian noise to the generated true neutrino arrival time of detectors in the payload.