PyMMT 1.0.0__tar.gz → 1.0.1__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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PyMMT
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: A python API wrapper for the MMT Observatory
5
5
  Author-email: Samuel Wyatt <swyatt@arizona.edu>, Manisha Shrestha <mshrestha1@arizona.edu>, Griffin Hosseinzadeh <griffin0@arizona.edu>
6
6
  Project-URL: Homepage, https://github.com/SAGUARO-MMA/PyMMT
@@ -10,17 +10,22 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
+ Requires-Dist: requests
14
+ Requires-Dist: setuptools_scm
15
+ Requires-Dist: ipykernel
13
16
 
17
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8322354.svg)](https://doi.org/10.5281/zenodo.8322354)
14
18
  # PyMMT
15
19
 
16
- This repository is designed to facilitate submitting a rapid Target of Opprotunity (ToO) observation to Binospec at the [MMT](https://www.mmto.org/) with the goal to enable same-night spectroscopy of interesting transients. Here we will provide examples to install and upload targets.
20
+ This repository is designed to facilitate rapid Target of Opportunity (ToO) observations to Binospec or MMIRS at the [MMT](https://www.mmto.org/) to enable same-night spectroscopy of interesting transients. Here we will provide examples to install and upload targets.
17
21
 
18
22
  ## Install
19
23
  To get the repository (in a bash/unix terminal)
20
24
  ```bash
21
25
  git-clone repository
26
+ python -m pip install -e .
27
+ #or
22
28
  python -m pip install pymmt
23
- or pip install pymmt
24
29
  ```
25
30
 
26
31
  ## Using the API Wrapper
@@ -83,12 +88,18 @@ For Binospec `observationtype:longslit`:
83
88
  * For `Longslit1_25`: id `131`
84
89
  * For `Longslit1_5`: id `114`
85
90
  * For `Longslit5`: id `112`
91
+ * `exposuretime`: The observation exposure time in seconds
86
92
 
87
93
  For MMIRS `observationtype:longslit`:
88
94
  * `grism`: Valid options are `J`, `HK`, and `HK3`
95
+ * `filter`: valid options are `Y`, `J`, `H`, `Ks`, `zJ`, `HK`, `HK3`, `Kspec`
89
96
  * `readtab`: Valid options are `ramp_4.426`
90
- * `slitwidth`: valid options are '1pixel', '2pixel', '3pixel', '4pixel', '5pixel','6pixel','12pixel'
97
+ * `slitwidth`: valid options are `1pixel`, `2pixel`, `3pixel`, `4pixel`, `5pixel`, `6pixel`, `12pixel`
91
98
  * `slitwidthproperty`: valid options are 'long', 'short'
99
+ * `maskid`: Can be a predefined machined mask, or a preset for imaging or spectroscopy:
100
+ * For imaging: id `110`
101
+ * For spectroscopy: id `111`
102
+ * `exposuretime`: The observation exposure time in seconds
92
103
 
93
104
  Other observation metadata:
94
105
 
@@ -106,7 +117,6 @@ All metadata will be validated upon initialization. Once the target object has b
106
117
  import pymmt
107
118
 
108
119
  #example for Binospec imaging target payload:
109
-
110
120
  payload = {
111
121
  'objectid':'TARGETNAME',
112
122
  'ra':'12:34:56.78',
@@ -123,7 +133,6 @@ payload = {
123
133
 
124
134
 
125
135
  #example payload for Binospec longslit target payload
126
-
127
136
  payload = {
128
137
  'objectid':'Targetname',
129
138
  'ra':'12:34:56.78',
@@ -136,17 +145,36 @@ payload = {
136
145
  `maskid`:131,
137
146
  `filter`:'LP380'
138
147
  'visits':1,
148
+ 'exposuretime':900,
139
149
  'numberexposures':2,
140
150
  'priority':1,
141
151
  'targetofopportunity':1
142
152
  }
143
- #example payload for MMIRS longslit target payload
144
153
 
145
- payload = {'dec': '-19:30:45.100', 'epoch': 'J2000', 'exposuretime': 450.0,
146
- 'filter': 'zJ', 'grating': '270','magnitude': 16.9, 'maskid': 111, 'notes': 'Demo observation request. Please do not observe this.',
147
- 'numberexposures': 3, 'objectid': 'AT2021fxy', 'observationtype': 'longslit','priority': 3, 'ra': '13:13:01.560',
148
- 'slitwidth': '1pixel', 'targetofopportunity': 0, 'visits': 1,'instrumentid':15, 'gain':'low',
149
- 'readtab': 'ramp_4.426', 'grism':'J', 'slitwidthproperty':'long', 'dithersize':'5' }
154
+ #example payload for MMIRS longslit target payload
155
+ payload = {
156
+ 'objectid': 'AT2021fxy',
157
+ 'ra': '13:13:01.560',
158
+ 'dec': '-19:30:45.100',
159
+ 'epoch': 'J2000',
160
+ 'exposuretime': 450.0,
161
+ 'filter': 'zJ',
162
+ 'grism': 'J',
163
+ 'magnitude': 16.9,
164
+ 'maskid': 111,
165
+ 'notes': 'Demo observation request. Please do not observe this.',
166
+ 'numberexposures': 3,
167
+ 'observationtype': 'longslit',
168
+ 'priority': 3,
169
+ 'slitwidth': '1pixel',
170
+ 'targetofopportunity': 0,
171
+ 'visits': 1,
172
+ 'instrumentid':15,
173
+ 'gain':'low',
174
+ 'readtab': 'ramp_4.426',
175
+ 'slitwidthproperty':'long',
176
+ 'dithersize':'5'
177
+ }
150
178
 
151
179
  #this will create the target along with validating the payload information. It will inform the user of any errors or warnings associated with the metadata
152
180
  target = pymmt.Target(token=API_TOKEN,
@@ -235,14 +263,14 @@ if you don't pass any params into the function it will just find the current ins
235
263
 
236
264
  ```python
237
265
  from datetime import datetime, timedelta
238
- api = pymmt.api()
239
- current_instruments = api.get_instruments()
266
+ insts = pymmt.Instruments()
267
+ current_instruments = insts.get_instruments()
240
268
 
241
269
  #you can look into the future to see what instruments will be available:
242
- future_instruments = api.get_instruments(date=datetime.datetime.now()+timedelta(months=1))
270
+ future_instruments = insts.get_instruments(date=datetime.datetime.now()+timedelta(months=1))
243
271
 
244
272
  #you can look through the entire published schedule to see when a certain instrument will be on the telescope (Binospec = 16, MMIRS = 15)
245
- my_instrument = api.get_instruments(instrumentid=16)
273
+ my_instrument = insts.get_instruments(instrumentid=16)
246
274
  ```
247
275
 
248
276
  This function returns a list of dictionary elements with the values for:
@@ -1,13 +1,15 @@
1
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8322354.svg)](https://doi.org/10.5281/zenodo.8322354)
1
2
  # PyMMT
2
3
 
3
- This repository is designed to facilitate submitting a rapid Target of Opprotunity (ToO) observation to Binospec at the [MMT](https://www.mmto.org/) with the goal to enable same-night spectroscopy of interesting transients. Here we will provide examples to install and upload targets.
4
+ This repository is designed to facilitate rapid Target of Opportunity (ToO) observations to Binospec or MMIRS at the [MMT](https://www.mmto.org/) to enable same-night spectroscopy of interesting transients. Here we will provide examples to install and upload targets.
4
5
 
5
6
  ## Install
6
7
  To get the repository (in a bash/unix terminal)
7
8
  ```bash
8
9
  git-clone repository
10
+ python -m pip install -e .
11
+ #or
9
12
  python -m pip install pymmt
10
- or pip install pymmt
11
13
  ```
12
14
 
13
15
  ## Using the API Wrapper
@@ -70,12 +72,18 @@ For Binospec `observationtype:longslit`:
70
72
  * For `Longslit1_25`: id `131`
71
73
  * For `Longslit1_5`: id `114`
72
74
  * For `Longslit5`: id `112`
75
+ * `exposuretime`: The observation exposure time in seconds
73
76
 
74
77
  For MMIRS `observationtype:longslit`:
75
78
  * `grism`: Valid options are `J`, `HK`, and `HK3`
79
+ * `filter`: valid options are `Y`, `J`, `H`, `Ks`, `zJ`, `HK`, `HK3`, `Kspec`
76
80
  * `readtab`: Valid options are `ramp_4.426`
77
- * `slitwidth`: valid options are '1pixel', '2pixel', '3pixel', '4pixel', '5pixel','6pixel','12pixel'
81
+ * `slitwidth`: valid options are `1pixel`, `2pixel`, `3pixel`, `4pixel`, `5pixel`, `6pixel`, `12pixel`
78
82
  * `slitwidthproperty`: valid options are 'long', 'short'
83
+ * `maskid`: Can be a predefined machined mask, or a preset for imaging or spectroscopy:
84
+ * For imaging: id `110`
85
+ * For spectroscopy: id `111`
86
+ * `exposuretime`: The observation exposure time in seconds
79
87
 
80
88
  Other observation metadata:
81
89
 
@@ -93,7 +101,6 @@ All metadata will be validated upon initialization. Once the target object has b
93
101
  import pymmt
94
102
 
95
103
  #example for Binospec imaging target payload:
96
-
97
104
  payload = {
98
105
  'objectid':'TARGETNAME',
99
106
  'ra':'12:34:56.78',
@@ -110,7 +117,6 @@ payload = {
110
117
 
111
118
 
112
119
  #example payload for Binospec longslit target payload
113
-
114
120
  payload = {
115
121
  'objectid':'Targetname',
116
122
  'ra':'12:34:56.78',
@@ -123,17 +129,36 @@ payload = {
123
129
  `maskid`:131,
124
130
  `filter`:'LP380'
125
131
  'visits':1,
132
+ 'exposuretime':900,
126
133
  'numberexposures':2,
127
134
  'priority':1,
128
135
  'targetofopportunity':1
129
136
  }
130
- #example payload for MMIRS longslit target payload
131
137
 
132
- payload = {'dec': '-19:30:45.100', 'epoch': 'J2000', 'exposuretime': 450.0,
133
- 'filter': 'zJ', 'grating': '270','magnitude': 16.9, 'maskid': 111, 'notes': 'Demo observation request. Please do not observe this.',
134
- 'numberexposures': 3, 'objectid': 'AT2021fxy', 'observationtype': 'longslit','priority': 3, 'ra': '13:13:01.560',
135
- 'slitwidth': '1pixel', 'targetofopportunity': 0, 'visits': 1,'instrumentid':15, 'gain':'low',
136
- 'readtab': 'ramp_4.426', 'grism':'J', 'slitwidthproperty':'long', 'dithersize':'5' }
138
+ #example payload for MMIRS longslit target payload
139
+ payload = {
140
+ 'objectid': 'AT2021fxy',
141
+ 'ra': '13:13:01.560',
142
+ 'dec': '-19:30:45.100',
143
+ 'epoch': 'J2000',
144
+ 'exposuretime': 450.0,
145
+ 'filter': 'zJ',
146
+ 'grism': 'J',
147
+ 'magnitude': 16.9,
148
+ 'maskid': 111,
149
+ 'notes': 'Demo observation request. Please do not observe this.',
150
+ 'numberexposures': 3,
151
+ 'observationtype': 'longslit',
152
+ 'priority': 3,
153
+ 'slitwidth': '1pixel',
154
+ 'targetofopportunity': 0,
155
+ 'visits': 1,
156
+ 'instrumentid':15,
157
+ 'gain':'low',
158
+ 'readtab': 'ramp_4.426',
159
+ 'slitwidthproperty':'long',
160
+ 'dithersize':'5'
161
+ }
137
162
 
138
163
  #this will create the target along with validating the payload information. It will inform the user of any errors or warnings associated with the metadata
139
164
  target = pymmt.Target(token=API_TOKEN,
@@ -222,14 +247,14 @@ if you don't pass any params into the function it will just find the current ins
222
247
 
223
248
  ```python
224
249
  from datetime import datetime, timedelta
225
- api = pymmt.api()
226
- current_instruments = api.get_instruments()
250
+ insts = pymmt.Instruments()
251
+ current_instruments = insts.get_instruments()
227
252
 
228
253
  #you can look into the future to see what instruments will be available:
229
- future_instruments = api.get_instruments(date=datetime.datetime.now()+timedelta(months=1))
254
+ future_instruments = insts.get_instruments(date=datetime.datetime.now()+timedelta(months=1))
230
255
 
231
256
  #you can look through the entire published schedule to see when a certain instrument will be on the telescope (Binospec = 16, MMIRS = 15)
232
- my_instrument = api.get_instruments(instrumentid=16)
257
+ my_instrument = insts.get_instruments(instrumentid=16)
233
258
  ```
234
259
 
235
260
  This function returns a list of dictionary elements with the values for:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyMMT"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  authors = [
9
9
  { name="Samuel Wyatt", email="swyatt@arizona.edu" },
10
10
  { name="Manisha Shrestha", email="mshrestha1@arizona.edu" },
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PyMMT
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: A python API wrapper for the MMT Observatory
5
5
  Author-email: Samuel Wyatt <swyatt@arizona.edu>, Manisha Shrestha <mshrestha1@arizona.edu>, Griffin Hosseinzadeh <griffin0@arizona.edu>
6
6
  Project-URL: Homepage, https://github.com/SAGUARO-MMA/PyMMT
@@ -10,17 +10,22 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
+ Requires-Dist: requests
14
+ Requires-Dist: setuptools_scm
15
+ Requires-Dist: ipykernel
13
16
 
17
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8322354.svg)](https://doi.org/10.5281/zenodo.8322354)
14
18
  # PyMMT
15
19
 
16
- This repository is designed to facilitate submitting a rapid Target of Opprotunity (ToO) observation to Binospec at the [MMT](https://www.mmto.org/) with the goal to enable same-night spectroscopy of interesting transients. Here we will provide examples to install and upload targets.
20
+ This repository is designed to facilitate rapid Target of Opportunity (ToO) observations to Binospec or MMIRS at the [MMT](https://www.mmto.org/) to enable same-night spectroscopy of interesting transients. Here we will provide examples to install and upload targets.
17
21
 
18
22
  ## Install
19
23
  To get the repository (in a bash/unix terminal)
20
24
  ```bash
21
25
  git-clone repository
26
+ python -m pip install -e .
27
+ #or
22
28
  python -m pip install pymmt
23
- or pip install pymmt
24
29
  ```
25
30
 
26
31
  ## Using the API Wrapper
@@ -83,12 +88,18 @@ For Binospec `observationtype:longslit`:
83
88
  * For `Longslit1_25`: id `131`
84
89
  * For `Longslit1_5`: id `114`
85
90
  * For `Longslit5`: id `112`
91
+ * `exposuretime`: The observation exposure time in seconds
86
92
 
87
93
  For MMIRS `observationtype:longslit`:
88
94
  * `grism`: Valid options are `J`, `HK`, and `HK3`
95
+ * `filter`: valid options are `Y`, `J`, `H`, `Ks`, `zJ`, `HK`, `HK3`, `Kspec`
89
96
  * `readtab`: Valid options are `ramp_4.426`
90
- * `slitwidth`: valid options are '1pixel', '2pixel', '3pixel', '4pixel', '5pixel','6pixel','12pixel'
97
+ * `slitwidth`: valid options are `1pixel`, `2pixel`, `3pixel`, `4pixel`, `5pixel`, `6pixel`, `12pixel`
91
98
  * `slitwidthproperty`: valid options are 'long', 'short'
99
+ * `maskid`: Can be a predefined machined mask, or a preset for imaging or spectroscopy:
100
+ * For imaging: id `110`
101
+ * For spectroscopy: id `111`
102
+ * `exposuretime`: The observation exposure time in seconds
92
103
 
93
104
  Other observation metadata:
94
105
 
@@ -106,7 +117,6 @@ All metadata will be validated upon initialization. Once the target object has b
106
117
  import pymmt
107
118
 
108
119
  #example for Binospec imaging target payload:
109
-
110
120
  payload = {
111
121
  'objectid':'TARGETNAME',
112
122
  'ra':'12:34:56.78',
@@ -123,7 +133,6 @@ payload = {
123
133
 
124
134
 
125
135
  #example payload for Binospec longslit target payload
126
-
127
136
  payload = {
128
137
  'objectid':'Targetname',
129
138
  'ra':'12:34:56.78',
@@ -136,17 +145,36 @@ payload = {
136
145
  `maskid`:131,
137
146
  `filter`:'LP380'
138
147
  'visits':1,
148
+ 'exposuretime':900,
139
149
  'numberexposures':2,
140
150
  'priority':1,
141
151
  'targetofopportunity':1
142
152
  }
143
- #example payload for MMIRS longslit target payload
144
153
 
145
- payload = {'dec': '-19:30:45.100', 'epoch': 'J2000', 'exposuretime': 450.0,
146
- 'filter': 'zJ', 'grating': '270','magnitude': 16.9, 'maskid': 111, 'notes': 'Demo observation request. Please do not observe this.',
147
- 'numberexposures': 3, 'objectid': 'AT2021fxy', 'observationtype': 'longslit','priority': 3, 'ra': '13:13:01.560',
148
- 'slitwidth': '1pixel', 'targetofopportunity': 0, 'visits': 1,'instrumentid':15, 'gain':'low',
149
- 'readtab': 'ramp_4.426', 'grism':'J', 'slitwidthproperty':'long', 'dithersize':'5' }
154
+ #example payload for MMIRS longslit target payload
155
+ payload = {
156
+ 'objectid': 'AT2021fxy',
157
+ 'ra': '13:13:01.560',
158
+ 'dec': '-19:30:45.100',
159
+ 'epoch': 'J2000',
160
+ 'exposuretime': 450.0,
161
+ 'filter': 'zJ',
162
+ 'grism': 'J',
163
+ 'magnitude': 16.9,
164
+ 'maskid': 111,
165
+ 'notes': 'Demo observation request. Please do not observe this.',
166
+ 'numberexposures': 3,
167
+ 'observationtype': 'longslit',
168
+ 'priority': 3,
169
+ 'slitwidth': '1pixel',
170
+ 'targetofopportunity': 0,
171
+ 'visits': 1,
172
+ 'instrumentid':15,
173
+ 'gain':'low',
174
+ 'readtab': 'ramp_4.426',
175
+ 'slitwidthproperty':'long',
176
+ 'dithersize':'5'
177
+ }
150
178
 
151
179
  #this will create the target along with validating the payload information. It will inform the user of any errors or warnings associated with the metadata
152
180
  target = pymmt.Target(token=API_TOKEN,
@@ -235,14 +263,14 @@ if you don't pass any params into the function it will just find the current ins
235
263
 
236
264
  ```python
237
265
  from datetime import datetime, timedelta
238
- api = pymmt.api()
239
- current_instruments = api.get_instruments()
266
+ insts = pymmt.Instruments()
267
+ current_instruments = insts.get_instruments()
240
268
 
241
269
  #you can look into the future to see what instruments will be available:
242
- future_instruments = api.get_instruments(date=datetime.datetime.now()+timedelta(months=1))
270
+ future_instruments = insts.get_instruments(date=datetime.datetime.now()+timedelta(months=1))
243
271
 
244
272
  #you can look through the entire published schedule to see when a certain instrument will be on the telescope (Binospec = 16, MMIRS = 15)
245
- my_instrument = api.get_instruments(instrumentid=16)
273
+ my_instrument = insts.get_instruments(instrumentid=16)
246
274
  ```
247
275
 
248
276
  This function returns a list of dictionary elements with the values for:
@@ -9,5 +9,4 @@ src/pymmt/__init__.py
9
9
  src/pymmt/pymmt.py
10
10
  src/pymmt/instruments/__init__.py
11
11
  src/pymmt/instruments/binospec.py
12
- src/pymmt/instruments/mmirs.py
13
- tests/test.py
12
+ src/pymmt/instruments/mmirs.py
@@ -10,7 +10,7 @@ class api():
10
10
 
11
11
  def __init__(self, target=None, token=None):
12
12
 
13
- self.base = 'https://scheduler.mmto.arizona.edu/APIv2'
13
+ self.base = 'https://scheduler-proxy.mmto.arizona.edu/APIv2'
14
14
  self.target = target
15
15
 
16
16
  if token is None:
PyMMT-1.0.0/tests/test.py DELETED
@@ -1,33 +0,0 @@
1
- import os, json, requests
2
- from requests_toolbelt.multipart.encoder import MultipartEncoder
3
-
4
-
5
- def main():
6
-
7
- token = '0f3732fcfb1c8577c390e71a176f3c8f'
8
- catalogid = 486
9
- targetid = 6302
10
- programid = 977
11
- url = 'https://scheduler.mmto.arizona.edu/upload.php'
12
- finder = 'M51.jpg'
13
-
14
- multipart_data = MultipartEncoder(
15
- fields={
16
- 'finding_chart_file':(finder, open(finder, 'rb').read(), 'image/jpeg'),
17
- 'type':'finding_chart',
18
- 'token':token,
19
- 'catalog_id':str(catalogid),
20
- 'program_id':str(programid),
21
- 'target_id':str(targetid),
22
- }
23
- )
24
-
25
- headers = {
26
- 'Content-Type':multipart_data.content_type,
27
- 'User-Agent':'Mozilla/5.0'
28
- }
29
-
30
- r = requests.post(url, headers=headers, data=multipart_data)
31
- print(r.text)
32
-
33
- main()
File without changes
File without changes