partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
SupervisorSatchel.deploy_services
Collects the configurations for all registered services and writes the appropriate supervisord.conf file.
burlap/supervisor.py
def deploy_services(self, site=None): """ Collects the configurations for all registered services and writes the appropriate supervisord.conf file. """ verbose = self.verbose r = self.local_renderer if not r.env.manage_configs: return # # tar...
def deploy_services(self, site=None): """ Collects the configurations for all registered services and writes the appropriate supervisord.conf file. """ verbose = self.verbose r = self.local_renderer if not r.env.manage_configs: return # # tar...
[ "Collects", "the", "configurations", "for", "all", "registered", "services", "and", "writes", "the", "appropriate", "supervisord", ".", "conf", "file", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/supervisor.py#L237-L297
[ "def", "deploy_services", "(", "self", ",", "site", "=", "None", ")", ":", "verbose", "=", "self", ".", "verbose", "r", "=", "self", ".", "local_renderer", "if", "not", "r", ".", "env", ".", "manage_configs", ":", "return", "#", "# target_sites = s...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitSatchel.clone
Clone a remote Git repository into a new directory. :param remote_url: URL of the remote repository to clone. :type remote_url: str :param path: Path of the working copy directory. Must not exist yet. :type path: str :param use_sudo: If ``True`` execute ``git`` with ...
burlap/git.py
def clone(self, remote_url, path=None, use_sudo=False, user=None): """ Clone a remote Git repository into a new directory. :param remote_url: URL of the remote repository to clone. :type remote_url: str :param path: Path of the working copy directory. Must not exist yet. ...
def clone(self, remote_url, path=None, use_sudo=False, user=None): """ Clone a remote Git repository into a new directory. :param remote_url: URL of the remote repository to clone. :type remote_url: str :param path: Path of the working copy directory. Must not exist yet. ...
[ "Clone", "a", "remote", "Git", "repository", "into", "a", "new", "directory", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L60-L90
[ "def", "clone", "(", "self", ",", "remote_url", ",", "path", "=", "None", ",", "use_sudo", "=", "False", ",", "user", "=", "None", ")", ":", "cmd", "=", "'git clone --quiet %s'", "%", "remote_url", "if", "path", "is", "not", "None", ":", "cmd", "=", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitSatchel.add_remote
Add a remote Git repository into a directory. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to fetch from. :type path: str :param use_sudo: If ``True`` execute ``git`` with ...
burlap/git.py
def add_remote(self, path, name, remote_url, use_sudo=False, user=None, fetch=True): """ Add a remote Git repository into a directory. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to fetch from. ...
def add_remote(self, path, name, remote_url, use_sudo=False, user=None, fetch=True): """ Add a remote Git repository into a directory. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to fetch from. ...
[ "Add", "a", "remote", "Git", "repository", "into", "a", "directory", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L93-L134
[ "def", "add_remote", "(", "self", ",", "path", ",", "name", ",", "remote_url", ",", "use_sudo", "=", "False", ",", "user", "=", "None", ",", "fetch", "=", "True", ")", ":", "if", "path", "is", "None", ":", "raise", "ValueError", "(", "\"Path to the wor...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitSatchel.fetch
Fetch changes from the default remote repository. This will fetch new changesets, but will not update the contents of the working tree unless yo do a merge or rebase. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with...
burlap/git.py
def fetch(self, path, use_sudo=False, user=None, remote=None): """ Fetch changes from the default remote repository. This will fetch new changesets, but will not update the contents of the working tree unless yo do a merge or rebase. :param path: Path of the working copy direct...
def fetch(self, path, use_sudo=False, user=None, remote=None): """ Fetch changes from the default remote repository. This will fetch new changesets, but will not update the contents of the working tree unless yo do a merge or rebase. :param path: Path of the working copy direct...
[ "Fetch", "changes", "from", "the", "default", "remote", "repository", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L137-L176
[ "def", "fetch", "(", "self", ",", "path", ",", "use_sudo", "=", "False", ",", "user", "=", "None", ",", "remote", "=", "None", ")", ":", "if", "path", "is", "None", ":", "raise", "ValueError", "(", "\"Path to the working copy is needed to fetch from a remote r...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitSatchel.pull
Fetch changes from the default remote repository and merge them. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to pull from. :type path: str :param use_sudo: If ``True`` execute ``git`` with ...
burlap/git.py
def pull(self, path, use_sudo=False, user=None, force=False): """ Fetch changes from the default remote repository and merge them. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to pull from. ...
def pull(self, path, use_sudo=False, user=None, force=False): """ Fetch changes from the default remote repository and merge them. :param path: Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to pull from. ...
[ "Fetch", "changes", "from", "the", "default", "remote", "repository", "and", "merge", "them", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L179-L216
[ "def", "pull", "(", "self", ",", "path", ",", "use_sudo", "=", "False", ",", "user", "=", "None", ",", "force", "=", "False", ")", ":", "if", "path", "is", "None", ":", "raise", "ValueError", "(", "\"Path to the working copy is needed to pull from a remote rep...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitTrackerSatchel.get_logs_between_commits
Retrieves all commit messages for all commits between the given commit numbers on the current branch.
burlap/git.py
def get_logs_between_commits(self, a, b): """ Retrieves all commit messages for all commits between the given commit numbers on the current branch. """ print('REAL') ret = self.local('git --no-pager log --pretty=oneline %s...%s' % (a, b), capture=True) if self.ver...
def get_logs_between_commits(self, a, b): """ Retrieves all commit messages for all commits between the given commit numbers on the current branch. """ print('REAL') ret = self.local('git --no-pager log --pretty=oneline %s...%s' % (a, b), capture=True) if self.ver...
[ "Retrieves", "all", "commit", "messages", "for", "all", "commits", "between", "the", "given", "commit", "numbers", "on", "the", "current", "branch", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L351-L360
[ "def", "get_logs_between_commits", "(", "self", ",", "a", ",", "b", ")", ":", "print", "(", "'REAL'", ")", "ret", "=", "self", ".", "local", "(", "'git --no-pager log --pretty=oneline %s...%s'", "%", "(", "a", ",", "b", ")", ",", "capture", "=", "True", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitTrackerSatchel.get_current_commit
Retrieves the git commit number of the current head branch.
burlap/git.py
def get_current_commit(self): """ Retrieves the git commit number of the current head branch. """ with hide('running', 'stdout', 'stderr', 'warnings'): s = str(self.local('git rev-parse HEAD', capture=True)) self.vprint('current commit:', s) return s
def get_current_commit(self): """ Retrieves the git commit number of the current head branch. """ with hide('running', 'stdout', 'stderr', 'warnings'): s = str(self.local('git rev-parse HEAD', capture=True)) self.vprint('current commit:', s) return s
[ "Retrieves", "the", "git", "commit", "number", "of", "the", "current", "head", "branch", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L363-L370
[ "def", "get_current_commit", "(", "self", ")", ":", "with", "hide", "(", "'running'", ",", "'stdout'", ",", "'stderr'", ",", "'warnings'", ")", ":", "s", "=", "str", "(", "self", ".", "local", "(", "'git rev-parse HEAD'", ",", "capture", "=", "True", ")"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
GitTrackerSatchel.record_manifest
Called after a deployment to record any data necessary to detect changes for a future deployment.
burlap/git.py
def record_manifest(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ manifest = super(GitTrackerSatchel, self).record_manifest() manifest[CURRENT_COMMIT] = self.get_current_commit() return manifest
def record_manifest(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ manifest = super(GitTrackerSatchel, self).record_manifest() manifest[CURRENT_COMMIT] = self.get_current_commit() return manifest
[ "Called", "after", "a", "deployment", "to", "record", "any", "data", "necessary", "to", "detect", "changes", "for", "a", "future", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/git.py#L372-L379
[ "def", "record_manifest", "(", "self", ")", ":", "manifest", "=", "super", "(", "GitTrackerSatchel", ",", "self", ")", ".", "record_manifest", "(", ")", "manifest", "[", "CURRENT_COMMIT", "]", "=", "self", ".", "get_current_commit", "(", ")", "return", "mani...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
VagrantSatchel.ssh_config
Get the SSH parameters for connecting to a vagrant VM.
burlap/vagrant.py
def ssh_config(self, name=''): """ Get the SSH parameters for connecting to a vagrant VM. """ r = self.local_renderer with self.settings(hide('running')): output = r.local('vagrant ssh-config %s' % name, capture=True) config = {} for line in output.sp...
def ssh_config(self, name=''): """ Get the SSH parameters for connecting to a vagrant VM. """ r = self.local_renderer with self.settings(hide('running')): output = r.local('vagrant ssh-config %s' % name, capture=True) config = {} for line in output.sp...
[ "Get", "the", "SSH", "parameters", "for", "connecting", "to", "a", "vagrant", "VM", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/vagrant.py#L31-L43
[ "def", "ssh_config", "(", "self", ",", "name", "=", "''", ")", ":", "r", "=", "self", ".", "local_renderer", "with", "self", ".", "settings", "(", "hide", "(", "'running'", ")", ")", ":", "output", "=", "r", ".", "local", "(", "'vagrant ssh-config %s'"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
VagrantSatchel.version
Get the Vagrant version.
burlap/vagrant.py
def version(self): """ Get the Vagrant version. """ r = self.local_renderer with self.settings(hide('running', 'warnings'), warn_only=True): res = r.local('vagrant --version', capture=True) if res.failed: return None line = res.splitlines()...
def version(self): """ Get the Vagrant version. """ r = self.local_renderer with self.settings(hide('running', 'warnings'), warn_only=True): res = r.local('vagrant --version', capture=True) if res.failed: return None line = res.splitlines()...
[ "Get", "the", "Vagrant", "version", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/vagrant.py#L69-L80
[ "def", "version", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "with", "self", ".", "settings", "(", "hide", "(", "'running'", ",", "'warnings'", ")", ",", "warn_only", "=", "True", ")", ":", "res", "=", "r", ".", "local", "(", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
VagrantSatchel.vagrant
Run the following tasks on a vagrant box. First, you need to import this task in your ``fabfile.py``:: from fabric.api import * from burlap.vagrant import vagrant @task def some_task(): run('echo hello') Then you can easily run tasks on...
burlap/vagrant.py
def vagrant(self, name=''): """ Run the following tasks on a vagrant box. First, you need to import this task in your ``fabfile.py``:: from fabric.api import * from burlap.vagrant import vagrant @task def some_task(): run('echo h...
def vagrant(self, name=''): """ Run the following tasks on a vagrant box. First, you need to import this task in your ``fabfile.py``:: from fabric.api import * from burlap.vagrant import vagrant @task def some_task(): run('echo h...
[ "Run", "the", "following", "tasks", "on", "a", "vagrant", "box", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/vagrant.py#L158-L180
[ "def", "vagrant", "(", "self", ",", "name", "=", "''", ")", ":", "r", "=", "self", ".", "local_renderer", "config", "=", "self", ".", "ssh_config", "(", "name", ")", "extra_args", "=", "self", ".", "_settings_dict", "(", "config", ")", "r", ".", "gen...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
VagrantSatchel.vagrant_settings
Context manager that sets a vagrant VM as the remote host. Use this context manager inside a task to run commands on your current Vagrant box:: from burlap.vagrant import vagrant_settings with vagrant_settings(): run('hostname')
burlap/vagrant.py
def vagrant_settings(self, name='', *args, **kwargs): """ Context manager that sets a vagrant VM as the remote host. Use this context manager inside a task to run commands on your current Vagrant box:: from burlap.vagrant import vagrant_settings with va...
def vagrant_settings(self, name='', *args, **kwargs): """ Context manager that sets a vagrant VM as the remote host. Use this context manager inside a task to run commands on your current Vagrant box:: from burlap.vagrant import vagrant_settings with va...
[ "Context", "manager", "that", "sets", "a", "vagrant", "VM", "as", "the", "remote", "host", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/vagrant.py#L182-L200
[ "def", "vagrant_settings", "(", "self", ",", "name", "=", "''", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "config", "=", "self", ".", "ssh_config", "(", "name", ")", "extra_args", "=", "self", ".", "_settings_dict", "(", "config", ")", "kw...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
VagrantSatchel.base_boxes
Get the list of vagrant base boxes
burlap/vagrant.py
def base_boxes(self): """ Get the list of vagrant base boxes """ return sorted(list(set([name for name, provider in self._box_list()])))
def base_boxes(self): """ Get the list of vagrant base boxes """ return sorted(list(set([name for name, provider in self._box_list()])))
[ "Get", "the", "list", "of", "vagrant", "base", "boxes" ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/vagrant.py#L239-L243
[ "def", "base_boxes", "(", "self", ")", ":", "return", "sorted", "(", "list", "(", "set", "(", "[", "name", "for", "name", ",", "provider", "in", "self", ".", "_box_list", "(", ")", "]", ")", ")", ")" ]
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
VagrantSatchel.install_from_upstream
Installs Vagrant from the most recent package available from their homepage.
burlap/vagrant.py
def install_from_upstream(self): """ Installs Vagrant from the most recent package available from their homepage. """ from burlap.system import get_arch, distrib_family r = self.local_renderer content = urlopen(r.env.download_url).read() print(len(content)) ...
def install_from_upstream(self): """ Installs Vagrant from the most recent package available from their homepage. """ from burlap.system import get_arch, distrib_family r = self.local_renderer content = urlopen(r.env.download_url).read() print(len(content)) ...
[ "Installs", "Vagrant", "from", "the", "most", "recent", "package", "available", "from", "their", "homepage", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/vagrant.py#L280-L303
[ "def", "install_from_upstream", "(", "self", ")", ":", "from", "burlap", ".", "system", "import", "get_arch", ",", "distrib_family", "r", "=", "self", ".", "local_renderer", "content", "=", "urlopen", "(", "r", ".", "env", ".", "download_url", ")", ".", "r...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
distrib_id
Get the OS distribution ID. Example:: from burlap.system import distrib_id if distrib_id() != 'Debian': abort(u"Distribution is not supported")
burlap/system.py
def distrib_id(): """ Get the OS distribution ID. Example:: from burlap.system import distrib_id if distrib_id() != 'Debian': abort(u"Distribution is not supported") """ with settings(hide('running', 'stdout')): kernel = (run('uname -s') or '').strip().lower(...
def distrib_id(): """ Get the OS distribution ID. Example:: from burlap.system import distrib_id if distrib_id() != 'Debian': abort(u"Distribution is not supported") """ with settings(hide('running', 'stdout')): kernel = (run('uname -s') or '').strip().lower(...
[ "Get", "the", "OS", "distribution", "ID", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/system.py#L41-L82
[ "def", "distrib_id", "(", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ")", ")", ":", "kernel", "=", "(", "run", "(", "'uname -s'", ")", "or", "''", ")", ".", "strip", "(", ")", ".", "lower", "(", ")", "if", "kern...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
distrib_release
Get the release number of the distribution. Example:: from burlap.system import distrib_id, distrib_release if distrib_id() == 'CentOS' and distrib_release() == '6.1': print(u"CentOS 6.2 has been released. Please upgrade.")
burlap/system.py
def distrib_release(): """ Get the release number of the distribution. Example:: from burlap.system import distrib_id, distrib_release if distrib_id() == 'CentOS' and distrib_release() == '6.1': print(u"CentOS 6.2 has been released. Please upgrade.") """ with settings...
def distrib_release(): """ Get the release number of the distribution. Example:: from burlap.system import distrib_id, distrib_release if distrib_id() == 'CentOS' and distrib_release() == '6.1': print(u"CentOS 6.2 has been released. Please upgrade.") """ with settings...
[ "Get", "the", "release", "number", "of", "the", "distribution", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/system.py#L85-L103
[ "def", "distrib_release", "(", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ")", ")", ":", "kernel", "=", "(", "run", "(", "'uname -s'", ")", "or", "''", ")", ".", "strip", "(", ")", ".", "lower", "(", ")", "if", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
distrib_family
Get the distribution family. Returns one of ``debian``, ``redhat``, ``arch``, ``gentoo``, ``sun``, ``other``.
burlap/system.py
def distrib_family(): """ Get the distribution family. Returns one of ``debian``, ``redhat``, ``arch``, ``gentoo``, ``sun``, ``other``. """ distrib = (distrib_id() or '').lower() if distrib in ['debian', 'ubuntu', 'linuxmint', 'elementary os']: return DEBIAN elif distrib in ['re...
def distrib_family(): """ Get the distribution family. Returns one of ``debian``, ``redhat``, ``arch``, ``gentoo``, ``sun``, ``other``. """ distrib = (distrib_id() or '').lower() if distrib in ['debian', 'ubuntu', 'linuxmint', 'elementary os']: return DEBIAN elif distrib in ['re...
[ "Get", "the", "distribution", "family", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/system.py#L134-L152
[ "def", "distrib_family", "(", ")", ":", "distrib", "=", "(", "distrib_id", "(", ")", "or", "''", ")", ".", "lower", "(", ")", "if", "distrib", "in", "[", "'debian'", ",", "'ubuntu'", ",", "'linuxmint'", ",", "'elementary os'", "]", ":", "return", "DEBI...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
supported_locales
Gets the list of supported locales. Each locale is returned as a ``(locale, charset)`` tuple.
burlap/system.py
def supported_locales(): """ Gets the list of supported locales. Each locale is returned as a ``(locale, charset)`` tuple. """ family = distrib_family() if family == 'debian': return _parse_locales('/usr/share/i18n/SUPPORTED') elif family == 'arch': return _parse_locales('/e...
def supported_locales(): """ Gets the list of supported locales. Each locale is returned as a ``(locale, charset)`` tuple. """ family = distrib_family() if family == 'debian': return _parse_locales('/usr/share/i18n/SUPPORTED') elif family == 'arch': return _parse_locales('/e...
[ "Gets", "the", "list", "of", "supported", "locales", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/system.py#L202-L216
[ "def", "supported_locales", "(", ")", ":", "family", "=", "distrib_family", "(", ")", "if", "family", "==", "'debian'", ":", "return", "_parse_locales", "(", "'/usr/share/i18n/SUPPORTED'", ")", "elif", "family", "==", "'arch'", ":", "return", "_parse_locales", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
CelerySatchel.force_stop
Forcibly terminates all Celery processes.
burlap/celery.py
def force_stop(self): """ Forcibly terminates all Celery processes. """ r = self.local_renderer with self.settings(warn_only=True): r.sudo('pkill -9 -f celery') r.sudo('rm -f /tmp/celery*.pid')
def force_stop(self): """ Forcibly terminates all Celery processes. """ r = self.local_renderer with self.settings(warn_only=True): r.sudo('pkill -9 -f celery') r.sudo('rm -f /tmp/celery*.pid')
[ "Forcibly", "terminates", "all", "Celery", "processes", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/celery.py#L94-L101
[ "def", "force_stop", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "with", "self", ".", "settings", "(", "warn_only", "=", "True", ")", ":", "r", ".", "sudo", "(", "'pkill -9 -f celery'", ")", "r", ".", "sudo", "(", "'rm -f /tmp/celery*...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
CelerySatchel.set_permissions
Sets ownership and permissions for Celery-related files.
burlap/celery.py
def set_permissions(self): """ Sets ownership and permissions for Celery-related files. """ r = self.local_renderer for path in r.env.paths_owned: r.env.path_owned = path r.sudo('chown {celery_daemon_user}:{celery_daemon_user} {celery_path_owned}')
def set_permissions(self): """ Sets ownership and permissions for Celery-related files. """ r = self.local_renderer for path in r.env.paths_owned: r.env.path_owned = path r.sudo('chown {celery_daemon_user}:{celery_daemon_user} {celery_path_owned}')
[ "Sets", "ownership", "and", "permissions", "for", "Celery", "-", "related", "files", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/celery.py#L104-L111
[ "def", "set_permissions", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "for", "path", "in", "r", ".", "env", ".", "paths_owned", ":", "r", ".", "env", ".", "path_owned", "=", "path", "r", ".", "sudo", "(", "'chown {celery_daemon_user}:...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
CelerySatchel.create_supervisor_services
This is called for each site to render a Celery config file.
burlap/celery.py
def create_supervisor_services(self, site): """ This is called for each site to render a Celery config file. """ self.vprint('create_supervisor_services:', site) self.set_site_specifics(site=site) r = self.local_renderer if self.verbose: print('r.en...
def create_supervisor_services(self, site): """ This is called for each site to render a Celery config file. """ self.vprint('create_supervisor_services:', site) self.set_site_specifics(site=site) r = self.local_renderer if self.verbose: print('r.en...
[ "This", "is", "called", "for", "each", "site", "to", "render", "a", "Celery", "config", "file", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/celery.py#L121-L154
[ "def", "create_supervisor_services", "(", "self", ",", "site", ")", ":", "self", ".", "vprint", "(", "'create_supervisor_services:'", ",", "site", ")", "self", ".", "set_site_specifics", "(", "site", "=", "site", ")", "r", "=", "self", ".", "local_renderer", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
BuildBotSatchel.check_ok
Ensures all tests have passed for this branch. This should be called before deployment, to prevent accidental deployment of code that hasn't passed automated testing.
burlap/buildbot.py
def check_ok(self): """ Ensures all tests have passed for this branch. This should be called before deployment, to prevent accidental deployment of code that hasn't passed automated testing. """ import requests if not self.env.check_ok: return ...
def check_ok(self): """ Ensures all tests have passed for this branch. This should be called before deployment, to prevent accidental deployment of code that hasn't passed automated testing. """ import requests if not self.env.check_ok: return ...
[ "Ensures", "all", "tests", "have", "passed", "for", "this", "branch", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/buildbot.py#L361-L386
[ "def", "check_ok", "(", "self", ")", ":", "import", "requests", "if", "not", "self", ".", "env", ".", "check_ok", ":", "return", "# Find current git branch.", "branch_name", "=", "self", ".", "_local", "(", "'git rev-parse --abbrev-ref HEAD'", ",", "capture", "=...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostSatchel.is_present
Returns true if the given host exists on the network. Returns false otherwise.
burlap/host.py
def is_present(self, host=None): """ Returns true if the given host exists on the network. Returns false otherwise. """ r = self.local_renderer r.env.host = host or self.genv.host_string ret = r._local("getent hosts {host} | awk '{{ print $1 }}'", capture=True) or...
def is_present(self, host=None): """ Returns true if the given host exists on the network. Returns false otherwise. """ r = self.local_renderer r.env.host = host or self.genv.host_string ret = r._local("getent hosts {host} | awk '{{ print $1 }}'", capture=True) or...
[ "Returns", "true", "if", "the", "given", "host", "exists", "on", "the", "network", ".", "Returns", "false", "otherwise", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L78-L104
[ "def", "is_present", "(", "self", ",", "host", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "r", ".", "env", ".", "host", "=", "host", "or", "self", ".", "genv", ".", "host_string", "ret", "=", "r", ".", "_local", "(", "\"getent ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostSatchel.purge_keys
Deletes all SSH keys on the localhost associated with the current remote host.
burlap/host.py
def purge_keys(self): """ Deletes all SSH keys on the localhost associated with the current remote host. """ r = self.local_renderer r.env.default_ip = self.hostname_to_ip(self.env.default_hostname) r.env.home_dir = '/home/%s' % getpass.getuser() r.local('ssh-keyg...
def purge_keys(self): """ Deletes all SSH keys on the localhost associated with the current remote host. """ r = self.local_renderer r.env.default_ip = self.hostname_to_ip(self.env.default_hostname) r.env.home_dir = '/home/%s' % getpass.getuser() r.local('ssh-keyg...
[ "Deletes", "all", "SSH", "keys", "on", "the", "localhost", "associated", "with", "the", "current", "remote", "host", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L107-L118
[ "def", "purge_keys", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "r", ".", "env", ".", "default_ip", "=", "self", ".", "hostname_to_ip", "(", "self", ".", "env", ".", "default_hostname", ")", "r", ".", "env", ".", "home_dir", "=", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostSatchel.find_working_password
Returns the first working combination of username and password for the current host.
burlap/host.py
def find_working_password(self, usernames=None, host_strings=None): """ Returns the first working combination of username and password for the current host. """ r = self.local_renderer if host_strings is None: host_strings = [] if not host_strings: ...
def find_working_password(self, usernames=None, host_strings=None): """ Returns the first working combination of username and password for the current host. """ r = self.local_renderer if host_strings is None: host_strings = [] if not host_strings: ...
[ "Returns", "the", "first", "working", "combination", "of", "username", "and", "password", "for", "the", "current", "host", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L121-L165
[ "def", "find_working_password", "(", "self", ",", "usernames", "=", "None", ",", "host_strings", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "if", "host_strings", "is", "None", ":", "host_strings", "=", "[", "]", "if", "not", "host_stri...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostSatchel.needs_initrole
Returns true if the host does not exist at the expected location and may need to have its initial configuration set. Returns false if the host exists at the expected location.
burlap/host.py
def needs_initrole(self, stop_on_error=False): """ Returns true if the host does not exist at the expected location and may need to have its initial configuration set. Returns false if the host exists at the expected location. """ ret = False target_host_present...
def needs_initrole(self, stop_on_error=False): """ Returns true if the host does not exist at the expected location and may need to have its initial configuration set. Returns false if the host exists at the expected location. """ ret = False target_host_present...
[ "Returns", "true", "if", "the", "host", "does", "not", "exist", "at", "the", "expected", "location", "and", "may", "need", "to", "have", "its", "initial", "configuration", "set", ".", "Returns", "false", "if", "the", "host", "exists", "at", "the", "expecte...
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L168-L197
[ "def", "needs_initrole", "(", "self", ",", "stop_on_error", "=", "False", ")", ":", "ret", "=", "False", "target_host_present", "=", "self", ".", "is_present", "(", ")", "if", "not", "target_host_present", ":", "default_host_present", "=", "self", ".", "is_pre...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostSatchel.initrole
Called to set default password login for systems that do not yet have passwordless login setup.
burlap/host.py
def initrole(self, check=True): """ Called to set default password login for systems that do not yet have passwordless login setup. """ if self.env.original_user is None: self.env.original_user = self.genv.user if self.env.original_key_filename is None: ...
def initrole(self, check=True): """ Called to set default password login for systems that do not yet have passwordless login setup. """ if self.env.original_user is None: self.env.original_user = self.genv.user if self.env.original_key_filename is None: ...
[ "Called", "to", "set", "default", "password", "login", "for", "systems", "that", "do", "not", "yet", "have", "passwordless", "login", "setup", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L200-L288
[ "def", "initrole", "(", "self", ",", "check", "=", "True", ")", ":", "if", "self", ".", "env", ".", "original_user", "is", "None", ":", "self", ".", "env", ".", "original_user", "=", "self", ".", "genv", ".", "user", "if", "self", ".", "env", ".", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostnameSatchel.iter_hostnames
Yields a list of tuples of the form (ip, hostname).
burlap/host.py
def iter_hostnames(self): """ Yields a list of tuples of the form (ip, hostname). """ from burlap.common import get_hosts_retriever if self.env.use_retriever: self.vprint('using retriever') self.vprint('hosts:', self.genv.hosts) retriever = get...
def iter_hostnames(self): """ Yields a list of tuples of the form (ip, hostname). """ from burlap.common import get_hosts_retriever if self.env.use_retriever: self.vprint('using retriever') self.vprint('hosts:', self.genv.hosts) retriever = get...
[ "Yields", "a", "list", "of", "tuples", "of", "the", "form", "(", "ip", "hostname", ")", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L351-L383
[ "def", "iter_hostnames", "(", "self", ")", ":", "from", "burlap", ".", "common", "import", "get_hosts_retriever", "if", "self", ".", "env", ".", "use_retriever", ":", "self", ".", "vprint", "(", "'using retriever'", ")", "self", ".", "vprint", "(", "'hosts:'...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostnameSatchel.get_public_ip
Gets the public IP for a host.
burlap/host.py
def get_public_ip(self): """ Gets the public IP for a host. """ r = self.local_renderer ret = r.run(r.env.get_public_ip_command) or '' ret = ret.strip() print('ip:', ret) return ret
def get_public_ip(self): """ Gets the public IP for a host. """ r = self.local_renderer ret = r.run(r.env.get_public_ip_command) or '' ret = ret.strip() print('ip:', ret) return ret
[ "Gets", "the", "public", "IP", "for", "a", "host", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L386-L394
[ "def", "get_public_ip", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "ret", "=", "r", ".", "run", "(", "r", ".", "env", ".", "get_public_ip_command", ")", "or", "''", "ret", "=", "ret", ".", "strip", "(", ")", "print", "(", "'ip:...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
HostnameSatchel.configure
Assigns a name to the server accessible from user space. Note, we add the name to /etc/hosts since not all programs use /etc/hostname to reliably identify the server hostname.
burlap/host.py
def configure(self, reboot=1): """ Assigns a name to the server accessible from user space. Note, we add the name to /etc/hosts since not all programs use /etc/hostname to reliably identify the server hostname. """ r = self.local_renderer for ip, hostname in self...
def configure(self, reboot=1): """ Assigns a name to the server accessible from user space. Note, we add the name to /etc/hosts since not all programs use /etc/hostname to reliably identify the server hostname. """ r = self.local_renderer for ip, hostname in self...
[ "Assigns", "a", "name", "to", "the", "server", "accessible", "from", "user", "space", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/host.py#L398-L415
[ "def", "configure", "(", "self", ",", "reboot", "=", "1", ")", ":", "r", "=", "self", ".", "local_renderer", "for", "ip", ",", "hostname", "in", "self", ".", "iter_hostnames", "(", ")", ":", "self", ".", "vprint", "(", "'ip/hostname:'", ",", "ip", ",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
JiraHelperSatchel.update_tickets_from_git
Run during a deployment. Looks at all commits between now and the last deployment. Finds all ticket numbers and updates their status in Jira.
burlap/jirahelper.py
def update_tickets_from_git(self, from_commit=None, to_commit=None): """ Run during a deployment. Looks at all commits between now and the last deployment. Finds all ticket numbers and updates their status in Jira. """ from jira import JIRA, JIRAError #from burlap...
def update_tickets_from_git(self, from_commit=None, to_commit=None): """ Run during a deployment. Looks at all commits between now and the last deployment. Finds all ticket numbers and updates their status in Jira. """ from jira import JIRA, JIRAError #from burlap...
[ "Run", "during", "a", "deployment", ".", "Looks", "at", "all", "commits", "between", "now", "and", "the", "last", "deployment", ".", "Finds", "all", "ticket", "numbers", "and", "updates", "their", "status", "in", "Jira", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/jirahelper.py#L67-L217
[ "def", "update_tickets_from_git", "(", "self", ",", "from_commit", "=", "None", ",", "to_commit", "=", "None", ")", ":", "from", "jira", "import", "JIRA", ",", "JIRAError", "#from burlap.deploy import get_last_current_diffs", "from", "burlap", ".", "git", "import", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
partitions
Get a partition list for all disk or for selected device only Example:: from burlap.disk import partitions spart = {'Linux': 0x83, 'Swap': 0x82} parts = partitions() # parts = {'/dev/sda1': 131, '/dev/sda2': 130, '/dev/sda3': 131} r = parts['/dev/sda1'] == spart['Linux'] ...
burlap/disk.py
def partitions(device=""): """ Get a partition list for all disk or for selected device only Example:: from burlap.disk import partitions spart = {'Linux': 0x83, 'Swap': 0x82} parts = partitions() # parts = {'/dev/sda1': 131, '/dev/sda2': 130, '/dev/sda3': 131} r ...
def partitions(device=""): """ Get a partition list for all disk or for selected device only Example:: from burlap.disk import partitions spart = {'Linux': 0x83, 'Swap': 0x82} parts = partitions() # parts = {'/dev/sda1': 131, '/dev/sda2': 130, '/dev/sda3': 131} r ...
[ "Get", "a", "partition", "list", "for", "all", "disk", "or", "for", "selected", "device", "only" ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/disk.py#L13-L39
[ "def", "partitions", "(", "device", "=", "\"\"", ")", ":", "partitions_list", "=", "{", "}", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ")", ")", ":", "res", "=", "run_as_root", "(", "'sfdisk -d %(device)s'", "%", "locals", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
getdevice_by_uuid
Get a HDD device by uuid Example:: from burlap.disk import getdevice_by_uuid device = getdevice_by_uuid("356fafdc-21d5-408e-a3e9-2b3f32cb2a8c") if device: mount(device,'/mountpoint')
burlap/disk.py
def getdevice_by_uuid(uuid): """ Get a HDD device by uuid Example:: from burlap.disk import getdevice_by_uuid device = getdevice_by_uuid("356fafdc-21d5-408e-a3e9-2b3f32cb2a8c") if device: mount(device,'/mountpoint') """ with settings(hide('running', 'warnings',...
def getdevice_by_uuid(uuid): """ Get a HDD device by uuid Example:: from burlap.disk import getdevice_by_uuid device = getdevice_by_uuid("356fafdc-21d5-408e-a3e9-2b3f32cb2a8c") if device: mount(device,'/mountpoint') """ with settings(hide('running', 'warnings',...
[ "Get", "a", "HDD", "device", "by", "uuid" ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/disk.py#L42-L60
[ "def", "getdevice_by_uuid", "(", "uuid", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'warnings'", ",", "'stdout'", ")", ",", "warn_only", "=", "True", ")", ":", "res", "=", "run_as_root", "(", "'blkid -U %s'", "%", "uuid", ")", "if...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ismounted
Check if partition is mounted Example:: from burlap.disk import ismounted if ismounted('/dev/sda1'): print ("disk sda1 is mounted")
burlap/disk.py
def ismounted(device): """ Check if partition is mounted Example:: from burlap.disk import ismounted if ismounted('/dev/sda1'): print ("disk sda1 is mounted") """ # Check filesystem with settings(hide('running', 'stdout')): res = run_as_root('mount') for...
def ismounted(device): """ Check if partition is mounted Example:: from burlap.disk import ismounted if ismounted('/dev/sda1'): print ("disk sda1 is mounted") """ # Check filesystem with settings(hide('running', 'stdout')): res = run_as_root('mount') for...
[ "Check", "if", "partition", "is", "mounted" ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/disk.py#L91-L118
[ "def", "ismounted", "(", "device", ")", ":", "# Check filesystem", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ")", ")", ":", "res", "=", "run_as_root", "(", "'mount'", ")", "for", "line", "in", "res", ".", "splitlines", "(", ")",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
query
Run a MySQL query.
burlap/mysql.py
def query(query, use_sudo=True, **kwargs): """ Run a MySQL query. """ func = use_sudo and run_as_root or run user = kwargs.get('mysql_user') or env.get('mysql_user') password = kwargs.get('mysql_password') or env.get('mysql_password') options = [ '--batch', '--raw', ...
def query(query, use_sudo=True, **kwargs): """ Run a MySQL query. """ func = use_sudo and run_as_root or run user = kwargs.get('mysql_user') or env.get('mysql_user') password = kwargs.get('mysql_password') or env.get('mysql_password') options = [ '--batch', '--raw', ...
[ "Run", "a", "MySQL", "query", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L518-L541
[ "def", "query", "(", "query", ",", "use_sudo", "=", "True", ",", "*", "*", "kwargs", ")", ":", "func", "=", "use_sudo", "and", "run_as_root", "or", "run", "user", "=", "kwargs", ".", "get", "(", "'mysql_user'", ")", "or", "env", ".", "get", "(", "'...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
user_exists
Check if a MySQL user exists.
burlap/mysql.py
def user_exists(name, host='localhost', **kwargs): """ Check if a MySQL user exists. """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): res = query(""" use mysql; SELECT COUNT(*) FROM user WHERE User = '%(name)s' AND Host =...
def user_exists(name, host='localhost', **kwargs): """ Check if a MySQL user exists. """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): res = query(""" use mysql; SELECT COUNT(*) FROM user WHERE User = '%(name)s' AND Host =...
[ "Check", "if", "a", "MySQL", "user", "exists", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L544-L557
[ "def", "user_exists", "(", "name", ",", "host", "=", "'localhost'", ",", "*", "*", "kwargs", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ",", "'stderr'", ",", "'warnings'", ")", ",", "warn_only", "=", "True", ")", ":",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
create_user
Create a MySQL user. Example:: import burlap # Create DB user if it does not exist if not burlap.mysql.user_exists('dbuser'): burlap.mysql.create_user('dbuser', password='somerandomstring')
burlap/mysql.py
def create_user(name, password, host='localhost', **kwargs): """ Create a MySQL user. Example:: import burlap # Create DB user if it does not exist if not burlap.mysql.user_exists('dbuser'): burlap.mysql.create_user('dbuser', password='somerandomstring') """ w...
def create_user(name, password, host='localhost', **kwargs): """ Create a MySQL user. Example:: import burlap # Create DB user if it does not exist if not burlap.mysql.user_exists('dbuser'): burlap.mysql.create_user('dbuser', password='somerandomstring') """ w...
[ "Create", "a", "MySQL", "user", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L560-L579
[ "def", "create_user", "(", "name", ",", "password", ",", "host", "=", "'localhost'", ",", "*", "*", "kwargs", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ")", ")", ":", "query", "(", "\"CREATE USER '%(name)s'@'%(host)s' IDENTIFIED BY '%(password...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
database_exists
Check if a MySQL database exists.
burlap/mysql.py
def database_exists(name, **kwargs): """ Check if a MySQL database exists. """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): res = query("SHOW DATABASES LIKE '%(name)s';" % { 'name': name }, **kwargs) return res.succeeded and (res == nam...
def database_exists(name, **kwargs): """ Check if a MySQL database exists. """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): res = query("SHOW DATABASES LIKE '%(name)s';" % { 'name': name }, **kwargs) return res.succeeded and (res == nam...
[ "Check", "if", "a", "MySQL", "database", "exists", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L582-L591
[ "def", "database_exists", "(", "name", ",", "*", "*", "kwargs", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ",", "'stderr'", ",", "'warnings'", ")", ",", "warn_only", "=", "True", ")", ":", "res", "=", "query", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
create_database
Create a MySQL database. Example:: import burlap # Create DB if it does not exist if not burlap.mysql.database_exists('myapp'): burlap.mysql.create_database('myapp', owner='dbuser')
burlap/mysql.py
def create_database(name, owner=None, owner_host='localhost', charset='utf8', collate='utf8_general_ci', **kwargs): """ Create a MySQL database. Example:: import burlap # Create DB if it does not exist if not burlap.mysql.database_exists('myapp'): b...
def create_database(name, owner=None, owner_host='localhost', charset='utf8', collate='utf8_general_ci', **kwargs): """ Create a MySQL database. Example:: import burlap # Create DB if it does not exist if not burlap.mysql.database_exists('myapp'): b...
[ "Create", "a", "MySQL", "database", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L594-L623
[ "def", "create_database", "(", "name", ",", "owner", "=", "None", ",", "owner_host", "=", "'localhost'", ",", "charset", "=", "'utf8'", ",", "collate", "=", "'utf8_general_ci'", ",", "*", "*", "kwargs", ")", ":", "with", "settings", "(", "hide", "(", "'r...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MySQLSatchel.conf_path
Retrieves the path to the MySQL configuration file.
burlap/mysql.py
def conf_path(self): """ Retrieves the path to the MySQL configuration file. """ from burlap.system import distrib_id, distrib_release hostname = self.current_hostname if hostname not in self._conf_cache: self.env.conf_specifics[hostname] = self.env.conf_defau...
def conf_path(self): """ Retrieves the path to the MySQL configuration file. """ from burlap.system import distrib_id, distrib_release hostname = self.current_hostname if hostname not in self._conf_cache: self.env.conf_specifics[hostname] = self.env.conf_defau...
[ "Retrieves", "the", "path", "to", "the", "MySQL", "configuration", "file", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L101-L114
[ "def", "conf_path", "(", "self", ")", ":", "from", "burlap", ".", "system", "import", "distrib_id", ",", "distrib_release", "hostname", "=", "self", ".", "current_hostname", "if", "hostname", "not", "in", "self", ".", "_conf_cache", ":", "self", ".", "env", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MySQLSatchel.prep_root_password
Enters the root password prompt entries into the debconf cache so we can set them without user interaction. We keep this process separate from set_root_password() because we also need to do this before installing the base MySQL package, because that will also prompt the user for a root ...
burlap/mysql.py
def prep_root_password(self, password=None, **kwargs): """ Enters the root password prompt entries into the debconf cache so we can set them without user interaction. We keep this process separate from set_root_password() because we also need to do this before installing the bas...
def prep_root_password(self, password=None, **kwargs): """ Enters the root password prompt entries into the debconf cache so we can set them without user interaction. We keep this process separate from set_root_password() because we also need to do this before installing the bas...
[ "Enters", "the", "root", "password", "prompt", "entries", "into", "the", "debconf", "cache", "so", "we", "can", "set", "them", "without", "user", "interaction", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L165-L178
[ "def", "prep_root_password", "(", "self", ",", "password", "=", "None", ",", "*", "*", "kwargs", ")", ":", "r", "=", "self", ".", "database_renderer", "(", "*", "*", "kwargs", ")", "r", ".", "env", ".", "root_password", "=", "password", "or", "r", "....
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MySQLSatchel.drop_views
Drops all views.
burlap/mysql.py
def drop_views(self, name=None, site=None): """ Drops all views. """ r = self.database_renderer result = r.sudo("mysql --batch -v -h {db_host} " #"-u {db_root_username} -p'{db_root_password}' " "-u {db_user} -p'{db_password}' " "--execute=\"SEL...
def drop_views(self, name=None, site=None): """ Drops all views. """ r = self.database_renderer result = r.sudo("mysql --batch -v -h {db_host} " #"-u {db_root_username} -p'{db_root_password}' " "-u {db_user} -p'{db_password}' " "--execute=\"SEL...
[ "Drops", "all", "views", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L280-L299
[ "def", "drop_views", "(", "self", ",", "name", "=", "None", ",", "site", "=", "None", ")", ":", "r", "=", "self", ".", "database_renderer", "result", "=", "r", ".", "sudo", "(", "\"mysql --batch -v -h {db_host} \"", "#\"-u {db_root_username} -p'{db_root_password}'...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MySQLSatchel.exists
Returns true if a database with the given name exists. False otherwise.
burlap/mysql.py
def exists(self, **kwargs): """ Returns true if a database with the given name exists. False otherwise. """ name = kwargs.pop('name', 'default') site = kwargs.pop('site', None) r = self.database_renderer(name=name, site=site) ret = r.run('mysql -h {db_host} -u {db...
def exists(self, **kwargs): """ Returns true if a database with the given name exists. False otherwise. """ name = kwargs.pop('name', 'default') site = kwargs.pop('site', None) r = self.database_renderer(name=name, site=site) ret = r.run('mysql -h {db_host} -u {db...
[ "Returns", "true", "if", "a", "database", "with", "the", "given", "name", "exists", ".", "False", "otherwise", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L303-L323
[ "def", "exists", "(", "self", ",", "*", "*", "kwargs", ")", ":", "name", "=", "kwargs", ".", "pop", "(", "'name'", ",", "'default'", ")", "site", "=", "kwargs", ".", "pop", "(", "'site'", ",", "None", ")", "r", "=", "self", ".", "database_renderer"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MySQLSatchel.load
Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally load the snapshot.
burlap/mysql.py
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None, force_host=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finall...
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None, force_host=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finall...
[ "Restores", "a", "database", "snapshot", "onto", "the", "target", "database", "server", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L371-L441
[ "def", "load", "(", "self", ",", "dump_fn", "=", "''", ",", "prep_only", "=", "0", ",", "force_upload", "=", "0", ",", "from_local", "=", "0", ",", "name", "=", "None", ",", "site", "=", "None", ",", "dest_dir", "=", "None", ",", "force_host", "=",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MySQLSatchel.shell
Opens a SQL shell to the given database, assuming the configured database and user supports this feature.
burlap/mysql.py
def shell(self, name='default', site=None, use_root=0, **kwargs): """ Opens a SQL shell to the given database, assuming the configured database and user supports this feature. """ r = self.database_renderer(name=name, site=site) if int(use_root): kwargs = dic...
def shell(self, name='default', site=None, use_root=0, **kwargs): """ Opens a SQL shell to the given database, assuming the configured database and user supports this feature. """ r = self.database_renderer(name=name, site=site) if int(use_root): kwargs = dic...
[ "Opens", "a", "SQL", "shell", "to", "the", "given", "database", "assuming", "the", "configured", "database", "and", "user", "supports", "this", "feature", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mysql.py#L444-L463
[ "def", "shell", "(", "self", ",", "name", "=", "'default'", ",", "site", "=", "None", ",", "use_root", "=", "0", ",", "*", "*", "kwargs", ")", ":", "r", "=", "self", ".", "database_renderer", "(", "name", "=", "name", ",", "site", "=", "site", ")...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
tic_single_object_crossmatch
This does a cross-match against the TIC catalog on MAST. Speed tests: about 10 crossmatches per second. (-> 3 hours for 10^5 objects to crossmatch). Parameters ---------- ra,dec : np.array The coordinates to cross match against, all in decimal degrees. radius : float The cros...
astrobase/services/tic.py
def tic_single_object_crossmatch(ra, dec, radius): '''This does a cross-match against the TIC catalog on MAST. Speed tests: about 10 crossmatches per second. (-> 3 hours for 10^5 objects to crossmatch). Parameters ---------- ra,dec : np.array The coordinates to cross match against, al...
def tic_single_object_crossmatch(ra, dec, radius): '''This does a cross-match against the TIC catalog on MAST. Speed tests: about 10 crossmatches per second. (-> 3 hours for 10^5 objects to crossmatch). Parameters ---------- ra,dec : np.array The coordinates to cross match against, al...
[ "This", "does", "a", "cross", "-", "match", "against", "the", "TIC", "catalog", "on", "MAST", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/services/tic.py#L127-L172
[ "def", "tic_single_object_crossmatch", "(", "ra", ",", "dec", ",", "radius", ")", ":", "for", "val", "in", "ra", ",", "dec", ",", "radius", ":", "if", "not", "isinstance", "(", "val", ",", "float", ")", ":", "raise", "AssertionError", "(", "'plz input ra...
2922a14619d183fb28005fa7d02027ac436f2265
valid
normalized_flux_to_mag
This converts the normalized fluxes in the TESS lcdicts to TESS mags. Uses the object's TESS mag stored in lcdict['objectinfo']['tessmag']:: mag - object_tess_mag = -2.5 log (flux/median_flux) Parameters ---------- lcdict : lcdict An `lcdict` produced by `read_tess_fitslc` or ...
astrobase/astrotess.py
def normalized_flux_to_mag(lcdict, columns=('sap.sap_flux', 'sap.sap_flux_err', 'sap.sap_bkg', 'sap.sap_bkg_err', 'pdc.pdcsap_flux', ...
def normalized_flux_to_mag(lcdict, columns=('sap.sap_flux', 'sap.sap_flux_err', 'sap.sap_bkg', 'sap.sap_bkg_err', 'pdc.pdcsap_flux', ...
[ "This", "converts", "the", "normalized", "fluxes", "in", "the", "TESS", "lcdicts", "to", "TESS", "mags", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrotess.py#L56-L108
[ "def", "normalized_flux_to_mag", "(", "lcdict", ",", "columns", "=", "(", "'sap.sap_flux'", ",", "'sap.sap_flux_err'", ",", "'sap.sap_bkg'", ",", "'sap.sap_bkg_err'", ",", "'pdc.pdcsap_flux'", ",", "'pdc.pdcsap_flux_err'", ")", ")", ":", "tess_mag", "=", "lcdict", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
get_time_flux_errs_from_Ames_lightcurve
Reads TESS Ames-format FITS light curve files. MIT TOI alerts include Ames lightcurve files. This function gets the finite, nonzero times, fluxes, and errors with QUALITY == 0. NOTE: the PDCSAP lightcurve typically still need "pre-whitening" after this step. .. deprecated:: 0.3.20 This fu...
astrobase/astrotess.py
def get_time_flux_errs_from_Ames_lightcurve(infile, lctype, cadence_min=2): '''Reads TESS Ames-format FITS light curve files. MIT TOI alerts include Ames lightcurve files. This function gets the finite, nonzero times, f...
def get_time_flux_errs_from_Ames_lightcurve(infile, lctype, cadence_min=2): '''Reads TESS Ames-format FITS light curve files. MIT TOI alerts include Ames lightcurve files. This function gets the finite, nonzero times, f...
[ "Reads", "TESS", "Ames", "-", "format", "FITS", "light", "curve", "files", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrotess.py#L116-L216
[ "def", "get_time_flux_errs_from_Ames_lightcurve", "(", "infile", ",", "lctype", ",", "cadence_min", "=", "2", ")", ":", "warnings", ".", "warn", "(", "\"Use the astrotess.read_tess_fitslc and \"", "\"astrotess.consolidate_tess_fitslc functions instead of this function. \"", "\"Th...
2922a14619d183fb28005fa7d02027ac436f2265
valid
read_tess_fitslc
This extracts the light curve from a single TESS .lc.fits file. This works on the light curves available at MAST. TODO: look at: https://archive.stsci.edu/missions/tess/doc/EXP-TESS-ARC-ICD-TM-0014.pdf for details on the column descriptions and to fill in any other info we need. Parameters ...
astrobase/astrotess.py
def read_tess_fitslc(lcfits, headerkeys=LCHEADERKEYS, datakeys=LCDATAKEYS, sapkeys=LCSAPKEYS, pdckeys=LCPDCKEYS, topkeys=LCTOPKEYS, apkeys=LCAPERTUREKEYS, normalize=False, ...
def read_tess_fitslc(lcfits, headerkeys=LCHEADERKEYS, datakeys=LCDATAKEYS, sapkeys=LCSAPKEYS, pdckeys=LCPDCKEYS, topkeys=LCTOPKEYS, apkeys=LCAPERTUREKEYS, normalize=False, ...
[ "This", "extracts", "the", "light", "curve", "from", "a", "single", "TESS", ".", "lc", ".", "fits", "file", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrotess.py#L331-L794
[ "def", "read_tess_fitslc", "(", "lcfits", ",", "headerkeys", "=", "LCHEADERKEYS", ",", "datakeys", "=", "LCDATAKEYS", ",", "sapkeys", "=", "LCSAPKEYS", ",", "pdckeys", "=", "LCPDCKEYS", ",", "topkeys", "=", "LCTOPKEYS", ",", "apkeys", "=", "LCAPERTUREKEYS", ",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
consolidate_tess_fitslc
This consolidates a list of LCs for a single TIC object. NOTE: if light curve time arrays contain nans, these and their associated measurements will be sorted to the end of the final combined arrays. Parameters ---------- lclist : list of str, or str `lclist` is either a list of actual li...
astrobase/astrotess.py
def consolidate_tess_fitslc(lclist, normalize=True, filterqualityflags=False, nanfilter=None, timestoignore=None, headerkeys=LCHEADERKEYS, datakeys=LCDA...
def consolidate_tess_fitslc(lclist, normalize=True, filterqualityflags=False, nanfilter=None, timestoignore=None, headerkeys=LCHEADERKEYS, datakeys=LCDA...
[ "This", "consolidates", "a", "list", "of", "LCs", "for", "a", "single", "TIC", "object", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrotess.py#L798-L996
[ "def", "consolidate_tess_fitslc", "(", "lclist", ",", "normalize", "=", "True", ",", "filterqualityflags", "=", "False", ",", "nanfilter", "=", "None", ",", "timestoignore", "=", "None", ",", "headerkeys", "=", "LCHEADERKEYS", ",", "datakeys", "=", "LCDATAKEYS",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
filter_tess_lcdict
This filters the provided TESS `lcdict`, removing nans and bad observations. By default, this function removes points in the TESS LC that have ANY quality flags set. Parameters ---------- lcdict : lcdict An `lcdict` produced by `consolidate_tess_fitslc` or `read_tess_fitslc`. ...
astrobase/astrotess.py
def filter_tess_lcdict(lcdict, filterqualityflags=True, nanfilter='sap,pdc,time', timestoignore=None, quiet=False): '''This filters the provided TESS `lcdict`, removing nans and bad observations. By default, this fu...
def filter_tess_lcdict(lcdict, filterqualityflags=True, nanfilter='sap,pdc,time', timestoignore=None, quiet=False): '''This filters the provided TESS `lcdict`, removing nans and bad observations. By default, this fu...
[ "This", "filters", "the", "provided", "TESS", "lcdict", "removing", "nans", "and", "bad", "observations", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/astrotess.py#L1085-L1221
[ "def", "filter_tess_lcdict", "(", "lcdict", ",", "filterqualityflags", "=", "True", ",", "nanfilter", "=", "'sap,pdc,time'", ",", "timestoignore", "=", "None", ",", "quiet", "=", "False", ")", ":", "cols", "=", "lcdict", "[", "'columns'", "]", "# filter all ba...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_pkl_finder_objectinfo
This returns the finder chart and object information as a dict. Parameters ---------- objectinfo : dict or None If provided, this is a dict containing information on the object whose light curve is being processed. This function will then be able to look up and download a finder ch...
astrobase/checkplot/pkl_utils.py
def _pkl_finder_objectinfo( objectinfo, varinfo, findercmap, finderconvolve, sigclip, normto, normmingap, deredden_object=True, custom_bandpasses=None, lclistpkl=None, nbrradiusarcsec=30.0, maxnumneighbors=5, plotdpi...
def _pkl_finder_objectinfo( objectinfo, varinfo, findercmap, finderconvolve, sigclip, normto, normmingap, deredden_object=True, custom_bandpasses=None, lclistpkl=None, nbrradiusarcsec=30.0, maxnumneighbors=5, plotdpi...
[ "This", "returns", "the", "finder", "chart", "and", "object", "information", "as", "a", "dict", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/checkplot/pkl_utils.py#L120-L1203
[ "def", "_pkl_finder_objectinfo", "(", "objectinfo", ",", "varinfo", ",", "findercmap", ",", "finderconvolve", ",", "sigclip", ",", "normto", ",", "normmingap", ",", "deredden_object", "=", "True", ",", "custom_bandpasses", "=", "None", ",", "lclistpkl", "=", "No...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_pkl_periodogram
This returns the periodogram plot PNG as base64, plus info as a dict. Parameters ---------- lspinfo : dict This is an lspinfo dict containing results from a period-finding function. If it's from an astrobase period-finding function in periodbase, this will already be in the correct...
astrobase/checkplot/pkl_utils.py
def _pkl_periodogram(lspinfo, plotdpi=100, override_pfmethod=None): '''This returns the periodogram plot PNG as base64, plus info as a dict. Parameters ---------- lspinfo : dict This is an lspinfo dict containing results from a period-finding f...
def _pkl_periodogram(lspinfo, plotdpi=100, override_pfmethod=None): '''This returns the periodogram plot PNG as base64, plus info as a dict. Parameters ---------- lspinfo : dict This is an lspinfo dict containing results from a period-finding f...
[ "This", "returns", "the", "periodogram", "plot", "PNG", "as", "base64", "plus", "info", "as", "a", "dict", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/checkplot/pkl_utils.py#L1207-L1355
[ "def", "_pkl_periodogram", "(", "lspinfo", ",", "plotdpi", "=", "100", ",", "override_pfmethod", "=", "None", ")", ":", "# get the appropriate plot ylabel", "pgramylabel", "=", "PLOTYLABELS", "[", "lspinfo", "[", "'method'", "]", "]", "# get the periods and lspvals fr...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_pkl_magseries_plot
This returns the magseries plot PNG as base64, plus arrays as dict. Parameters ---------- stimes,smags,serrs : np.array The mag/flux time-series arrays along with associated errors. These should all have been run through nan-stripping and sigma-clipping beforehand. plotdpi : i...
astrobase/checkplot/pkl_utils.py
def _pkl_magseries_plot(stimes, smags, serrs, plotdpi=100, magsarefluxes=False): '''This returns the magseries plot PNG as base64, plus arrays as dict. Parameters ---------- stimes,smags,serrs : np.array The mag/flux time-series arrays along with...
def _pkl_magseries_plot(stimes, smags, serrs, plotdpi=100, magsarefluxes=False): '''This returns the magseries plot PNG as base64, plus arrays as dict. Parameters ---------- stimes,smags,serrs : np.array The mag/flux time-series arrays along with...
[ "This", "returns", "the", "magseries", "plot", "PNG", "as", "base64", "plus", "arrays", "as", "dict", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/checkplot/pkl_utils.py#L1359-L1462
[ "def", "_pkl_magseries_plot", "(", "stimes", ",", "smags", ",", "serrs", ",", "plotdpi", "=", "100", ",", "magsarefluxes", "=", "False", ")", ":", "scaledplottime", "=", "stimes", "-", "npmin", "(", "stimes", ")", "# open the figure instance", "magseriesfig", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_pkl_phased_magseries_plot
This returns the phased magseries plot PNG as base64 plus info as a dict. Parameters ---------- checkplotdict : dict This is an existing checkplotdict to update. If it's None or `directreturn` = True, then the generated dict result for this magseries plot will be returned directly....
astrobase/checkplot/pkl_utils.py
def _pkl_phased_magseries_plot( checkplotdict, lspmethod, periodind, stimes, smags, serrs, varperiod, varepoch, lspmethodind=0, phasewrap=True, phasesort=True, phasebin=0.002, minbinelems=7, plotxlim=(-0.8,0.8), plotdpi=100,...
def _pkl_phased_magseries_plot( checkplotdict, lspmethod, periodind, stimes, smags, serrs, varperiod, varepoch, lspmethodind=0, phasewrap=True, phasesort=True, phasebin=0.002, minbinelems=7, plotxlim=(-0.8,0.8), plotdpi=100,...
[ "This", "returns", "the", "phased", "magseries", "plot", "PNG", "as", "base64", "plus", "info", "as", "a", "dict", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/checkplot/pkl_utils.py#L1466-L1961
[ "def", "_pkl_phased_magseries_plot", "(", "checkplotdict", ",", "lspmethod", ",", "periodind", ",", "stimes", ",", "smags", ",", "serrs", ",", "varperiod", ",", "varepoch", ",", "lspmethodind", "=", "0", ",", "phasewrap", "=", "True", ",", "phasesort", "=", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
prewhiten_magseries
Removes a periodic sinusoidal signal generated using whitenparams from the input magnitude time series. Parameters ---------- times,mags,errs : np.array The input mag/flux time-series to prewhiten. whitenperiod : float The period of the sinusoidal signal to remove. whitenpara...
astrobase/varbase/signals.py
def prewhiten_magseries(times, mags, errs, whitenperiod, whitenparams, sigclip=3.0, magsarefluxes=False, plotfit=None, plotfitphasedlconly=True, rescale...
def prewhiten_magseries(times, mags, errs, whitenperiod, whitenparams, sigclip=3.0, magsarefluxes=False, plotfit=None, plotfitphasedlconly=True, rescale...
[ "Removes", "a", "periodic", "sinusoidal", "signal", "generated", "using", "whitenparams", "from", "the", "input", "magnitude", "time", "series", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/signals.py#L69-L328
[ "def", "prewhiten_magseries", "(", "times", ",", "mags", ",", "errs", ",", "whitenperiod", ",", "whitenparams", ",", "sigclip", "=", "3.0", ",", "magsarefluxes", "=", "False", ",", "plotfit", "=", "None", ",", "plotfitphasedlconly", "=", "True", ",", "rescal...
2922a14619d183fb28005fa7d02027ac436f2265
valid
gls_prewhiten
Iterative pre-whitening of a magnitude series using the L-S periodogram. This finds the best period, fits a fourier series with the best period, then whitens the time series with the best period, and repeats until `nbestpeaks` are done. Parameters ---------- times,mags,errs : np.array ...
astrobase/varbase/signals.py
def gls_prewhiten(times, mags, errs, fourierorder=3, # 3rd order series to start with initfparams=None, startp_gls=None, endp_gls=None, stepsize=1.0e-4, autofreq=True, sigclip=30.0, ...
def gls_prewhiten(times, mags, errs, fourierorder=3, # 3rd order series to start with initfparams=None, startp_gls=None, endp_gls=None, stepsize=1.0e-4, autofreq=True, sigclip=30.0, ...
[ "Iterative", "pre", "-", "whitening", "of", "a", "magnitude", "series", "using", "the", "L", "-", "S", "periodogram", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/signals.py#L332-L590
[ "def", "gls_prewhiten", "(", "times", ",", "mags", ",", "errs", ",", "fourierorder", "=", "3", ",", "# 3rd order series to start with", "initfparams", "=", "None", ",", "startp_gls", "=", "None", ",", "endp_gls", "=", "None", ",", "stepsize", "=", "1.0e-4", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
mask_signal
This removes repeating signals in the magnitude time series. Useful for masking planetary transit signals in light curves to search for other variability. A small worked example of using this and `prewhiten_magseries` above: https://github.com/waqasbhatti/astrobase/issues/77#issuecomment-463803558 ...
astrobase/varbase/signals.py
def mask_signal(times, mags, errs, signalperiod, signalepoch, magsarefluxes=False, maskphases=(0,0,0.5,1.0), maskphaselength=0.1, plotfit=None, plotfitphasedlconly=True, sigclip=30.0): '''...
def mask_signal(times, mags, errs, signalperiod, signalepoch, magsarefluxes=False, maskphases=(0,0,0.5,1.0), maskphaselength=0.1, plotfit=None, plotfitphasedlconly=True, sigclip=30.0): '''...
[ "This", "removes", "repeating", "signals", "in", "the", "magnitude", "time", "series", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/signals.py#L594-L821
[ "def", "mask_signal", "(", "times", ",", "mags", ",", "errs", ",", "signalperiod", ",", "signalepoch", ",", "magsarefluxes", "=", "False", ",", "maskphases", "=", "(", "0", ",", "0", ",", "0.5", ",", "1.0", ")", ",", "maskphaselength", "=", "0.1", ",",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
main
This launches the server. The current script args are shown below:: Usage: checkplotserver [OPTIONS] Options: --help show this help information checkplotserver.py options: --assetpath Sets the asset (server images, css, js, DB) ...
astrobase/cpserver/checkplotserver.py
def main(): ''' This launches the server. The current script args are shown below:: Usage: checkplotserver [OPTIONS] Options: --help show this help information checkplotserver.py options: --assetpath Sets the asset (server ima...
def main(): ''' This launches the server. The current script args are shown below:: Usage: checkplotserver [OPTIONS] Options: --help show this help information checkplotserver.py options: --assetpath Sets the asset (server ima...
[ "This", "launches", "the", "server", ".", "The", "current", "script", "args", "are", "shown", "below", "::" ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/cpserver/checkplotserver.py#L153-L498
[ "def", "main", "(", ")", ":", "# parse the command line", "tornado", ".", "options", ".", "parse_command_line", "(", ")", "DEBUG", "=", "True", "if", "options", ".", "debugmode", "==", "1", "else", "False", "# get a logger", "LOGGER", "=", "logging", ".", "g...
2922a14619d183fb28005fa7d02027ac436f2265
valid
find_lc_timegroups
Finds gaps in the provided time-series and indexes them into groups. This finds the gaps in the provided `lctimes` array, so we can figure out which times are for consecutive observations and which represent gaps between seasons or observing eras. Parameters ---------- lctimes : array-like ...
astrobase/lcmath.py
def find_lc_timegroups(lctimes, mingap=4.0): '''Finds gaps in the provided time-series and indexes them into groups. This finds the gaps in the provided `lctimes` array, so we can figure out which times are for consecutive observations and which represent gaps between seasons or observing eras. Pa...
def find_lc_timegroups(lctimes, mingap=4.0): '''Finds gaps in the provided time-series and indexes them into groups. This finds the gaps in the provided `lctimes` array, so we can figure out which times are for consecutive observations and which represent gaps between seasons or observing eras. Pa...
[ "Finds", "gaps", "in", "the", "provided", "time", "-", "series", "and", "indexes", "them", "into", "groups", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L58-L114
[ "def", "find_lc_timegroups", "(", "lctimes", ",", "mingap", "=", "4.0", ")", ":", "lc_time_diffs", "=", "np", ".", "diff", "(", "lctimes", ")", "group_start_indices", "=", "np", ".", "where", "(", "lc_time_diffs", ">", "mingap", ")", "[", "0", "]", "if",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
normalize_magseries
This normalizes the magnitude time-series to a specified value. This is used to normalize time series measurements that may have large time gaps and vertical offsets in mag/flux measurement between these 'timegroups', either due to instrument changes or different filters. NOTE: this works in-place! Th...
astrobase/lcmath.py
def normalize_magseries(times, mags, mingap=4.0, normto='globalmedian', magsarefluxes=False, debugmode=False): '''This normalizes the magnitude time-series to a specified value. This is used ...
def normalize_magseries(times, mags, mingap=4.0, normto='globalmedian', magsarefluxes=False, debugmode=False): '''This normalizes the magnitude time-series to a specified value. This is used ...
[ "This", "normalizes", "the", "magnitude", "time", "-", "series", "to", "a", "specified", "value", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L118-L235
[ "def", "normalize_magseries", "(", "times", ",", "mags", ",", "mingap", "=", "4.0", ",", "normto", "=", "'globalmedian'", ",", "magsarefluxes", "=", "False", ",", "debugmode", "=", "False", ")", ":", "ngroups", ",", "timegroups", "=", "find_lc_timegroups", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
sigclip_magseries
Sigma-clips a magnitude or flux time-series. Selects the finite times, magnitudes (or fluxes), and errors from the passed values, and apply symmetric or asymmetric sigma clipping to them. Parameters ---------- times,mags,errs : np.array The magnitude or flux time-series arrays to sigma-cl...
astrobase/lcmath.py
def sigclip_magseries(times, mags, errs, sigclip=None, iterative=False, niterations=None, meanormedian='median', magsarefluxes=False): '''Sigma-clips a magnitude or flux time-series. Selects the finite...
def sigclip_magseries(times, mags, errs, sigclip=None, iterative=False, niterations=None, meanormedian='median', magsarefluxes=False): '''Sigma-clips a magnitude or flux time-series. Selects the finite...
[ "Sigma", "-", "clips", "a", "magnitude", "or", "flux", "time", "-", "series", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L243-L589
[ "def", "sigclip_magseries", "(", "times", ",", "mags", ",", "errs", ",", "sigclip", "=", "None", ",", "iterative", "=", "False", ",", "niterations", "=", "None", ",", "meanormedian", "=", "'median'", ",", "magsarefluxes", "=", "False", ")", ":", "returnerr...
2922a14619d183fb28005fa7d02027ac436f2265
valid
sigclip_magseries_with_extparams
Sigma-clips a magnitude or flux time-series and associated measurement arrays. Selects the finite times, magnitudes (or fluxes), and errors from the passed values, and apply symmetric or asymmetric sigma clipping to them. Uses the same array indices as these values to filter out the values of all arra...
astrobase/lcmath.py
def sigclip_magseries_with_extparams(times, mags, errs, extparams, sigclip=None, iterative=False, magsarefluxes=False): '''Sigma-clips a magnitude or flux time-series and associated measurement arrays....
def sigclip_magseries_with_extparams(times, mags, errs, extparams, sigclip=None, iterative=False, magsarefluxes=False): '''Sigma-clips a magnitude or flux time-series and associated measurement arrays....
[ "Sigma", "-", "clips", "a", "magnitude", "or", "flux", "time", "-", "series", "and", "associated", "measurement", "arrays", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L593-L830
[ "def", "sigclip_magseries_with_extparams", "(", "times", ",", "mags", ",", "errs", ",", "extparams", ",", "sigclip", "=", "None", ",", "iterative", "=", "False", ",", "magsarefluxes", "=", "False", ")", ":", "returnerrs", "=", "True", "# fake the errors if they ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
phase_magseries
Phases a magnitude/flux time-series using a given period and epoch. The equation used is:: phase = (times - epoch)/period - floor((times - epoch)/period) This phases the given magnitude timeseries using the given period and epoch. If wrap is True, wraps the result around 0.0 (and returns an array...
astrobase/lcmath.py
def phase_magseries(times, mags, period, epoch, wrap=True, sort=True): '''Phases a magnitude/flux time-series using a given period and epoch. The equation used is:: phase = (times - epoch)/period - floor((times - epoch)/period) This phases the given magnitude timeseries using the given period and...
def phase_magseries(times, mags, period, epoch, wrap=True, sort=True): '''Phases a magnitude/flux time-series using a given period and epoch. The equation used is:: phase = (times - epoch)/period - floor((times - epoch)/period) This phases the given magnitude timeseries using the given period and...
[ "Phases", "a", "magnitude", "/", "flux", "time", "-", "series", "using", "a", "given", "period", "and", "epoch", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L838-L915
[ "def", "phase_magseries", "(", "times", ",", "mags", ",", "period", ",", "epoch", ",", "wrap", "=", "True", ",", "sort", "=", "True", ")", ":", "# find all the finite values of the magnitudes and times", "finiteind", "=", "np", ".", "isfinite", "(", "mags", ")...
2922a14619d183fb28005fa7d02027ac436f2265
valid
time_bin_magseries
Bins the given mag/flux time-series in time using the bin size given. Parameters ---------- times,mags : np.array The magnitude/flux time-series to bin in time. Non-finite elements will be removed from these arrays. At least 10 elements in each array are required for this function ...
astrobase/lcmath.py
def time_bin_magseries(times, mags, binsize=540.0, minbinelems=7): '''Bins the given mag/flux time-series in time using the bin size given. Parameters ---------- times,mags : np.array The magnitude/flux time-series to bin in time. Non-finite elemen...
def time_bin_magseries(times, mags, binsize=540.0, minbinelems=7): '''Bins the given mag/flux time-series in time using the bin size given. Parameters ---------- times,mags : np.array The magnitude/flux time-series to bin in time. Non-finite elemen...
[ "Bins", "the", "given", "mag", "/", "flux", "time", "-", "series", "in", "time", "using", "the", "bin", "size", "given", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L1011-L1112
[ "def", "time_bin_magseries", "(", "times", ",", "mags", ",", "binsize", "=", "540.0", ",", "minbinelems", "=", "7", ")", ":", "# check if the input arrays are ok", "if", "not", "(", "times", ".", "shape", "and", "mags", ".", "shape", "and", "len", "(", "ti...
2922a14619d183fb28005fa7d02027ac436f2265
valid
phase_bin_magseries
Bins a phased magnitude/flux time-series using the bin size provided. Parameters ---------- phases,mags : np.array The phased magnitude/flux time-series to bin in phase. Non-finite elements will be removed from these arrays. At least 10 elements in each array are required for this ...
astrobase/lcmath.py
def phase_bin_magseries(phases, mags, binsize=0.005, minbinelems=7): '''Bins a phased magnitude/flux time-series using the bin size provided. Parameters ---------- phases,mags : np.array The phased magnitude/flux time-series to bin in phase. Non-...
def phase_bin_magseries(phases, mags, binsize=0.005, minbinelems=7): '''Bins a phased magnitude/flux time-series using the bin size provided. Parameters ---------- phases,mags : np.array The phased magnitude/flux time-series to bin in phase. Non-...
[ "Bins", "a", "phased", "magnitude", "/", "flux", "time", "-", "series", "using", "the", "bin", "size", "provided", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L1233-L1334
[ "def", "phase_bin_magseries", "(", "phases", ",", "mags", ",", "binsize", "=", "0.005", ",", "minbinelems", "=", "7", ")", ":", "# check if the input arrays are ok", "if", "not", "(", "phases", ".", "shape", "and", "mags", ".", "shape", "and", "len", "(", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
fill_magseries_gaps
This fills in gaps in a light curve. This is mainly intended for use in ACF period-finding, but maybe useful otherwise (i.e. when we figure out ARMA stuff for LCs). The main steps here are: - normalize the light curve to zero - remove giant outliers - interpolate gaps in the light curve ...
astrobase/lcmath.py
def fill_magseries_gaps(times, mags, errs, fillgaps=0.0, sigclip=3.0, magsarefluxes=False, filterwindow=11, forcetimebin=None, verbose=True): '''This fills in gaps in a lig...
def fill_magseries_gaps(times, mags, errs, fillgaps=0.0, sigclip=3.0, magsarefluxes=False, filterwindow=11, forcetimebin=None, verbose=True): '''This fills in gaps in a lig...
[ "This", "fills", "in", "gaps", "in", "a", "light", "curve", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcmath.py#L1455-L1645
[ "def", "fill_magseries_gaps", "(", "times", ",", "mags", ",", "errs", ",", "fillgaps", "=", "0.0", ",", "sigclip", "=", "3.0", ",", "magsarefluxes", "=", "False", ",", "filterwindow", "=", "11", ",", "forcetimebin", "=", "None", ",", "verbose", "=", "Tru...
2922a14619d183fb28005fa7d02027ac436f2265
valid
get_snr_of_dip
Calculate the total SNR of a transit assuming gaussian uncertainties. `modelmags` gets interpolated onto the cadence of `mags`. The noise is calculated as the 1-sigma std deviation of the residual (see below). Following Carter et al. 2009:: Q = sqrt( Γ T ) * δ / σ for Q the total SNR of the ...
astrobase/varbase/transits.py
def get_snr_of_dip(times, mags, modeltimes, modelmags, atol_normalization=1e-8, indsforrms=None, magsarefluxes=False, verbose=True, transitdepth=None, ...
def get_snr_of_dip(times, mags, modeltimes, modelmags, atol_normalization=1e-8, indsforrms=None, magsarefluxes=False, verbose=True, transitdepth=None, ...
[ "Calculate", "the", "total", "SNR", "of", "a", "transit", "assuming", "gaussian", "uncertainties", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/transits.py#L107-L245
[ "def", "get_snr_of_dip", "(", "times", ",", "mags", ",", "modeltimes", ",", "modelmags", ",", "atol_normalization", "=", "1e-8", ",", "indsforrms", "=", "None", ",", "magsarefluxes", "=", "False", ",", "verbose", "=", "True", ",", "transitdepth", "=", "None"...
2922a14619d183fb28005fa7d02027ac436f2265
valid
estimate_achievable_tmid_precision
Using Carter et al. 2009's estimate, calculate the theoretical optimal precision on mid-transit time measurement possible given a transit of a particular SNR. The relation used is:: sigma_tc = Q^{-1} * T * sqrt(θ/2) Q = SNR of the transit. T = transit duration, which is 2.14 hours...
astrobase/varbase/transits.py
def estimate_achievable_tmid_precision(snr, t_ingress_min=10, t_duration_hr=2.14): '''Using Carter et al. 2009's estimate, calculate the theoretical optimal precision on mid-transit time measurement possible given a transit of a particular SNR. The relation used i...
def estimate_achievable_tmid_precision(snr, t_ingress_min=10, t_duration_hr=2.14): '''Using Carter et al. 2009's estimate, calculate the theoretical optimal precision on mid-transit time measurement possible given a transit of a particular SNR. The relation used i...
[ "Using", "Carter", "et", "al", ".", "2009", "s", "estimate", "calculate", "the", "theoretical", "optimal", "precision", "on", "mid", "-", "transit", "time", "measurement", "possible", "given", "a", "transit", "of", "a", "particular", "SNR", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/transits.py#L249-L303
[ "def", "estimate_achievable_tmid_precision", "(", "snr", ",", "t_ingress_min", "=", "10", ",", "t_duration_hr", "=", "2.14", ")", ":", "t_ingress", "=", "t_ingress_min", "*", "u", ".", "minute", "t_duration", "=", "t_duration_hr", "*", "u", ".", "hour", "theta...
2922a14619d183fb28005fa7d02027ac436f2265
valid
get_transit_times
Given a BLS period, epoch, and transit ingress/egress points (usually from :py:func:`astrobase.periodbase.kbls.bls_stats_singleperiod`), return the times within transit durations + `extra_maskfrac` of each transit. Optionally, can use the (more accurate) trapezoidal fit period and epoch, if it's passed...
astrobase/varbase/transits.py
def get_transit_times( blsd, time, extra_maskfrac, trapd=None, nperiodint=1000 ): '''Given a BLS period, epoch, and transit ingress/egress points (usually from :py:func:`astrobase.periodbase.kbls.bls_stats_singleperiod`), return the times within transit durations + `e...
def get_transit_times( blsd, time, extra_maskfrac, trapd=None, nperiodint=1000 ): '''Given a BLS period, epoch, and transit ingress/egress points (usually from :py:func:`astrobase.periodbase.kbls.bls_stats_singleperiod`), return the times within transit durations + `e...
[ "Given", "a", "BLS", "period", "epoch", "and", "transit", "ingress", "/", "egress", "points", "(", "usually", "from", ":", "py", ":", "func", ":", "astrobase", ".", "periodbase", ".", "kbls", ".", "bls_stats_singleperiod", ")", "return", "the", "times", "w...
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/transits.py#L307-L395
[ "def", "get_transit_times", "(", "blsd", ",", "time", ",", "extra_maskfrac", ",", "trapd", "=", "None", ",", "nperiodint", "=", "1000", ")", ":", "if", "trapd", ":", "period", "=", "trapd", "[", "'fitinfo'", "]", "[", "'finalparams'", "]", "[", "0", "]...
2922a14619d183fb28005fa7d02027ac436f2265
valid
given_lc_get_transit_tmids_tstarts_tends
Gets the transit start, middle, and end times for transits in a given time-series of observations. Parameters ---------- time,flux,err_flux : np.array The input flux time-series measurements and their associated measurement errors blsfit_savpath : str or None If provided a...
astrobase/varbase/transits.py
def given_lc_get_transit_tmids_tstarts_tends( time, flux, err_flux, blsfit_savpath=None, trapfit_savpath=None, magsarefluxes=True, nworkers=1, sigclip=None, extra_maskfrac=0.03 ): '''Gets the transit start, middle, and end times for transits in...
def given_lc_get_transit_tmids_tstarts_tends( time, flux, err_flux, blsfit_savpath=None, trapfit_savpath=None, magsarefluxes=True, nworkers=1, sigclip=None, extra_maskfrac=0.03 ): '''Gets the transit start, middle, and end times for transits in...
[ "Gets", "the", "transit", "start", "middle", "and", "end", "times", "for", "transits", "in", "a", "given", "time", "-", "series", "of", "observations", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/transits.py#L399-L521
[ "def", "given_lc_get_transit_tmids_tstarts_tends", "(", "time", ",", "flux", ",", "err_flux", ",", "blsfit_savpath", "=", "None", ",", "trapfit_savpath", "=", "None", ",", "magsarefluxes", "=", "True", ",", "nworkers", "=", "1", ",", "sigclip", "=", "None", ",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
given_lc_get_out_of_transit_points
This gets the out-of-transit light curve points. Relevant during iterative masking of transits for multiple planet system search. Parameters ---------- time,flux,err_flux : np.array The input flux time-series measurements and their associated measurement errors blsfit_savpath...
astrobase/varbase/transits.py
def given_lc_get_out_of_transit_points( time, flux, err_flux, blsfit_savpath=None, trapfit_savpath=None, in_out_transit_savpath=None, sigclip=None, magsarefluxes=True, nworkers=1, extra_maskfrac=0.03 ): '''This gets the out-of-transit light curve point...
def given_lc_get_out_of_transit_points( time, flux, err_flux, blsfit_savpath=None, trapfit_savpath=None, in_out_transit_savpath=None, sigclip=None, magsarefluxes=True, nworkers=1, extra_maskfrac=0.03 ): '''This gets the out-of-transit light curve point...
[ "This", "gets", "the", "out", "-", "of", "-", "transit", "light", "curve", "points", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varbase/transits.py#L555-L657
[ "def", "given_lc_get_out_of_transit_points", "(", "time", ",", "flux", ",", "err_flux", ",", "blsfit_savpath", "=", "None", ",", "trapfit_savpath", "=", "None", ",", "in_out_transit_savpath", "=", "None", ",", "sigclip", "=", "None", ",", "magsarefluxes", "=", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_pycompress_sqlitecurve
This just compresses the sqlitecurve. Should be independent of OS.
astrobase/hatsurveys/hatlc.py
def _pycompress_sqlitecurve(sqlitecurve, force=False): '''This just compresses the sqlitecurve. Should be independent of OS. ''' outfile = '%s.gz' % sqlitecurve try: if os.path.exists(outfile) and not force: os.remove(sqlitecurve) return outfile else: ...
def _pycompress_sqlitecurve(sqlitecurve, force=False): '''This just compresses the sqlitecurve. Should be independent of OS. ''' outfile = '%s.gz' % sqlitecurve try: if os.path.exists(outfile) and not force: os.remove(sqlitecurve) return outfile else: ...
[ "This", "just", "compresses", "the", "sqlitecurve", ".", "Should", "be", "independent", "of", "OS", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L429-L453
[ "def", "_pycompress_sqlitecurve", "(", "sqlitecurve", ",", "force", "=", "False", ")", ":", "outfile", "=", "'%s.gz'", "%", "sqlitecurve", "try", ":", "if", "os", ".", "path", ".", "exists", "(", "outfile", ")", "and", "not", "force", ":", "os", ".", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_pyuncompress_sqlitecurve
This just uncompresses the sqlitecurve. Should be independent of OS.
astrobase/hatsurveys/hatlc.py
def _pyuncompress_sqlitecurve(sqlitecurve, force=False): '''This just uncompresses the sqlitecurve. Should be independent of OS. ''' outfile = sqlitecurve.replace('.gz','') try: if os.path.exists(outfile) and not force: return outfile else: with gzip.open(sq...
def _pyuncompress_sqlitecurve(sqlitecurve, force=False): '''This just uncompresses the sqlitecurve. Should be independent of OS. ''' outfile = sqlitecurve.replace('.gz','') try: if os.path.exists(outfile) and not force: return outfile else: with gzip.open(sq...
[ "This", "just", "uncompresses", "the", "sqlitecurve", ".", "Should", "be", "independent", "of", "OS", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L456-L479
[ "def", "_pyuncompress_sqlitecurve", "(", "sqlitecurve", ",", "force", "=", "False", ")", ":", "outfile", "=", "sqlitecurve", ".", "replace", "(", "'.gz'", ",", "''", ")", "try", ":", "if", "os", ".", "path", ".", "exists", "(", "outfile", ")", "and", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_gzip_sqlitecurve
This just compresses the sqlitecurve in gzip format. FIXME: this doesn't work with gzip < 1.6 or non-GNU gzip (probably).
astrobase/hatsurveys/hatlc.py
def _gzip_sqlitecurve(sqlitecurve, force=False): '''This just compresses the sqlitecurve in gzip format. FIXME: this doesn't work with gzip < 1.6 or non-GNU gzip (probably). ''' # -k to keep the input file just in case something explodes if force: cmd = 'gzip -k -f %s' % sqlitecurve e...
def _gzip_sqlitecurve(sqlitecurve, force=False): '''This just compresses the sqlitecurve in gzip format. FIXME: this doesn't work with gzip < 1.6 or non-GNU gzip (probably). ''' # -k to keep the input file just in case something explodes if force: cmd = 'gzip -k -f %s' % sqlitecurve e...
[ "This", "just", "compresses", "the", "sqlitecurve", "in", "gzip", "format", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L482-L514
[ "def", "_gzip_sqlitecurve", "(", "sqlitecurve", ",", "force", "=", "False", ")", ":", "# -k to keep the input file just in case something explodes", "if", "force", ":", "cmd", "=", "'gzip -k -f %s'", "%", "sqlitecurve", "else", ":", "cmd", "=", "'gzip -k %s'", "%", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_gunzip_sqlitecurve
This just uncompresses the sqlitecurve in gzip format. FIXME: this doesn't work with gzip < 1.6 or non-GNU gzip (probably).
astrobase/hatsurveys/hatlc.py
def _gunzip_sqlitecurve(sqlitecurve): '''This just uncompresses the sqlitecurve in gzip format. FIXME: this doesn't work with gzip < 1.6 or non-GNU gzip (probably). ''' # -k to keep the input .gz just in case something explodes cmd = 'gunzip -k %s' % sqlitecurve try: subprocess.check...
def _gunzip_sqlitecurve(sqlitecurve): '''This just uncompresses the sqlitecurve in gzip format. FIXME: this doesn't work with gzip < 1.6 or non-GNU gzip (probably). ''' # -k to keep the input .gz just in case something explodes cmd = 'gunzip -k %s' % sqlitecurve try: subprocess.check...
[ "This", "just", "uncompresses", "the", "sqlitecurve", "in", "gzip", "format", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L518-L532
[ "def", "_gunzip_sqlitecurve", "(", "sqlitecurve", ")", ":", "# -k to keep the input .gz just in case something explodes", "cmd", "=", "'gunzip -k %s'", "%", "sqlitecurve", "try", ":", "subprocess", ".", "check_output", "(", "cmd", ",", "shell", "=", "True", ")", "retu...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_validate_sqlitecurve_filters
This validates the sqlitecurve filter string. This MUST be valid SQL but not contain any commands.
astrobase/hatsurveys/hatlc.py
def _validate_sqlitecurve_filters(filterstring, lccolumns): '''This validates the sqlitecurve filter string. This MUST be valid SQL but not contain any commands. ''' # first, lowercase, then _squeeze to single spaces stringelems = _squeeze(filterstring).lower() # replace shady characters ...
def _validate_sqlitecurve_filters(filterstring, lccolumns): '''This validates the sqlitecurve filter string. This MUST be valid SQL but not contain any commands. ''' # first, lowercase, then _squeeze to single spaces stringelems = _squeeze(filterstring).lower() # replace shady characters ...
[ "This", "validates", "the", "sqlitecurve", "filter", "string", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L564-L620
[ "def", "_validate_sqlitecurve_filters", "(", "filterstring", ",", "lccolumns", ")", ":", "# first, lowercase, then _squeeze to single spaces", "stringelems", "=", "_squeeze", "(", "filterstring", ")", ".", "lower", "(", ")", "# replace shady characters", "stringelems", "=",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
read_and_filter_sqlitecurve
This reads a HAT sqlitecurve and optionally filters it. Parameters ---------- lcfile : str The path to the HAT sqlitecurve file. columns : list A list of columns to extract from the ligh curve file. If None, then returns all columns present in the latest `columnlist` in the li...
astrobase/hatsurveys/hatlc.py
def read_and_filter_sqlitecurve(lcfile, columns=None, sqlfilters=None, raiseonfail=False, returnarrays=True, forcerecompress=False, ...
def read_and_filter_sqlitecurve(lcfile, columns=None, sqlfilters=None, raiseonfail=False, returnarrays=True, forcerecompress=False, ...
[ "This", "reads", "a", "HAT", "sqlitecurve", "and", "optionally", "filters", "it", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L624-L853
[ "def", "read_and_filter_sqlitecurve", "(", "lcfile", ",", "columns", "=", "None", ",", "sqlfilters", "=", "None", ",", "raiseonfail", "=", "False", ",", "returnarrays", "=", "True", ",", "forcerecompress", "=", "False", ",", "quiet", "=", "True", ")", ":", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
describe
This describes the light curve object and columns present. Parameters ---------- lcdict : dict The input lcdict to parse for column and metadata info. returndesc : bool If True, returns the description string as an str instead of just printing it to stdout. offsetwith : s...
astrobase/hatsurveys/hatlc.py
def describe(lcdict, returndesc=False, offsetwith=None): '''This describes the light curve object and columns present. Parameters ---------- lcdict : dict The input lcdict to parse for column and metadata info. returndesc : bool If True, returns the description string as an str in...
def describe(lcdict, returndesc=False, offsetwith=None): '''This describes the light curve object and columns present. Parameters ---------- lcdict : dict The input lcdict to parse for column and metadata info. returndesc : bool If True, returns the description string as an str in...
[ "This", "describes", "the", "light", "curve", "object", "and", "columns", "present", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L918-L1037
[ "def", "describe", "(", "lcdict", ",", "returndesc", "=", "False", ",", "offsetwith", "=", "None", ")", ":", "# transparently read LCC CSV format description", "if", "'lcformat'", "in", "lcdict", "and", "'lcc-csv'", "in", "lcdict", "[", "'lcformat'", "]", ".", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_smartcast
This just tries to apply the caster function to castee. Returns None on failure.
astrobase/hatsurveys/hatlc.py
def _smartcast(castee, caster, subval=None): ''' This just tries to apply the caster function to castee. Returns None on failure. ''' try: return caster(castee) except Exception as e: if caster is float or caster is int: return nan elif caster is str: ...
def _smartcast(castee, caster, subval=None): ''' This just tries to apply the caster function to castee. Returns None on failure. ''' try: return caster(castee) except Exception as e: if caster is float or caster is int: return nan elif caster is str: ...
[ "This", "just", "tries", "to", "apply", "the", "caster", "function", "to", "castee", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1045-L1061
[ "def", "_smartcast", "(", "castee", ",", "caster", ",", "subval", "=", "None", ")", ":", "try", ":", "return", "caster", "(", "castee", ")", "except", "Exception", "as", "e", ":", "if", "caster", "is", "float", "or", "caster", "is", "int", ":", "retu...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_parse_csv_header
This parses the CSV header from the CSV HAT sqlitecurve. Returns a dict that can be used to update an existing lcdict with the relevant metadata info needed to form a full LC.
astrobase/hatsurveys/hatlc.py
def _parse_csv_header(header): ''' This parses the CSV header from the CSV HAT sqlitecurve. Returns a dict that can be used to update an existing lcdict with the relevant metadata info needed to form a full LC. ''' # first, break into lines headerlines = header.split('\n') headerlines...
def _parse_csv_header(header): ''' This parses the CSV header from the CSV HAT sqlitecurve. Returns a dict that can be used to update an existing lcdict with the relevant metadata info needed to form a full LC. ''' # first, break into lines headerlines = header.split('\n') headerlines...
[ "This", "parses", "the", "CSV", "header", "from", "the", "CSV", "HAT", "sqlitecurve", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1090-L1187
[ "def", "_parse_csv_header", "(", "header", ")", ":", "# first, break into lines", "headerlines", "=", "header", ".", "split", "(", "'\\n'", ")", "headerlines", "=", "[", "x", ".", "lstrip", "(", "'# '", ")", "for", "x", "in", "headerlines", "]", "# next, fin...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_parse_csv_header_lcc_csv_v1
This parses the header of the LCC CSV V1 LC format.
astrobase/hatsurveys/hatlc.py
def _parse_csv_header_lcc_csv_v1(headerlines): ''' This parses the header of the LCC CSV V1 LC format. ''' # the first three lines indicate the format name, comment char, separator commentchar = headerlines[1] separator = headerlines[2] headerlines = [x.lstrip('%s ' % commentchar) for x i...
def _parse_csv_header_lcc_csv_v1(headerlines): ''' This parses the header of the LCC CSV V1 LC format. ''' # the first three lines indicate the format name, comment char, separator commentchar = headerlines[1] separator = headerlines[2] headerlines = [x.lstrip('%s ' % commentchar) for x i...
[ "This", "parses", "the", "header", "of", "the", "LCC", "CSV", "V1", "LC", "format", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1195-L1217
[ "def", "_parse_csv_header_lcc_csv_v1", "(", "headerlines", ")", ":", "# the first three lines indicate the format name, comment char, separator", "commentchar", "=", "headerlines", "[", "1", "]", "separator", "=", "headerlines", "[", "2", "]", "headerlines", "=", "[", "x"...
2922a14619d183fb28005fa7d02027ac436f2265
valid
read_lcc_csvlc
This reads a CSV LC produced by an `LCC-Server <https://github.com/waqasbhatti/lcc-server>`_ instance. Parameters ---------- lcfile : str The LC file to read. Returns ------- dict Returns an lcdict that's readable by most astrobase functions for further processing...
astrobase/hatsurveys/hatlc.py
def read_lcc_csvlc(lcfile): '''This reads a CSV LC produced by an `LCC-Server <https://github.com/waqasbhatti/lcc-server>`_ instance. Parameters ---------- lcfile : str The LC file to read. Returns ------- dict Returns an lcdict that's readable by most astrobase funct...
def read_lcc_csvlc(lcfile): '''This reads a CSV LC produced by an `LCC-Server <https://github.com/waqasbhatti/lcc-server>`_ instance. Parameters ---------- lcfile : str The LC file to read. Returns ------- dict Returns an lcdict that's readable by most astrobase funct...
[ "This", "reads", "a", "CSV", "LC", "produced", "by", "an", "LCC", "-", "Server", "<https", ":", "//", "github", ".", "com", "/", "waqasbhatti", "/", "lcc", "-", "server", ">", "_", "instance", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1221-L1299
[ "def", "read_lcc_csvlc", "(", "lcfile", ")", ":", "# read in the file and split by lines", "if", "'.gz'", "in", "os", ".", "path", ".", "basename", "(", "lcfile", ")", ":", "infd", "=", "gzip", ".", "open", "(", "lcfile", ",", "'rb'", ")", "else", ":", "...
2922a14619d183fb28005fa7d02027ac436f2265
valid
describe_lcc_csv
This describes the LCC CSV format light curve file. Parameters ---------- lcdict : dict The input lcdict to parse for column and metadata info. returndesc : bool If True, returns the description string as an str instead of just printing it to stdout. Returns ------- ...
astrobase/hatsurveys/hatlc.py
def describe_lcc_csv(lcdict, returndesc=False): ''' This describes the LCC CSV format light curve file. Parameters ---------- lcdict : dict The input lcdict to parse for column and metadata info. returndesc : bool If True, returns the description string as an str instead of ju...
def describe_lcc_csv(lcdict, returndesc=False): ''' This describes the LCC CSV format light curve file. Parameters ---------- lcdict : dict The input lcdict to parse for column and metadata info. returndesc : bool If True, returns the description string as an str instead of ju...
[ "This", "describes", "the", "LCC", "CSV", "format", "light", "curve", "file", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1303-L1369
[ "def", "describe_lcc_csv", "(", "lcdict", ",", "returndesc", "=", "False", ")", ":", "metadata_lines", "=", "[", "]", "coldef_lines", "=", "[", "]", "if", "'lcformat'", "in", "lcdict", "and", "'lcc-csv'", "in", "lcdict", "[", "'lcformat'", "]", ".", "lower...
2922a14619d183fb28005fa7d02027ac436f2265
valid
read_csvlc
This reads a HAT data server or LCC-Server produced CSV light curve into an lcdict. This will automatically figure out the format of the file provided. Currently, it can read: - legacy HAT data server CSV LCs (e.g. from https://hatsouth.org/planets/lightcurves.html) with an extension of the ...
astrobase/hatsurveys/hatlc.py
def read_csvlc(lcfile): '''This reads a HAT data server or LCC-Server produced CSV light curve into an lcdict. This will automatically figure out the format of the file provided. Currently, it can read: - legacy HAT data server CSV LCs (e.g. from https://hatsouth.org/planets/lightcurves.html...
def read_csvlc(lcfile): '''This reads a HAT data server or LCC-Server produced CSV light curve into an lcdict. This will automatically figure out the format of the file provided. Currently, it can read: - legacy HAT data server CSV LCs (e.g. from https://hatsouth.org/planets/lightcurves.html...
[ "This", "reads", "a", "HAT", "data", "server", "or", "LCC", "-", "Server", "produced", "CSV", "light", "curve", "into", "an", "lcdict", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1377-L1459
[ "def", "read_csvlc", "(", "lcfile", ")", ":", "# read in the file and split by lines", "if", "'.gz'", "in", "os", ".", "path", ".", "basename", "(", "lcfile", ")", ":", "LOGINFO", "(", "'reading gzipped HATLC: %s'", "%", "lcfile", ")", "infd", "=", "gzip", "."...
2922a14619d183fb28005fa7d02027ac436f2265
valid
find_lc_timegroups
This finds the time gaps in the light curve, so we can figure out which times are for consecutive observations and which represent gaps between seasons. Parameters ---------- lctimes : np.array This is the input array of times, assumed to be in some form of JD. mingap : float ...
astrobase/hatsurveys/hatlc.py
def find_lc_timegroups(lctimes, mingap=4.0): '''This finds the time gaps in the light curve, so we can figure out which times are for consecutive observations and which represent gaps between seasons. Parameters ---------- lctimes : np.array This is the input array of times, assumed to...
def find_lc_timegroups(lctimes, mingap=4.0): '''This finds the time gaps in the light curve, so we can figure out which times are for consecutive observations and which represent gaps between seasons. Parameters ---------- lctimes : np.array This is the input array of times, assumed to...
[ "This", "finds", "the", "time", "gaps", "in", "the", "light", "curve", "so", "we", "can", "figure", "out", "which", "times", "are", "for", "consecutive", "observations", "and", "which", "represent", "gaps", "between", "seasons", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1467-L1521
[ "def", "find_lc_timegroups", "(", "lctimes", ",", "mingap", "=", "4.0", ")", ":", "lc_time_diffs", "=", "[", "(", "lctimes", "[", "x", "]", "-", "lctimes", "[", "x", "-", "1", "]", ")", "for", "x", "in", "range", "(", "1", ",", "len", "(", "lctim...
2922a14619d183fb28005fa7d02027ac436f2265
valid
normalize_lcdict
This normalizes magcols in `lcdict` using `timecol` to find timegroups. Parameters ---------- lcdict : dict The input lcdict to process. timecol : str The key in the lcdict that is to be used to extract the time column. magcols : 'all' or list of str If this is 'all', all...
astrobase/hatsurveys/hatlc.py
def normalize_lcdict(lcdict, timecol='rjd', magcols='all', mingap=4.0, normto='sdssr', debugmode=False, quiet=False): '''This normalizes magcols in `lcdict` using `timecol` to find timegroup...
def normalize_lcdict(lcdict, timecol='rjd', magcols='all', mingap=4.0, normto='sdssr', debugmode=False, quiet=False): '''This normalizes magcols in `lcdict` using `timecol` to find timegroup...
[ "This", "normalizes", "magcols", "in", "lcdict", "using", "timecol", "to", "find", "timegroups", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1525-L1718
[ "def", "normalize_lcdict", "(", "lcdict", ",", "timecol", "=", "'rjd'", ",", "magcols", "=", "'all'", ",", "mingap", "=", "4.0", ",", "normto", "=", "'sdssr'", ",", "debugmode", "=", "False", ",", "quiet", "=", "False", ")", ":", "# check if this lc has be...
2922a14619d183fb28005fa7d02027ac436f2265
valid
normalize_lcdict_byinst
This is a function to normalize light curves across all instrument combinations present. Use this to normalize a light curve containing a variety of: - HAT station IDs ('stf') - camera IDs ('ccd') - filters ('flt') - observed field names ('fld') - HAT project IDs ('prj') - exposure tim...
astrobase/hatsurveys/hatlc.py
def normalize_lcdict_byinst( lcdict, magcols='all', normto='sdssr', normkeylist=('stf','ccd','flt','fld','prj','exp'), debugmode=False, quiet=False ): '''This is a function to normalize light curves across all instrument combinations present. Use this to norm...
def normalize_lcdict_byinst( lcdict, magcols='all', normto='sdssr', normkeylist=('stf','ccd','flt','fld','prj','exp'), debugmode=False, quiet=False ): '''This is a function to normalize light curves across all instrument combinations present. Use this to norm...
[ "This", "is", "a", "function", "to", "normalize", "light", "curves", "across", "all", "instrument", "combinations", "present", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1722-L1925
[ "def", "normalize_lcdict_byinst", "(", "lcdict", ",", "magcols", "=", "'all'", ",", "normto", "=", "'sdssr'", ",", "normkeylist", "=", "(", "'stf'", ",", "'ccd'", ",", "'flt'", ",", "'fld'", ",", "'prj'", ",", "'exp'", ")", ",", "debugmode", "=", "False"...
2922a14619d183fb28005fa7d02027ac436f2265
valid
main
This is called when we're executed from the commandline. The current usage from the command-line is described below:: usage: hatlc [-h] [--describe] hatlcfile read a HAT LC of any format and output to stdout positional arguments: hatlcfile path to the light curve you want to ...
astrobase/hatsurveys/hatlc.py
def main(): ''' This is called when we're executed from the commandline. The current usage from the command-line is described below:: usage: hatlc [-h] [--describe] hatlcfile read a HAT LC of any format and output to stdout positional arguments: hatlcfile path to the ...
def main(): ''' This is called when we're executed from the commandline. The current usage from the command-line is described below:: usage: hatlc [-h] [--describe] hatlcfile read a HAT LC of any format and output to stdout positional arguments: hatlcfile path to the ...
[ "This", "is", "called", "when", "we", "re", "executed", "from", "the", "commandline", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/hatsurveys/hatlc.py#L1929-L2031
[ "def", "main", "(", ")", ":", "# handle SIGPIPE sent by less, head, et al.", "import", "signal", "signal", ".", "signal", "(", "signal", ".", "SIGPIPE", ",", "signal", ".", "SIG_DFL", ")", "import", "argparse", "aparser", "=", "argparse", ".", "ArgumentParser", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
coord_features
Calculates object coordinates features, including: - galactic coordinates - total proper motion from pmra, pmdecl - reduced J proper motion from propermotion and Jmag Parameters ---------- objectinfo : dict This is an objectinfo dict from a light curve file read into an `lcdic...
astrobase/varclass/starfeatures.py
def coord_features(objectinfo): '''Calculates object coordinates features, including: - galactic coordinates - total proper motion from pmra, pmdecl - reduced J proper motion from propermotion and Jmag Parameters ---------- objectinfo : dict This is an objectinfo dict from a ligh...
def coord_features(objectinfo): '''Calculates object coordinates features, including: - galactic coordinates - total proper motion from pmra, pmdecl - reduced J proper motion from propermotion and Jmag Parameters ---------- objectinfo : dict This is an objectinfo dict from a ligh...
[ "Calculates", "object", "coordinates", "features", "including", ":" ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/starfeatures.py#L102-L174
[ "def", "coord_features", "(", "objectinfo", ")", ":", "retdict", "=", "{", "'propermotion'", ":", "np", ".", "nan", ",", "'gl'", ":", "np", ".", "nan", ",", "'gb'", ":", "np", ".", "nan", ",", "'rpmj'", ":", "np", ".", "nan", "}", "if", "(", "'ra...
2922a14619d183fb28005fa7d02027ac436f2265
valid
color_features
Stellar colors and dereddened stellar colors using 2MASS DUST API: http://irsa.ipac.caltech.edu/applications/DUST/docs/dustProgramInterface.html Parameters ---------- in_objectinfo : dict This is a dict that contains the object's magnitudes and positions. This requires at least 'ra', ...
astrobase/varclass/starfeatures.py
def color_features(in_objectinfo, deredden=True, custom_bandpasses=None, dust_timeout=10.0): '''Stellar colors and dereddened stellar colors using 2MASS DUST API: http://irsa.ipac.caltech.edu/applications/DUST/docs/dustProgramInterface.html Paramete...
def color_features(in_objectinfo, deredden=True, custom_bandpasses=None, dust_timeout=10.0): '''Stellar colors and dereddened stellar colors using 2MASS DUST API: http://irsa.ipac.caltech.edu/applications/DUST/docs/dustProgramInterface.html Paramete...
[ "Stellar", "colors", "and", "dereddened", "stellar", "colors", "using", "2MASS", "DUST", "API", ":" ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/starfeatures.py#L324-L723
[ "def", "color_features", "(", "in_objectinfo", ",", "deredden", "=", "True", ",", "custom_bandpasses", "=", "None", ",", "dust_timeout", "=", "10.0", ")", ":", "objectinfo", "=", "in_objectinfo", ".", "copy", "(", ")", "# this is the initial output dict", "outdict...
2922a14619d183fb28005fa7d02027ac436f2265
valid
mdwarf_subtype_from_sdsscolor
This calculates the M-dwarf subtype given SDSS `r-i` and `i-z` colors. Parameters ---------- ri_color : float The SDSS `r-i` color of the object. iz_color : float The SDSS `i-z` color of the object. Returns ------- (subtype, index1, index2) : tuple `subtype`: if ...
astrobase/varclass/starfeatures.py
def mdwarf_subtype_from_sdsscolor(ri_color, iz_color): '''This calculates the M-dwarf subtype given SDSS `r-i` and `i-z` colors. Parameters ---------- ri_color : float The SDSS `r-i` color of the object. iz_color : float The SDSS `i-z` color of the object. Returns -------...
def mdwarf_subtype_from_sdsscolor(ri_color, iz_color): '''This calculates the M-dwarf subtype given SDSS `r-i` and `i-z` colors. Parameters ---------- ri_color : float The SDSS `r-i` color of the object. iz_color : float The SDSS `i-z` color of the object. Returns -------...
[ "This", "calculates", "the", "M", "-", "dwarf", "subtype", "given", "SDSS", "r", "-", "i", "and", "i", "-", "z", "colors", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/starfeatures.py#L727-L800
[ "def", "mdwarf_subtype_from_sdsscolor", "(", "ri_color", ",", "iz_color", ")", ":", "# calculate the spectral type index and the spectral type spread of the", "# object. sti is calculated by fitting a line to the locus in r-i and i-z", "# space for M dwarfs in West+ 2007", "if", "np", ".",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
color_classification
This calculates rough star type classifications based on star colors in the ugrizJHK bands. Uses the output from `color_features` and `coord_features`. By default, `color_features` will use dereddened colors, as are expected by most relations here. Based on the color cuts from: - SDSS SEGUE (...
astrobase/varclass/starfeatures.py
def color_classification(colorfeatures, pmfeatures): '''This calculates rough star type classifications based on star colors in the ugrizJHK bands. Uses the output from `color_features` and `coord_features`. By default, `color_features` will use dereddened colors, as are expected by most relations ...
def color_classification(colorfeatures, pmfeatures): '''This calculates rough star type classifications based on star colors in the ugrizJHK bands. Uses the output from `color_features` and `coord_features`. By default, `color_features` will use dereddened colors, as are expected by most relations ...
[ "This", "calculates", "rough", "star", "type", "classifications", "based", "on", "star", "colors", "in", "the", "ugrizJHK", "bands", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/starfeatures.py#L804-L1110
[ "def", "color_classification", "(", "colorfeatures", ",", "pmfeatures", ")", ":", "possible_classes", "=", "[", "]", "if", "not", "colorfeatures", ":", "return", "possible_classes", "if", "not", "pmfeatures", ":", "return", "possible_classes", "# dered mags", "if", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
neighbor_gaia_features
Gets several neighbor, GAIA, and SIMBAD features: From the KD-Tree in the given light curve catalog the object is in: `lclist_kdtree`: - distance to closest neighbor in arcsec - total number of all neighbors within 2 x `neighbor_radius_arcsec` From the GAIA DR2 catalog: - distance to closest...
astrobase/varclass/starfeatures.py
def neighbor_gaia_features(objectinfo, lclist_kdtree, neighbor_radius_arcsec, gaia_matchdist_arcsec=3.0, verbose=True, gaia_submit_timeout=10.0, gaia_submit_t...
def neighbor_gaia_features(objectinfo, lclist_kdtree, neighbor_radius_arcsec, gaia_matchdist_arcsec=3.0, verbose=True, gaia_submit_timeout=10.0, gaia_submit_t...
[ "Gets", "several", "neighbor", "GAIA", "and", "SIMBAD", "features", ":" ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/varclass/starfeatures.py#L1114-L1709
[ "def", "neighbor_gaia_features", "(", "objectinfo", ",", "lclist_kdtree", ",", "neighbor_radius_arcsec", ",", "gaia_matchdist_arcsec", "=", "3.0", ",", "verbose", "=", "True", ",", "gaia_submit_timeout", "=", "10.0", ",", "gaia_submit_tries", "=", "3", ",", "gaia_ma...
2922a14619d183fb28005fa7d02027ac436f2265
valid
apply_epd_magseries
This applies external parameter decorrelation (EPD) to a light curve. Parameters ---------- lcfile : str The filename of the light curve file to process. timecol,magcol,errcol : str The keys in the lcdict produced by your light curve reader function that correspond to the time...
astrobase/lcproc/epd.py
def apply_epd_magseries(lcfile, timecol, magcol, errcol, externalparams, lcformat='hat-sql', lcformatdir=None, epdsmooth_sigclip=3.0, ...
def apply_epd_magseries(lcfile, timecol, magcol, errcol, externalparams, lcformat='hat-sql', lcformatdir=None, epdsmooth_sigclip=3.0, ...
[ "This", "applies", "external", "parameter", "decorrelation", "(", "EPD", ")", "to", "a", "light", "curve", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/epd.py#L84-L280
[ "def", "apply_epd_magseries", "(", "lcfile", ",", "timecol", ",", "magcol", ",", "errcol", ",", "externalparams", ",", "lcformat", "=", "'hat-sql'", ",", "lcformatdir", "=", "None", ",", "epdsmooth_sigclip", "=", "3.0", ",", "epdsmooth_windowsize", "=", "21", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
parallel_epd_worker
This is a parallel worker for the function below. Parameters ---------- task : tuple - task[0] = lcfile - task[1] = timecol - task[2] = magcol - task[3] = errcol - task[4] = externalparams - task[5] = lcformat - task[6] = lcformatdir - task[7...
astrobase/lcproc/epd.py
def parallel_epd_worker(task): '''This is a parallel worker for the function below. Parameters ---------- task : tuple - task[0] = lcfile - task[1] = timecol - task[2] = magcol - task[3] = errcol - task[4] = externalparams - task[5] = lcformat - ...
def parallel_epd_worker(task): '''This is a parallel worker for the function below. Parameters ---------- task : tuple - task[0] = lcfile - task[1] = timecol - task[2] = magcol - task[3] = errcol - task[4] = externalparams - task[5] = lcformat - ...
[ "This", "is", "a", "parallel", "worker", "for", "the", "function", "below", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/epd.py#L284-L340
[ "def", "parallel_epd_worker", "(", "task", ")", ":", "(", "lcfile", ",", "timecol", ",", "magcol", ",", "errcol", ",", "externalparams", ",", "lcformat", ",", "lcformatdir", ",", "magsarefluxes", ",", "epdsmooth_sigclip", ",", "epdsmooth_windowsize", ",", "epdsm...
2922a14619d183fb28005fa7d02027ac436f2265
valid
parallel_epd_lclist
This applies EPD in parallel to all LCs in the input list. Parameters ---------- lclist : list of str This is the list of light curve files to run EPD on. externalparams : dict or None This is a dict that indicates which keys in the lcdict obtained from the lcfile correspond t...
astrobase/lcproc/epd.py
def parallel_epd_lclist(lclist, externalparams, timecols=None, magcols=None, errcols=None, lcformat='hat-sql', lcformatdir=None, epdsmooth_sigclip=3.0, ...
def parallel_epd_lclist(lclist, externalparams, timecols=None, magcols=None, errcols=None, lcformat='hat-sql', lcformatdir=None, epdsmooth_sigclip=3.0, ...
[ "This", "applies", "EPD", "in", "parallel", "to", "all", "LCs", "in", "the", "input", "list", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/epd.py#L344-L510
[ "def", "parallel_epd_lclist", "(", "lclist", ",", "externalparams", ",", "timecols", "=", "None", ",", "magcols", "=", "None", ",", "errcols", "=", "None", ",", "lcformat", "=", "'hat-sql'", ",", "lcformatdir", "=", "None", ",", "epdsmooth_sigclip", "=", "3....
2922a14619d183fb28005fa7d02027ac436f2265
valid
parallel_epd_lcdir
This applies EPD in parallel to all LCs in a directory. Parameters ---------- lcdir : str The light curve directory to process. externalparams : dict or None This is a dict that indicates which keys in the lcdict obtained from the lcfile correspond to the required external par...
astrobase/lcproc/epd.py
def parallel_epd_lcdir( lcdir, externalparams, lcfileglob=None, timecols=None, magcols=None, errcols=None, lcformat='hat-sql', lcformatdir=None, epdsmooth_sigclip=3.0, epdsmooth_windowsize=21, epdsmooth_func=smooth_magseries_savgol,...
def parallel_epd_lcdir( lcdir, externalparams, lcfileglob=None, timecols=None, magcols=None, errcols=None, lcformat='hat-sql', lcformatdir=None, epdsmooth_sigclip=3.0, epdsmooth_windowsize=21, epdsmooth_func=smooth_magseries_savgol,...
[ "This", "applies", "EPD", "in", "parallel", "to", "all", "LCs", "in", "a", "directory", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/lcproc/epd.py#L514-L678
[ "def", "parallel_epd_lcdir", "(", "lcdir", ",", "externalparams", ",", "lcfileglob", "=", "None", ",", "timecols", "=", "None", ",", "magcols", "=", "None", ",", "errcols", "=", "None", ",", "lcformat", "=", "'hat-sql'", ",", "lcformatdir", "=", "None", ",...
2922a14619d183fb28005fa7d02027ac436f2265
valid
bls_serial_pfind
Runs the Box Least Squares Fitting Search for transit-shaped signals. Based on the version of BLS in Astropy 3.1: `astropy.stats.BoxLeastSquares`. If you don't have Astropy 3.1, this module will fail to import. Note that by default, this implementation of `bls_serial_pfind` doesn't use the `.autoperiod...
astrobase/periodbase/abls.py
def bls_serial_pfind(times, mags, errs, magsarefluxes=False, startp=0.1, # search from 0.1 d to... endp=100.0, # ... 100.0 d -- don't search full timebase stepsize=5.0e-4, mintransitduration=0.01, # minimum trans...
def bls_serial_pfind(times, mags, errs, magsarefluxes=False, startp=0.1, # search from 0.1 d to... endp=100.0, # ... 100.0 d -- don't search full timebase stepsize=5.0e-4, mintransitduration=0.01, # minimum trans...
[ "Runs", "the", "Box", "Least", "Squares", "Fitting", "Search", "for", "transit", "-", "shaped", "signals", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/abls.py#L75-L601
[ "def", "bls_serial_pfind", "(", "times", ",", "mags", ",", "errs", ",", "magsarefluxes", "=", "False", ",", "startp", "=", "0.1", ",", "# search from 0.1 d to...", "endp", "=", "100.0", ",", "# ... 100.0 d -- don't search full timebase", "stepsize", "=", "5.0e-4", ...
2922a14619d183fb28005fa7d02027ac436f2265
valid
_parallel_bls_worker
This wraps Astropy's BoxLeastSquares for use with bls_parallel_pfind below. `task` is a tuple:: task[0] = times task[1] = mags task[2] = errs task[3] = magsarefluxes task[4] = minfreq task[5] = nfreq task[6] = stepsize task[7] = ndurations ...
astrobase/periodbase/abls.py
def _parallel_bls_worker(task): ''' This wraps Astropy's BoxLeastSquares for use with bls_parallel_pfind below. `task` is a tuple:: task[0] = times task[1] = mags task[2] = errs task[3] = magsarefluxes task[4] = minfreq task[5] = nfreq task[6] = ste...
def _parallel_bls_worker(task): ''' This wraps Astropy's BoxLeastSquares for use with bls_parallel_pfind below. `task` is a tuple:: task[0] = times task[1] = mags task[2] = errs task[3] = magsarefluxes task[4] = minfreq task[5] = nfreq task[6] = ste...
[ "This", "wraps", "Astropy", "s", "BoxLeastSquares", "for", "use", "with", "bls_parallel_pfind", "below", "." ]
waqasbhatti/astrobase
python
https://github.com/waqasbhatti/astrobase/blob/2922a14619d183fb28005fa7d02027ac436f2265/astrobase/periodbase/abls.py#L605-L691
[ "def", "_parallel_bls_worker", "(", "task", ")", ":", "try", ":", "times", ",", "mags", ",", "errs", "=", "task", "[", ":", "3", "]", "magsarefluxes", "=", "task", "[", "3", "]", "minfreq", ",", "nfreq", ",", "stepsize", "=", "task", "[", "4", ":",...
2922a14619d183fb28005fa7d02027ac436f2265