text stringlengths 81 112k |
|---|
Render HTML from Markdown file content.
def render(file):
"""Render HTML from Markdown file content."""
with file.open() as fp:
encoding = detect_encoding(fp, default='utf-8')
result = mistune.markdown(fp.read().decode(encoding))
return result |
Validate the length of a list.
:param value: List of values.
:raises: :class:`halogen.exception.ValidationError` exception when length of the list is less than
minimum or greater than maximum.
def validate(self, value):
"""Validate the length of a list.
:param value: List... |
Validate value.
:param value: Value which should be validated.
:raises: :class:`halogen.exception.ValidationError` exception when either if value less than min in case when
min is not None or if value greater than max in case when max is not None.
def validate(self, value):
"""Validat... |
This actually executes the calls registered in the ProxyArgumentParser.
:param proxy_parser: ProxyArgumentParser instance
:param real_parser: ArgumentParser instance
def __get_calls_from_parser(proxy_parser, real_parser):
"""
This actually executes the calls registered in the ProxyArgumentParser.
... |
This recursively converts ProxyArgumentParser instances to actual parsers.
Use case: defining subparsers with a parent
>>> [...]
>>> parser.add_argument(...) # argument common to all subparsers
>>> subparsers = parser.add_subparsers()
>>> subparsers.add_parser(..., parents=[parent])
... |
Initialization function ; sets up the arguments for the parser and creates a
logger to be inserted in the input dictionary of global variables from the
calling script.
:param glob: globals() instance from the calling script
:param sudo: if True, require sudo credentials and ... |
Function for validating group of arguments ; each argument is represented as
a 4-tuple like follows:
(argument_name, fail_condition, error_message, default)
- argument_name: the name of the argument like entered in add_argument()
- fail_condition: condition in Python code with the argumen... |
Calcualte mse between vector or matrix x and xhat
def mse(x, xhat):
""" Calcualte mse between vector or matrix x and xhat """
buf_ = x - xhat
np.square(buf_, out=buf_) # square in-place
sum_ = np.sum(buf_)
sum_ /= x.size # divide in-place
return sum_ |
Returns approximation of A of rank r in least-squares sense.
def low_rank_approximation(A, r):
""" Returns approximation of A of rank r in least-squares sense."""
try:
u, s, v = np.linalg.svd(A, full_matrices=False)
except np.linalg.LinAlgError as e:
print('Matrix:', A)
print('Matri... |
Computes sorted eigendecomposition of G.
:param G: Matrix
:param d: rank
:return factor: vector of square root d of eigenvalues (biggest to smallest).
:return u: matrix with colums equal to the normalized eigenvectors corresponding to sorted eigenvalues.
def eigendecomp(G, d):
"""
Compute... |
Returns the vector xhat closest to x in 2-norm, satisfying A.xhat =b.
:param x: vector
:param A, b: matrix and array characterizing the constraints on x (A.x = b)
:return x_hat: optimum angle vector, minimizing cost.
:return cost: least square error of xhat, x
:return constraints_error: mse of co... |
All of the comparators that can be used for arguments.
def build_comparators(*values_or_types):
'''
All of the comparators that can be used for arguments.
'''
comparators = []
for item in values_or_types:
if isinstance(item, Comparator):
comparators.append(item)
elif isi... |
create a changelog
def changelog(build):
""" create a changelog """
build.packages.install("gitchangelog")
changelog_text = subprocess.check_output(["gitchangelog", "HEAD...v0.2.9"])
with open(os.path.join(build.root, "CHANGELOG"), "wb+") as fh:
fh.write(changelog_text) |
Creates a ArgumentsExpectationRule and adds it to the expectation
def args(self, *args, **kwargs):
"""
Creates a ArgumentsExpectationRule and adds it to the expectation
"""
self._any_args = False
self._arguments_rule.set_args(*args, **kwargs)
return self |
Returns the value for this expectation or raises the proper exception.
def return_value(self):
"""
Returns the value for this expectation or raises the proper exception.
"""
if self._raises:
# Handle exceptions
if inspect.isclass(self._raises):
ra... |
Check the if these args match this expectation.
def match(self, *args, **kwargs):
"""
Check the if these args match this expectation.
"""
return self._any_args or \
self._arguments_rule.validate(*args, **kwargs) |
Load default record file factory.
def record_file_factory(self):
"""Load default record file factory."""
try:
get_distribution('invenio-records-files')
from invenio_records_files.utils import record_file_factory
default = record_file_factory
except Distributi... |
Register a previewer in the system.
def register_previewer(self, name, previewer):
"""Register a previewer in the system."""
if name in self.previewers:
assert name not in self.previewers, \
"Previewer with same name already registered"
self.previewers[name] = previe... |
Get previewers ordered by PREVIEWER_PREVIEWERS_ORDER.
def iter_previewers(self, previewers=None):
"""Get previewers ordered by PREVIEWER_PREVIEWERS_ORDER."""
if self.entry_point_group is not None:
self.load_entry_point_group(self.entry_point_group)
self.entry_point_group = None
... |
Flask application initialization.
def init_app(self, app, entry_point_group='invenio_previewer.previewers'):
"""Flask application initialization."""
self.init_config(app)
app.register_blueprint(blueprint)
state = _InvenioPreviewerState(
app,
entry_point_group=ent... |
Parse a 9 bytes packet in the Humidity format and return a
dictionary containing the data extracted. An example of a return value
would be:
.. code-block:: python
{
'id': "0x2EB2",
'packet_length': 8,
'packet_type': 81,
... |
Create a pipeline component from a factory.
name (unicode): Factory name to look up in `Language.factories`.
config (dict): Configuration parameters to initialise component.
RETURNS (callable): Pipeline component.
def create_tokenizer(self, name, config=dict()):
"""Create a pipeline co... |
Add error codes to string messages via class attribute names.
def add_codes(err_cls):
"""Add error codes to string messages via class attribute names."""
class ErrorsWithCodes(object):
def __getattribute__(self, code):
msg = getattr(err_cls, code)
return '[{code}] {msg}'.format(... |
message (unicode): The message to display.
category (Warning): The Warning to show.
def _warn(message, warn_type='user'):
"""
message (unicode): The message to display.
category (Warning): The Warning to show.
"""
w_id = message.split('[', 1)[1].split(']', 1)[0] # get ID from string
if war... |
Download compatible model from default download path using pip. Model
can be shortcut, model name or, if --direct flag is set, full model name
with version.
def download(model=None, direct=False, *pip_args):
"""
Download compatible model from default download path using pip. Model
can be shortcut, ... |
Create a symlink for models within the spacy/data directory. Accepts
either the name of a pip package, or the local path to the model data
directory. Linking models allows loading them via spacy.load(link_name).
def link(origin, link_name, force=False, model_path=None):
"""
Create a symlink for models ... |
Load a model from a data directory path. Creates Language class with
pipeline from meta.json and then calls from_disk() with path.
def load_model_from_path(model_path, meta=False, **overrides):
"""Load a model from a data directory path. Creates Language class with
pipeline from meta.json and then calls fr... |
Check if string maps to a package installed via pip.
name (unicode): Name of package.
RETURNS (bool): True if installed package, False if not.
def is_package(name):
"""Check if string maps to a package installed via pip.
name (unicode): Name of package.
RETURNS (bool): True if installed package, ... |
Yield an infinite series of linearly decaying values.
def decaying(start, stop, decay):
"""Yield an infinite series of linearly decaying values."""
def clip(value):
return max(value, stop) if (start > stop) else min(value, stop)
nr_upd = 1.
while True:
yield clip(start * 1./(1. + decay ... |
Open and load JSON from file.
location (Path): Path to JSON file.
RETURNS (dict): Loaded JSON content.
def read_json(location):
"""Open and load JSON from file.
location (Path): Path to JSON file.
RETURNS (dict): Loaded JSON content.
"""
location = ensure_path(location)
with location.... |
Get user input from the command line via raw_input / input.
description (unicode): Text to display before prompt.
default (unicode or False/None): Default value to display with prompt.
RETURNS (unicode): User input.
def get_raw_input(description, default=False):
"""Get user input from the command line... |
Print data in table format.
data (dict or list of tuples): Label/value pairs.
title (unicode or None): Title, will be printed above.
def print_table(data, title=None):
"""Print data in table format.
data (dict or list of tuples): Label/value pairs.
title (unicode or None): Title, will be printed ... |
Print data in GitHub-flavoured Markdown format for issues etc.
data (dict or list of tuples): Label/value pairs.
title (unicode or None): Title, will be rendered as headline 2.
def print_markdown(data, title=None):
"""Print data in GitHub-flavoured Markdown format for issues etc.
data (dict or list o... |
Print formatted message (manual ANSI escape sequences to avoid
dependency)
*texts (unicode): Texts to print. Each argument is rendered as paragraph.
**kwargs: 'title' becomes coloured headline. exits=True performs sys exit.
def prints(*texts, **kwargs):
"""Print formatted message (manual ANSI escape s... |
Wrap text at given width using textwrap module.
text (unicode): Text to wrap. If it's a Path, it's converted to string.
wrap_max (int): Maximum line length (indent is deducted).
indent (int): Number of spaces for indentation.
RETURNS (unicode): Wrapped text.
def _wrap(text, wrap_max=80, indent=4):
... |
Replace <, >, &, " with their HTML encoded representation. Intended to
prevent HTML errors in rendered displaCy markup.
text (unicode): The original text.
RETURNS (unicode): Equivalent text to be safely used within HTML.
def escape_html(text):
"""Replace <, >, &, " with their HTML encoded representati... |
Given a dictionary, make sure keys are unicode strings, not bytes.
def normalize_string_keys(old):
"""Given a dictionary, make sure keys are unicode strings, not bytes."""
new = {}
for key, value in old.items():
if isinstance(key, bytes_):
new[key.decode('utf8')] = value
else:
... |
Mangle non-supported characters, for savages with ascii terminals.
def locale_escape(string, errors='replace'):
'''
Mangle non-supported characters, for savages with ascii terminals.
'''
encoding = locale.getpreferredencoding()
string = string.encode(encoding, errors).decode('utf8')
return stri... |
Parses an incoming file handle as a CMU pronouncing dictionary file.
(Most end-users of this module won't need to call this function explicitly,
as it's called internally by the :func:`init_cmu` function.)
:param cmufh: a filehandle with CMUdict-formatted data
:returns: a list of 2-tuples pairing a wo... |
Initialize the module's pronunciation data.
This function is called automatically the first time you attempt to use
another function in the library that requires loading the pronunciation
data from disk. You can call this function manually to control when and
how the pronunciation data is loaded (e.g.,... |
Get the "rhyming part" of a string with CMUdict phones.
"Rhyming part" here means everything from the vowel in the stressed
syllable nearest the end of the word up to the end of the word.
.. doctest::
>>> import pronouncing
>>> phones = pronouncing.phones_for_word("purple")
>>> pr... |
Get words whose pronunciation matches a regular expression.
This function Searches the CMU dictionary for pronunciations matching a
given regular expression. (Word boundary anchors are automatically added
before and after the pattern.)
.. doctest::
>>> import pronouncing
>>> 'interpol... |
Get words whose stress pattern matches a regular expression.
This function is a special case of :func:`search` that searches only the
stress patterns of each pronunciation in the dictionary. You can get
stress patterns for a word using the :func:`stresses_for_word` function.
.. doctest::
>>> ... |
Get words rhyming with a given word.
This function may return an empty list if no rhyming words are found in
the dictionary, or if the word you pass to the function is itself not
found in the dictionary.
.. doctest::
>>> import pronouncing
>>> pronouncing.rhymes("conditioner")
... |
Set the default values on the ds9 display.
def set_ds9(self, level="PREF"):
"""
Set the default values on the ds9 display.
"""
self.set_zoom()
ds9_settings = config.read("DS9."+level)
for key in ds9_settings.keys():
value = ds9_settings[key]
cmd =... |
Do a query of the CADC Megacam table.
Get all observations inside the box (right now it turns width/height into a radius, should not do this).
@rtype : Table
@param ra_deg: center of search region, in degrees
@param dec_deg: center of search region in degrees
@param width: width of search region i... |
Ensure that the size of the dimension matches the number of bands in the
scale
Raises:
ValueError: when the dimension size and number of bands don't match
def validate(self, size):
"""
Ensure that the size of the dimension matches the number of bands in the
scale
... |
Create a basic processing pipeline that can resample all incoming audio
to a normalized sampling rate for downstream processing, and store a
convenient, compressed version for playback
:param chunksize_bytes: The number of bytes from the raw stream to process
at once
:param resample_to: The new, no... |
Produce a base class suitable as a starting point for many audio processing
pipelines. This class resamples all audio to a common sampling rate, and
produces a bark band spectrogram from overlapping short-time fourier
transform frames. It also compresses the audio into ogg vorbis format for
compact st... |
Produce a mixin class that extracts onsets
:param fft_feature: The short-time fourier transform feature
:return: A mixin class that extracts onsets
def with_onsets(fft_feature):
"""
Produce a mixin class that extracts onsets
:param fft_feature: The short-time fourier transform feature
:return: ... |
Shift fields from the discovery set to the requested date by the average motion of L7 kbos in the discovery field.
:param ras:
:param decs:
:param plot:
:param ax:
:param kbos: precomputed at the discovery date for that block. e.g. Oct new moon for 13B
:param date:
:param names:
:param e... |
For a given field, calculate the solar elongation at the given date.
:param ra: field's right ascension. unit="h" format="RAh:RAm:RAs"
:param dec: field's declination. degrees
:param date: date at which to calculate elongation
:return: elongation from the Sun in degrees
def field_elongation(ra, dec, ... |
Convert string value to timedelta instance according to the given format.
If format not set function tries to load timedelta using default
``TIMEDELTA_FORMAT`` and then both of magic "full" formats.
You should also specify list of formats and function tries to convert
to timedelta using each of format... |
r"""Compute the arithmetic mean for timedeltas list.
:param \*values: Timedelta instances to process.
def timedelta_average(*values: datetime.timedelta) -> datetime.timedelta:
r"""Compute the arithmetic mean for timedeltas list.
:param \*values: Timedelta instances to process.
"""
if isinstance(v... |
Implement divison for timedelta instances.
:param first: First timedelta instance.
:param second: Second timedelta instance.
def timedelta_div(first: datetime.timedelta,
second: datetime.timedelta) -> Optional[float]:
"""Implement divison for timedelta instances.
:param first: First... |
Return full number of seconds from timedelta.
By default, Python returns only one day seconds, not all timedelta seconds.
:param value: Timedelta instance.
def timedelta_seconds(value: datetime.timedelta) -> int:
"""Return full number of seconds from timedelta.
By default, Python returns only one da... |
Display the timedelta formatted according to the given string.
You should use global setting ``TIMEDELTA_FORMAT`` to specify default
format to this function there (like ``DATE_FORMAT`` for builtin ``date``
template filter).
Default value for ``TIMEDELTA_FORMAT`` is ``'G:i'``.
Format uses the same... |
Create a 'shifts' file that transforms the space/flux/time scale of all images to the first image.
This function relies on the .fwhm, .trans.jmp, .phot and .zeropoint.used files for inputs.
The scaling we are computing here is for use in planting sources into the image at the same sky/flux locations
while ... |
How should the values in range be sampled, uniformly or via some function.
:return:
def dist(self):
"""
How should the values in range be sampled, uniformly or via some function.
:return:
"""
if self.func is None:
return random.uniform(self.min, self.max)
... |
:return: a set of values that can be used for an planted object builder.
def next(self):
"""
:return: a set of values that can be used for an planted object builder.
"""
# x y mag pix rate angle ''/h rate id
# 912.48 991.06 22.01 ... |
Send command to foscam.
def send_command(self, cmd, params=None, raw=False):
'''
Send command to foscam.
'''
paramstr = ''
if params:
paramstr = urlencode(params)
paramstr = '&' + paramstr if paramstr else ''
cmdurl = 'http://%s/cgi-bin/CGIProxy.f... |
Execute a command and return a parsed response.
def execute_command(self, cmd, params=None, callback=None, raw=False):
'''
Execute a command and return a parsed response.
'''
def execute_with_callbacks(cmd, params=None, callback=None, raw=False):
code, params = self.send_com... |
isDHCP: 0(False), 1(True)
System will reboot automatically to take effect after call this CGI command.
def set_ip_info(self, is_dhcp, ip='', gate='', mask='',
dns1='', dns2='', callback=None):
'''
isDHCP: 0(False), 1(True)
System will reboot automatically... |
Set http port and media port of camera.
def set_port_info(self, webport, mediaport, httpsport,
onvifport, callback=None):
'''
Set http port and media port of camera.
'''
params = {'webPort' : webport,
'mediaPort' : mediaport,
... |
Get the aps around after refreshWifiList.
Note: Only 10 aps will be returned one time.
def get_wifi_list(self, startno, callback=None):
'''
Get the aps around after refreshWifiList.
Note: Only 10 aps will be returned one time.
'''
params = {'startNo': startno}
re... |
Set wifi config.
Camera will not connect to AP unless you enject your cable.
def set_wifi_setting(self, ssid, psk, isenable, isusewifi, nettype,
encryptype, authmode, keyformat, defaultkey,
key1='', key2='', key3='', key4='',
k... |
Set UPnP config
def set_upnp_config(self, isenable, callback=None):
'''
Set UPnP config
'''
params = {'isEnable': isenable}
return self.execute_command('setUPnPConfig', params, callback=callback) |
Set DDNS config.
def set_ddns_config(self, isenable, hostname, ddnsserver,
user, password, callback=None):
'''
Set DDNS config.
'''
params = {'isEnable': isenable,
'hostName': hostname,
'ddnsServer': ddnsserver,... |
Set the stream fromat of sub stream.
Supported format: (1) H264 : 0
(2) MotionJpeg 1
def set_sub_video_stream_type(self, format, callback=None):
'''
Set the stream fromat of sub stream.
Supported format: (1) H264 : 0
(2) MotionJpeg 1
... |
Set the stream fromat of sub stream????
def set_sub_stream_format(self, format, callback=None):
'''
Set the stream fromat of sub stream????
'''
params = {'format': format}
return self.execute_command('setSubStreamFormat',
params, callback=... |
Set the stream type of main stream
def set_main_video_stream_type(self, streamtype, callback=None):
'''
Set the stream type of main stream
'''
params = {'streamType': streamtype}
return self.execute_command('setMainVideoStreamType',
params... |
Set the video stream param of stream N
streamtype(0~3): Stream N.
resolution(0~4): 0 720P,
1 VGA(640*480),
2 VGA(640*360),
3 QVGA(320*240),
4 QVGA(320*180).
bitrate: Bit rate of stream type N(2048... |
Mirror video
``is_mirror``: 0 not mirror, 1 mirror
def mirror_video(self, is_mirror, callback=None):
'''
Mirror video
``is_mirror``: 0 not mirror, 1 mirror
'''
params = {'isMirror': is_mirror}
return self.execute_command('mirrorVideo', params, callback=callback) |
Flip video
``is_flip``: 0 Not flip, 1 Flip
def flip_video(self, is_flip, callback=None):
'''
Flip video
``is_flip``: 0 Not flip, 1 Flip
'''
params = {'isFlip': is_flip }
return self.execute_command('flipVideo', params, callback=callback) |
Change user name.
def change_user_name(self, usrname, newusrname, callback=None):
'''
Change user name.
'''
params = {'usrName': usrname,
'newUsrName': newusrname,
}
return self.execute_command('changeUserName', params, callback=callback) |
Change password.
def change_password(self, usrname, oldpwd, newpwd, callback=None):
'''
Change password.
'''
params = {'usrName': usrname,
'oldPwd' : oldpwd,
'newPwd' : newpwd,
}
return self.execute_command('changePassword',
... |
Set systeim time
def set_system_time(self, time_source, ntp_server, date_format,
time_format, time_zone, is_dst, dst, year,
mon, day, hour, minute, sec, callback=None):
'''
Set systeim time
'''
if ntp_server not in ['time.nist.gov',
... |
Set camera name
def set_dev_name(self, devname, callback=None):
'''
Set camera name
'''
params = {'devName': devname.encode('gbk')}
return self.execute_command('setDevName', params, callback=callback) |
Set Infrared LED configuration
cmd: setInfraLedConfig
mode(0,1): 0=Auto mode, 1=Manual mode
def set_infra_led_config(self, mode, callback=None):
'''
Set Infrared LED configuration
cmd: setInfraLedConfig
mode(0,1): 0=Auto mode, 1=Manual mode
'''
params = {... |
Move to preset.
def ptz_goto_preset(self, name, callback=None):
'''
Move to preset.
'''
params = {'name': name}
return self.execute_command('ptzGotoPresetPoint', params, callback=callback) |
Get the current config and set the motion detection on or off
def set_motion_detection(self, enabled=1):
'''
Get the current config and set the motion detection on or off
'''
result, current_config = self.get_motion_detect_config()
if result != FOSCAM_SUCCESS:
return... |
Get the current config and set the motion detection on or off
def set_motion_detection1(self, enabled=1):
'''
Get the current config and set the motion detection on or off
'''
result, current_config = self.get_motion_detect_config1()
if result != FOSCAM_SUCCESS:
retu... |
Set alarm record config
Return: set result(0-success, -1-error)
def set_alarm_record_config(self, is_enable_prerecord=1,
prerecord_secs=5, alarm_record_secs=300, callback=None):
'''
Set alarm record config
Return: set result(0-success, -1-error)
'... |
Set local alarm-record config
`is_enable_local_alarm_record`: 0 disable, 1 enable
def set_local_alarm_record_config(self, is_enable_local_alarm_record = 1,
local_alarm_record_secs = 30, callback=None):
'''
Set local alarm-record config
`is_enable_lo... |
Set frame shipping reference mode of H264 encode stream.
params:
`mode`: see docstr of meth::get_h264_frm_ref_mode
def set_h264_frm_ref_mode(self, mode=1, callback=None):
'''
Set frame shipping reference mode of H264 encode stream.
params:
`mode`: see docstr of m... |
Set schedule record config.
cmd: setScheduleRecordConfig
args: See docstring of meth::get_schedule_record_config
def set_schedule_record_config(self, is_enable, record_level,
space_full_mode, is_enable_audio,
schedule0 = 0, schedule1... |
Set Record path: sd/ftp
cmd: setRecordPath
param:
path: (0,SD), (2, FTP)
def set_record_path(self, path, callback=None):
'''
Set Record path: sd/ftp
cmd: setRecordPath
param:
path: (0,SD), (2, FTP)
'''
params = {'Path': path}
... |
Retrieve log records from camera.
cmd: getLog
param:
offset: log offset for first record
count: number of records to return
def get_log(self, offset, count=10, callback=None):
'''
Retrieve log records from camera.
cmd: getLog
param:
offse... |
retrieve the aperture correction for this exposure
@param expnum:
@param ccd:
@param version:
@param prefix:
@return:
def get_apcor(expnum, ccd, version='p', prefix=None):
"""
retrieve the aperture correction for this exposure
@param expnum:
@param ccd:
@param version:
@para... |
Do a QUERY on the TAP service for all observations that are part of OSSOS (*P05/*P016)
where taken after mjd and have calibration 'observable'.
@param ra: RA center of search cont
@type ra: Quantity
@param dec: float degrees
@type dec: Quantity
@param dra: float degrees
@type dra: Quantity
... |
Given a dataset_name created the desired dbimages directories
and links to the raw data files stored at CADC.
@param dataset_name: the name of the CFHT dataset to make a link to.
@param data_web_servica_url: the URL of the data web service run by CADC.
def populate(dataset_name, data_web_service_url=DATA_W... |
return the nominal URI for a candidate file.
@param field: the OSSOS field name
@param ccd: which CCD are the candidates on
@param version: either the 'p', or 's' (scrambled) candidates.
@param ext: Perhaps we'll change this one day.
@param prefix: if this is a 'fake' dataset then add 'fk'
@par... |
Build the uri for an OSSOS image stored in the dbimages
containerNode.
:rtype : basestring
expnum: CFHT exposure number
ccd: CCD in the mosaic [0-35]
version: one of p,s,o etc.
dbimages: dbimages containerNode.
@type subdir: str
@param expnum: int
@param ccd:
@param version:
... |
given a key, return the vospace tag value.
@param expnum: Number of the CFHT exposure that a tag value is needed for
@param key: The process tag (such as mkpsf_00) that is being looked up.
@return: the value of the tag
@rtype: str
def get_tag(expnum, key):
"""given a key, return the vospace tag va... |
make a process tag have a suffix indicating which ccd its for.
@param program: Name of the process that a tag is built for.
@param ccd: the CCD number that this process ran on.
@param version: The version of the exposure (s, p, o) that the process ran on.
@return: The string that represents the processi... |
Report back status of the given program by looking up the associated VOSpace annotation.
@param task: name of the process or task that will be checked.
@param prefix: prefix of the file that was processed (often fk or None)
@param expnum: which exposure number (or base filename)
@param version: which ... |
set the processing status of the given program.
@param task: name of the processing task
@param prefix: was there a prefix on the exposure number processed?
@param expnum: exposure number processed.
@param version: which version of the exposure? (p, s, o)
@param ccd: the number of the CCD processing... |
Get a cutout from an exposure based on the RA/DEC location.
@param observation: The Observation object that contains the expusre number information.
@type observation: Observation
@param sky_coord: which RA/DEC is needed,
@type sky_coord: SkyCoord
@param radius:
@type radius: Quantity
@retu... |
Given a standard OSSOS frameid return the expnum, version and ccdnum as a dictionary.
def frame2expnum(frameid):
"""Given a standard OSSOS frameid return the expnum, version and ccdnum as a dictionary."""
result = {}
parts = re.search('(?P<expnum>\d{7})(?P<type>\S)(?P<ccd>\d\d)', frameid)
assert parts ... |
Get a FITS file for this expnum/ccd from VOSpace.
@param cutout: (str)
@param return_file: return an filename (True) or HDUList (False)
@param expnum: CFHT exposure number (int)
@param ccd: @param ccd:
@param version: [p, s, o] (char)
@param ext:
@param subdir:
@param prefix:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.