National Phenology Network (NPN)¶
This page demonstrates how to retrieve data from the National Phenology Network (NPN) using springtime.
Species: Syringa vulgaris
Phenophase (fb): 483 (?)
In [4]:
Copied!
from springtime.datasets.insitu.npn.rnpn import RNPN, npn_species, npn_phenophases
from springtime.datasets.insitu.npn.rnpn import RNPN, npn_species, npn_phenophases
Data from all the locations¶
In [5]:
Copied!
# List IDs and names for available species, phenophases
species = npn_species()
phenophases = npn_phenophases()
# List IDs and names for available species, phenophases
species = npn_species()
phenophases = npn_phenophases()
In [6]:
Copied!
phenophases
phenophases
Out[6]:
phenophase_id | phenophase_name | phenophase_category | color | pheno_class_id | |
---|---|---|---|---|---|
0 | 56 | First leaf | Leaves | NaN | 1 |
1 | 57 | 75% leaf elongation | Leaves | NaN | 2 |
2 | 58 | First flower | Flowers | NaN | 7 |
3 | 59 | Last flower | Flowers | NaN | 9 |
4 | 60 | First fruit ripe | Fruits | NaN | 12 |
... | ... | ... | ... | ... | ... |
194 | 545 | Post-dormant nymphs | Development | Brown3 | 113 |
195 | 546 | Crawlers | Development | Brown3 | 112 |
196 | 547 | Egg laying | Reproduction | Brown2 | 136 |
197 | 548 | Egg laying | Reproduction | Brown2 | 136 |
198 | 549 | Mating | Reproduction | Brown2 | 82 |
199 rows × 5 columns
In [13]:
Copied!
species[species.species_id==36]
species[species.species_id==36]
Out[13]:
species_id | common_name | genus | genus_id | genus_common_name | species | kingdom | itis_taxonomic_sn | functional_type | class_id | class_common_name | class_name | order_id | order_common_name | order_name | family_id | family_name | family_common_name | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
421 | 36 | common lilac | Syringa | 1035 | Lilacs (Syringa) | vulgaris | Plantae | 32996.0 | Deciduous broadleaf | 15 | Flowering Plants | Magnoliopsida | 83 | Mint, Olive and Plantain Families | Lamiales | 305 | Oleaceae | Olive Family |
In [12]:
Copied!
phenophases[phenophases.phenophase_id==483]
phenophases[phenophases.phenophase_id==483]
Out[12]:
phenophase_id | phenophase_name | phenophase_category | color | pheno_class_id | |
---|---|---|---|---|---|
138 | 483 | Leaves | Leaves | Green1 | 3 |
In [8]:
Copied!
# Create a data instance
dataset = RNPN(species_ids={"name": "Syringa", "items":[36]},
phenophase_ids={"name": "leaves", "items":[483]},
years=[2010, 2011])
dataset
# Create a data instance
dataset = RNPN(species_ids={"name": "Syringa", "items":[36]},
phenophase_ids={"name": "leaves", "items":[483]},
years=[2010, 2011])
dataset
Out[8]:
RNPN(dataset='RNPN', years=YearRange(start=2010, end=2011), species_ids=NamedIdentifiers(name='Syringa', items=[36]), phenophase_ids=NamedIdentifiers(name='leaves', items=[483]), area=None, use_first=True, aggregation_operator='min')
In [9]:
Copied!
# Download data
dataset.download()
# Download data
dataset.download()
/tmp/data/rnpn/rnpn_npn_data_y_2010_Syringa_leaves.csv already exists, skipping /tmp/data/rnpn/rnpn_npn_data_y_2011_Syringa_leaves.csv already exists, skipping
In [10]:
Copied!
# Load downloded data as a dataframe
df = dataset.load()
df
# Load downloded data as a dataframe
df = dataset.load()
df
Out[10]:
geometry | datetime | leaves_doy | |
---|---|---|---|
0 | POINT (-91.37602 38.38862) | 2010-03-01 | 60 |
1 | POINT (-79.97169 39.53892) | 2010-05-05 | 125 |
2 | POINT (-85.60993 39.79147) | 2010-04-12 | 102 |
3 | POINT (-76.62881 40.94780) | 2010-04-05 | 95 |
4 | POINT (-91.69318 41.29201) | 2010-04-12 | 102 |
5 | POINT (-91.48378 41.88856) | 2010-04-04 | 94 |
6 | POINT (-74.29987 42.10105) | 2010-04-09 | 99 |
7 | POINT (-77.43737 42.89832) | 2010-04-08 | 98 |
8 | POINT (-83.05326 35.59232) | 2011-04-13 | 103 |
9 | POINT (-80.53153 35.59463) | 2011-03-14 | 73 |
10 | POINT (-84.17097 35.65687) | 2011-03-10 | 69 |
11 | POINT (-86.96690 36.39927) | 2011-02-25 | 56 |
12 | POINT (-91.78845 36.65863) | 2011-03-21 | 80 |
13 | POINT (-90.15485 38.71774) | 2011-03-19 | 78 |
14 | POINT (-83.82374 38.82653) | 2011-03-23 | 82 |
15 | POINT (-84.52015 38.88288) | 2011-03-21 | 80 |
16 | POINT (-85.24599 38.99372) | 2011-04-11 | 101 |
17 | POINT (-81.54738 39.24728) | 2011-03-18 | 77 |
18 | POINT (-77.48402 39.72047) | 2011-04-11 | 101 |
19 | POINT (-79.89363 40.66472) | 2011-04-04 | 94 |
20 | POINT (-73.11993 40.85247) | 2011-03-22 | 81 |
21 | POINT (-77.44374 40.98488) | 2011-04-14 | 104 |
22 | POINT (-80.29738 41.04120) | 2011-04-13 | 103 |
23 | POINT (-74.59502 41.12333) | 2011-04-30 | 120 |
24 | POINT (-80.81221 41.13425) | 2011-05-01 | 121 |
25 | POINT (-85.12750 41.21440) | 2011-04-15 | 105 |
26 | POINT (-72.63346 41.91122) | 2011-04-27 | 117 |
27 | POINT (-80.33588 42.01947) | 2011-04-29 | 119 |
28 | POINT (-79.26913 42.09705) | 2011-04-23 | 113 |
29 | POINT (-80.01417 42.13030) | 2011-04-20 | 110 |
30 | POINT (-73.65140 42.33499) | 2011-04-18 | 108 |
31 | POINT (-83.21512 42.49105) | 2011-04-23 | 113 |
32 | POINT (-88.16408 42.98386) | 2011-05-12 | 132 |
In [ ]:
Copied!