repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
DeepGlow | DeepGlow-main/setup.py |
"""DeepGlow
DeepGlow is a Python package which emulates the BOXFIT gamma-ray burst afterglow simulation code using a neural network approach.
It can calculate light curves in milliseconds to within a few percent accuracy compared to the original BOXFIT model.
"""
from setuptools import setup
setup(
name='DeepG... | 1,579 | 38.5 | 274 | py |
DeepGlow | DeepGlow-main/DeepGlow/DGmain.py | import numpy as np
from tensorflow import keras
import importlib.resources
class Emulator(object):
def __init__(self, simtype='ism'):
if simtype == 'ism':
with importlib.resources.path('DeepGlow', 'data') as data_path:
scale_path = data_path / "scale_facs_ism_final.csv"
... | 3,302 | 43.04 | 88 | py |
DeepGlow | DeepGlow-main/DeepGlow/__init__.py |
"""DeepGlow
Library to emulate the BOXFIT gamma-ray burst afterglow simulation code using a neural network approach.
"""
from .DGmain import Emulator
__version__ = "1.0.0"
__author__ = 'Oliver Boersma'
| 207 | 16.333333 | 104 | py |
DeepGlow | DeepGlow-main/paper/MCstats.py | import pickle
import sys
import numpy as np
import json
MCdist_file_scalefit_ism = open('scalefit-final-ism.pickle','rb')
MCdist_file_scalefit_wind = open('scalefit-final-wind.pickle','rb')
MCdist_file_deepglow_ism = open('deepglow-final-ism.pickle','rb')
MCdist_file_deepglow_wind = open('deepglow-final-wind.pickle','r... | 6,274 | 54.530973 | 310 | py |
DeepGlow | DeepGlow-main/paper/whichbox.py | def which_boxes(theta_0):
boxes_ISM = ['0','1']*(theta_0<=2e-2) + ['1','2']*(theta_0 > 2e-2 and theta_0<=3e-2) + ['2','3']*(theta_0 >3e-2 and theta_0<=4e-2) + ['3','4']*(theta_0 >4e-2 and theta_0<=4.5e-2) + ['4','5']*(theta_0 > 4.5e-2 and theta_0<=5e-2) + ['5','6']*(theta_0 > 5e-2 and theta_0<=7.5e-2) + ['6','7']*(... | 1,669 | 277.333333 | 1,619 | py |
DeepGlow | DeepGlow-main/paper/boxfit_clrDLtrain.py | from CLR.clr_callback import CyclicLR
from sklearn.preprocessing import StandardScaler
import numpy as np
from tensorflow.keras.losses import MeanAbsoluteError
from keras import layers
import keras
from tensorflow.keras import backend as K
import tensorflow as tf
import pandas as pd
import os
os.environ["CUDA_VISIBLE_D... | 4,003 | 36.773585 | 112 | py |
DeepGlow | DeepGlow-main/paper/plot_overlay.py | import pickle
from getdist import plots
from matplotlib import pyplot as plt
import sys
from matplotlib import rc
f1 = sys.argv[1]
f2 = sys.argv[2]
f3 = sys.argv[3]
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)
with open(f1,mode='rb') as f:
scalefit = pickle.load(f)
with... | 889 | 31.962963 | 213 | py |
DeepGlow | DeepGlow-main/paper/run_boxfit.py | import numpy as np
import time
import pandas as pd
import subprocess
import sys
from whichbox import which_boxes
n = int(2500)
Mpc_cm = 3.08567758 * 1e24
redshift = 0
filenumber = sys.argv[1]
nDP = 117
dp = []
for k in range(nDP):
dp.append('dp'+str(k+1))
data = pd.DataFrame(index=np.arange(int(n)), columns=[
... | 2,446 | 37.84127 | 298 | py |
DeepGlow | DeepGlow-main/paper/split_traintest.py | import pandas as pd
import numpy as np
import sys
import pandas as pd
filename = sys.argv[1]
out = sys.argv[2]
print('reading in data')
dataset =pd.read_csv(filename)
print('dataset size: '+str(len(dataset)))
allinf = np.where(np.all(dataset.iloc[:,8:]==-np.inf,axis=1))[0]
dataset = dataset.drop(allinf)
print('dat... | 1,049 | 25.923077 | 69 | py |
DeepGlow | DeepGlow-main/paper/combine_datasets.py | import sys
import pandas as pd
nfiles = len(sys.argv[1:])
files = sys.argv[1:-1]
out = sys.argv[-1]
total = []
for i,filename in enumerate(files):
print('reading in file '+str(i))
ext = filename[-3:]
if ext =='hdf':
filedata = pd.read_hdf(filename,key='data')
else:
filedata = p... | 461 | 20 | 59 | py |
DeepGlow | DeepGlow-main/paper/boxfit_clrDLtrain_wind.py | from CLR.clr_callback import CyclicLR
from sklearn.preprocessing import StandardScaler
import numpy as np
from tensorflow.keras.losses import MeanAbsoluteError
from keras import layers
import keras
from tensorflow.keras import backend as K
import tensorflow as tf
import pandas as pd
import os
os.environ["CUDA_VISIBLE_D... | 3,833 | 35.169811 | 136 | py |
GL-AT | GL-AT-master/utils/crash.py | import sys
class ExceptionHook:
instance = None
def __call__(self, *args, **kwargs):
if self.instance is None:
from IPython.core import ultratb
self.instance = ultratb.FormattedTB(mode='Plain',
color_scheme='Linux', call_pdb=1)
return self.instance(*args... | 366 | 27.230769 | 61 | py |
GL-AT | GL-AT-master/utils/create_black_list.py | import argparse
import csv
import os
from utilities import create_folder
def dcase2017task4(args):
"""Create black list. Black list is a list of audio ids that will be
skipped in training.
"""
# Augments & parameters
workspace = args.workspace
# Black list from DCASE 2017 Task 4
t... | 1,887 | 28.5 | 91 | py |
GL-AT | GL-AT-master/utils/data_generator.py | import os
import sys
import numpy as np
import h5py
import csv
import time
import logging
from utilities import int16_to_float32
def read_black_list(black_list_csv):
"""Read audio names from black list.
"""
with open(black_list_csv, 'r') as fr:
reader = csv.reader(fr)
lines = list(reader... | 15,307 | 34.850117 | 116 | py |
GL-AT | GL-AT-master/utils/dataset.py | import numpy as np
import argparse
import csv
import os
import glob
import datetime
import time
import logging
import h5py
import librosa
from utilities import (create_folder, get_filename, create_logging,
float32_to_int16, pad_or_truncate, read_metadata)
import config
def split_unbalanced_csv_to_partial_csvs(a... | 8,269 | 35.919643 | 147 | py |
GL-AT | GL-AT-master/utils/utilities.py | import os
import logging
import h5py
import soundfile
import librosa
import numpy as np
import pandas as pd
from scipy import stats
import datetime
import pickle
def create_folder(fd):
if not os.path.exists(fd):
os.makedirs(fd)
def get_filename(path):
path = os.path.realpath(path)
... | 5,085 | 28.74269 | 105 | py |
GL-AT | GL-AT-master/utils/config.py | import numpy as np
import csv
sample_rate = 32000
clip_samples = sample_rate * 10 # Audio clips are 10-second
# Load label
with open('metadata/class_labels_indices.csv', 'r') as f:
reader = csv.reader(f, delimiter=',')
lines = list(reader)
labels = []
ids = [] # Each label has a unique id such as "/m/... | 5,404 | 55.894737 | 71 | py |
GL-AT | GL-AT-master/utils/plot_statistics.py | import os
import sys
import numpy as np
import argparse
import h5py
import time
import _pickle as cPickle
import _pickle
import matplotlib.pyplot as plt
import csv
from sklearn import metrics
from utilities import (create_folder, get_filename, d_prime)
import config
def _load_metrics0(filename, sample_rate, window_s... | 100,664 | 48.49115 | 169 | py |
GL-AT | GL-AT-master/utils/create_indexes.py | import numpy as np
import argparse
import csv
import os
import glob
import datetime
import time
import logging
import h5py
import librosa
from utilities import create_folder, get_sub_filepaths
import config
def create_indexes(args):
"""Create indexes a for dataloader to read for training. When users have
a ... | 4,498 | 34.706349 | 151 | py |
GL-AT | GL-AT-master/pytorch/inference.py | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../utils'))
import numpy as np
import argparse
import librosa
import matplotlib.pyplot as plt
import torch
from utilities import create_folder, get_filename
from models import *
from pytorch_utils import move_data_to_device
import config
def audio_ta... | 7,172 | 34.161765 | 101 | py |
GL-AT | GL-AT-master/pytorch/main.py | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../utils'))
import numpy as np
import argparse
import h5py
import math
import time
import logging
import matplotlib.pyplot as plt
from sklearn import metrics
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim... | 15,044 | 37.676093 | 148 | py |
GL-AT | GL-AT-master/pytorch/losses.py | import torch
import torch.nn.functional as F
def clip_bce(output_dict, target_dict):
"""Binary crossentropy loss.
"""
return F.binary_cross_entropy(
output_dict['local_prob'], target_dict['target'])
def get_loss_func(loss_type):
if loss_type == 'clip_bce':
return clip_bce | 308 | 21.071429 | 57 | py |
GL-AT | GL-AT-master/pytorch/test.py | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../utils'))
import numpy as np
import argparse
import librosa
import matplotlib.pyplot as plt
import torch
from utilities import create_folder, get_filename
from models import *
from pytorch_utils import move_data_to_device
import config
def audio_ta... | 9,038 | 40.847222 | 295 | py |
GL-AT | GL-AT-master/pytorch/evaluate.py | from sklearn import metrics
from pytorch_utils import forward
class Evaluator(object):
def __init__(self, model, model_G):
"""Evaluator.
Args:
model: object
"""
self.model = model
self.model_G = model_G
def evaluate(self, data_loader):
"""Fo... | 1,176 | 25.75 | 76 | py |
GL-AT | GL-AT-master/pytorch/finetune_template.py | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../utils'))
import numpy as np
import argparse
import h5py
import math
import time
import logging
import matplotlib.pyplot as plt
import torch
torch.backends.cudnn.benchmark=True
torch.manual_seed(0)
import torch.nn as nn
import torch.nn.functional as ... | 3,979 | 30.587302 | 88 | py |
GL-AT | GL-AT-master/pytorch/models.py | import os
import sys
import math
import time
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from torch.nn.parameter import Parameter
from torchlibrosa.stft import Spectrogram, LogmelFilterBank
from torchlibrosa.... | 33,592 | 38.708038 | 144 | py |
GL-AT | GL-AT-master/pytorch/pytorch_utils.py | import numpy as np
import time
import torch
import torch.nn as nn
def move_data_to_device(x, device):
if 'float' in str(x.dtype):
x = torch.Tensor(x)
elif 'int' in str(x.dtype):
x = torch.LongTensor(x)
else:
return x
return x.to(device)
def do_mixup(x, mixup_lambda):
"""... | 8,446 | 32.387352 | 127 | py |
gbm-bench | gbm-bench-master/datasets.py | # MIT License
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | 12,989 | 40.238095 | 121 | py |
gbm-bench | gbm-bench-master/json2csv.py | #!/usr/bin/env python
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, thi... | 3,610 | 32.435185 | 94 | py |
gbm-bench | gbm-bench-master/metrics.py | # BSD License
#
# Copyright (c) 2016-present, Miguel Gonzalez-Fierro. All rights reserved.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistribu... | 3,749 | 42.604651 | 93 | py |
gbm-bench | gbm-bench-master/algorithms.py | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | 17,038 | 34.204545 | 97 | py |
gbm-bench | gbm-bench-master/runme.py | #!/usr/bin/env python
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, thi... | 6,334 | 42.095238 | 97 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/__init__.py | 0 | 0 | 0 | py | |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/loaders.py | import os
import pandas as pd
import arff
import numpy as np
from functools import reduce
import sqlite3
import logging
from libs.planet_kaggle import (to_multi_label_dict, get_file_count, enrich_with_feature_encoding,
featurise_images, generate_validation_files)
import tensorflow as tf... | 12,263 | 48.853659 | 356 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/timer.py | #code based on https://github.com/miguelgfierro/codebase/
from timeit import default_timer
class Timer(object):
"""Timer class.
Examples:
>>> big_num = 100000
>>> t = Timer()
>>> t.start()
>>> for i in range(big_num):
>>> r = 1
>>> t.stop()
>>> prin... | 1,215 | 23.32 | 64 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/conversion.py | import pandas as pd
def _get_nominal_integer_dict(nominal_vals):
"""Convert nominal values in integers, starting at 0.
Parameters:
nominal_vals (pd.Series): A series.
Returns:
d (dict): An dictionary with numeric values.
"""
d = {}
for val in nominal_vals:
if val not i... | 3,069 | 30.979167 | 105 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/utils.py | import os
import multiprocessing
def get_number_processors():
try:
num = os.cpu_count()
except:
num = multiprocessing.cpu_count()
return num
| 174 | 13.583333 | 41 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/metrics.py | #Original source: https://github.com/miguelgfierro/codebase/blob/master/python/machine_learning/metrics.py
import numpy as np
from sklearn.metrics import roc_auc_score,accuracy_score, precision_score, recall_score, f1_score
def classification_metrics_binary(y_true, y_pred):
m_acc = accuracy_score(y_true, y_pred)
... | 1,233 | 36.393939 | 106 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/__init__.py | 0 | 0 | 0 | py | |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/football.py | #code from https://www.kaggle.com/airback/match-outcome-prediction-in-football
import numpy as np
import pandas as pd
def get_fifa_stats(match, player_stats):
''' Aggregates fifa stats for a given match. '''
#Define variables
match_id = match.match_api_id
date = match['date']
players = ['home_pl... | 12,833 | 35.985591 | 140 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/planet_kaggle.py | import os
import numpy as np
import glob
from tqdm import tqdm
import shutil
from keras.preprocessing import image
from keras.applications.imagenet_utils import preprocess_input
def labels_from(labels_df):
""" Extracts the unique labels from the labels dataframe
"""
# Build list with unique labels
lab... | 2,761 | 30.033708 | 110 | py |
gbm-bench | gbm-bench-master/3rdparty/fast_retraining/experiments/libs/notebook_memory_management.py | #Source: https://github.com/ianozsvald/ipython_memory_usage
"""Profile mem usage envelope of IPython commands and report interactively"""
from __future__ import division # 1/2 == 0.5, as in Py3
from __future__ import absolute_import # avoid hiding global modules with locals
from __future__ import print_function # fo... | 2,794 | 35.298701 | 106 | py |
gbm-bench | gbm-bench-master/3rdparty/codebase/python/machine_learning/metrics.py | from sklearn.metrics import (confusion_matrix, accuracy_score, roc_auc_score, f1_score, log_loss, precision_score,
recall_score, mean_squared_error, mean_absolute_error, r2_score)
import numpy as np
def classification_metrics_binary(y_true, y_pred):
"""Returns a report with different ... | 13,258 | 44.098639 | 120 | py |
dataqa | dataqa-master/subtract_continuum.py | #!/usr/bin/env python
"""
This script does continuum subtraction on line cubes.
- It creates a new fits file in: '/data*/apertif/<obs_id>/<beam>/line/cubes/HI_image_cube_contsub.fits'
Parameter
obs_id : int
Observation number which should be assessed
Example:
python subtract_continuum.py obs_id
"""... | 4,482 | 34.023438 | 126 | py |
dataqa | dataqa-master/create_report.py | #!/usr/bin/python2.7
"""
Script to create an html overview
# NOTE:
In triggered QA crosscal and selfcal plots are distributed over notes.
Preflag plots are also distributed over the notes.
An option exists to combine the QA from different happilis if run on happili-01
You can specify the name of the target, fluxc... | 14,735 | 40.982906 | 212 | py |
dataqa | dataqa-master/scandata.py | import os
import numpy as np
import logging
"""
Define object classes for holding data related to scans
The key thing to specify an object is the scan of the target field
Also need name of fluxcal (for cross-cal solutions)
Want to add functionality for pol-cal for pol solutions (secondary)
This specifies the location o... | 5,043 | 39.677419 | 120 | py |
dataqa | dataqa-master/make_mosaic_image.py | #!/usr/bin/env python
"""
This script creates a mosaic file from apertif continuum images.
- This script takes the obs_id as an argument,
- looks for continuum images from the pipeline (fits format),
- copies the images into a temporary directory,
- creates a mosaic image in /data/apertif/obs_id/mosaic/
- and del... | 3,896 | 28.300752 | 173 | py |
dataqa | dataqa-master/run_cube_stats.py | import numpy as np
import sys
import os
import argparse
import glob
import socket
import time
import logging
from apercal.libs import lib
from dataqa.scandata import get_default_imagepath
from dataqa.line.cube_stats import get_cube_stats
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
if __name... | 2,849 | 33.337349 | 125 | py |
dataqa | dataqa-master/run_merge_plots.py | from scandata import get_default_imagepath
import argparse
import time
import logging
import os
import glob
import socket
import numpy as np
from PIL import Image
from apercal.libs import lib
from time import time
import pymp
from report.merge_ccal_scal_plots import run_merge_plots
if __name__ == "__main__":
pars... | 1,935 | 29.730159 | 117 | py |
dataqa | dataqa-master/run_qa.py | """
This script contains functionality to run all QA automatically after being triggered at the end of apercal
"""
import os
import time
import numpy as np
import logging
import socket
from apercal.libs import lib
from apercal.subs import calmodels as subs_calmodels
from astropy.table import Table
from dataqa.scandat... | 21,273 | 39.676864 | 202 | py |
dataqa | dataqa-master/run_continuum_validation.py | #!/usr/bin/env python
"""
This script contains functionality to run pybdsf on continuum data
for the QA
It does can run on a single image for the mosaic QA or an observation
number alone for the continuum QA. In the latter case, it will go through
all the beams.
There will be a log file either in
/home/<user>/qa_sci... | 7,717 | 35.065421 | 134 | py |
dataqa | dataqa-master/run_inspection_plot.py | """
Script to automatically retrieve inspection plots from ALTA
for the QA
Requires a scan number
Optionally takes a directory for writing plots
"""
import os
import socket
import argparse
from timeit import default_timer as timer
from scandata import get_default_imagepath
from inspection_plots.inspection_plots import... | 3,753 | 32.221239 | 100 | py |
dataqa | dataqa-master/run_ccal_plots.py | #!/usr/bin/env python
"""
Script to automatically run crosscal plots
Requires a scan number
Optionally takes a directory for writing plots
"""
from crosscal import crosscal_plots
from scandata import get_default_imagepath
import argparse
from timeit import default_timer as timer
import logging
import os
from apercal.l... | 1,987 | 30.0625 | 120 | py |
dataqa | dataqa-master/run_beamweights_plots.py | # inspect_beamweights: Make plots of beam weights from any observation
# K.M.Hess 27/06/2019 (hess@astro.rug.nl)
# adapted for dataQA by Robert Schulz
__author__ = "Tammo Jan Dijkema & Kelley M. Hess & Robert Schulz"
__date__ = "$23-jul-2019 16:00:00$"
__version__ = "0.3"
from argparse import ArgumentParser, RawTextHe... | 12,056 | 41.305263 | 145 | py |
dataqa | dataqa-master/run_cube_stats_cont.py | import numpy as np
import sys
import os
import argparse
import glob
import socket
import time
import logging
from apercal.libs import lib
from dataqa.scandata import get_default_imagepath
from dataqa.line.cube_stats_cont import get_cube_stats_cont
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
... | 2,875 | 33.650602 | 125 | py |
dataqa | dataqa-master/run_osa_report_check.py | """
This script contains functionality to check the OSA report
"""
import os
import time
import numpy as np
import logging
import socket
import glob
import argparse
from astropy.table import Table
def osa_report_check(output_file=''):
"""Function to check the available OSA reports.
Basic check if the number... | 5,671 | 35.358974 | 98 | py |
dataqa | dataqa-master/__init__.py | 0 | 0 | 0 | py | |
dataqa | dataqa-master/run_scal_plots.py | """
Script to automatically run crosscal plots
Requires a scan number
Optionally takes a directory for writing plots
"""
import os
from selfcal import selfcal_plots as scplots
import argparse
from timeit import default_timer as timer
from scandata import get_default_imagepath
from selfcal.selfcal_maps import get_selfc... | 3,890 | 33.433628 | 124 | py |
dataqa | dataqa-master/run_preflag_qa.py | """
Script to automatically run preflag qa
Combines the preflag plots
Requires a scan number
Optionally takes a directory for writing plots
"""
import os
from selfcal import selfcal_plots as scplots
import argparse
from timeit import default_timer as timer
from scandata import get_default_imagepath
from preflag impo... | 2,078 | 27.875 | 94 | py |
dataqa | dataqa-master/run_rfinder.py | #!/usr/bin/env python
"""
Script to automatically run RFInder on flux calibrator
Requires a taskID and name of flux calibrator
"""
import os
import argparse
from timeit import default_timer as timer
import logging
from apercal.libs import lib
from dataqa.scandata import get_default_imagepath
import socket
import glob
... | 4,366 | 33.385827 | 121 | py |
dataqa | dataqa-master/cb_plots.py | # Compound beam overview plots of QA
from __future__ import print_function
__author__ = "E.A.K. Adams"
"""
Functions for producing compound beam plots
showing an overview of data QA
Contributions from R. Schulz
"""
from astropy.io import ascii
from astropy.table import Table
from matplotlib.patches import Circle
f... | 13,115 | 36.261364 | 122 | py |
dataqa | dataqa-master/plot_schedule.py | #!/usr/bin/env python
"""
This script visualises the observing schedule by producing elevation and HA plots as a function of time.
Written in python3 and using pandas, astropy and matplotlib.
Parameter
obs_id : str
csv file with the schedule.
Example:
python plot_schedule.py schedule.csv
"""
impor... | 4,446 | 37.336207 | 139 | py |
dataqa | dataqa-master/line/cube_stats.py | """
This file contains functionality to analyze the quality of the data cube
generated by the pipeline for each beam.
"""
from astropy.io import fits
from astropy.wcs import WCS
from astropy.table import Table
import numpy as np
import os
import glob
import socket
import time
import logging
import glob
from dataqa.sca... | 14,836 | 42.25656 | 183 | py |
dataqa | dataqa-master/line/cube_stats_cont.py | """
This file contains functionality to analyze the quality of the data cube
generated by the pipeline for each beam.
"""
from astropy.io import fits
from astropy.wcs import WCS
from astropy.table import Table
import numpy as np
import os
import glob
import socket
import time
import logging
from dataqa.scandata import... | 8,602 | 39.966667 | 132 | py |
dataqa | dataqa-master/line/__init__.py | 0 | 0 | 0 | py | |
dataqa | dataqa-master/report/html_report_content_inspection_plots.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_inspection_plots(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for inspection plo... | 11,971 | 42.376812 | 186 | py |
dataqa | dataqa-master/report/pipeline_run_time.py | """
This module containes functionality to read the timing
measurement of the pipeline for the report
"""
import logging
import os
from astropy.table import Table, hstack, vstack
from apercal import parselog
from scandata import get_default_imagepath
import socket
import numpy as np
import glob
from datetime import ti... | 9,018 | 39.084444 | 185 | py |
dataqa | dataqa-master/report/osa_functions.py | # test script for jupyter notebook OSA report
import numpy as np
import os
import shutil
from astropy.table import Table, join
from ipywidgets import widgets, Layout
from IPython.display import display
import glob
import json
from collections import OrderedDict
def run(obs_id=None, single_node=False):
layout_sel... | 29,468 | 43.181409 | 340 | py |
dataqa | dataqa-master/report/html_report_content_continuum.py | import os
import sys
from astropy.table import Table, join
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_continuum(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for continuum
... | 14,933 | 40.140496 | 226 | py |
dataqa | dataqa-master/report/html_report_content_mosaic.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_mosaic(html_code, qa_report_obs_path, page_type):
"""Function to create the html page for mosaic
"""
logger.info("Writin... | 4,479 | 35.721311 | 170 | py |
dataqa | dataqa-master/report/html_report_content_polarisation.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_polarisation(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for polarisation
... | 1,019 | 26.567568 | 161 | py |
dataqa | dataqa-master/report/html_report_content_apercal_logs.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_apercal_log(html_code, qa_report_obs_path, page_type):
"""Function to create the html page for apercal_log
Args:
htm... | 17,268 | 43.279487 | 192 | py |
dataqa | dataqa-master/report/html_report_content_line.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_line(html_code, qa_report_obs_path, page_type):
"""Function to create the html page for line
Args:
html_code (str): ... | 9,744 | 37.824701 | 183 | py |
dataqa | dataqa-master/report/html_report_content.py | #!/usr/bin/python2.7
"""
This file contains functionality to create the content for the
each subpage of the report
"""
import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
from html_report_content_observing_log import write_obs_content_observing_... | 6,830 | 34.952632 | 116 | py |
dataqa | dataqa-master/report/html_report_content_selfcal.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_selfcal(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for selfcal
Args:
... | 21,868 | 37.232517 | 192 | py |
dataqa | dataqa-master/report/html_report_content_crosscal.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_crosscal(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for crosscal
Args:
... | 11,836 | 39.537671 | 245 | py |
dataqa | dataqa-master/report/html_report_content_observing_log.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_observing_log(html_code, qa_report_obs_path, page_type):
"""Function to create the html page for the observing log
Args:
... | 1,974 | 29.859375 | 107 | py |
dataqa | dataqa-master/report/make_nptabel_summary.py | #!/usr/bin/env python
import glob
import os
import numpy as np
import logging
import csv
import socket
# ----------------------------------------------
# read data from np file
logger = logging.getLogger(__name__)
def find_sources(obs_id, data_dir):
"""
Identify preflag sources e.g. target name and calibra... | 9,789 | 32.993056 | 238 | py |
dataqa | dataqa-master/report/merge_ccal_scal_plots.py | from dataqa.scandata import get_default_imagepath
import argparse
import time
import logging
import os
import glob
import socket
import numpy as np
from PIL import Image
from apercal.libs import lib
from apercal.subs.managefiles import director
from time import time
import pymp
logger = logging.getLogger(__name__)
d... | 11,002 | 36.810997 | 122 | py |
dataqa | dataqa-master/report/__init__.py | 0 | 0 | 0 | py | |
dataqa | dataqa-master/report/html_report_content_summary.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_summary(html_code, qa_report_obs_path, page_type, obs_info=None, osa_report=''):
"""Function to create the html page for summary
... | 9,470 | 37.189516 | 641 | py |
dataqa | dataqa-master/report/html_report.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import argparse
import socket
import report.html_report_content as hrc
# from __future__ import with_statement
logger = logging.getLogger(__name__)
def write_html_header(html_file_name, js_file, css_file=None, page_type='inde... | 10,998 | 36.927586 | 211 | py |
dataqa | dataqa-master/report/html_report_content_beamweights.py | import os
import sys
from astropy.table import Table, join
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_beamweights(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for beamweights
... | 6,448 | 42.281879 | 428 | py |
dataqa | dataqa-master/report/test_nptabel_summary.py | #!/usr/bin/env python
import glob
import os
import numpy as np
import logging
from make_nptabel_summary import extract_all_beams, find_sources, make_nptable_csv
import csv
# -------------------------------------------------
beams_1 = '/data/apertif/190602049/'
obs_id = '190602049'
module = 'preflag'
#source = 'LH_GRG... | 578 | 18.965517 | 82 | py |
dataqa | dataqa-master/report/test_merge.py | from merge_ccal_scal_plots import run_merge_plots
import numpy as np
import os
from apercal.libs import lib
import logging
lib.setup_logger('debug', logfile='test_merge_plots.log')
logger = logging.getLogger(__name__)
basedir = '/data/apertif/190602049_flag-strategy-test/qa'
do_ccal = True
do_scal = False
# file_l... | 504 | 23.047619 | 72 | py |
dataqa | dataqa-master/report/html_report_dir.py | #!/usr/bin/python2.7
"""
This file contains functionality to create the directory structure for the report.
Instead of copying files, they are linked.
"""
import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
from shutil import copy2, copy
logger = logging.getLogge... | 59,521 | 38.05643 | 236 | py |
dataqa | dataqa-master/report/html_report_content_preflag.py | import os
import sys
from astropy.table import Table
import logging
import glob
import time
import socket
import numpy as np
logger = logging.getLogger(__name__)
def write_obs_content_preflag(html_code, qa_report_obs_path, page_type, obs_info=None):
"""Function to create the html page for preflag
Args:
... | 11,334 | 37.686007 | 245 | py |
dataqa | dataqa-master/preflag/preflag_plots.py | # Module to merge preflag plots
import os
import numpy as np
#import pymp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import socket
import glob
import logging
logger = logging.getLogger(__name__)
def combine_preflag_plots(qa_preflag_dir, trigger_mode=False):
"""
Function to combi... | 4,311 | 31.179104 | 111 | py |
dataqa | dataqa-master/preflag/__init__.py | 0 | 0 | 0 | py | |
dataqa | dataqa-master/mosaic/qa_mosaic.py | import numpy as np
import logging
import bdsf
import os
import time
import logging
import socket
from apercal.libs import lib
import sys
import glob
from astropy.io import fits
from astropy.wcs import WCS
import matplotlib.pyplot as plt
from dataqa.continuum.validation_tool import validation
from dataqa.continuum.qa_co... | 6,828 | 32.806931 | 146 | py |
dataqa | dataqa-master/mosaic/__init__.py | 0 | 0 | 0 | py | |
dataqa | dataqa-master/continuum/test_plot.py | """
Script to test plotting images
"""
import numpy as np
import os
import argparse
from astropy.io import fits
import matplotlib.pyplot as plt
import matplotlib.colors as mc
from astropy.wcs import WCS
#import qa_continuum
import time
def main():
start_time = time.time()
# Create and parse argument list
... | 2,984 | 28.554455 | 133 | py |
dataqa | dataqa-master/continuum/qa_continuum.py | """
This script contains function to run pybdsf for the continuum QA.
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.colors as mc
from astropy.wcs import WCS
import numpy as np
import logging
import bdsf
import os
import time
import socket
from apercal.libs import lib
imp... | 19,282 | 33.068905 | 116 | py |
dataqa | dataqa-master/continuum/__init__.py | 0 | 0 | 0 | py | |
dataqa | dataqa-master/continuum/continuum_tables.py | # This module contains functionality to merge the image properties tables
import os
import glob
from astropy.table import Table, vstack
import numpy as np
import logging
logger = logging.getLogger(__name__)
def merge_continuum_image_properties_table(obs_id, qa_dir, single_node=False):
"""
This function comb... | 3,695 | 41.482759 | 92 | py |
dataqa | dataqa-master/continuum/validation_tool/validation.py | #!/usr/bin/env python2
from __future__ import division
import os
# from datetime import datetime
from inspect import currentframe, getframeinfo
#Set my own obvious warning output
cf = currentframe()
WARN = '\n\033[91mWARNING: \033[0m' + getframeinfo(cf).filename
from functions import find_file, config2dic, changeDir
... | 4,420 | 41.104762 | 96 | py |
dataqa | dataqa-master/continuum/validation_tool/functions.py | from __future__ import division
import os
import numpy as np
import scipy.optimize as opt
import scipy.special as special
from astropy.wcs import WCS
import matplotlib.pyplot as plt
from matplotlib import ticker
def changeDir(filepath, suffix, verbose=False):
"""Derive a directory name from an input file to store... | 25,247 | 30.718593 | 157 | py |
dataqa | dataqa-master/continuum/validation_tool/report.py | from __future__ import division
from functions import get_pixel_area, get_stats, flux_at_freq, axis_lim
import os
import collections
from datetime import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt, mpld3
from matplotlib import cm, ticker, colors
from mpld3 import plugins
from matp... | 69,888 | 39.63314 | 156 | py |
dataqa | dataqa-master/continuum/validation_tool/dynamic_range.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 14:09:37 2019
@author: AK
"""
import pandas as pd
import astropy.io.fits as fits
import astropy.units as u
from astropy.coordinates import SkyCoord, Angle
from astropy.wcs import WCS
import numpy as np
import matplotlib.pyplot as plt
def get_... | 2,743 | 29.153846 | 89 | py |
dataqa | dataqa-master/continuum/validation_tool/__init__.py | 0 | 0 | 0 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.