How to make monthly earthquake catalog

1) Concatinate daily databases into monthly database and remove daily databases:
cd /Seis/processing/analyzed/YEAR_MO
aeic_dbconcat_event analyzed_YEAR_MO_01 .... analyzed_YEAR_MO_31 analyzed_YEAR_MO
mkdir db_daily
mv analyzed_YEAR_MO_DA.* db_daily
mv analyzed_YEAR_MO_DA db_daily

2) Review monthly database:
cd /Seis/processing/qc/YEAR_MO
cp /Seis/processing/analyzed/YEAR_MO/analyzed_YEAR_MO.* .
This is assuming that quality control of processed events was done previously.

3) Download PDE catalogs:
cd /Seis/catalogs/pde/Raw
ftp hazards.cr.usgs.gov (anonymous log-in, e-mail as password)
cd weekly
type binary
get ehdfYEARNNw.dat
quit

4) Convert weekly PDE's into origin tables:
pde2origin pde_file dbname

5) Update pde_YEAR database.
If it's continuation of a year, add new tables to existing database:
dbmerge dbnew dbexisting
For new year just concatinate new databases:
aeic_dbconcat db1 db2 ... dbout

6) Combine PDE and AEIC databases. Unpdate magnitudes.
Subset updated new database for your month and region of Alaska (49-72N, 165E-130W) and save it as a new database in /Seis/processing/qc/YEAR_MO. Identify missing PDE solutions and add those to the analyzed database (you can remove duplicate solutions from the saved PDE origin table and then concatinate updated PDE with the existing analyzed database). Make sure there are rows for new PDE events in event table and evids in origin table, edit it manually if necessary. Also, update mb's and Ms's from PDE and Harvard catalogs
(http://www.seismology.harvard.edu/CMTsearch.html).

7) Update /Seis/catalogs/aeic/ depository.
Call final database aeic_YEAR_MO and move it into /Seis/catalogs/aeic/YEAR_MO. You may need to create YEAR_MO directory first.
cd /Seis/catalogs/aeic
mkdir YEAR_MO
cd YEAR_MO
mv /Seis/processing/qc/YEAR_MO/aeic_YEAR_MO.* .
Change write permissions on it:
chmod a-w aeic_YEAR_MO.*

8) Create catalog:
cd /Seis/reports/catalogs
mkdir YEAR_MO
cd YEAR_MO
Copy one of the previous catalogs to use as a template:
cp ../YEAR_MM/catalog_YEAR_MM.fm catalog_YEAR_MO.fm

9) Create maps and event lists:
aeic_db2catalog /Seis/catalogs/aeic/YEAR_MO/aeic_YEAR_MO
(click"x" on figure 2 for cross-section, hit "return" in x-window where you run aeid_db2catalog to make cross-section figure, click "q" on cross-section figure to exit out of it; close all figures with [CTRL]-C)

10) Create summary figure:
db2zmap /Seis/catalogs/aeic/YEAR_MO/aeic_YEAR_MO (you may need to copy db2zmap program from /home/natasha/bin)
Open Matlab, start ZMAP:
matlab -nodesktop
start_zmap
click "Create or modify *.mat Datafile"
click "EQ Datafile"
"Choose a data format" -> " ASCII columns" -> "Load"
Enter directory "/Seis/reports/catalogs/YEAR_MO"
Enter file name "zmap_list"
Click "Open" -> Click "Go"
ZMAP will make a map. In Matlab command window type "sumaeicmonthly2". It will make summary plot. Save this plot as summary_plot.epsi:
print -noui -depsc2 /Seis/reports/catalogs/YEAR_MO/summary_plot.epsi
Quit out of ZMAP

11) Edit catalog with Frame Maker
- replace cover picture and caption
- make mini-maps for highlights and write short descriptions of a couple events (see examples in other catalogs)
- insert monthly_list, monthly_m4, and monthly_quarry (File -> Import -> Use "Copy into Document" option -> Use "Convert from Text" option-> Use "Treat Each Line As a Paragraph" option
- add felt reports (look through releases)
- edit fig2b.ps with IslandDraw (ungroup, remove extra-symbols in the left-bottom corner, group, position in the center of the page) and save as fig2b.epsi

12) Print hard copy of the catalog to present at the Lab meeting and leave on the lunch table for review.

13) Update web depository.
Save as PDF file and move it to:
cp catalog_YEAR_MO.pdf /usr/local/Mosaic/Seis/monthly_reports/.
Update monthly_reports.html (/usr/local/Mosaic/Seis/html_docs/). You have to be part of Mosaic group to be able to do this. Otherwise, ask someone who can.

14) Update CNSS depository:
cd /Seis/catalog/cnss
db2cnss /Seis/catalogs/aeic/YEAR_MO/aeic_YEAR_MO cnss_YEAR_MO
rsh megathrust -l catalog
(ask Mitch to update login list with your username:host for catalog:megathrust login)
cd /Seis/catalog/cnss
submit_cnss YEARMO cnss_YEAR_MO
exit

15) Update aeic_tracking_database:
dbe -e /Seis/processing/tracking_database/aeic_analysis.months
For your month change "status" to "done" and "aeic_catalog" to "created".

16) Update Total database:
cd /Seis/catalogs/aeic
aeic_dbconcat_event Total/Total YEAR_MO/aeic_YEAR_MO Total_new
(dbmerge program won't work for some reason)
Check Total_new database, make sure it's OK, and replace Total database with Total_new.

17) Update uptodate database for the catalog websearch:
cp Total.origin /usr/local/apache/htmldocs/summary_database/uptodate.origin
cp Total.origerr /usr/local/apache/htmldocs/summary_database/uptodate.origerr
cp Total.event /usr/local/apache/htmldocs/summary_database/uptodate.event

18) Update db2catalog.html with new end date (/usr/local/Mosaic/Seis/html_docs/). Again, you have to be on Mosaic group to be able to do this.

19) You are done now!