#!/bin/bash

echo "all stations"
curl -o fdsnws-station_gee_stations.xml 'http://service.iris.edu/fdsnws/station/1/query?net=TA,II,IU,IC,BK,CI,N4&cha=HH?,BH*&level=station&format=xml&nodata=404'

for NET in II IU IC US TA N4 BK CI CO
do
    echo "$NET channels"
    curl -o fdsnws-station_${NET}_all.xml "http://service.iris.edu/fdsnws/station/1/query?net=${NET}&cha=HH?,BH?&level=channel&includeavailability=true&format=xml&nodata=404"
done
