-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update healpixgrp() in path.py to group by 1000 instead of by 100. #23
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1125,13 +1125,66 @@ def healpixgrp(self, filetype, **kwargs): | |
Returns | ||
------- | ||
healpixgrp : str | ||
HEALPix group directory, HEALPix//100. | ||
HEALPix group directory, HEALPix//1000. | ||
|
||
''' | ||
|
||
healpix = int(kwargs['healpix']) | ||
subdir = "{:d}".format(healpix//100) | ||
subdir = "{:d}".format(healpix//1000) | ||
return subdir | ||
|
||
def apgprefix(self, filetype, **kwargs): | ||
''' Returns APOGEE prefix using telescope/instrument. | ||
|
||
Parameters | ||
---------- | ||
filetype : str | ||
File type parameter. | ||
telescope : str | ||
The APOGEE telescope (apo25m, lco25m, apo1m). | ||
instrument : str | ||
The APOGEE instrument (apogee-n, apogee-s). | ||
|
||
Returns | ||
------- | ||
prefix : str | ||
The APOGEE prefix (ap/as). | ||
|
||
''' | ||
|
||
telescope = kwargs.get('telescope') | ||
if telescope is not None: | ||
prefix = {'apo25m':'ap', 'apo1m':'ap', 'lco25m':'as'}[telescope] | ||
return prefix | ||
instrument = kwargs.get('instrument') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar here as with previous comment on telescope |
||
if instrument is not None: | ||
prefix = {'apogee-n':'ap', 'apogee-s':'as'}[instrument] | ||
return prefix | ||
return '' | ||
|
||
def apginst(self, filetype, **kwargs): | ||
''' Returns APOGEE "instrument" from "telescope". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this function to work, it needs a |
||
|
||
Parameters | ||
---------- | ||
filetype : str | ||
File type parameter. | ||
telescope : str | ||
The APOGEE telescope (apo25m, lco25m, apo1m). | ||
|
||
Returns | ||
------- | ||
instrument : str | ||
The APOGEE instrument (apogee-n, apogee-s). | ||
|
||
''' | ||
|
||
telescope = kwargs.get('telescope') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar here as with previous comments. |
||
if telescope is not None: | ||
instrument = {'apo25m':'apogee-n', 'apo1m':'apogee-n', 'lco25m':'apogee-s'}[telescope] | ||
return instrument | ||
return '' | ||
|
||
|
||
class AccessError(Exception): | ||
pass |
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.
To ensure that telescope is set to None if it is not present in the kwargs, try
telescope = kwargs.get('telescope', None)
. Otherwise this will throw an uncaught error.