Skip to content

Instantly share code, notes, and snippets.

View jtrive84's full-sized avatar

James Triveri jtrive84

View GitHub Profile
@jtrive84
jtrive84 / us-weather-events-2016-2023.csv
Created June 16, 2024 16:11
US weather events: 2016-2023
We can't make this file beautiful and searchable because it's too large.
BEGIN_YEARMONTH,BEGIN_DAY,BEGIN_TIME,END_YEARMONTH,END_DAY,END_TIME,EVENT_ID,STATE,STATE_FIPS,YEAR,MONTH_NAME,EVENT_TYPE,BEGIN_DATE_TIME,CZ_TIMEZONE,END_DATE_TIME,INJURIES_DIRECT,DEATHS_DIRECT,DAMAGE_PROPERTY,DAMAGE_CROPS,MAGNITUDE,MAGNITUDE_TYPE,BEGIN_LAT,BEGIN_LON
201612,27,500,201612,27,900,669700,MASSACHUSETTS,25,2016,December,Strong Wind,12/27/2016 5:00,EST-5,12/27/2016 9:00,0,0,0.10K,0.00K,41,EG,,
201612,27,200,201612,27,600,669703,MASSACHUSETTS,25,2016,December,Strong Wind,12/27/2016 2:00,EST-5,12/27/2016 6:00,0,0,0.10K,0.00K,42,MG,,
201612,27,200,201612,27,700,669707,MASSACHUSETTS,25,2016,December,Strong Wind,12/27/2016 2:00,EST-5,12/27/2016 7:00,0,0,0.10K,0.00K,49,MG,,
201612,27,300,201612,27,700,669708,MASSACHUSETTS,25,2016,December,Strong Wind,12/27/2016 3:00,EST-5,12/27/2016 7:00,0,0,0.10K,0.00K,41,EG,,
201612,18,1400,201612,18,1700,669667,RHODE ISLAND,44,2016,December,Strong Wind,12/18/2016 14:00,EST-5,12/18/2016 17:00,0,0,0.10K,0.00K,46,MG,,
201612,27,200,201612,27,600,669686,MASSACHUSETTS,25,20
@jtrive84
jtrive84 / severity.ipynb
Created June 5, 2024 21:29
Severity Distributions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / censored-mle.ipynb
Created May 23, 2024 18:48
Censored Maximum Likelihood Estimation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / btw.ipynb
Created April 26, 2024 20:38
Betweenness Centrality
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / saliency.ipynb
Created April 24, 2024 15:38
Saliency Maps
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / softmax.py
Created April 23, 2024 20:59
Classifier with softmax
class PreTrainedImageClassifier(nn.Module):
"""
Transfer learning using Resnet models for map image classification.
"""
def __init__(self, pt_model, dropout=0):
super().__init__()
# Set requires_grad = False for pretrained model.
for param in pt_model.parameters():
param.requires_grad = False
@jtrive84
jtrive84 / get-bounding-envelopes.ipynb
Created April 23, 2024 16:12
Get bounding envelopes for links in target region.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / segmented.ipynb
Created April 23, 2024 16:09
Segment map images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtrive84
jtrive84 / qgis_map_imaging.py
Created April 23, 2024 16:08
Create static map images via QGIS.
"""
Script to use for creating static map images in QGIS.
A dictionary of bounding boxes is required, with key representing the
linkId and value a list of four coordinates representing the region that
encloses the link. The dictionary for Charlotte has been included in the
repository.
Author: James D. Triveri
Date: 2024-02
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.