Proceedngs of the IMC, Gron, 2014 1 Software for analyss of vsual meteor data Krstna Veljkovć, Ilja Ivanovć Petnca Meteor Group, Valjevo, Serba mackkac@gmal.com, lja91vanovc@gmal.com In ths paper, we wll present new software for analyss of IMO data collected from vsual observatons. The software conssts of a package of functons wrtten n the statstcal programmng language R, as well as Java applcaton whch uses these functons n a user frendly envronment. R code contans varous flters for selecton of data, methods for calculaton of Zenthal Hourly Rate (ZHR), solar longtude, populaton ndex and graphcal representaton of ZHR and dstrbuton of observed magntudes. Java applcaton allows everyone to use these functons wthout any knowledge of R. Both R code and Java applcaton are open source and free wth provded user manuals and examples. 1 Introducton Ths paper presents results of software development for analyss of IMO vsual meteor data. The software conssts of a package of functons wrtten n the statstcal programmng language R, as well as Java applcaton. The purpose of R functons s to provde basc analyss, and Java applcaton s developed wth the am to make use of ths functons n a user frendly envronment. The R package MetFns contans data frames wth vsual meteor data (rate or magntude data), as well as varous flters for the selecton of the data, methods for calculaton of Zenthal Hourly Rate (ZHR), solar longtude, populaton ndex and a graphcal representaton of the ZHRs and the observed magntude dstrbutons. The developed Java applcaton allows users to call R functons wthout any knowledge about the R programmng language. Although ts purpose s to be proxy for these functons, the applcaton contans a few extra features whch can be useful to users. The applcaton uses a standard graphcal nterface, and t contans help fles from the R package. All software s open source and free, wth manuals and examples provded for both software packages. The rest of the paper s organzed as follows. In Secton 2, we provde detals about the nstallaton of package MetFns and the applcaton MetRApp. The descrpton of the R package and the Java applcaton s gven n Sectons 3 and 4, respectvely. Fnally, conclusons are drawn n Secton 5. 2 Installaton In order to nstall the R MetFns package, follow the next steps: 1. (f not already nstalled) download and nstall the latest verson of R 1 2. Download the packages astrofns 2 and plotrx 3 3. Download the package MetFns 4 In order to nstall the MetRApp applcaton: 1. (f not already nstalled) download and nstall latest JRE 5 2. Download and nstall the Runversal package from CRAN 6 3. Download the applcaton 7 Please note: In our software we use many dependences developed by thrd party organzatons. We are not responsble for that content. Also, please note that as new versons of those dependences are developed, and you use them, they may not be compatble wth our software. We wll try to keep up wth new versons of these dependences, but f you encounter dffcultes, please contact us. 3 R package The R package MetFns conssts of data frames contanng vsual meteor data and functons whch manpulate these data. Data frames can be dvded nto three sectons, by ther type: a. Yearly rate data named ratexx, where XX represents the two last dgts of the year 1 cran.r-project.org 2 cran.r-project.org/web/packages/astrofns/ 3 cran.r-project.org/web/packages/plotrx 4 cran.r-project.org/web/packages/metfns/ 5 http://www.oracle.com/technetwork/java/javase/downloads/nde x.html?sssourcesteid=ocomen 6 http://cran.r-project.org/web/packages/runversal/ 7 https://btbucket.org/val/metrapp (alternatvely t may be hosted on www.meteor.rs)
2 Proceedngs of the IMC, Gron, 2014 b. Yearly magntude data named magnxx c. Accompanyng data ncludes data frames radant wth coordnates of shower radants throughout the year, shw_lst, vmdbpers and vmdbste wth a lst of observed meteor showers, observers and observng stes, respectvely. Functons that manpulate vsual meteor data can be dvded nto four types: Functons that read rate or magntude data from the IMO ste or fle saved on a computer, named read.rate(data) and read.magn (data) Functons that select (flter) data by one or more crtera Functons that perform some calculatons over data Functons that draw graphcs wth the data Next, we wll cover the last three types of functons n more detal. Flter functons The Package MetFns contans 13 ndvdual flter functons and a global flter. Some flters can be used only on rate data and t wll be specfed n the descrpton of the flter. In the followng examples, we suppose that all rate and magntude data are prevously loaded (usng data functon, for example data (rate00)) flter.shw (data, shw) selects data for a gven vsual meteor dataset and specfed shower code. For example, f we want to select data for the Perseds from the rate data for the year 2000, we would call the functon flter.shw n the followng way flter.shw (rate00, shw="per") If we wsh to do the same selecton for the magntude data, we would type n the R console flter.shw (magn00, shw="per") flter.date (data, year, month, day.beg, day.end=day.beg) selects data for a gven vsual meteor dataset and specfed year, month and day (or days). By default, the argument day.end (endng day) s set to be equal to day.beg (begnnng day). So, f the argument day.end s not provded, the functon flter.date selects data for a gven date, otherwse t selects data for a perod of days, lmted by day.beg and day.end. The day gven n meteor datasets corresponds to the begnnng of the observng tme perod. For the selecton of the data, the day correspondng to the mddle of the observng tme perod s used. For example, to select rate data for the perod from 5 15 August 2007, we would type flter.date (rate07, year=2007, month=8, day.beg=5, day.end=15) In a smlar way, we would select the magntude data. flter.tme (data, tme.low, tme.up) selects data for a gven vsual meteor dataset and specfed tme perod. Arguments tme.low and tme.up are n the format 0-2359 specfyng, the lower and upper boundary of tme n hours and mnutes, respectvely. flter.mocode (data, mocode) selects data for a gven vsual meteor dataset and specfed IMO observer code. flter.obsname (data, name, name) selects data for a gven vsual meteor dataset and specfed observer's frst and last name. It can be used when one s not certan of the IMO observer code (due to possble non-unqueness of the fve letter combnaton). flter.gc (data, long.low=0, long.up=180, ew=c ("E","W"), lat.low=0, lat.up=90, ns=c ("N","S")) selects data for a gven vsual meteor dataset and specfed geographcal coordnates of the observng ste or nterval of geographcal coordnates. The arguments long.low and long.up represent, respectvely, the lower and upper boundary of longtude and lat.low and lat.up are, respectvely, the lower and upper boundary of lattude. If the values of the arguments long.low and long.up, as well as lat.low and lat.up, are the same, flter.gc selects data for a partcular observng ste. Ths flter enables one to select data only by longtude or lattude, wth the geographcal coordnates beng between gven boundares, less, greater or equal to a boundary. For example, f we wsh to select magntude data for the year 2004 for a ste wth longtude 19.7E and lattude 44.2N, we would type nto the R console. flter.gc (magn04, long.low=19.7, long.up =19.7, ew="e", lat.low=44.2, lat.up=44.2, ns="n") flter.ste (data, ste) selects data for a gven vsual meteor dataset and specfed observng ste. In order to use ths flter, the argument data has to consst of the column named "stecode". flter.country (data, country) selects data for a gven vsual meteor dataset and specfed country. The data selecton s performed usng flter.ste whch flters data by codes of all stes belongng to the specfed country. As for the functon flter.ste, data has to consst of the column named "stecode". flter.sol (data, sol.low=0, sol.up=359.999) selects data for a gven vsual meteor dataset and specfed solar longtude or nterval of solar longtudes. flter.f (data, F.low=1, F.up=3) selects data for a gven vsual meteor rate dataset and specfed correcton factor
Proceedngs of the IMC, Gron, 2014 3 or nterval of correcton factor for clouds. Arguments F.low and F.up represent, respectvely, the lower and the upper boundary for the correcton for clouds. flter.mag (data, mag.low=2.0, mag.up=7.5) selects data for a gven vsual meteor dataset and specfed lmtng magntude or nterval of magntudes. The arguments mag.low and mag.up are, respectvely, the lower and the upper boundary of the lmtng magntude. flter.h (data, shw, Ralpha=NULL, Delta=NULL, h.low=10, h.up=90) selects data for a gven vsual meteor dataset, specfed shower and ts radant elevaton or nterval of radant elevatons. The arguments h.low and h.up specfy, respectvely, the lower and the upper boundary of the radant elevaton. flter.totcor (data, shw, Ralpha=NULL, Delta=NULL, r, C=5) selects data for a gven vsual meteor rate dataset, specfed shower, populaton ndex and correcton factor. The correcton factor s equal to (Rendtel and Arlt, 2008) 6.5lmg r F C sn( h) where r s the populaton ndex, lmg the lmtng magntude, F the correcton factor for clouds and h the radant elevaton. One needs to specfy the maxmum value of the correcton factor C (default value of C s 5). The functon flter performs varous data selectons for a gven vsual meteor data. It s a wrapper functon for all prevously mentoned flters. For example, f we want to select rate data for observatons of the Perseds n Serba, tme perod 5 15 th August 2007, lmtng magntudes of 5.5 or hgher and a total correcton factor less than 5, we would use flter (rate07, shw="per", year=2007, month=8, day.beg=5, day.end=15, country= "Serba", mag.low =5.5, r=2.2) Calculaton functons In our R package, we have three functons that perform dfferent calculatons on vsual meteor data. solar.long (year, month, day, tme) calculates the solar longtude wth respect to the equnox of 2000.0 (Steyeart, 1991) for a gven year, month, day and tme n hours. zhr (data,year, month, day.beg, day.end, shw, r=null, Ralpha=NULL, Delta=NULL, k, c=1) calculates the average zenthal hourly rate (ZHR) of a meteor shower for a gven rate data, specfed shower, perod of days, populaton ndex, length of tme nterval and ZHR correcton. The average zenthal hourly rate s gven by the formula 1 k c n 1 ZHR k T eff, where k s the number of observng perods, n - the number of meteors seen durng the observng perod, T - the effectve tme or amount of tme an observer eff, actually scans the sky for meteors durng the observng perod, and C a correcton factor. In the numerator, c s ncluded to correct for the asymmetrc hgh and low end possbltes n a Posson dstrbuton (Bas, 2011.). By default, t s set to 1. The standard error of the average zenthal rate s calculated by the formula ZHR c C k n 1 The spatal number densty of meteorods producng meteors of magntude at least 6.5 s (per 10 9 km 3 ) (Koschack and Rendtel, 1990a) (10.65r 12.15) ZHR 1.82 3600 178700r V where V s the stream's geocentrc velocty. The standard error of the spatal number densty s approxmated wth ZHR Day s dvded n subntervals of k hours. For example, f k=12, subntervals are [ 0,12) and [ 12,24). Zenthal hourly rate s calculated for each subnterval n the followng manner: If mddle of observer's tme perod belongs to the subnterval, hs/hers data values are used n calculaton of ZHR. For example, f we want to select vsual meteor data for observaton of Oronds, perod 20-24th October 2006, 12 hours tme ntervals, and calculate ZHR rateor <- flter (rate06, shw="ori", year =2006, month=10, day.beg=20, day.end=24) zhr (rateor, year=2006, month=10, day.beg =20, day.end=24, shw="ori", r=2.5, k=12)
4 Proceedngs of the IMC, Gron, 2014 pop.ndex (data, year, month, day.beg, day.end=day.beg, shw, mag=-6:7) calculates populaton ndex of a meteor shower for a gven magntude data, specfed perod of days and magntude values. Cumulatve summarzed magntude dstrbuton (m) s formed by summng cumulatve frequences of all observers for each magntude class m. Usng the relatonshp 1,...,m magntudes, equaton ( m 1) r and substtutng 0, ( m) ) m ( m) (0 r (or ln ( m) ln (0) mln r n logarthmc form) can be wrtten. Then, populaton ndex r s calculated by the method of least squares, for chosen range of magntude values. Standard error of populaton ndex s approxmated wth r r n 2 e 1 n ( n 2) 1 where n s number of magntude values, resduals, =1,2,,n. m 2 e regresson The nterval for regresson s chosen such that: there s at least 3 meteors per magntude class, the fantest magntude classes are not ncluded ( m 4 or n exceptonal cases m 5) and there are at least 5 magntude classes avalable (Koschack and Rendtel, 1990b). All these condtons are fulflled for the range of magntude values prnted n results. To select magntude data for observaton of Perseds, tme perod 1-20th August 2007 and calculate populaton ndex usng magntudes -6 to +4, we would type magnper <-flter (magn07, shw="per", year=2007, month=8, day.beg=1, day.end=20) pop.ndex (magnper, year=2007, month=8, day.beg=1, day.end=20, shw="per", mag=-6:4) Drawng graphs functons We have two functons of ths type. mag.dstr (data, year, month, day.beg, day.end=day.beg, shw) graphcally represents magntude dstrbuton for a gven magntude dataset, specfed meteor shower and perod of days. It returns a plot of summarzed magntude dstrbuton consstng of hstogram and box-plot. For example, to select data for observatons of Perseds, perod 12-14th August 2007 and make a graphc of magntude dstrbuton, we would type nto R console magnper <-flter (magn07, shw="per", year =2007, month=8, day.beg=12, day.end=14) popi.dstrb (magnper, year=2007, month=8, day.beg=12, day.end=14, shw="per") zhr.graph (data, year, month, day. beg, day.end=day.beg, shw, r=null, Ralpha=NULL, Delta=NULL, k, c=1, type=c ("UTC", "sol")) represents graphcally the average zenthal hourly rate of a meteor shower wth error bars for a gven rate dataset, specfed shower, perod of days, populaton ndex, length of tme nterval, ZHR correcton and a type of x-axs dsplay. For type="utc", the tck marks on the x-axs represent coordnated unversal tme (UTC), set k dstance apart, wth labels specfyng date (at 00:00 UTC). For type="sol", the tck marks and the labels on the x-axs represent the solar longtude, correspondng to the above mentoned tme n UTC. Functon zhr.graph returns the xy plot of the Zenthal Hourly Rate, wth tme (UTC) or solar longtude on the x-axs and the ZHR on the y-axs. The ZHR s represented wth black flled crcles wth 68% confdence ntervals/one sgma error bars. For example, to select data for observatons of the Oronds, perod 20 26 th October 2006, 6hrs tme ntervals, and to generate a ZHR graph we would type: rateor <-flter (rate06, shw="ori", year =2006, month=10, day.beg=20, day.end=26) zhr.graph (rateor, year=2006, month=10, day.beg=20, day.end=26, shw="ori", r=2.5, k=6, type="utc") 4 MetRApp Java Applcaton The motvaton for ths applcaton ams to provde a smple user nterface to the R package and to allow all users to use ts functons wthout any necessary knowledge of R. Currently, t s developed only as a desktop applcaton, but wth potental to be moved to the web. User experence Ths applcaton uses a standard graphcal user nterface to communcate wth users. The setup needed for runtme s only to provde the paths for the nstallaton of R and other
Proceedngs of the IMC, Gron, 2014 5 resources needed to run the applcaton (datasets, tables etc.). Software archtecture of MetRApp Ths applcaton s developed usng standard three ter archtecture. All compled versons and the applcaton are avalable at the lnk gven n secton 2 and t can be ndependently developed by other organzatons. The applcaton s developed usng Java 7 and Netbeans IDE. The verson control software s gt and the repostory host s Btbucket. A short descrpton of the software archtecture of ths applcaton s provded too, as a startng pont for any potental efforts. Data ter MetRApp does not mantan any data n the databases snce ts functon s to be a proxy between the R package and the users. However, snce the results of the executon of the R code are contaned n R data structures, approprate doman classes have to be mplemented n MetRApp. In ths case, a doman class for the R data frame has to be mplemented. Three Java classes are mplemented to provde an approprate representaton of data from the R data frame abstract class DataFrame, and two classes whch extend the prevous one StrngDataFrame and DataFrameFromCSV. More detals about doman classes are provded n the documentaton on the project s repostory. In addton to these doman classes, more of them had to be mplemented for the IMO data. These new classes are a representaton of, for example, persons or stes nstances n the correspondng datasets. Also, the R code whch s used to evaluate data s nserted n the class IntalRCode. Logc ter The logc part of ths system s mplemented n several packages. The frst part contans flters for the selecton of data whch correspond to the prevously explaned R flters. These Java flters had to be mplemented to avod unnecessary parsng of data n the communcaton between MetRApp and MetFns. Ths approach allows very fast flterng of data whch s done n MetRApp only, wthout callng R code. However, only 11 of the 13 flters could be fully mplemented n Java because of the dependency to thrd party functons avalable exclusvely n R for some flters. The archtecture of ths package s very basc there s an abstract class JavaFlter whch s then extended by concrete flters whch mplement the logc of the approprate R flter. Ths abstract class has reference to the current dataset whch s used n the applcaton runtme, and also provdes the abstract method whch accepts HashMap of parameters whch are needed for a concrete flter to be executed. As stated before, MetRApp calls R functons to evaluate data and returns the result to the user. Ths communcaton s acheved usng RCaller 8, a software lbrary for callng R functons wthn Java programs. The dea behnd RCaller s very smple the Java program (n ths case MetRApp) s the caller and t sends requests (contanng R code and data) va XML and accepts responses, agan n XML format. The logc ter of the applcaton also contans a few controllers whch are responsble for dspatchng calls between objects and for provdng an essental backbone for all mplemented functonaltes. The controllers have also references to all data sources and they provde a control on ther correct usage. Presentaton ter As stated before, ths applcaton uses a standard graphcal user nterface platform. It s based on Swng components, wthout any addtonal customzaton (and dependences). The structure of the presentaton ter s not very well optmzed, snce new efforts were made to move ths applcaton to the web. Future mprovements A very large part of the applcaton s mplemented usng software patterns whch provde a large flexblty and very much smplfy the mplementaton of new functonaltes. Sx software patterns were mplemented n the applcaton, but not all of them are currently used. Requests for new functonaltes are welcome, as well as revews of the current verson of the software. Our group wll contnue to develop ths software, but also support new ntatves by branchng ths code base. 5 Concluson The developed software covers a vast majorty of use cases 9 specfed by our meteor observaton group. Due to ts modular archtecture, t s possble to expand the applcaton specfcaton and to provde addtonal features f needed. All resources ncludng source code, test examples, documentaton and other fles are provded at publc repostores, and everyone can develop ther specfc dstrbuton of ths software. We hope that other IMO observers wll fnd our software useful. However, f new features are requested, we shall try to mplement them n new releases of our software. Acknowledgment We would lke to thank Branslav Savć whose suggestons and comments were nvaluable n developng our software. 8 https://code.google.com/p/rcaller/ 9 http://en.wkpeda.org/wk/use_case
6 Proceedngs of the IMC, Gron, 2014 References Bas P. V. (2011). A Note on Posson nference and extrapolatons under low raw data and short nterval observaton condtons. WGN, Journal of the IMO, 39, 14 19. Koschack R. and Rendtel J. (1990a). Determnaton of spatal number densty and mass ndex from vsual meteor observatons (I). WGN, Journal of the IMO, 18, 44 58. Koschack R. and Rendtel J. (1990b). Determnaton of spatal number densty and mass ndex from vsual meteor observatons (II). WGN, Journal of the IMO, 18, 119 140. Rendtel J. and Arlt R., edtors (2008). IMO Handbook For Meteor Observers. IMO, Potsdam. Steyaert C. (1991). Calculatng the Solar Longtude 2000.0. WGN, Journal of the IMO, 19, 31 34.