-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ra-Dec #253
Ra-Dec #253
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## auto_MCP_DL2_DL3 #253 +/- ##
=================================================
Coverage 77.23% 77.23%
=================================================
Files 21 21
Lines 2614 2614
=================================================
Hits 2019 2019
Misses 595 595 ☔ View full report in Codecov by Sentry. |
This new scripts seems to work fine. We still miss some entries into the dictionaries, but we just have to update the txt files later on (while working on Dl2 and DL3): ra, dec, MC_dec and point_source cols. are added to the LST database |
Why do you need three files to specify the RA, Dec and point-like/extended property of the same sources? Can't you have e.g. a single yaml file to store all that info? Or also JSON, since you use it anyway to open the txt files. |
A single file with 3 dictionaries inside? Maybe quite a mess when we have to modify it (hundreds of lines and quite difficult to find out if a source is already there in which dictionary) |
Yes, I meant the solution you proposed i.e. one list for each source, and each source name becomes a key. Regarding the Crab/CrabNebula, it is likely our problem to solve. 99% I am sure that the configuration on the LST side have the same coordonates. Astropy gives slightly different ones because most probably Crab is the pulsar (not sure which catalog is used though). |
I'm almost sure that the source is always the same (as for the observations): probably they just put the wrong name. astropy retrieves coordinates from simbad usually. This can be easily solved in this script by adding an 'if', but I will also check MAGIC root files for one of these obs (just to be sure that the coordinates are the same) |
here are we talking about MAGIC or LST? in LST I see only one configuration called |
Now I am checking MAGIC coordinates (easier: they are written in the files) and there seem to exist two different sources (Crab and CrabNebula) according to MARS and data taking: also in the runbook there is a different name in schedule wrt run summary |
@Elisa-Visentin can you tell one of these dates? I would like to check better, because in the scheduling catalog files I did not find source with the name "Crab", only "CrabNebula". |
OK, from MAGIC: Crab: 22° 00′ 51", 05:34:31 (h:m:s) deg: 22.0141667 83.6291667 mhhh... the second one does not even correspond to the one by astropy |
3-4 March 2024 (LST): Yes the name is the 'wrong' one in run summary, not in scheduling |
In the mean time, I fixed the input dictionary |
ok, apparently there is a catalog of sources in MAGIC called "favorites" where indeed we have: Crab,f|T,+5:34:31.00,+22:0:51.00,1.0,2000 that's what shifters used. |
Ok so now:
|
effectively for observations that difference does not affect analysis. Please use the coordinates of
I already modified the only catalog file of MAGIC where the name was CrabNebula,f|T,5:34:32.00,22:00:52.00,1.0,2000 so, it was just really a remote coincidence that shifters used that catalog... |
fixed. Thanks |
Add, to LST database, infos about coordinates and extension of the sources and MC declination to be used to process the source | ||
|
||
Usage: | ||
$ set_ra_dec (-b YYYYMMDD -e YYYYMMDD -r ra_dict -d dec_dict -m mc_dec -p point_source_dict) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options -r -d and -p were changes into one -s
coord = SkyCoord.from_name("CrabNebula") | ||
src_dec = coord.dec.degree | ||
src_ra = coord.ra.degree | ||
df_LST["ra"] = np.where(df_LST["source"] == src, src_ra, df_LST["ra"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those 3 lines are also repeated in the except block of the code. I think you can put them once after the except block always setting them to src_ra, src_dec and min dec if those are available, and if not to Nan
) | ||
except NameResolveError: | ||
print(f"{i}: {src} not found in astropy. Looking to the dictionaries...") | ||
if (src in source_dict.keys()) and (source_dict.get(src)[0] != "NaN"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can read RA and Dec together? they should be both either available or both NaN, and it would simplify the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put a few small comments
a3387b3
to
808627a
Compare
808627a
to
cea9fa6
Compare
Add ra-dec and MC dec information in LST database