Skip to content
Snippets Groups Projects
Commit 2a94474b authored by Peijin Zhang's avatar Peijin Zhang
Browse files

doc auto try8

parent 5864da17
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ test/*
tmpdata/*
builddoc/*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
......
====================
Beam Beam Beam
Interferometry Beam
====================
......
......@@ -6,20 +6,34 @@ GUI
:code:`lofarBFcube` : GUI tool to load fits cube data for LOFAR beamformed observations
command line
Command line tools
------------
.. program-output:: python -V
Dynamic Spectrum
~~~~~~~~~~~~~~~~
.. autoprogram:: lofarSun.cli.pyms_utils:pyms_cook_wsclean_cmd_main
:prog: pymsCookWscleanCMD
* :code:`h5toFitsDS`
.. program-output:: h5toFitsDS -h
:code:`h5toFitsDS` : convert a LOFAR hdf5 file to small fits files, including averaging and flagging processings
:code:`pymsOverview` : msoverview implemented with casacore
measurement set
~~~~~~~~~~~~~~~~
:code:`pymsCookWscleanCMD` : recommended wsclean command line for LOFAR solar interferometry
:code:`pymsDatetime2Index` : convert datatime to index in a LOFAR MS file
* :code:`pymsOverview`
.. program-output:: pymsOverview -h
* :code:`pymsCookWscleanCMD`
.. program-output:: pymsCookWscleanCMD -h
* :code:`pymsDatetime2Index`
.. program-output:: pymsDatetime2Index -h
* :code:`pymsIndex2Datetime`
.. program-output:: pymsIndex2Datetime -h
:code:`pymsIndex2Datetime` : convert index to datatime in a LOFAR MS file
\ No newline at end of file
......@@ -39,12 +39,17 @@ release = '0.1.0'
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinxcontrib-programoutput',
'sphinxcontrib-autoprogram']
'sphinxcontrib.programoutput',
'sphinx.ext.autosummary']
html_favicon = 'img/image.ico'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
extensions.append('autoapi.extension')
autoapi_type = 'python'
autoapi_dirs = ['../lofarSun']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
......
......@@ -86,6 +86,7 @@ The common data formats for solar and space weather studys:
.. autosummary::
Cite as
-------
......
......@@ -336,7 +336,6 @@ directory '/HDD/path/to/data/' to '/lofardata'
.. autofunction:: lofarSun.IM.get_peak_beam_from_psf
.. autofunction:: lofarSun.cli.get_obs_info_from_ms
.. rubric:: Footnotes
......
......@@ -3,5 +3,4 @@ lofarSun
sphinx
sphinx_rtd_theme
readthedocs-sphinx-search
sphinxcontrib-programoutput
sphinxcontrib-autoprogram
\ No newline at end of file
sphinxcontrib-programoutput
\ No newline at end of file
......@@ -15,11 +15,15 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def h5_fetch_meta(f, SAP="000"):
""" get metadata from h5 file
"""get info from the h5 file
Args:
f (_type_): _description_
"""
f (h5 file): target h5 file
SAP (str, optional): Sub-Array-Pointing. Defaults to "000".
Returns:
list: metadata of the h5 file
"""
root_group = f["/"]
......@@ -62,6 +66,27 @@ def h5_fetch_meta(f, SAP="000"):
def downsample_h5_seg_by_time_ratio(data_array_uri, t_all, t_ratio_start, t_ratio_end, t_idx_count,
t_c_ratio, f_c_ratio, averaging=True, flagging=False, t_idx_cut=256,
agg_factor=[1.66, 1.66, 0.45, 0.45], subband_edge=False, subband_ch=16, device=device):
""" Downsample the h5 file by time ratio
Args:
data_array_uri (array): dynamic spectrum
t_all (1d array): all time stamps
t_ratio_start (float): start time ratio (0-1)
t_ratio_end (float): end time ratio (0-1)
t_idx_count (int): number of total time stamps
t_c_ratio (int): time compression ratio
f_c_ratio (int): frequency compression ratio
averaging (bool, optional): averaging or direct sample. Defaults to True.
flagging (bool, optional): flagging or not. Defaults to False.
t_idx_cut (int, optional): factor to contour segment length for processing, to make use of the memory. Defaults to 256.
agg_factor (list, optional): factor for flagging. Defaults to [1.66, 1.66, 0.45, 0.45].
subband_edge (bool, optional): remove one channel every [subband num] channels. Defaults to False.
subband_ch (int, optional): number of subbands per channel. Defaults to 16.
device (device, optional): GPU or CPU, should be something like torch.device("cuda:0") . Defaults to device.
Returns:
list: [averaged dynamic spectrum, time stamps]
"""
idx_start = int(t_ratio_start * (t_idx_count - 1))
idx_end = int(t_ratio_end * (t_idx_count - 1))
......
# -*- coding: utf-8 -*-
"""
python version msoverview
command line tools to process the lofar solar data
Usage:
python -m pymsoverview -f xxxxx.MS [-v]
Written by Peijin Zhang
by Peijin Zhang
version 0.1 2022-5-23 00:24:52: Initial version
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment