# SuperWASP Asteroids Archive

Number of asteroids:
Number of data points:

### SuperWASP asteroid archive API documents

Information about getting data from the REST API into your own programs. (This site is currently in developement, please forgive the spelling mistakes). This web site uses JavaScipt to retrieve the data using these methods.

This API is broken down into sections: Summary Queries, Stat Queries, Catalogue Queries and Data Queries . The root url for the API is http://asteroids.neilparley.com/asteroidsAPI.

The API can return in four formats JSON - JavaScipt Object Notation, HTML - when using a web browser, XML or plain text. The API will read the Accept header for all requests. In this order, if the header contains text/html xml will be returned, if the header contains text/pain plain text will be returned, if the header contains application/json JSON will be return and if the header contains application/xml XML will be return. If none are found JSON will be returned. The a web browser's Accept might look something like: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 in which case html will be returned. Some scriptting lanuages will send */* as the accept header, so JSON will be returned in this case. The format returned can be overridden be using the format url string. ?format=json will return json, ?format=html will return html, ?format=xml will return xml and ?format=text will return text (anything else will be return as JSON). Examples of the different formats are below:

##### JSON
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/number/350?format=json
{
"ampMax": 0.23, "binFlag": ".", "ampMin": 0.1, "number": 350, "period": 9.178, "lcQual": "3 ",
}
##### HTML
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/number/350?format=html
self: Asteroid Lightcurve Catalogue data for (350)ampMax : 0.23ampMin : 0.1binFlag : .lcQual : 3 number : 350period : 9.178
##### Text
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/number/350?format=text
self :
about : Asteroid Lightcurve Catalogue data for (350)
href : /asteroidsAPI/cats/lc/number/350
ampMax : 0.23
ampMin : 0.1
binFlag : .
lcQual : 3
number : 350
period : 9.178

##### XML
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/number/350?format=xml
<resource>
<ampMax>0.23</ampMax>
<ampMin>0.1</ampMin>
<binFlag>.</binFlag>
<lcQual>'3 '</lcQual>
<link href="/asteroidsAPI/cats/lc/number/350" rel="self" title="Asteroid Lightcurve Catalogue data for (350)"/>
<number>350L</number>
<period>9.178000000000001</period>
</resource>

The API tries to be self describing. I.e. pointing to the root of the URL returns information about the next level of the API.
Get: http://asteroids.neilparley.com/asteroidsAPI
cats: Ingested asteroid cataloguesdata: SuperWASP asteroid photometry dataperiods: SuperWASP asteroid lightcurve rotation dataself: API rootstats: SuperWASP asteroid data statssummary: Detected asteroids summary information
There are also hypermedia links which can be navigated through the API. As html these appear as clickable links, in xml as rel links, in json in the _links object and in text similarly under _links.. The self link is the current url requested. No all the hypermedia links are displayed in the examples below to save space.

#### Summary Queries

The summary database holds catalogue information on the asteroids as well as the best rotation period, phasecurve information found in the SuperWASP data (if the asteroid has had a lightcurve / phasecurve created).

To get a list of the asteroid names in the database:

Get: http://asteroids.neilparley.com/asteroidsAPI/summary/name 
This returns a JSON object with an array of names for example {"names": ["1036 T-2", "1080 T-3" ... ] }. Similarly to get a list of Asteroid numbers:

Get: http://asteroids.neilparley.com/asteroidsAPI/summary/number 

This returns a JSON object with an array of numbers for example {"numbers": [1, 2, 3, 4, 5, 6, ... ] }.

Summary information can then be retrieved by querying on the asteroid number or the asteroid name, for example:

Get: http://asteroids.neilparley.com/asteroidsAPI/summary/number/{ASTEROID NUMBER} 
Get: http://asteroids.neilparley.com/asteroidsAPI/summary/name/{ASTEROID NAME}  

This will return a JSON object. For example for {ASTEROID NAME} = Ornamenta or {ASTEROID NUMBER} = 350, the array that is returned is:

{
"hCat": 8.37, "gErr": 0.0947403, "eccentricity": 0.155188, "name": "Ornamenta",
"gWasp": 0.401325, "number": 350, "semiAxis": 3.11364, "hWasp": 8.68066,
"pErr": 0.00156735, "bv": 0.69, "sizeIras": 118.3, "hErr": 0.0726351,
"pWasp": 9.178, "gCat": 0.15, "inclination": 24.8848, "taxIras": "C"
}

Here, gWasp, hWasp, gErr and hErr are the fitted parameters for the best SuperWASP phasecurve. pWasp and pErr are the fitted parameters for the best SuperWASP rotation curve (in hours). The rest of the parameters are ingested from the astorb asteroid orbital elements. sizeIras is the IRAS diameter (km) and taxIras is the IRAS Taxonomic classification. hCat and gCat are the catalogued H and G values for the asteroid. bv gives an indication of the asteroids colour. semiAxis, eccentricity and inclination give details about the asteroids orbit.

The asteroids summary data can also be queried through the API, this is done by sending query arguments through the name or number url. These arguments are, pWasp_min / pWasp_max = min and max SuperWASP periods, hWasp_min / hWasp_max = limits on SuperWASP found absolute magnitude, gWasp_min / gWasp_max = limits on SuperWASP found slope parameter, taxIras = asteroid taxonomic classification, sizeIras_min / sizeIras_max = limits on the IRAS diameter, bv_min / bv_max = limits on the asteroid colour, inclination_min / inclination_max = limits on the asteroids' inclination, eccentricity_min / eccentricity_max = limits on the asteroids' eccentricity, semiAxis_min / semiAxis_max = limits on the asteroids' semiAxis, hCat_min / hCat_max = limits on the catalogue absolute magnitude values and gCat_min / gCat_max = limits on the catalogue slope parameters.

For example to query for objects with semiAxis between 1.0 and 2.0 AU (inclusive) you could use:

Get: http://asteroids.neilparley.com/asteroidsAPI/summary/name?semiAxis_min=1.0&semiAxis_max=2.0 
Get: http://asteroids.neilparley.com/asteroidsAPI/summary/number?semiAxis_min=1.0&semiAxis_max=2.0 


#### Stat Queries

The stats database holds summary information on the data held in SuperWASP asteroid database. This avoids having to make slower queries on the main database when you want to find out if there is data on a particular asteroid.

To get a list of the asteroid names in the database:

Get: http://asteroids.neilparley.com/asteroidsAPI/stats/name 

This returns a JSON object with an array of names for example {"names": ["1036 T-2", "1080 T-3" ... ] }. Similarly to get a list of Asteroid numbers:

Get: http://asteroids.neilparley.com/asteroidsAPI/stats/number 
This returns a JSON object with an array of numbers for example {"numbers": [1, 2, 3, 4, 5, 6, ... ] }.

Stats information can then be retrieved by querying on the asteroid number or the asteroid name, for example:

Get: http://asteroids.neilparley.com/asteroidsAPI/stats/number/{ASTEROID NUMBER} 
Get: http://asteroids.neilparley.com/asteroidsAPI/stats/name/{ASTEROID NAME} 


This will return a JSON object. For example for {ASTEROID NAME} = Ornamenta or {ASTEROID NUMBER} = 350, the array that is returned is:

{
"fluxZero": 2132, "flux2010": 1578, "flux2011": 0, "number": 350, "fluxTotal": 14231, "nights": 243,
"minPhase": 4.089, "nights2010": 26, "nights2011": 0, "nightStart": "2004-05-04", "nFields": 25,
"maxPhase": 20.486, "flux2007": 4285, "flux2006": 2149, "flux2004": 503, "qCode": 6, "flux2009": 3846,
"flux2008": 1870, "medMag": 13.26, "nightEnd": "2010-06-02", "nights2004": 37, "nights2007": 84,
"nights2006": 46, "nights2009": 36, "nights2008": 14
}


Here nightStart is the night of the first data point for the asteroid and nightEnd is the night of the last data point for the asteroid. nights give the total number of nights where there is asteroid data. nights2004 etc. give the number of nights there are data for each year. fluxTotal is the total number of photometric flux points, fluxZero is the number of detections where photometry failed, flux2009 etc. gives the number of photometric points for each year. minPhase is the minimum phase angle the data covers and similarly maxPhase is the maximum phase angle. medMag is the median magnitude of the asteroid in the data, nFields is the number of different SuperWASP photometric fields the asteroid was detected in. qCode is the data quality code from 0 to 6, which is used as a rating on how much data exists on an asteroid. For example a qcode of 6 would mean there is enough data for a lightcurve and phasecurve, a qcode of 0 would mean that there are very few detections and the asteroid detection might be a false positive.

The asteroids summary data can also be queried through the API, this is done by sending query arguments through the name or number url. All the parameters above can be queried with _min and _max appended to defined the limits of the query. For example to query asteroids where data was taken before 2005 and where there are 100 or more points.

Get: http://asteroids.neilparley.com/asteroidsAPI/stats/number?nightStart_max=2005-01-05&fluxTotal_max=100
Get: http://asteroids.neilparley.com/asteroidsAPI/stats/name?nightStart_max=2005-01-05&fluxTotal_max=100


#### Catalogue Queries

There are five catalogues that have been injested and are made available to help add useful information to the SuperWASP asteroid data. The short hand names for the catalogues can be found by calling the cats url, i.e.

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/


Returns (with format = html):

diam: Catalogue with asteroids' diameterslc: Catalogue of asteroid lightcurve datamag: Catalogue with asteroids' absolute magnitude and phase informationnames: Catalogue to convert between asteroid name and numberself: Asteroid Cataloguestax: Catalogue with asteroid taxonomy


Information about each catalogue can be found by calling the base URL for each of the catalogues, for example for the names catalogue:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/names/


Returns (with format = text):

_links :
name :
about : Asteroid name to number
href : /asteroidsAPI/cats/names/name
number :
about : Asteroids number to name
href : /asteroidsAPI/cats/names/number
self :
href : /asteroidsAPI/cats/names
columns :
name : Asteroid name
number : Asteroid number
info :
name : EAR-A-5-DDR-ASTNAMES-DISCOVERY-V12.0
records : 181699
url : http://sbn.psi.edu/pds/resource/discover.html


Here the info.url field points to the pds summary page about the catalogue, info.records is the number of enteries for the catalogue and info.name is the pds catalogue name. The detail columns and methods for each catalogues are outlined below.

##### Names Catalogue

The names catalogue is an import of the ASTEROID NAMES AND DISCOVERY data catalogue (EAR-A-5-DDR-ASTNAMES-DISCOVERY-V12.0). Only the asteroid number and asteroid name are imported and this catalogue API allows the user to translate name into number and number into name for asteroids that are not in the asteroid summary table, i.e. have not been detected by SuperWASP. To get the asteroid name use for example:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/names/number/350


Which returns the JSON object:

{"name": "Ornamenta"}

And similarly to get the number from the name use:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/names/name/Ornamenta

Which returns

{"number": 350}

Unlike the later catalogues the name catalogue can not be searched

##### Diam Catalogue

The diam catalogue is an import of the DIAMETERS AND ALBEDOS data catalogue (IRAS-A-FPA-3-RDR-IMPS-V6.0). The catalogue can be queried by a number or named of asteroid for example:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/diam/number/350
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/diam/name/Ornamenta


Will return the JSON object:

{"diam": 118.35, "albedoErr": 0.005, "h": 8.37, "number": 350, "diamErr": 4.5, "albedo": 0.0566}

Here number is the asteroid number (when querying by name the url is forwarded to the asteroid number internally using the names catalogue data), h is the absolute magnitude, albedo is the mean derived geometric albedo, albedoErr is the 1-sigma uncertainty in mean albedo, due solely to the precision of the IRAS Flux data, diam is the mean diameter computed from h and mean albedo (in km) and diamErr is the 1-sigma uncertainty in diam, due solely to the precision of the IRAS flux data.

The catalogue can also be queried to fine asteroid numbers that match a certain criteria (when querying by name only non-null names will be returned). The h, diam and albedo columns can all have _min and _max appended to them in a query string to define the search parameters. For example to fine asteroid numbers where the diameter is greater or equal to 300km and that have an absolute magnitude less than or equal to 8, you can use:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/diam/number?diam_min=300&h_max=8

Which returns the array of numbers that match:

{"numbers": [1, 2, 4, 10, 52, 511, 704]}

##### Mag Catalogue

The mag catalogue is an import of the ASTEROID MAGNITUDES AND SLOPES data catalogue (EAR-A-5-DDR-ASTERMAG-V12.0). The catalogue can be queried by asteroid number or name, for example

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/mag/number/350
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/mag/name/Ornamenta


Will return the JSON object:

{"origin": "a", "h": 8.37, "number": 350, "g": 0.15}

Here number is the asteroid number (when querying by name the url is forwarded to the asteroid number internally using the names catalogue data), h is the absolute magnitude, g is the slope parameter and origin is f for a fitted slope parameter value or a for assumed from taxonomic classification.

The catalogue can also be queried to fine asteroid numbers that match a certain criteria (when querying by name only non-null names will be returned). The h and g columns can have _min and _max appended to them to define a search range of a absolute magnitudes and slope parameters. The origin column can also be included in the search string to select fitted or assumed values. For example, to fine asteroids with fitted slope parameters less than or euqal to 0.05, the URL would be:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/mag/number?g_max=0.05&origin=f

Which returns the array of asteroid numbers that match:

{"numbers": [65, 109, 163, 173, 192, 236, 505, 521, 704, 712, 887, 1580]}

##### Tax Catalogue

The tax catalogue is an import of the ASTEROID TAXONOMY data catalogue (EAR-A-5-DDR-TAXONOMY-V6.0). The catalogue can be queried by asteroid number or name, for example

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/tax/number/350
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/tax/name/Ornamenta

Will return the JSON object:

{"bus": "-  ", "sos": "Caa", "number": 350}

Here number is the asteroid number, bus is the taxonomic classification based on the spectra of the SMASSII survey (Bus and Binzel 2002) and sos is the S3OS2 taxonomic classification according to the method of [BUS&BINZEL2002] (Icarus 158, 146-177.). "- " indicates a null field for that asteroid.

The catalogue can also be queried to fine asteroid numbers (when querying by name only non-null names will be returned) that match the taxonomic classifications for the bus and sos columns. For example the asteroids that have a SMASSII survey class xC and an S3OS2 class of C can be found be the URL:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/tax/number/?bus=Xc&sos=C

Which will return the array of asteroid numbers:

{"numbers": [65, 140, 626, 2906]}

##### Lc Catalogue

The lc catalogue is an import of the ASTEROID LIGHTCURVE DERIVED DATA catalogue (EAR-A-5-DDR-DERIVED-LIGHTCURVE-V13.0). The catalogue can be queried by asteroid number or name, for example

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/number/350
Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/name/Ornamenta

Will return the JSON object:

{"lcQual": "3 ", "binFlag": ".", "number": 350, "ampMax": 0.23, "period": 9.178, "ampMin": 0.1} 

Here number is the asteroid number, period is the rotation period of the asteroid (hours), ampMax upper limit of lightcurve amplitude range (or amplitude if only single value is given), ampMin lower limit of lightcurve amplitude range (or null if single value is given), lcQual code describes the reliability of the lightcurve results (4 = full coverage and pole position, 3 = full coverage, 2 = result based on less than full coverage, 1 = result based on fragmentary lightcurve(s), 0 = result later proven incorrect), and binFlag indicates if the asteroid is in a binary (?=possible, B=Binary system, M= Multiple system, more than two, .=not a binary i.e null).

The catalogue can also be queried to fine asteroid numbers that match a certain criteria (when querying by name only non-null names will be returned). The period, ampMax, ampMin and lcQual columns can have _min and _max appended to them to define a search range and the binFlag column can also be queried. For example to find binary asteroids, where the lower limit of lightcurve amplitude has been report at greater or equal to 0.3 magnitudes and that have a period of 10.0 hours or greater, the URL would be:

Get: http://asteroids.neilparley.com/asteroidsAPI/cats/lc/number?ampMin_min=0.3&binFlag=b&period_min=10

Which will return the array of asteroid numbers:

{"numbers": [2478, 4492]}

#### Data Queries

The data database table holds all the photometry data on the asteroids. This api can be used to download asteroid data for a asteroid for lightcurve analysis. This api consists of two parts, using query in the url string will return the actual number of data points for that set of parameters; without the actual data being returned. The data can be restricted to a certain date range and phase range using the url parameters, startDate inclusive start date, endDate inclusive end date, minPhase inclusive minimum phase and maxPhase inclusive maximum phase.

For example to query the data for asteroid Ornamenta (350) for 2006 you could use:

Get: http://asteroids.neilparley.com/asteroidsAPI/data/query/number/350?startDate=2006-01-01&endDate=2006-12-31
Get: http://asteroids.neilparley.com/asteroidsAPI/data/query/name/ornamenta?startDate=2006-01-01&endDate=2006-12-31


This returns a JSON object. In this example the object returned is:

{
"startDate": "2006-05-30", "rows": 2149, "endDate": "2006-09-24",
"minPhase": 4.08887004852295, "nights": 46,
"fields": ["222SW1918-3537", "222SW1956-3537", "221SW1954-3523", "223SW1941-3559", "223SW1957-2801"],
"maxPhase": 17.1123008728027
}


Here startDate and endDate give the date range of available data. I.e. even though we searched for all of 2006, data for this asteroid is only available from May to September 2006. Similarly minPhase and maxPhase give the phase range for the available data. rows gives the number of good photometric data points and nights gives the number of nights of data. The fields array lists all the SuperWASP fields the asteroid was detected in. To download the photometry data for the asteroid from just one of these fields you can append the field name to the url. For example:

Get: http://asteroids.neilparley.com/asteroidsAPI/data/query/number/350/222SW1918-3537?startDate=2006-01-01&endDate=2006-12-31
Get: http://asteroids.neilparley.com/asteroidsAPI/data/query/name/ornamenta/222SW1918-3537?startDate=2006-01-01&endDate=2006-12-31


Will return the data available for the asteroid with the search parameters in the field 222SW1918-3537. I.e.

_links :
self :
about : Asteroid data query for (350) and field 222SW1918-3537
href : /asteroidsAPI/data/query/number/350/222SW1918-3537?startDate=2006-01-01&endDate=2006-12-31&format=text
endDate : 2006-09-24
fields :
222SW1918-3537
maxPhase : 17.1123008728
minPhase : 4.38959980011
nights : 24
rows : 692
startDate : 2006-07-18


Data can be download in the normal formats. However, there is also a special column format available when downloading data. To retrieve the data in column format add format=columns to the url string when requesting the data. For example, to download the above data we would use:

Get: http://asteroids.neilparley.com/asteroidsAPI/data/number/350?startDate=2006-01-01&endDate=2006-12-31&format=columns
Get: http://asteroids.neilparley.com/asteroidsAPI/data/name/ornamenta?startDate=2006-01-01&endDate=2006-12-31&format=columns


This would return a text file that the user can save and look like:

# Asteroid: 350
# Start Date: 2006-05-30, End Date: 2006-09-24
# Min Phase: 4.08887004852, Max Phase: 17.1123008728
# Field: All
# Nights 46, Rows 2149
# Url of data: http://asteroids.neilparley.com/asteroidsAPI/data/number/350?startDate=2006-01-01&endDate=2006-12-31&format=columns
#
#            jd           jd_lc          ra         dec      night   phase       field cam       flux flux_err     mag mag_err   c_mag c_mag_err
2453886.432870  2453886.417180  301.985928  -29.110451 2006-05-30 12.8002 SW1957-2801 223    1.63532 0.08970 14.46600 0.05956 9.61156 0.06153
2453886.433310  2453886.417619  301.985861  -29.110660 2006-05-30 12.8001 SW1957-2801 223    1.61159 0.08983 14.48190 0.06052 9.62786 0.06253
2453886.446320  2453886.430630  301.984611  -29.112354 2006-05-30 12.7977 SW1957-2801 223    1.58255 0.08812 14.50160 0.06046 9.65179 0.06271
...


In the text file the columns are space separated and have the following meanings. jd = Julian date of the observation, jd_lc = Julian date of the observation corrected for light travel time, ra = Right ascension of the asteroid observation, dec = Declination of the asteroid observation, night = night the observation was taken (defined at the start of the night), phase = the phase angle of the asteroid, field = the SuperWASP field where the data comes from, cam = the SuperWASP camera that took the image, flux = raw flux, flux_err = raw flux uncertainy, mag = raw magnitude, mag_err = raw magnitude uncertainy, c_mag = the reduced asteroid magnitude corrected for blending and c_mag_err = uncertainy in reduced magnitude.

If format = json our example above this would look something like:

{
"startDate": "2006-05-30", "rows": 2149, "endDate": "2006-09-24",
"url": "http://asteroids.neilparley.com/asteroidsAPI/data/number/350?startDate=2006-01-01&endDate=2006-12-31&format=json",
"minPhase": 4.08887004852295, "asteroid": 350,
"fields": ["222SW1918-3537", "222SW1956-3537", "221SW1954-3523", "223SW1941-3559", "223SW1957-2801"],
"data": [{"as_sun": 3.46508, "c_mag": 9.61156, "offset3": -0.0536758, "lon_pab_ecl": 291.514, "jd": 2453886.43287,
"offset3_error": 0.0358038, "blend_mag_error": 0.0119798, "lat_ast_ecl": -6.8257, "offset2": -0.114735,
"lat_pab_ecl": -7.82018, "flux_err": 0.089703, "blend_dist": 73.2888, "field": "SW1957-2801", "camera": 223,
"ra": 301.985928, "offset_error": 0.0146946, "jd_lc": 2453886.41718, "mag_err": 0.059556, "blend_mag": 0.014405,
"mag": 14.466, "offset": 0.0197609, "phase": 12.8002, "blend_fraction": 0.0131799, "blend_star": 16.4127,
"offset2_error": 0.0416293, "c_mag_err": 0.0615294, "flux": 1.63532, "night": "2006-05-30", "lon_ast_ecl": 285.14,
"dec": -29.110451, "as_earth": 2.71678}, ... ],
"nights": 46, "maxPhase": 17.1123008728027
}


url displays the url used to get the data and asteroid displays the number of the asteroid. data then contains a json array with the fields having the same meanings as above with the additonal fields: lon_pab_ecl = Longitude of the phase angle bisector, lat_pab_ecl = Latitude of the phase angle bisector, lon_ast_ecl = Asteroid ecliptic longitude, lat_ast_ecl = Asteroid ecliptic latitude, offset1 = Mean nightly SuperWASP magnitude offset, offset1_error = uncertainy in offset 1, offset2 = Mean nightly NOMAD magnitude offset, offset2_error = uncertainy in offset 2, offset3 = Mean nightly TYCHO magnitude offset, offset3_error = uncertainy Error in offset 3, as_earth = Asteroid to Earth distance, as_sun = Asteroid to Sun distance, blend_mag = Calculated blend magnitude, blend_magErr = Error in calculated blend, blend_fraction = Fraction of magnitude caused by blend, blend_dist = Distance to blending star, blend_star = Magnitude of blending star.

#### Rotation Period Queries

Information on the asteroid rotation lightcurves and period data can be found using the period API. The root is: http://asteroids.neilparley.com/asteroidsAPI/periods. This API then has 5 subsections, lc, data, fit, means and plot; these are explained in turn below.

##### lc API

This section gives information about the rotation lightcurves that have been created for asteroid. For example:>

Get: http://asteroids.neilparley.com/asteroidsAPI/periods/lc/number/350

will return data on the 11 lightcurves created for Asteroid (350). An example of the output in text format (where only one lightcurves is shown) is given below.

_links :
self :
about : Asteroid rotation curve data for (350)
href : /asteroidsAPI/periods/lc/number/350
lightcurves :
1 :
data :
href : /asteroidsAPI/periods/data/number/350/1
fit :
about : Lightcurve fourier series fit
href : /asteroidsAPI/periods/fit/number/350/1
means :
about : Lightcurve nightly mean magnitudes
href : /asteroidsAPI/periods/means/number/350/1
plot :
href : /asteroidsAPI/periods/plot/number/350/1
amplitude : 0.328857
blendFraction : 0.1
creator : Dr Neil Parley
endDate : 2006-07-08
epoch : 2453914.5
errorClip : 0.0758924
field : 222SW1956-3537
lcId : 1
nFit : 4
nNights : 15
nPts : 509
number : 350
period : 9.161
periodErr : 0.00209648
startDate : 2006-06-17
nLC : 11
number : 350


Here _links gives the normal self documenting information about the data object, nLC gives the number of lightcurves that have been created for the asteroid and number gives the asteroid number. Then the lightcurves object contains child objects for each lightcurve that has been created for the asteroid. For example, lightscurves.1 is an object containing information on lightcurve id 1 for asteroid 350. Although in most cases lightcurve ids will run from 1 to nLC in rare cases an asteroid lightcurve might have been deleted from the database and thus there will be a gap in the sequence, it is therefore recommended that you code to take this into account. For each lightcurve object amplitude gives the size of the rotational variation in magnitudes, startDate is the inclusive start date for the data used, endDate is the inclusive end date for the data used, field is the SuperWASP camera/field combination where the data came from, period is the rotation period in hours, periodErr is the uncertainty in the period, nNight is the number of nights of data used, nPts contains the number of data points used, epoch gives the lightcurve epoch or t_0, lcId is the id of the lightcurve and creator is the person who folded the lightcurve. errorClip is the maximum photometric uncertainty for data points to be included in the lightcurve (points with a higher uncertainty being clipped) and blendFraction is the maximum fraction of blended light allowed for points to be included in the lightcurve. For example a blendFraction of 0.1 means no more than 10% of data point flux is allowed to be from nearby stars blending into the aperature of the asteroid. For each of the lightcurve objects _links give internal links to the lightcurve data from the other APIs in this section.

##### Data API

This section allows easy downloading of the RAW data used to create the lightcurve. For example to get the data for asteroid (350) lightcurve 1:

Get: http://asteroids.neilparley.com/asteroidsAPI/periods/data/number/350/1

Forwards to the main API with the request:

Get: http://asteroids.neilparley.com/asteroidsAPI/data/number/350/222SW1956-3537/?startDate=2006-06-17&endDate=2006-07-08&blendFraction=0.1&errorClip=0.0758924

Nights where all the corrected magnitude points are zero (and thus not useable) will not be included in the nNights total etc. but these points may be return when requesting the raw data. This could happened if the magnitude correction code failed for one of the nights. You should make sure you check the usability of the datapoints when using the data.

##### Fit API

The rotation lightcurve of an asteroid is model as:

$$V(\alpha,t) = \overline{V}(\alpha) + \sum^{maxOrder}_{i=1} \left[ A_i \sin \frac{2\pi i}{P} (t-t_0) + B_i \cos \frac{2\pi i}{P}(t-t_0) \right]$$
where $$t_0$$ is the epoch of the lightcurve, $$P$$ is the period of rotation (both available from the lc API above) and $$\overline{V}(\alpha)$$ is the nightly mean magnitude of the lightcurve for night $$\alpha$$ (available from the means API below). The fourier series fit coefficients $$A_i$$ and $$B_i$$ are given by querying the fit API. For example:

Get: http://asteroids.neilparley.com/asteroidsAPI/periods/fit/number/350/1

will return (in JSON):

{
"maxOrder": 4,
"lcId": 1,
"number": 350,
"fit": [ {"cos": -0.0592, "order": 1, "sin": 0.0094},
{"cos": -0.1303, "order": 2, "sin": 0.0182},
{"cos": 0.0176, "order": 3, "sin": -0.0065},
{"cos": -0.0054, "order": 4, "sin": -0.0165}]
}


Here maxOrder gives the numbers of terms of the fourier series and fit holds an array of objects for each order. The sin terms are the coefficients infront of the sine term in the eqution above (As) and the cos terms are the coefficients infront of cosine terms (Bs).

##### Means API

The nightly mean magnitudes, $$\overline{V}(\alpha)$$ in the above equation, can be retrieved using the means API. For example:

Get: http://asteroids.neilparley.com/asteroidsAPI/periods/means/number/350/1

will return (in JSON):

{
"totalNights": 15,
"lcId": 1,
"number": 350,
"means": {
"2006-06-20": {"night": "2006-06-20", "meanMag": 9.1527},
"2006-07-08": {"night": "2006-07-08", "meanMag": 8.91958},
"2006-06-22": {"night": "2006-06-22", "meanMag": 9.12227},
"2006-06-23": {"night": "2006-06-23", "meanMag": 9.06389},
"2006-06-19": {"night": "2006-06-19", "meanMag": 8.92066},
"2006-06-18": {"night": "2006-06-18", "meanMag": 9.1917},
...
}
}


Here totalNights holds the total number of nights. (Nights with flux points which are all not usable are not include). means then holds an object for each night indexed by the night. Each object contains meanMag which is the mean magnitude for that night and night holding the night string in case you are interacting over the means object and not recording the key.