11from ROOT
import EventFile, EquatorialCoords, Det, Vec
16 times = np.linspace(0, timespan, n_datapoints, dtype=int)
17 d = ROOT.Det(data_path(
"detx/KM3NeT_00000133_20221025.detx"))
19 outfile = open(
"local2eq_aanet_2.7.1.csv",
"w")
20 outfile.write(
"dx,dy,dz,")
21 outfile.write(
"phi,theta,")
22 outfile.write(
"utm_easting,utm_northing,utm_z,utm_zone,utm_reference_elipsoid,")
23 outfile.write(
"det_latitude,det_longitude,meridian_convergence,")
24 outfile.write(
"year,month,day,hour,min,sec,")
25 outfile.write(
"eq_ra,eq_dec,gal_lon,gal_lat,")
26 outfile.write(
"j2000\n")
28 t_year = ctypes.c_uint()
29 t_month = ctypes.c_uint()
30 t_day = ctypes.c_uint()
31 t_hour = ctypes.c_uint()
32 t_minute = ctypes.c_uint()
33 t_sec = ctypes.c_uint()
41 for v
in [Vec(0, 0, -1), Vec(0, 1, 0), Vec(1, 0, 0), Vec(-1.2, 3.4, -5.6).normalize()]:
42 for year
in [2000, 2010, 2025]:
43 starttime = datetime.datetime(year, month, day, hour, min, sec).
replace(tzinfo=datetime.timezone.utc).timestamp()
44 for j2000
in (
True,
False):
46 timestamp = ROOT.TTimeStamp(int(starttime+t))
47 timestamp.GetDate(
True, 0, t_year, t_month, t_day)
48 timestamp.GetTime(
True, 0, t_hour, t_minute, t_sec)
50 coords = EquatorialCoords(d, v, timestamp, j2000)
51 gal = ROOT.sla.eqgal(coords.ra(), coords.dec())
53 outfile.write(f
"{v.x},{v.y},{v.z},")
54 outfile.write(f
"{v.phi()},{v.theta()},")
55 outfile.write(f
"{d.utm_ref_easting},{d.utm_ref_northing},{d.utm_ref_z},{d.utm_zone},{d.utm_reference_elipsoid},")
56 outfile.write(f
"{d.latitude},{d.longitude},{d.meridian_convergence_angle},")
57 outfile.write(f
"{t_year.value},{t_month.value},{t_day.value},{t_hour.value},{t_minute.value},{t_sec.value},")
60 outfile.write(f
"{ROOT.wrap(coords.ra())},{coords.dec()},{gal.DL},{gal.DB},")
61 outfile.write(f
"{j2000}\n")
TString replace(const TString &target, const TRegexp ®exp, const T &replacement)
Replace regular expression in input by given replacement.