steadfastasart/geoscience-skills/harmonica
Claude Code and agent skill by steadfastasart/geoscience-skills
- community
Checking that the SKILL.md file is still in the repository.
Gravity and magnetic data processing and forward modelling using Fatiando a Terra. Use when the agent needs to: (1) Compute gravity forward models (point masses, prisms, tesseroids), (2) Apply terrain/Bouguer corrections, (3) Grid scattered potential field data with equivalent sources, (4) Perform upward/downward continuation, (5) Calculate magnetic anomalies from magnetized bodies, (6) Apply derivative filters (gradients, tilt angle), (7) Process regional or local gravity surveys.
Install
npx vskill@latest install steadfastasart/geoscience-skills/harmonicaSKILL.md
Harmonica - Gravity and Magnetics
Quick Reference
Key Functions
| Function | Purpose | |
|---|---|---|
point_gravity | Gravity from point masses | |
prism_gravity | Gravity from rectangular prisms | |
tesseroid_gravity | Gravity from spherical prisms (regional/global) | |
prism_magnetic | Magnetic anomaly from prisms | |
prism_layer | Create layer of prisms from topography | |
EquivalentSources | Grid scattered data with equivalent sources | |
upward_continuation | FFT-based upward continuation | |
bouguer_correction | Simple Bouguer plate correction |
Essential Operations
Forward Model - Rectangular Prism
Terrain Correction
Equivalent Source Gridding
Magnetic Forward Model
Derivative Filters
Coordinate System
Harmonica uses a right-handed coordinate system:
- Easting (x): positive east
- Northing (y): positive north
- Upward (z): positive up (heights positive, depths negative)
Units are SI: meters for distance, kg/m3 for density, mGal for gravity.
When to Use vs Alternatives
| Use Case | Tool | Why | |
|---|---|---|---|
| Gravity/magnetic forward modelling | Harmonica | Purpose-built, Fatiando ecosystem | |
| Potential field inversion | SimPEG | Full inversion framework with regularization | |
| Commercial gravity processing | Oasis Montaj | Industry-standard GUI, proprietary formats | |
| Simple Bouguer corrections only | Custom numpy | Fewer dependencies for one-off calculations | |
| Equivalent source gridding | Harmonica | Best open-source option for potential fields | |
| Regional/global scale | Harmonica (tesseroids) | Handles spherical geometry natively | |
| Magnetic data reduction to pole | Harmonica | FFT-based filters for gridded data | |
| Teaching/prototyping | Harmonica | Clean API, good documentation |
Choose Harmonica when: You need open-source gravity/magnetic processing with forward modelling, terrain corrections, or equivalent source gridding. It integrates well with Verde for projections and gridding. Part of the Fatiando a Terra ecosystem.
Choose SimPEG when: You need to invert potential field data for subsurface property distributions (density or susceptibility models).
Choose Oasis Montaj when: You work in an industry setting that requires proprietary formats, commercial support, or GUI-based interactive processing.
Common Workflows
Process Gravity Survey with Terrain Correction and Gridding
- [ ] Load raw gravity observations and station coordinates
- [ ] Apply latitude, free-air, and tidal corrections
- [ ] Load DEM and build prism layer with
hm.prism_layer() - [ ] Compute terrain effect at observation points
- [ ] Subtract terrain effect from free-air anomaly to get Bouguer anomaly
- [ ] Project coordinates to Cartesian with
verde.get_projection() - [ ] Block-reduce data if station density is uneven
- [ ] Fit equivalent sources with
hm.EquivalentSources() - [ ] Grid the Bouguer anomaly onto a regular grid
- [ ] Apply
vd.distance_mask()to mask areas far from data - [ ] Apply derivative filters (horizontal gradient, tilt angle) for interpretation
- [ ] Perform upward continuation to enhance regional features
- [ ] Export gridded data to NetCDF
Common Issues
| Issue | Solution | |
|---|---|---|
| Wrong gravity sign | Check z-axis convention (positive upward) | |
| Poor equivalent source fit | Adjust depth and damping parameters | |
| Slow terrain correction | Reduce DEM resolution or use larger prisms | |
| Edge effects in FFT filters | Pad grid before applying upward_continuation | |
| Coordinate mismatch | Ensure consistent use of projected vs geographic coords |
Tips
- Use projected coordinates (meters) for local surveys
- Use tesseroids for regional/global scale modelling
- Equivalent sources handle irregular data spacing well
- Choose appropriate density (2670 kg/m3 typical for upper crust)
- Check sign conventions - depths are negative z values
References
- [Gravity/Magnetic Corrections](references/corrections.md) - Standard corrections and anomalies
- [Forward Modeling](references/forward_modeling.md) - Detailed forward modeling methods
Scripts
- [scripts/gravity_processing.py](scripts/gravity_processing.py) - Process gravity survey data
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingharmonica/SKILL.md
Popularity
- Repository stars
- 28
- Repository forks
- 3
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/steadfastasart/geoscience-skills/harmonica)