for j in range(beginyear,endyear):

    # 1. Pull exoplanet data using NASA API

    print 'Retrieving planets detected before ',str(j)

    disc = '+AND+pl_disc<'+str(j+1)
    
    radii = exo.pull_exoplanet_radii(extraconditions=disc)

    # If requested, pull planets with masses and calculate radii

    if guess_radius_from_mass:
        print 'Retrieving other planets with masses'
        disc = disc+'+AND+pl_rade+is+null'
        masses = exo.pull_exoplanet_masses(extraconditions=disc)
        guessradii = fun.guess_radii_from_masses_PHL(masses)
    
        # Add to confirmed candidate list
    
        if(len(radii) > 0):
            radii = np.concatenate((radii,guessradii),axis=0)
        else:
            radii = guessradii
            
    nplanet = len(radii)

    if guess_radius_from_mass:
        print 'There are ',nplanet, ' planets with confirmed and calculated radii'
    else:
        print 'There are ',nplanet, ' planets with confirmed radii'
Пример #2
0
print 'Retrieving confirmed planets'

radii = exo.pull_exoplanet_radii()

# Now candidate exoplanets (Kepler)

print 'Retrieving Kepler Candidates'

radii_c = exo.pull_candidate_exoplanet_radii()

# If requested, pull planets with masses and calculate radii

if guess_radius_from_mass:
    print 'Retrieving other planets with masses'
    
    masses = exo.pull_exoplanet_masses(extraconditions='+AND+pl_rade+is+null')
    
    guessradii = fun.guess_radii_from_masses_PHL(masses)
    
    # Add to confirmed exoplanet list
    
    radii = np.concatenate((radii,guessradii),axis=0)

nplanet = len(radii)
ncandidate = len(radii_c)

if guess_radius_from_mass:
    print 'There are ',nplanet, ' planets with confirmed and calculated radii'
else:
    print 'There are ',nplanet, ' planets with confirmed radii'