Skip to content

Commit

Permalink
Merge branch 'main' into 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinperaza authored Apr 21, 2024
2 parents 82e6093 + b2e020c commit 246abb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ site/*
crnpy.egg-info/*
.idea/*
/.idea
.idea/*
5 changes: 4 additions & 1 deletion src/crnpy/crnpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ def correction_humidity(abs_humidity, Aref):

def correction_incoming_flux(incoming_neutrons, incoming_Ref=None, fill_na=None, Rc_method=None, Rc_site=None,
site_atmdepth=None, Rc_ref=None, ref_atmdepth=None):

r"""Correction factor for incoming neutron flux.
This function corrects neutron counts for incoming neutron flux using the method described in Anderson et al. (2017). The correction is performed using the following equation:
Expand Down Expand Up @@ -671,6 +672,7 @@ def sensing_depth(vwc, pressure, p_ref, bulk_density, Wlat, dist=None, method='S
# Compute soil depth that accounts for 86% of the neutron flux
D86 = 1 / bulk_density * (8.321 + 0.14249 * (0.96655 + np.exp(-0.01 * r_start)) * (20 + (Wlat + vwc)) / (
0.0429 + (Wlat + vwc)))

results.append(D86)

elif method == 'Franz_2012':
Expand Down Expand Up @@ -1100,7 +1102,6 @@ def cutoff_rigidity(lat, lon):

return np.round(zq, 2)


def atmospheric_depth(elevation, latitude):
"""Function to estimate the atmospheric depth for any point on Earth according to McJannet and Desilets, 2023
Expand Down Expand Up @@ -1187,6 +1188,7 @@ def location_factor(site_atmospheric_depth, site_Rc, reference_atmospheric_depth
return tau



def find_neutron_monitor(Rc, start_date=None, end_date=None, verbose=False):
"""Search for potential reference neutron monitoring stations based on cutoff rigidity.
Expand Down Expand Up @@ -1272,6 +1274,7 @@ def interpolate_incoming_flux(nmdb_timestamps, nmdb_counts, crnp_timestamps):
# Create a DataFrame from nmdb timestamps and counts
df_nmdb = pd.DataFrame({'timestamp': nmdb_timestamps, 'counts': nmdb_counts})


# Set the Timestamp column as the index
df_nmdb.set_index('timestamp', inplace=True)

Expand Down

0 comments on commit 246abb8

Please sign in to comment.