Skip to content

Commit

Permalink
Update demo (#9)
Browse files Browse the repository at this point in the history
* update skyportal and kowalski

* update K and SP
  • Loading branch information
dmitryduev authored Jun 8, 2020
1 parent a80bdde commit 770f9d6
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 5 deletions.
84 changes: 84 additions & 0 deletions doc/data/filter_examples/fritz_filter_01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[
{
"$project": {
"cutoutScience": 0,
"cutoutTemplate": 0,
"cutoutDifference": 0
}
},
{
"$lookup": {
"from": "ZTF_alerts_aux",
"localField": "objectId",
"foreignField": "_id",
"as": "aux"
}
},
{
"$replaceRoot": {
"newRoot": {
"$mergeObjects": [
{
"$arrayElemAt": [
"$aux",
0
]
},
"$$ROOT"
]
}
}
},
{
"$project": {
"cross_matches": 1,
"prv_candidates": {
"$filter": {
"input": "$prv_candidates",
"as": "item",
"cond": {
"$in": [
"$$item.programid",
[
1
]
]
}
}
},
"schemavsn": 1,
"publisher": 1,
"objectId": 1,
"candid": 1,
"candidate": 1,
"classifications": 1,
"coordinates": 1
}
},
{
"$match": {
"candidate.drb": {
"$gt": 0.9999999
},
"cross_matches.CLU_20190625.0": {
"$exists": false
}
}
},
{
"$addFields": {
"annotations.author": "dd",
"annotations.mean_rb": {
"$avg": "$prv_candidates.rb"
}
}
},
{
"$project": {
"_id": 0,
"candid": 1,
"objectId": 1,
"annotations": 1
}
}
]
79 changes: 79 additions & 0 deletions doc/data/filter_examples/fritz_filter_02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[
{
"$project": {
"cutoutScience": 0,
"cutoutTemplate": 0,
"cutoutDifference": 0
}
},
{
"$lookup": {
"from": "ZTF_alerts_aux",
"localField": "objectId",
"foreignField": "_id",
"as": "aux"
}
},
{
"$project": {
"cross_matches": {
"$arrayElemAt": [
"$aux.cross_matches",
0
]
},
"prv_candidates": {
"$filter": {
"input": {
"$arrayElemAt": [
"$aux.prv_candidates",
0
]
},
"as": "item",
"cond": {
"$in": [
"$$item.programid",
[
1
]
]
}
}
},
"schemavsn": 1,
"publisher": 1,
"objectId": 1,
"candid": 1,
"candidate": 1,
"classifications": 1,
"coordinates": 1
}
},
{
"$match": {
"candidate.drb": {
"$gt": 0.9999999
},
"cross_matches.CLU_20190625.0": {
"$exists": false
}
}
},
{
"$addFields": {
"annotations.author": "dd",
"annotations.mean_rb": {
"$avg": "$prv_candidates.rb"
}
}
},
{
"$project": {
"_id": 0,
"candid": 1,
"objectId": 1,
"annotations": 1
}
}
]
4 changes: 2 additions & 2 deletions fritz
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def generate_skyportal_token():
"""from skyportal.models import init_db; """
"""from skyportal.model_util import create_token; """
"""conn = init_db(**load_config(['config.yaml'])['database']); """
"""print(create_token(['Upload data', 'Manage sources'], 1, 'kowalski'))" """
"""print(create_token(['Upload data', 'Manage sources', 'Manage groups'], 1, 'kowalski'))" """
],
cwd="skyportal",
capture_output=True,
Expand Down Expand Up @@ -90,7 +90,7 @@ def check_config(cfg='fritz.defaults.yaml', yes=False):
user_id=config['kowalski']['server']['admin_username'],
jwt_secret=config['kowalski']['server']['JWT_SECRET_KEY'],
)
config['app']['kowalski_token'] = kowalski_token
config['app']['kowalski']['token'] = kowalski_token

with open(c, 'w') as cyaml:
yaml.dump(config, cyaml) # default_flow_style=False
Expand Down
14 changes: 13 additions & 1 deletion fritz.defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ app:
- path: "/user/:id"
component: UserInfo

kowalski_token:
kowalski:
protocol: "http"
host: "kowalski_api_1"
port: 4000
token:

database:
database: skyportal
Expand All @@ -54,6 +58,14 @@ server:
services:
dask: False

misc:
days_to_keep_unsaved_candidates: 7

cron:
- interval: 1440
script: jobs/delete_unsaved_candidates.py
limit: ["01:00", "02:00"]


kowalski:
server:
Expand Down
2 changes: 1 addition & 1 deletion kowalski
2 changes: 1 addition & 1 deletion skyportal
Submodule skyportal updated 88 files
+1 −1 Makefile
+1 −1 baselayer
+12 −0 config.yaml.defaults
+2 −2 instrument_observation_params.json
+32 −0 jobs/delete_unsaved_candidates.py
+14 −11 package.json
+1 −0 requirements.txt
+6 −1 skyportal/app_server.py
+4 −3 skyportal/handlers/api/__init__.py
+423 −0 skyportal/handlers/api/candidate.py
+27 −6 skyportal/handlers/api/comment.py
+151 −0 skyportal/handlers/api/filter.py
+10 −7 skyportal/handlers/api/followup_request.py
+79 −35 skyportal/handlers/api/group.py
+80 −45 skyportal/handlers/api/instrument.py
+10 −7 skyportal/handlers/api/internal/dbinfo.py
+1 −1 skyportal/handlers/api/internal/instrument_observation_params.py
+6 −2 skyportal/handlers/api/internal/plot.py
+35 −1 skyportal/handlers/api/internal/profile.py
+1 −1 skyportal/handlers/api/internal/source_views.py
+7 −4 skyportal/handlers/api/internal/token.py
+15 −7 skyportal/handlers/api/news_feed.py
+334 −88 skyportal/handlers/api/photometry.py
+217 −137 skyportal/handlers/api/source.py
+9 −10 skyportal/handlers/api/spectrum.py
+5 −3 skyportal/handlers/api/sysinfo.py
+9 −7 skyportal/handlers/api/telescope.py
+13 −9 skyportal/handlers/api/thumbnail.py
+3 −3 skyportal/handlers/api/user.py
+10 −8 skyportal/handlers/base.py
+147 −38 skyportal/models.py
+20 −0 skyportal/phot_enum.py
+338 −46 skyportal/plot.py
+408 −10 skyportal/schema.py
+28 −0 skyportal/tests/api/test_bulk_delete_photometry.py
+109 −0 skyportal/tests/api/test_candidates.py
+2 −2 skyportal/tests/api/test_comments.py
+1 −1 skyportal/tests/api/test_dbinfo.py
+76 −0 skyportal/tests/api/test_filters.py
+3 −3 skyportal/tests/api/test_groups.py
+36 −25 skyportal/tests/api/test_instrument.py
+514 −100 skyportal/tests/api/test_photometry.py
+8 −17 skyportal/tests/api/test_sources.py
+10 −11 skyportal/tests/api/test_spectrum.py
+8 −8 skyportal/tests/api/test_telescope.py
+80 −76 skyportal/tests/api/test_thumbnail.py
+3 −6 skyportal/tests/api/test_user.py
+5 −4 skyportal/tests/api/test_versioned_requests.py
+84 −34 skyportal/tests/conftest.py
+367 −1,532 skyportal/tests/data/phot.csv
+27 −23 skyportal/tests/fixtures.py
+21 −14 skyportal/tests/frontend/test_followup_requests.py
+5 −13 skyportal/tests/frontend/test_frontpage.py
+267 −0 skyportal/tests/frontend/test_scanning_page.py
+37 −24 skyportal/tests/frontend/test_sources.py
+107 −0 skyportal/tests/frontend/test_upload_photometry.py
+24 −6 skyportal/tests/tools/test_offset_util.py
+5 −1 static/js/API.js
+43 −0 static/js/components/CandidateCommentList.jsx
+136 −0 static/js/components/CandidateList.jsx
+31 −21 static/js/components/CommentList.css
+52 −24 static/js/components/CommentList.jsx
+220 −0 static/js/components/FilterCandidateList.jsx
+34 −31 static/js/components/Main.jsx.template
+8 −0 static/js/components/ProfileDropdown.jsx
+225 −0 static/js/components/SaveCandidateButton.jsx
+108 −114 static/js/components/SearchBox.jsx
+6 −0 static/js/components/Source.css
+7 −0 static/js/components/Source.jsx
+2 −2 static/js/components/SourceList.jsx
+8 −3 static/js/components/ThumbnailList.jsx
+385 −0 static/js/components/UploadPhotometry.jsx
+31 −0 static/js/ducks/candidate.js
+57 −0 static/js/ducks/candidates.js
+1 −1 static/js/ducks/group.js
+2 −2 static/js/ducks/instruments.js
+1 −1 static/js/ducks/newsFeed.js
+15 −1 static/js/ducks/source.js
+6 −6 static/js/ducks/sources.js
+7 −2 static/js/ducks/sysInfo.js
+1 −1 static/js/ducks/topSources.js
+1 −1 static/js/ducks/users.js
+55 −0 static/js/plotjs/download.js
+115 −0 static/js/plotjs/stackf.js
+205 −0 static/js/plotjs/stackm.js
+7 −0 static/js/plotjs/togglef.js
+9 −0 static/js/plotjs/togglem.js
+81 −15 tools/load_demo_data.py

0 comments on commit 770f9d6

Please sign in to comment.