read maccs.pro

InfoInfo
Search:    

; Comments added by Erik Johnson 7/16/07

; read_maccs.pro, compiles and runs with idl

; called by igloolik_despike.pro (which creates despiked .s2 files)
; called by five_sec_avg.pro (which creates 5 second average .5s files)
; called by sec_to_min.pro (which creates 1 minute average .1m files)

; reads 5 different types of maccs data: raw maccs, cleaned maccs, raw gsc, cleaned gsc, 5 sec & 1 min

; GSC = Geological Survey of Canada (The Geomagnetic Monitoring Service of the GSC operates a network of 13 Magnetic Observatories across Canada which includes all CANMOS magnetometers and the Alert magnetometer. It used to operate the Mould Bay magnetometer which is now closed.)
; calculates and returns time

; stores the data in variables and returns them
; the only required parameter is the filename unless it is a raw file (then raw must be set to 1 or 2)
; Ex: read_maccs, "CD04025.s2"
; if you set the diag parameter (diag="something") it outputs the following to the command line:
; *****************************************************************************
; if you are reading a raw file you must set the raw parameter to 1 for a maccs file or 2 for a gsc file.

; to prevent the program from printing the name of the file it is processing: quiet="something"
; If you set the nt parameter (ex: nt="nt") the field values will be divided by 1000 to get the values in nanoteslas.

; Ex: read_maccs, "/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/CD07193.dat", diag="bob", raw=1, nt="nanoT", quiet="please"

pro read_maccs,filename,time,bx1,by1,bz1,type,raw=raw,nt=nt,$

; set the keyword raw to 1 for raw maccs and to 2 for raw gsc

; x and y are the byte dimensions of the file. The order for the different file

; types is raw maccs, raw gsc, cleaned maccs, cleaned gsc, 5 sec, and 1 min

; (the raw files do not have fixed length)

x = [35, 21, 28, 15, 15, 14]

y = [00, 00, 86400L, 86400L, 17280L, 1440L]

sizes = [00, 00, 2419200L, 1296000L, 259200L, 20160L]

; Open file and get file size

; Extract the individual data arrays from the file byte array. Also, divide

; the field values by 1000. to get nanotesla.

; all files

print, bx2(10)

print, by2(10)

print, bz2(10)

end

This is a Wiki Spot wiki. Wiki Spot is a non-profit organization that helps communities collaborate via wikis.