pycsamt.metadata.survey#
pycsamt.metadata.survey#
Campaign-level survey descriptor.
SurveyMeta captures the essential context of an MT/AMT/CSAMT/TEM
measurement campaign — who, what, when, where — as a first-class Python
object. It serialises to / deserialises from JSON and YAML, can be built
directly from a Sites collection, and can push
its fields into an EDI >HEAD section.
Quick start#
from pycsamt.metadata.survey import SurveyMeta, BBox
meta = SurveyMeta(
name="WILLY_2023",
project="Copper-gold exploration",
operator="EarthAI-Tech",
method="AMT",
bbox=BBox(lat_min=27.8, lat_max=28.9,
lon_min=101.5, lon_max=103.2),
)
# build from a Sites collection
meta2 = SurveyMeta.from_sites(sites, name="WILLY_2023")
# round-trip to JSON
meta.to_json("survey.json")
meta3 = SurveyMeta.from_json("survey.json")
Classes
|
Geographic bounding box in decimal degrees (WGS-84 default). |
|
Campaign-level descriptor for an MT/AMT/CSAMT/TEM survey. |
- class pycsamt.metadata.survey.BBox(lat_min, lat_max, lon_min, lon_max)[source]#
Bases:
objectGeographic bounding box in decimal degrees (WGS-84 default).
- Parameters:
Examples
bbox = BBox(27.8, 28.9, 101.5, 103.2) assert 28.0 in bbox # latitude membership test print(bbox.centre) # (28.35, 102.35) print(bbox.area_deg2) # 1.1 × 1.7 ≈ 1.87 deg²
- class pycsamt.metadata.survey.SurveyMeta(name, project=None, operator=None, method='MT', bbox=None, date_start=None, date_end=None, crs='WGS84', n_stations=None, notes='', extra=<factory>)[source]#
Bases:
objectCampaign-level descriptor for an MT/AMT/CSAMT/TEM survey.
- Parameters:
name (str) – Short survey identifier (e.g.
"WILLY_L18_2023").project (str, optional) – Parent project name (e.g.
"Copper-gold exploration").operator (str, optional) – Acquisition company or institution.
method (str, default
"MT") – EM method:"MT","AMT","CSAMT","TEM","CSEM","BBMT","LAMT", or"LMT".bbox (BBox, optional) – Geographic bounding box of all station locations.
date_start (date, optional) – First day of field acquisition.
date_end (date, optional) – Last day of field acquisition.
crs (str, default
"WGS84") – Coordinate reference system name.n_stations (int, optional) – Total number of stations.
notes (str) – Free-form annotation.
extra (dict) – Arbitrary additional fields preserved on round-trips.
Examples
meta = SurveyMeta( name="WILLY_L18", project="Phase-III drill targeting", operator="EarthAI-Tech", method="AMT", bbox=BBox(27.8, 28.9, 101.5, 103.2), n_stations=128, ) print(meta.duration_days) # None (no dates set) # build from a Sites collection: meta2 = SurveyMeta.from_sites(sites, name="survey_A") # JSON round-trip: meta.to_json("survey_meta.json") meta3 = SurveyMeta.from_json("survey_meta.json")
- property duration_days: int | None[source]#
Number of acquisition days, or None when dates are incomplete.
- classmethod from_sites(sites, name='survey', method='MT', **kwargs)[source]#
Build a
SurveyMetafrom a Sites collection.- Parameters:
- Return type:
- update_edi_head(head)[source]#
Push survey fields into an EDI
Head.Only non-None fields are written so existing values are not overwritten unless a replacement is explicitly provided.
- classmethod from_dict(d)[source]#
Reconstruct from a plain dict (as produced by
to_dict()).- Parameters:
- Return type: