-
Notifications
You must be signed in to change notification settings - Fork 0
Tod tools #3
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
Conversation
|
@chervias I'd like to know if the function |
mapcat/toolkit/mapmaking.py
Outdated
| if len(tods) == 0: # pragma: no cover | ||
| raise ValueError(f"No TODs with obs ID {obs_id} found.") | ||
|
|
||
| depth_one_maps = [tod.maps for tod in tods][0] |
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.
This only returns a single map right? When in reality multiple may match.
I think you can do this all in one sql query:
SELECT m.*
FROM depth_one_maps AS m
JOIN link_tod_to_depth_one_map AS link
ON m.map_id = link.map_id
JOIN tod_depth_one AS t
ON link.tod_id = t.tod_id
WHERE t.obs_id = 'obs_1758179265_lati1_111'
There should be some way of representing this as SQLAlchemy...
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.
This should be able to return multiple maps, see 209/210 in test_mapmaking.py. I did just notice that the [0] index is cutting it down to only the first returned TOD. I forgot about this issue, I was treating the obs_idas if there could be more than one TOD with a givenobs_id, but that shouldn't be. The obs_id` are one-to-one with the TODs. I'll change that.
|
Hi @Sulla2012 yes I think it works. So in theory we will have a list of maps-to-be-made in the mapmaker, and then we need to run that list against something checking which maps stay and which maps are removed. Is it any different running that list against the full sql database versus running that list against the output of |
Add a
build_obslistanalogue to map cat. This function allows users to input a list ofobs_idsand receive 1) a dict with keys theobs_idand entries the Depth-1 maps associated with eachobs_idand 2) a list ofobs_idnot in any map.