pycsamt.site.report#
pycsamt.site.report#
Human-friendly display layer for Site and
Sites objects.
Two classes are provided:
SiteReport— statistics and rich display for a single site.SitesReport— statistics and rich display for a collection.
Both compute their statistics lazily at construction time so that
repeated calls to report() are cheap.
Quick start#
from pycsamt.site.report import SiteReport, SitesReport
# --- single site ---
report = SiteReport(site)
report.report() # prints to terminal
d = report.to_dict() # plain dict
df = report.to_dataframe() # pandas DataFrame (resphase)
# --- collection ---
rep = SitesReport(sites)
rep.report() # full survey summary
rep.report(top=10) # first 10 stations only
df = rep.to_dataframe() # one row per station
d = rep.to_dict() # list of per-station dicts
Notes
The report() method uses rich when available and degrades to
plain-text output when rich is not installed.
All statistics are computed from the arrays exposed by
SiteMixin: freq, z, rho,
phase, tipper. Missing arrays are handled gracefully and
reported as "—" in the output.
Classes
|
Statistics and display for a single |
|
Statistics and display for a |
- class pycsamt.site.report.SiteReport(site)[source]#
Bases:
objectStatistics and display for a single
Site.- Parameters:
site (Site-like) – Any object that exposes
name,coords,freq,z,rho,phase, andtipperas perSiteMixin.
Examples
from pycsamt.site.report import SiteReport rep = SiteReport(site) rep.report() # rich terminal output d = rep.to_dict() # machine-readable dict
- report(*, detail=False)[source]#
Print a rich panel with site statistics.
- Parameters:
detail (bool) – If
True, include per-frequency Z and ρ–φ tables.- Return type:
None
- to_dataframe(kind='resphase', *, api=None)[source]#
Export site arrays to a
pandas.DataFrame.- Parameters:
kind (str) – Passed to
to_dataframe().api (bool or None, default None) –
Trueforces API view wrapping;Falsereturns a bare pandas dataframe;None(default) defers to the globalPYCSAMT_API_VIEWsetting.
- Return type:
- class pycsamt.site.report.SitesReport(sites)[source]#
Bases:
objectStatistics and display for a
Sitescollection.- Parameters:
sites (Sites-like) – Any iterable of
Site-like objects.
Examples
from pycsamt.site.report import SitesReport rep = SitesReport(sites) rep.report() # full survey panel + per-station table rep.report(top=10) # first 10 stations only df = rep.to_dataframe() # one row per station
- to_dataframe(*, api=None)[source]#
Return a
pandas.DataFramewith one row per station.