-
Notifications
You must be signed in to change notification settings - Fork 2
Dl3 reader for LST data #7
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
Changes from 1 commit
f9fcc0f
475cdba
61925ca
6a91533
d0fa65a
4c79f97
bdf3989
0358b26
61e2e9a
4a46b01
57913de
eab77dd
98e48fc
8966b98
84aeceb
a5f98dd
64a3e9c
af0e3a9
33ea973
e1cf033
588bb61
b0081b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -574,9 +574,17 @@ def is_compatible(cls, file_name): | |
| True if fits file according to file extension | ||
| """ | ||
|
|
||
| ext = Path(file_name).suffixes | ||
| compatible = ".fits" in ext | ||
| ext = Path(file_name) | ||
|
|
||
| print("PATH", ext) | ||
|
|
||
| try: | ||
| with fits.open(ext) as file: | ||
| pass | ||
| compatible = True | ||
| except OSError: | ||
| compatible = False | ||
|
|
||
| return compatible | ||
|
|
||
| @classmethod | ||
|
|
@@ -654,25 +662,20 @@ def load_events(cls, file_name): | |
| event_data[name] *= u.one | ||
|
|
||
| # Event times need to be converted from Instrument reference epoch | ||
| ref_epoch = astropy.time.Time(evt_head['MJDREFI']+evt_head['MJDREFF'], format='mjd') | ||
| ref_epoch = astropy.time.Time(evt_head['MJDREFI'], evt_head['MJDREFF'], format='mjd') | ||
|
|
||
| event_data['mjd'] = astropy.time.Time((evt_data['TIME'].to_numpy() | ||
| + ref_epoch.unix), | ||
| scale='utc', | ||
| format='unix' | ||
| event_data['mjd'] = astropy.time.Time((evt_data['TIME'].quantity | ||
|
||
| + ref_epoch) | ||
| ).mjd * u.d | ||
|
|
||
| # Adapt | ||
| evt_time = astropy.time.Time(event_data['mjd'], format='mjd') | ||
|
|
||
| # TODO: current observatory location only La Palma, no mandatory header keyword | ||
| obs_loc = EarthLocation(lat=28.761758*u.deg, | ||
| lon=-17.890659*u.deg, | ||
| height=2200*u.m) | ||
|
|
||
| if evt_head['OBS_MODE'] in ('POINTING', 'WOBBLE'): | ||
|
|
||
| alt_az_frame = AltAz(obstime=evt_time, | ||
| alt_az_frame = AltAz(obstime=event_data['mjd'], | ||
|
||
| location=obs_loc) | ||
|
|
||
| coords = SkyCoord(evt_head['RA_PNT'] *u.deg, | ||
|
|
||
IevgenVovk marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.