Skip to content

Commit 47acc80

Browse files
committed
update ALMA help docs and ALMA help parsing
1 parent ac74469 commit 47acc80

File tree

2 files changed

+38
-17
lines changed

2 files changed

+38
-17
lines changed

astroquery/alma/core.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import numpy as np
1111
import re
1212
import tarfile
13+
import string
1314
from bs4 import BeautifulSoup
1415

1516
from astropy.extern.six.moves.urllib_parse import urljoin
@@ -678,6 +679,20 @@ def _get_help_page(self, cache=True):
678679
checkbox = "[x]" if checked else "[ ]"
679680
help_section[1].append((name, payload_keyword,
680681
checkbox, value))
682+
select = inp.find('select')
683+
if select is not None:
684+
options = [(filter_printable(option.text),
685+
option.attrs['value'])
686+
for option in select.findAll('option')]
687+
if sp is not None:
688+
name = whitespace.sub(" ", sp.text)
689+
else:
690+
name = select.attrs['name']
691+
option_str = " , ".join(["{0} = {1}".format(o[0],o[1])
692+
for o in options])
693+
help_section[1].append((name, option_str))
694+
695+
681696
help_list.append(help_section)
682697
self._help_list = help_list
683698

@@ -856,3 +871,7 @@ def unique(seq):
856871
seen = set()
857872
seen_add = seen.add
858873
return [x for x in seq if not (x in seen or seen_add(x))]
874+
875+
def filter_printable(s):
876+
""" extract printable characters from a string """
877+
return filter(lambda x: x in string.printable, s)

docs/alma/alma.rst

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,37 @@ You can get interactive help to find out what keywords to query for:
2121
Valid ALMA keywords:
2222
2323
Position
24-
Source name (Sesame) : source_name_sesame
25-
Source name (ALMA) : source_name-asu
26-
RA Dec : raDecCoordinates
24+
Source name (Resolver) : source_name_resolver
25+
Source name (ALMA) : source_name_alma
26+
RA Dec : ra_dec
2727
2828
Energy
29-
Frequency : energy.frequency-asu
30-
Bandwidth : energy.bandwidth-asu
31-
Spectral resolution : energy.resolution-asu
32-
Band : band-asu
29+
Frequency : frequency
30+
Bandwidth : bandwidth
31+
Spectral resolution : spectral_resolution
32+
Band : 3(84-116 GHz) = 3 , 4(125-163 GHz) = 4 , 6(211-275 GHz) = 6 , 7(275-373 GHz) = 7 , 8(385-500 GHz) = 8 , 9(602-720 GHz) = 9 , 10(787-950 GHz) = 10
3333
3434
Time
35-
Observation date : start_date-asu
36-
Integration time : int_time-asu
35+
Observation date : start_date
36+
Integration time : integration_time
3737
3838
Polarisation
39-
Polarisation type : energy.pol_num-asu
39+
Polarisation type : Stokes I = 0 , Single = 1 , Dual = 2 , Full = =3|4
4040
4141
Observation
42-
Water vapour : pwv-asu
42+
Water vapour : water_vapour
4343
4444
Project
45-
Project code : project_code-asu
46-
Project title : project.title-substr
47-
PI name : project.pi_name-substr
45+
Project code : project_code
46+
Project title : project_title
47+
PI name : pi_name
4848
4949
Options
50-
View: : viewFormat
51-
[x] public data only : publicFilterFlag = public
52-
[x] science observations only : scan_intent-asu = =%TARGET%
50+
(I) View: : result_view = raw
51+
( ) View: : result_view = project
52+
[x] public data only : public_data = public
53+
[x] science observations only : science_observations = =%TARGET%
54+
5355
5456
Authentication
5557
==============

0 commit comments

Comments
 (0)