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
Cutouts + light curves in anomaly notifications #153
Conversation
The code is ready for review, but I don't know how to hide the tokens to pass the tests |
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.
Thanks @Knispel2 ! For the tokens, we could use the Slack Fink_bot_test workspace, and the Telegram Fink_test channel? You can send me the token via email, and I will add them in the secrets of GitHub.
pdf[maskValid & maskFilt]['i:jd'].apply(lambda x: x - 2400000.5), | ||
pdf[maskValid & maskFilt]['i:magpsf'], | ||
pdf[maskValid & maskFilt]['i:sigmapsf'], | ||
ls='', marker='o', color=colordic[filt] |
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 would also add the label=filt
argument
ls='', marker='v', color=colordic[filt] | ||
) | ||
|
||
plt.gca().invert_yaxis() |
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 would add the plt.legend()
command to display the legend.
1c81737
into
astrolabsoftware:ad_secrets
* Cutouts + light curves in anomaly notifications (#153) * ZTF DR OID added * docstring * docstring refinement * flake8 check * ZTF DR OID ---> DR OID (<1'') * '' -> " * Moving the variables inside the if * cutouts+lc images in notifications * Hide token in status_check * Add secrets to the env * plot legend * correction --------- Co-authored-by: Timofei Pshenichnyy <93309519+Knispel2@users.noreply.github.com> Co-authored-by: Timofei Pshenichniy <timofei.psheno@gmail.com>
I have added 3 new functions:
get_cutout
- this function loads cutout image via Fink API;get_curve
- this function loads light curve image via Fink API (I used the code from the example in Fink API documentation to build the curve);get_data_permalink_slack
- using the two functions listed above, this function loads two images and copies these images to the Slack server.I also put the status_code check of post requests into a separate function
status_check
, so as not to duplicate the code.These versions of the modules are required to upload images to Slack:
slack-sdk==3.21.3 or newer
slackclient==2.9.4 or newer
Examples: