cfpack package

Submodules

cfpack.automator module

cfpack.browser_control module

cfpack.constants module

cfpack.defaults module

cfpack.hdfio module

cfpack.hdfio.delete(filename, datasetname, quiet=False)[source]
cfpack.hdfio.get_dataset_names(filename)[source]
cfpack.hdfio.get_shape(filename, datasetname)[source]
cfpack.hdfio.read(filename, datasetname, ind=(), return_attributes=False)[source]
cfpack.hdfio.write(data, filename, datasetname, overwrite_file=False, overwrite_dataset=False)[source]

cfpack.matplotlibrc module

cfpack.tests module

cfpack.tests.test_fit(n=21)[source]
cfpack.tests.test_get_spectrum()[source]
cfpack.tests.test_plot_map(N=500)[source]

Module contents

cfpack.MJ(rho, c_s)[source]
cfpack.add_line_to_file(filename, add_line, position='end', debug=True)[source]
cfpack.alpha_vir(rho, L, sigma_v, spherical=False)[source]
cfpack.check_for_overwrite(filename)[source]
cfpack.comov2proper(q, redshift=None, qtype=None, inverse=False)[source]
cfpack.congrid(inarray, outshape, method='linear')[source]
cfpack.debug_decorator(func)[source]
cfpack.eform(x, prec=10, print_leading_plus=False)[source]
cfpack.find_line_in_file(filename, search_str, debug=True)[source]
cfpack.fit(func, xdat, ydat, xerr=None, yerr=None, perr_method='statistical', n_random_draws=1000, dat_frac_for_systematic_perr=0.3, weights=None, scale_covar=True, params=None, fit_method='ls', plot_fit=False, mcmc_walkers=32, mcmc_steps=2000, verbose=1, *args, **kwargs)[source]
cfpack.gauss_smooth(input_data, sigma=None, fwhm=None, mode='wrap', truncate=3.0, verbose=1)[source]
cfpack.generate_random_gaussian_numbers(n=100, mu=0.0, sigma=1.0, seed=None)[source]
cfpack.generate_random_uniform_numbers(n=100, min=0.0, max=1.0, seed=None)[source]
cfpack.get_1d_coords(cmin=0, cmax=1, ndim=10, cell_centred=True)[source]
cfpack.get_2d_coords(cmin=[0, 0], cmax=[1, 1], ndim=[10, 10], cell_centred=True)[source]
cfpack.get_3d_coords(cmin=[0, 0, 0], cmax=[1, 1, 1], ndim=[10, 10, 10], cell_centred=True)[source]
cfpack.get_binned_stats(data, bin_values, bins=None, statistic='mean', **kwargs)[source]
cfpack.get_binned_stats_2d(data, bin_values_1, bin_values_2, bins=None, statistic='sum', **kwargs)[source]
cfpack.get_coords(cmin, cmax, ndim, cell_centred=True)[source]
cfpack.get_dirs(dirname='.', include_base_dir=False, strip=False, verbose=1)[source]
cfpack.get_hostname()[source]
cfpack.get_kde_sample(data, n=1000, seed=1, show=False)[source]
cfpack.get_moments(x, pdf=None, xs=None, xe=None)[source]
cfpack.get_moments_from_time_series(time, func, ts=None, te=None)[source]
cfpack.get_pdf(data, range=None, bins=200)[source]
cfpack.get_sigma(mean, ms)[source]
cfpack.get_spectrum(data_in, ncmp=1, binning='spherical', sum=False, return_ft_data=False, mirror=False, window=False, verbose=1)[source]
cfpack.import_matplotlibrc()[source]
cfpack.lJ(rho, c_s)[source]
class cfpack.legend_formatter[source]

Bases: object

fontsize = None
length = 1
loc = 'center left'
pos = (0.5, 0.5)
textpad = 0.01
cfpack.mass(rho, L, spherical=False)[source]
class cfpack.monitor(loop_size, signature='')[source]

Bases: object

class datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])

Bases: date

The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints.

astimezone()

tz -> convert to local time in new timezone tz

classmethod combine()

date, time -> datetime with same date and time fields

ctime()

Return ctime() style string.

date()

Return date object with same year, month and day.

dst()

Return self.tzinfo.dst(self).

fold
classmethod fromisoformat(object, /)

string -> datetime from a string in most ISO 8601 formats

classmethod fromtimestamp()

timestamp[, tz] -> tz’s local time from POSIX timestamp.

hour
isoformat()

[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’ and ‘microseconds’.

max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
microsecond
min = datetime.datetime(1, 1, 1, 0, 0)
minute
classmethod now(tz=None)

Returns new datetime object representing current time local to tz.

tz

Timezone object.

If no tz is specified, uses local timezone.

replace()

Return datetime with new specified fields.

resolution = datetime.timedelta(microseconds=1)
second
classmethod strptime()

string, format -> new datetime parsed from a string (like time.strptime()).

time()

Return time object with same time but with tzinfo=None.

timestamp()

Return POSIX timestamp as float.

timetuple()

Return time tuple, compatible with time.localtime().

timetz()

Return time object with same time and tzinfo.

tzinfo
tzname()

Return self.tzinfo.tzname(self).

classmethod utcfromtimestamp()

Construct a naive UTC datetime from a POSIX timestamp.

classmethod utcnow()

Return a new datetime representing UTC day and time.

utcoffset()

Return self.tzinfo.utcoffset(self).

utctimetuple()

Return UTC time tuple, compatible with time.localtime().

report(loop_index)[source]
cfpack.plot(y=None, x=None, yerr=None, xerr=None, type=None, xlabel='x', ylabel='y', label=None, linestyle=None, linewidth=None, marker=None, text=None, shaded_err=None, aspect_data=None, aspect_box=None, normalised_coords=False, bar_width=1.0, xlog=False, ylog=False, xlim=None, ylim=None, legend_loc='upper left', legend_formatter=None, axes_format=[None, None], axes_pos=None, ax=None, show=False, pause=None, save=None, *args, **kwargs)[source]
cfpack.plot_colorbar(cmap=None, label=None, vmin=None, vmax=None, log=False, symlog=False, symlog_linthresh=1, norm=None, format=None, aspect=28, extend='neither', panels=1, orientation='vertical', swap=False, ax=None, show=False, pause=None, save=None)[source]
cfpack.plot_map(image=None, xedges=None, yedges=None, dims=None, vmin=None, vmax=None, log=False, symlog=False, symlog_linthresh=1, symlog_linscale=0.01, norm=None, colorbar=True, cmap='magma', cmap_label=None, xlabel=None, ylabel=None, xlog=False, ylog=False, xlim=None, ylim=None, axes_format=[None, None], axes_pos=None, aspect_data='auto', aspect_box=None, dpi=200, ax=None, show=False, pause=None, save=None, *args, **kwargs)[source]
cfpack.plot_multi_panel(figure_axes, nrows=1, ncols=1, width_panel=0.8, height_panel=0.8, col_sep=0.15, row_sep=0.15, remove_old_fig=True, verbose=False, show=False, pause=None, save=None)[source]
cfpack.polytropic_eos(dens, mu=2.3)[source]
cfpack.print(*args, error=False, warn=False, highlight=False, color='', input=False, no_prefix=False, **kwargs)[source]
cfpack.r_larmor(B, v, m=1.67262192369e-24, q=4.803204712570263e-10)[source]
cfpack.read_ascii(filename, astropy_read=True, read_header=True, quiet=False, max_num_lines=10000000.0, plain=False, *args, **kwargs)[source]
cfpack.rebin(inarray, outshape)[source]
cfpack.replace_line_in_file(filename, search_str, new_line, search_str_position=0, debug=True)[source]
cfpack.rgba2data(rgba_image, cmap_name, cmap_vmin, cmap_vmax)[source]
cfpack.round(xin, nfigs=3, str_ret=False)[source]
cfpack.round_with_error(val, val_err, nfigs=2)[source]
cfpack.run_shell_command(cmd, quiet=False, print_only=False, capture=False, **kargs)[source]
cfpack.scale_factor(redshift)[source]
cfpack.shock_jump_T(Mach, gamma=1.6666666666666667)[source]
cfpack.shock_jump_p(Mach, gamma=1.6666666666666667)[source]
cfpack.shock_jump_rho(Mach, gamma=1.6666666666666667)[source]
cfpack.show_or_save_plot(figax=None, show=None, pause=None, save=None)[source]
cfpack.sigma_s(Mach, b=0.4, beta=1e+99)[source]
cfpack.sink_dens_thresh(r_sink, c_s)[source]
cfpack.smooth(x, y, window_npts=11, order=3)[source]
cfpack.symlogspace(start, stop, num=50, base=10.0)[source]
cfpack.t_larmor(B, m=1.67262192369e-24, q=4.803204712570263e-10)[source]
cfpack.tex_escape(text)[source]
cfpack.tff(rho)[source]
class cfpack.timer(name='', quiet=True)[source]

Bases: object

class datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])

Bases: date

The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints.

astimezone()

tz -> convert to local time in new timezone tz

classmethod combine()

date, time -> datetime with same date and time fields

ctime()

Return ctime() style string.

date()

Return date object with same year, month and day.

dst()

Return self.tzinfo.dst(self).

fold
classmethod fromisoformat(object, /)

string -> datetime from a string in most ISO 8601 formats

classmethod fromtimestamp()

timestamp[, tz] -> tz’s local time from POSIX timestamp.

hour
isoformat()

[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’ and ‘microseconds’.

max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
microsecond
min = datetime.datetime(1, 1, 1, 0, 0)
minute
classmethod now(tz=None)

Returns new datetime object representing current time local to tz.

tz

Timezone object.

If no tz is specified, uses local timezone.

replace()

Return datetime with new specified fields.

resolution = datetime.timedelta(microseconds=1)
second
classmethod strptime()

string, format -> new datetime parsed from a string (like time.strptime()).

time()

Return time object with same time but with tzinfo=None.

timestamp()

Return POSIX timestamp as float.

timetuple()

Return time tuple, compatible with time.localtime().

timetz()

Return time object with same time and tzinfo.

tzinfo
tzname()

Return self.tzinfo.tzname(self).

classmethod utcfromtimestamp()

Construct a naive UTC datetime from a POSIX timestamp.

classmethod utcnow()

Return a new datetime representing UTC day and time.

utcoffset()

Return self.tzinfo.utcoffset(self).

utctimetuple()

Return UTC time tuple, compatible with time.localtime().

get_dt()[source]
report()[source]
start()[source]
stop()[source]
cfpack.timer_decorator(func)[source]
cfpack.write_ascii(filename, dat, format='fixed_width', delimiter='', comment=False, quiet=False, plain=False, *args, **kwargs)[source]