Skip to content
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

Feature/hermes support #25

Merged
merged 6 commits into from
May 13, 2024
Merged

Feature/hermes support #25

merged 6 commits into from
May 13, 2024

Conversation

jnation3406
Copy link
Contributor

This PR adds the ability to submit to TNS through Hermes (If Hermes info is defined in the DATA_SHARING section). I also enhanced the form a bit to have:

  • Extra discovery parameters to specify a nondetection flux
  • A set of choices for spectra files in a dropdown from the dataproducts associated with the target
  • Descriptions for the files to send
  • An endpoint for going to the TNS form with a specific ReducedDatum pk, which will use that datum to seed the initial info in the form

Please check out the README especially to see if that makes sense for the two modes of submission now. Also @jchate6 I added a bit at the bottom about how to include it into your TOM's templates - the idea was originally to add a button to the target details "manage data" or "photometry" and "spectroscopy" tabs to go to the tns form for a specific datum or data product, but I can't really see a way to "inject" that into this plugin? Please let me know if there is a way, but ff there isn't, then I think its fine to leave this as is since the main user SNEX uses fully custom target detail templates anyway, so they will need to add it themselves either way.

@jnation3406 jnation3406 requested review from cmccully and jchate6 April 25, 2024 05:43
'TNS_GROUP_NAMES': ['bot_group', 'PI_group'], # Optional List. Include if you wish to use any affiliated Group Names when reporting to TNS.
'FILTER_MAPPING': {
'o': 'Other',
'c': 'Clear',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't really important, but the o and c bands are from the atlas survey and stand for orange and cyan respectively.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this readme is just to show an example setting... users should tailor it to their own data sources and mapping. But if there is a better example mapping you want me to put here please let me know (Cyan/Orange aren't tns filter names I think).

Copy link

@cmccully cmccully left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Minor comments interleaved.

Copy link
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.
I'm OK with releasing this and letting Griffin make any issues that he finds.

README.md Outdated
'c': 'Clear',
...
}, # Optional mapping from your reduced datum filter values to TNS filter options.
'default_authors': 'Foo Bar <[email protected]>' # Optional default authors string to populate the author fields for tns submission. If not specified, defaults to saying "<logged in user> using <tom name>".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a second author to the example?
Something like 'Foo Bar [email protected], Rando Calrissian, et al.'

```python
urlpatterns = [
...
path('tns/', include('tom_tns.urls', namespace='tns')),
]
```

Once configured, a `TNS` button should appear below the Target Name.
Once configured, a `TNS` button should appear below the Target Name on the default Target Detail page.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good solution for now. Ultimately, we want to get away from forcing users to modify their templates to benefit from our apps. (See TOMToolkit/tom_base#745)

Adding a connection point to apps.py for photometry table would be an interesting step for future development.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I saw that was used for the TNS button here. Seems nice, but will be a lot of work to add them everywhere that might make sense (anywhere with the target, datums, or dataproducts)

# Get IAU name from Report Reply
iau_name = get_tns_report_reply(report_id, self.request)

if iau_name:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@jchate6 jchate6 linked an issue May 7, 2024 that may be closed by this pull request
@jnation3406 jnation3406 merged commit bc8b4d7 into dev May 13, 2024
10 checks passed
@jnation3406 jnation3406 deleted the feature/hermes_support branch May 13, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

TOM_TNS: Configurable author list
3 participants