roman-snpit-snappl 0.19.0__tar.gz → 0.20.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of roman-snpit-snappl might be problematic. Click here for more details.

Files changed (142) hide show
  1. {roman_snpit_snappl-0.19.0/roman_snpit_snappl.egg-info → roman_snpit_snappl-0.20.0}/PKG-INFO +1 -1
  2. roman_snpit_snappl-0.20.0/changes/86.snappl.rst +1 -0
  3. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0/roman_snpit_snappl.egg-info}/PKG-INFO +1 -1
  4. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/roman_snpit_snappl.egg-info/SOURCES.txt +3 -0
  5. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/_version.py +3 -3
  6. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/admin/load_ou2024_l2images.py +7 -7
  7. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/config.py +2 -2
  8. roman_snpit_snappl-0.20.0/snappl/db/migrations/20251025_lightcurve.sql +5 -0
  9. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/webserver.py +119 -3
  10. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/image.py +1 -1
  11. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/imagecollection.py +27 -9
  12. roman_snpit_snappl-0.20.0/snappl/lightcurve.py +553 -0
  13. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/provenance.py +8 -0
  14. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.cruft.json +0 -0
  15. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/CODEOWNERS +0 -0
  16. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +0 -0
  17. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md +0 -0
  18. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/ISSUE_TEMPLATE/PR_TEMPLATE.md +0 -0
  19. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/dependabot.yml +0 -0
  20. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/labeler.yml +0 -0
  21. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/workflows/changelog.yml +0 -0
  22. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/workflows/run_labeler.yml +0 -0
  23. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/workflows/run_snappl_tests.yml +0 -0
  24. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/workflows/sphinx-deploy.yml +0 -0
  25. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.github/workflows/sub_package_update.yml +0 -0
  26. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.gitignore +0 -0
  27. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/.pre-commit-config.yaml +0 -0
  28. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/CHANGES.rst +0 -0
  29. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/CITATION.cff +0 -0
  30. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/CODE_OF_CONDUCT.md +0 -0
  31. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/CONTRIBUTING.md +0 -0
  32. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/LICENSE +0 -0
  33. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/MANIFEST.in +0 -0
  34. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/README.rst +0 -0
  35. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/.gitkeep +0 -0
  36. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/10.snappl.rst +0 -0
  37. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/13.bugfix.rst +0 -0
  38. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/14.snappl.rst +0 -0
  39. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/15.feature.rst +0 -0
  40. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/16.feature.rst +0 -0
  41. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/18.feature.rst +0 -0
  42. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/20.bugfix.rst +0 -0
  43. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/23.snappl.rst +0 -0
  44. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/26.feature.rst +0 -0
  45. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/29.feature.rst +0 -0
  46. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/3.snappl.rst +0 -0
  47. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/31.feature.rst +0 -0
  48. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/35.snappl.rst +0 -0
  49. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/36.snappl.rst +0 -0
  50. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/37.snappl.rst +0 -0
  51. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/40.snappl.rst +0 -0
  52. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/41.snappl.rst +0 -0
  53. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/43.snappl.rst +0 -0
  54. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/47.feature.rst +0 -0
  55. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/49.docs.rst +0 -0
  56. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/5.snappl.rst +0 -0
  57. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/54.snappl.rst +0 -0
  58. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/57.snappl.rst +0 -0
  59. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/58.snappl.rst +0 -0
  60. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/61.bugfix.rst +0 -0
  61. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/62.snappl.rst +0 -0
  62. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/63.snappl.rst +0 -0
  63. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/65.bugfix.rst +0 -0
  64. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/68.feature.rst +0 -0
  65. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/72.snappl.rst +0 -0
  66. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/73.feature.rst +0 -0
  67. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/74.bugfix.rst +0 -0
  68. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/79.snappl.rst +0 -0
  69. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/8.snappl.rst +0 -0
  70. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/81.snappl.rst +0 -0
  71. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/82.snappl.rst +0 -0
  72. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/83.snappl.rst +0 -0
  73. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/84.feature.rst +0 -0
  74. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/85.feature.rst +0 -0
  75. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/87.docs.rst +0 -0
  76. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/89.feature.rst +0 -0
  77. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/9.snappl.rst +0 -0
  78. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/91.feature.rst +0 -0
  79. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/92.docs.rst +0 -0
  80. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/changes/94.snappl.rst +0 -0
  81. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/codespell-ignore.txt +0 -0
  82. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/postgres/Dockerfile +0 -0
  83. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/postgres/postgresql.conf +0 -0
  84. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/postgres/run_postgres.sh +0 -0
  85. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/webserver/Dockerfile +0 -0
  86. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/webserver/cert.pem +0 -0
  87. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/webserver/config-test.yaml +0 -0
  88. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/webserver/key.pem +0 -0
  89. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docker/webserver/roman-snpit-server.py +0 -0
  90. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/Makefile +0 -0
  91. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/_static/logo_black_filled.png +0 -0
  92. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/api.rst +0 -0
  93. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/changes.rst +0 -0
  94. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/conf.py +0 -0
  95. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/database_schema.rst +0 -0
  96. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/index.rst +0 -0
  97. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/installation.rst +0 -0
  98. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/make.bat +0 -0
  99. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/docs/usage.rst +0 -0
  100. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/experimentation/README.md +0 -0
  101. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/experimentation/ap_phot_simulated_images.py +0 -0
  102. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/experimentation/play_with_photutils.py +0 -0
  103. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/licenses/.DS_Store +0 -0
  104. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/licenses/LICENSE.rst +0 -0
  105. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/licenses/README.rst +0 -0
  106. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/licenses/TEMPLATE_LICENSE.rst +0 -0
  107. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/pyproject.toml +0 -0
  108. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/roman_snpit_snappl.egg-info/dependency_links.txt +0 -0
  109. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/roman_snpit_snappl.egg-info/not-zip-safe +0 -0
  110. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/roman_snpit_snappl.egg-info/requires.txt +0 -0
  111. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/roman_snpit_snappl.egg-info/top_level.txt +0 -0
  112. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/setup.cfg +0 -0
  113. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/setup.py +0 -0
  114. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/__init__.py +0 -0
  115. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/_dev/__init__.py +0 -0
  116. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/_dev/scm_version.py +0 -0
  117. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/admin/load_snana_ou2024_diaobject.py +0 -0
  118. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/data/README.rst +0 -0
  119. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/baseview.py +0 -0
  120. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/db.py +0 -0
  121. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/20251008_init.sql +0 -0
  122. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/20251017_objdetcount.sql +0 -0
  123. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/20251024_l2image_mjd.sql +0 -0
  124. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/apply_migrations.py +0 -0
  125. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/schema_to_rst.py +0 -0
  126. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/scorched_earth.py +0 -0
  127. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/migrations/wipe_all_data.py +0 -0
  128. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/static/romansnpit.css +0 -0
  129. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/static/romansnpit.js +0 -0
  130. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/static/romansnpit_start.js +0 -0
  131. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/templates/base.html +0 -0
  132. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/db/templates/romansnpitdb.html +0 -0
  133. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/dbclient.py +0 -0
  134. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/diaobject.py +0 -0
  135. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/http.py +0 -0
  136. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/image_simulator.py +0 -0
  137. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/logger.py +0 -0
  138. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/psf.py +0 -0
  139. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/sed.py +0 -0
  140. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/utils.py +0 -0
  141. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/snappl/wcs.py +0 -0
  142. {roman_snpit_snappl-0.19.0 → roman_snpit_snappl-0.20.0}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roman_snpit_snappl
3
- Version: 0.19.0
3
+ Version: 0.20.0
4
4
  Summary: General, database, and photometry utilities for the Roman SNPIT
5
5
  Author: Roman Supernova Project Infrastructure Team
6
6
  Maintainer-email: Roman SN PIT <raknop@lbl.gov>
@@ -0,0 +1 @@
1
+ Added lightcurve class.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roman_snpit_snappl
3
- Version: 0.19.0
3
+ Version: 0.20.0
4
4
  Summary: General, database, and photometry utilities for the Roman SNPIT
5
5
  Author: Roman Supernova Project Infrastructure Team
6
6
  Maintainer-email: Roman SN PIT <raknop@lbl.gov>
@@ -63,6 +63,7 @@ changes/82.snappl.rst
63
63
  changes/83.snappl.rst
64
64
  changes/84.feature.rst
65
65
  changes/85.feature.rst
66
+ changes/86.snappl.rst
66
67
  changes/87.docs.rst
67
68
  changes/89.feature.rst
68
69
  changes/9.snappl.rst
@@ -109,6 +110,7 @@ snappl/http.py
109
110
  snappl/image.py
110
111
  snappl/image_simulator.py
111
112
  snappl/imagecollection.py
113
+ snappl/lightcurve.py
112
114
  snappl/logger.py
113
115
  snappl/provenance.py
114
116
  snappl/psf.py
@@ -126,6 +128,7 @@ snappl/db/webserver.py
126
128
  snappl/db/migrations/20251008_init.sql
127
129
  snappl/db/migrations/20251017_objdetcount.sql
128
130
  snappl/db/migrations/20251024_l2image_mjd.sql
131
+ snappl/db/migrations/20251025_lightcurve.sql
129
132
  snappl/db/migrations/apply_migrations.py
130
133
  snappl/db/migrations/schema_to_rst.py
131
134
  snappl/db/migrations/scorched_earth.py
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.19.0'
32
- __version_tuple__ = version_tuple = (0, 19, 0)
31
+ __version__ = version = '0.20.0'
32
+ __version_tuple__ = version_tuple = (0, 20, 0)
33
33
 
34
- __commit_id__ = commit_id = 'g463af9082'
34
+ __commit_id__ = commit_id = 'g3f6286e64'
@@ -38,7 +38,7 @@ def _parse_fits_file( relpath, base_path=None, provid=None ):
38
38
  'provenance_id': provid,
39
39
  'pointing': image.pointing,
40
40
  'sca': image.sca,
41
- 'filter': image.band,
41
+ 'band': image.band,
42
42
  'ra': ra,
43
43
  'dec': dec,
44
44
  'ra_corner_00': ra_corner_00,
@@ -96,17 +96,17 @@ class OU2024_L2image_loader:
96
96
  words = line.split(',')
97
97
  if len(words) != 3:
98
98
  raise ValueError( f'Failed to parse line: "{line}"' )
99
- if ( ( words[0].strip() == 'filter' ) and
99
+ if ( any( words[0].strip() == i for i in ('filter', 'band') ) and
100
100
  ( words[1].strip() == 'pointing' ) and
101
101
  ( words[2].strip() == 'sca' )
102
102
  ):
103
103
  header = True
104
104
  elif not header:
105
- raise ValueError( f'First line was "{line}", not "filter,pointing,sca"' )
105
+ raise ValueError( f'First line was "{line}", not "band,pointing,sca"' )
106
106
  else:
107
- filter, pointing, sca = words
108
- fpath = pathlib.Path( f'{filter}/{pointing}/'
109
- f'Roman_TDS_simple_model_{filter}_{pointing}_{sca}.fits.gz' )
107
+ band, pointing, sca = words
108
+ fpath = pathlib.Path( f'{band}/{pointing}/'
109
+ f'Roman_TDS_simple_model_{band}_{pointing}_{sca}.fits.gz' )
110
110
  if ( self.base_path / fpath ).is_file():
111
111
  imagefiles.append( fpath )
112
112
  else:
@@ -190,7 +190,7 @@ def main():
190
190
  parser.add_argument( '-b', '--basedir', default='/ou2024/RomanTDS/images/simple_model',
191
191
  help='Base directory.' )
192
192
  parser.add_argument( '-f', '--filelist', default=None,
193
- help="File with list of filter,pointing,sca" )
193
+ help="File with list of band,pointing,sca" )
194
194
  parser.add_argument( '-j', '--just-get-filenames', default=False, action='store_true',
195
195
  help="Don't actually load files to the database, just generate a file list." )
196
196
  parser.add_argument( '-s', '--save-file-list', default=None,
@@ -112,7 +112,7 @@ class Config:
112
112
  images:
113
113
  format: fits
114
114
  single_file: false
115
- name_convention: "{inst_name}_{date}_{time}_{section_id}_{filter}_{im_type}_{prov_hash:.6s}"
115
+ name_convention: "{inst_name}_{date}_{time}_{section_id}_{band}_{im_type}_{prov_hash:.6s}"
116
116
 
117
117
  then confobj.value("storage.images.format") will return
118
118
  "fits". You can also ask configobj.value for higher levels. For
@@ -120,7 +120,7 @@ class Config:
120
120
 
121
121
  { "format": "fits",
122
122
  "single_file": False,
123
- "name_convention": "{inst_name}_{date}_{time}_{section_id}_{filter}_{im_type}_{prov_hash:.6s}"
123
+ "name_convention": "{inst_name}_{date}_{time}_{section_id}_{band}_{im_type}_{prov_hash:.6s}"
124
124
  }
125
125
 
126
126
  4. Change a config value with::
@@ -0,0 +1,5 @@
1
+ ALTER TABLE l2image RENAME COLUMN filter TO band;
2
+ ALTER TABLE summed_image RENAME COLUMN filter TO band;
3
+ ALTER TABLE lightcurve RENAME COLUMN filter TO band;
4
+
5
+ ALTER TABLE lightcurve ADD COLUMN diaobject_position_id UUID DEFAULT NULL;
@@ -484,13 +484,28 @@ class GetL2Image( BaseView ):
484
484
 
485
485
  class FindL2Images( BaseView ):
486
486
  def do_the_things( self, provid ):
487
- q = "SELECT * FROM l2image WHERE "
487
+ q = sql.SQL( "SELECT * FROM l2image WHERE " )
488
488
  conditions = [ 'provenance_id=%(provid)s' ]
489
489
  subdict = { 'provid': provid }
490
490
 
491
491
  if flask.request.is_json:
492
492
  data = flask.request.json
493
493
 
494
+ orderby = []
495
+ limit = None
496
+ offset = None
497
+ if 'order_by' in data:
498
+ orderby = data['order_by']
499
+ if not isinstance( orderby, list ):
500
+ orderby = [ orderby ]
501
+ del data['order_by']
502
+ if 'limit' in data:
503
+ limit = int( data['limit'] )
504
+ del data['limit']
505
+ if 'offset' in data:
506
+ offset = int( data['offset'] )
507
+ del data['offset']
508
+
494
509
  if ( 'ra' in data ) or ( 'dec' in data ):
495
510
  # 'ra' and 'dec' are supposed to be "includes this".
496
511
  #
@@ -512,7 +527,7 @@ class FindL2Images( BaseView ):
512
527
  del data['ra']
513
528
  del data['dec']
514
529
 
515
- for kw in [ 'pointing', 'sca', 'filter', 'filepath' ]:
530
+ for kw in [ 'pointing', 'sca', 'band', 'filepath' ]:
516
531
  if kw in data:
517
532
  conditions.append( f"{kw}=%({kw})s" )
518
533
  subdict[kw] = data[kw] if data[kw] is not None else None
@@ -534,7 +549,20 @@ class FindL2Images( BaseView ):
534
549
  if len(data) != 0:
535
550
  return f"Error, unknown parameters: {data.keys()}", 500
536
551
 
537
- q += ' AND '.join( conditions )
552
+ q += sql.SQL( ' AND '.join( conditions ) )
553
+
554
+ if len( orderby ) > 0:
555
+ q += sql.SQL( " ORDER BY " )
556
+ comma = ""
557
+ for o in orderby:
558
+ q += sql.SQL( f"{comma}{{orderby}}" ).format( orderby=sql.Identifier(o) )
559
+ comma = ","
560
+ if limit is not None:
561
+ q += sql.SQL( " LIMIT %(limit)s" )
562
+ subdict['limit'] = limit
563
+ if offset is not None:
564
+ q += sql.SQL( " OFFSET %(offset)s" )
565
+ subdict['offset'] = offset
538
566
 
539
567
  with db.DBCon( dictcursor=True ) as dbcon:
540
568
  rows = dbcon.execute( q, subdict )
@@ -542,6 +570,90 @@ class FindL2Images( BaseView ):
542
570
  return rows
543
571
 
544
572
 
573
+ # ======================================================================
574
+
575
+ class SaveLightcurve( BaseView ):
576
+ def do_the_things( self ):
577
+ if not flask.request.is_json:
578
+ return "Expected lightcurve info in json POST, didn't get any.", 500
579
+
580
+ data = flask.request.json
581
+ needed_keys = { 'id', 'provenance_id', 'diaobject_id', 'diaobject_position_id', 'band', 'filepath' }
582
+ passed_keys = set( data.keys() )
583
+ if not passed_keys.issubset( needed_keys ):
584
+ return f"Unknown keys: {passed_keys - needed_keys}", 500
585
+ if not needed_keys.issubset( passed_keys ):
586
+ return f"Missing required keys: {needed_keys - passed_keys}", 500
587
+
588
+ with db.DBCon( dictcursor=True ) as dbcon:
589
+ rows = dbcon.execute( "SELECT * FROM provenance WHERE id=%(id)s", { 'id': data['provenance_id'] } )
590
+ if len(rows) == 0:
591
+ return f"Unknown provenance {data['provenance_id']}", 500
592
+
593
+ dbcon.execute( ( "INSERT INTO lightcurve(id, provenance_id, diaobject_id, "
594
+ " diaobject_position_id, band, filepath) "
595
+ "VALUES(%(id)s, %(provenance_id)s, %(diaobject_id)s, %(diaobject_position_id)s, "
596
+ " %(band)s, %(filepath)s)" ),
597
+ data )
598
+ dbcon.commit()
599
+
600
+ res = dbcon.execute( "SELECT * FROM lightcurve WHERE id=%(id)s", {'id': data['id']} )
601
+ if len(res) == 0:
602
+ return "Something went wrong, lightcurve not saved to database", 500
603
+
604
+ return res[0]
605
+
606
+
607
+ # ======================================================================
608
+
609
+ class GetLightcurve( BaseView ):
610
+ def do_the_things( self, ltcvid ):
611
+ with db.DBCon( dictcursor=True ) as dbcon:
612
+ rows = dbcon.execute( "SELECT * FROM lightcurve WHERE id=%(id)s", { 'id': ltcvid } )
613
+ if len(rows) == 0:
614
+ return f"No lightcurve with id {ltcvid}", 500
615
+ elif len(rows) > 1:
616
+ return f"Multiple lightcurves with id {ltcvid}; this should never happen.", 500
617
+ else:
618
+ return rows[0]
619
+
620
+
621
+ # ======================================================================
622
+
623
+ class FindLightcurves( BaseView ):
624
+ def do_the_things( self ):
625
+ if not flask.request.is_json:
626
+ return "Expected lightcurve search data in json POST, didn't get any.", 500
627
+
628
+ conditions = []
629
+
630
+ data = flask.request.json
631
+ q = "SELECT l.* FROM lightcurve l "
632
+ subdict = {}
633
+
634
+ if 'provenance_id' in data:
635
+ conditions.append( "l.provenance_id=%(provid)s" )
636
+ subdict['provid'] = data['provenance_id']
637
+ else:
638
+ if ( 'provenance_tag' not in data ) or ( 'process' not in data ):
639
+ return "Must pass either provenance_id, or both of provenance_tag and process", 500
640
+ q += "INNER JOIN provenance_tag t ON l.provenance_id=t.provenance_id "
641
+ conditions.append( "t.tag=%(tag)s" )
642
+ conditions.append( "t.process=%(process)s" )
643
+ subdict.update( { 'tag': data['provenance_tag'], 'process': data['process'] } )
644
+
645
+ for thing in [ 'diaobject_id', 'band' ]:
646
+ if thing in data:
647
+ conditions.append( f"l.{thing}=%({thing})s" )
648
+ subdict[thing] = data[thing]
649
+
650
+ if len(conditions) > 0:
651
+ q += " WHERE " + " AND ".join( conditions )
652
+
653
+ with db.DBCon( dictcursor=True ) as dbcon:
654
+ return dbcon.execute( q, subdict )
655
+
656
+
545
657
  # ======================================================================
546
658
 
547
659
  urls = {
@@ -564,4 +676,8 @@ urls = {
564
676
 
565
677
  "/getl2image/<imageid>": GetL2Image,
566
678
  "/findl2images/<provid>": FindL2Images,
679
+
680
+ "/savelightcurve": SaveLightcurve,
681
+ "/getlightcurve/<ltcvid>": GetLightcurve,
682
+ "/findlightcurves": FindLightcurves,
567
683
  }
@@ -1256,7 +1256,7 @@ class OpenUniverse2024FITSImage( FITSImageOnDisk ):
1256
1256
 
1257
1257
  @property
1258
1258
  def exptime( self ):
1259
- # Galsim has fixed exptimes for roman filters
1259
+ # ou2024 has fixed exptimes for roman bands
1260
1260
  exptimes = {'F184': 901.175,
1261
1261
  'J129': 302.275,
1262
1262
  'H158': 302.275,
@@ -126,7 +126,7 @@ class ImageCollection:
126
126
  Pointing. If not given, just use the Path to find the image.
127
127
 
128
128
  band: str, default None
129
- Filter.
129
+ Band.
130
130
 
131
131
  sca: int, default None
132
132
  SCA.
@@ -200,8 +200,8 @@ class ImageCollection:
200
200
  dec: float, default None
201
201
  Only return images that containe this dec
202
202
 
203
- filter: str, default None
204
- Only include images from this filter
203
+ band: str, default None
204
+ Only include images from this band
205
205
 
206
206
  exptime_min: float, default None
207
207
  Only include images with at least this exptime in seconds.
@@ -212,6 +212,25 @@ class ImageCollection:
212
212
  sca: int
213
213
  Only include images from this sca.
214
214
 
215
+ order_by: str or list, default None
216
+ By default, the returned images are not sorted in any
217
+ particular way. Put a keyword here to sort by that value
218
+ (or by those values). Options include 'id',
219
+ 'provenance_id', 'pointing', 'sca', 'ra', 'dec', 'filepath',
220
+ 'width', 'height', 'mjd', 'exptime'. Not all of these are
221
+ necessarily useful, and some of them may be null for many
222
+ objects in the database.
223
+
224
+ limit : int, default None
225
+ Only return this many objects at most.
226
+
227
+ offset : int, default None
228
+ Useful with limit and order_by ; offset the returned value
229
+ by this many entries. You can make repeated calls to
230
+ find_objects to get subsets of objects by passing the same
231
+ order_by and limit, but different offsets each time, to
232
+ slowly build up a list.
233
+
215
234
  Returns
216
235
  -------
217
236
  imagelist: list of snappl.image.Image
@@ -288,7 +307,7 @@ class ImageCollectionOU2024:
288
307
  mjd_max=None,
289
308
  ra=None,
290
309
  dec=None,
291
- filter=None,
310
+ band=None,
292
311
  exptime_min=None,
293
312
  exptime_max=None,
294
313
  sca=None ):
@@ -304,8 +323,8 @@ class ImageCollectionOU2024:
304
323
  params['mjd_min'] = float(mjd_min)
305
324
  if mjd_max is not None:
306
325
  params['mjd_max'] = float(mjd_max)
307
- if filter is not None:
308
- params['filter'] = str(filter)
326
+ if band is not None:
327
+ params['filter'] = str(band)
309
328
  if exptime_min is not None:
310
329
  params['exptime_min'] = float(exptime_min)
311
330
  if exptime_max is not None:
@@ -415,7 +434,7 @@ class ImageCollectionDB:
415
434
  ( all( i is not None for i in [ pointing, band, sca ] ) ) ):
416
435
  raise ValueError( "Must specify one of image_id, path, or (pointing, band, and sca)." )
417
436
 
418
- data = { k: v for k, v in zip( ['filepath', 'pointing', 'filter', 'sca' ],
437
+ data = { k: v for k, v in zip( ['filepath', 'pointing', 'band', 'sca' ],
419
438
  [path, pointing, band, sca ] )
420
439
  if v is not None }
421
440
  rows = dbclient.send( f"/findl2images/{self.provenance.id}",
@@ -429,7 +448,6 @@ class ImageCollectionDB:
429
448
  row = rows[0]
430
449
 
431
450
  row['path'] = self.base_path / row['filepath']
432
- row['band'] = row['filter']
433
451
  return self.image_class( **row )
434
452
 
435
453
 
@@ -446,7 +464,7 @@ class ImageCollectionDB:
446
464
  images = []
447
465
  for row in rows:
448
466
  row['path'] = self.base_path / row['filepath']
449
- row['band'] = row['filter']
467
+ row['band'] = row['band']
450
468
  images.append( self.image_class( **row ) )
451
469
 
452
470
  return images