<jupyter_start><jupyter_text>First Look at Mag Data  Import Data Files<jupyter_code>%reset -f
import pandas as pd
import hvplot.pandas
import numpy as np
import matplotlib.dates as dates
import warnings
warnings.filterwarnings('ignore')
import holoviews as hv
from holoviews import dim, opts
import hvplot.dask
hv.extension('bokeh')
import glob, os
import dask.dataframe as dd
from time import sleep

def inc(x):
    sleep(1)
    return x + 1

def add(x, y):
    sleep(1)
    return x + y<jupyter_output><empty_output><jupyter_text>Start a Dask Cluster<jupyter_code>from dask.distributed import Client, LocalCluster
cluster = LocalCluster()
client = Client(cluster)
client
def parse_date(date_string):
    year   = date_string[3:5]
    month  = date_string[0:2]
    day    = date_string[7:9]
    hour   = date_string[10:12]
    minute = date_string[13:15]
    second = date_string[16:18]
#     if day == '032':
#         print(date_string)
#         month = '02'
#         day = '01'
    
    common_date_string = year   + '-' + \
                         month  + '-' + \
                         day    + ' ' + \
                         hour   + ':' + \
                         minute + ':' + \
                         second
    
    dt = datetime.datetime.strptime(common_date_string, 
                                    "%y-%m-%d %H:%M:%S")
    
    return dt
!ls /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/
cat /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/*.mag > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/feb_test.txt
!head /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/feb_mag.txt
#!head /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp.txt
#additioal lines need to be deleted: 289185- 289241;  57dd
# !rm /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/febMag.csv
# !sed 's/*/02-/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/feb_mag.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp.txt
# !sed 's/\./-/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp1.txt
# !sed 's/\// /g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp1.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date.txt
# # !sed 's/ /,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp2.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/tempA.txt
# !sed 's/02-19-032/02-19-001/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date1.txt
# !sed 's/02-19-023/01-19-023/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date1.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date2.txt
# !sed 's/02-19-024/01-19-024/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date2.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date3.txt
# !sed 's/02-19-025/01-19-025/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date1.txt
# !sed 's/02-19-026/01-19-026/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date3.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date4.txt
# !sed 's/02-19-027/01-19-027/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date4.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date5.txt
# !sed 's/02-19-028/01-19-028/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date5.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date6.txt
# !sed 's/02-19-029/01-19-029/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date6.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date7.txt
# !sed 's/02-19-033/02-19-002/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date7.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date8.txt
# !sed 's/02-19-034/02-19-003/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date8.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date9.txt
# !sed 's/02-19-035/02-19-004/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date9.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date10.txt
# !sed 's/02-19-021/01-19-021/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date10.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date11.txt
# !sed 's/02-19-022/01-19-022/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/date11.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp2.txt

# !sed 's/ F:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp2.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp3.txt
# !sed 's/ S:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp3.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp4.txt
# !sed 's/ D:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp4.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp5.txt
# !sed 's/ A:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp5.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp6.txt
# !sed 's/m /,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp6.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp7.txt
# !sed 's/ Q:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp7.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp8.txt
# !sed 's/      X:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp8.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp9.txt
# !sed 's/ Y:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp9.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp10.txt
# !sed 's/ Z:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp10.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp11.txt
# !sed 's/ x:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp11.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp12.txt
# !sed 's/ y:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp12.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp13.txt
# !sed 's/ <INTERP>//' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp13.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp14.txt
# !sed 's/ <REAL>//' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp14.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp15.txt
# !sed 's/ <LAYBACK INTERPOLATION>//' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp15.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp17.txt
# !sed 's/L0 /L0/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/temp17.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/feb_mag_clean.csv
# !echo 'datetime,f_mag,S:,depth,dummy, A:,LO,Xgrid,Ygrid,zone,longitude,latitude' | cat - /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/feb_mag_clean.csv > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/febMag.csv
# !head /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/febMag.csv
!head /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/jan_mag.txt
!rm /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/janMag.csv
!rm /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp*
!sed 's/*/01-/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/jan_mag.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp.txt
!sed 's/\./-/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp1.txt
!sed 's/\// /g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp1.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp2.txt
#!sed 's/ /,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp2.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/tempA.txt
!sed 's/ F:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp2.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp3.txt
!sed 's/ S:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp3.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp4.txt
!sed 's/ D:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp4.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp5.txt
!sed 's/ A:/,/g' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp5.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp6.txt
!sed 's/m /,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp6.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp7.txt
!sed 's/ Q:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp7.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp8.txt
!sed 's/      X:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp8.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp9.txt
!sed 's/ Y:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp9.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp10.txt
!sed 's/ Z:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp10.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp11.txt
!sed 's/ x:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp11.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp12.txt
!sed 's/ y:/,/' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp12.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp13.txt
!sed 's/ <INTERP>//' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp13.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp14.txt
!sed 's/ <REAL>//' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp14.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp15.txt
!sed 's/ <LAYBACK INTERPOLATION>//' /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp15.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp16.txt
!echo 'datetime,f_mag,S:,depth,dummy, A:,LO,Xgrid,Ygrid,zone,longitude,latitude' | cat - /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/temp16.txt > /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/janMag.csv
!head /Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/janMag.csv
from dask import delayed
import dask.array as dsa<jupyter_output><empty_output><jupyter_text>Read Jan mag Files01-19-021,14:27:40.5,034839.779,192,+004.9m,096.49,L00465ms,99,426488.3,3087109.0,21E,-58.419440,-62.340243^M 45990 Layback,lengthchanges fro,200-0 to 200.0 (m)^M 45991 01-19-021,14:27:41.5,034839.268,192,+004.8m,062.62,L00465ms,99,426486.8,3087110.9,21E,-58.419467,-62.340225^M  699153 01-19-029,08:29:07.5,035541.093,186,+006.6m,096.48,L00465ms,99     ^M699154 Xcvr,sn: 5807^M699155 01-19-029,08:29:08.5,035541.09^B"Zrj^Erj1j^B^B^B^B^BjR01-19.02908:29:10.5,035540.759,185,+006.5m,083.98,L0 0465ms,99     ^M716873 01-19-029,13:25:53.5,034639.300,192,+006.1m,044.21,L00466ms,99,424274.5,3072845.9,21E,-58.468424,-62.467784^M716874 Layback,lengthchanges fro,0-0 to 200.0 (m)^M716875 01-19-029,13:25:54.5,034639.424,192,+006.1m,042.10,L00466ms,99,424428.5,3072969.9,21E,-58.465384,-62.466703^M<jupyter_code>%%time
df_feb=pd.read_csv('/Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/febMag.csv')
df_feb.head(5)
%%time
df_jan=pd.read_csv('/Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/january/janMag.csv')
#df_jan.sample(50)
#df_mag[df_mag['datetime'].str.contains('-032')]
df_feb['timestamp'] = df_feb['datetime'].apply(parse_date)
df_feb.head()
!pwd
df_jan.to_csv('magNew.csv');
df_jan['date']=df_jan.timestamp.date
df_jan['time']=df_jan.timestamp.time<jupyter_output><empty_output><jupyter_text>Read February Files<jupyter_code>%%time
df_feb=pd.read_csv('/Users/dsoule/data/bravoseis_data/MAGNETOMETRO/dotmagFiles/february/febMag.csv')
df_feb.head()
df_feb['timestamp'] = df_feb['datetime'].apply(parse_date)
df_feb.head()
df_bath = df_bath.resample('s').mean().compute()
#df_bath.index = pd.to_datetime(df_bath.index.values)<jupyter_output><empty_output><jupyter_text>Merge Dataframes<jupyter_code>test = pd.merge(df_bath, df_grav,how='inner', indicator=True,left_index=True, right_index=True, suffixes=('_B', '_G'))
#test = dd.merge(df_bath, df_grav,how='inner',right_index=True, left_index=True,suffixes=('_B', '_G')).compute()
test.head()
df_gravMerge = test[test['_merge'] == 'both']
del df_gravMerge['_merge']
df_gravMerge['longitud'] = df_gravMerge['longitud_G']
df_gravMerge['latitud'] = df_gravMerge['latitud_G']
del df_gravMerge['longitud_B']
del df_gravMerge['latitud_B']
del df_gravMerge['longitud_G']
del df_gravMerge['latitud_G']
df_gravMerge.head()
#df_gravMerge.size<jupyter_output><empty_output><jupyter_text>Downsample the data<jupyter_code>df_minuteGrav = pd.DataFrame()
df_minuteGrav['proc_gravity'] = df_gravMerge.gravimetria_bruta.resample('min').mean()
#df_minuteGrav['eotvos'] = df_gravMerge.eotvos.resample('min').mean()
#df_minuteGrav['grav_corr'] = df_gravMerge.gravimetria_bruta.resample('min').mean() + df_gravMerge.eotvos.resample('min').mean()
df_minuteGrav['lon'] = df_gravMerge.longitud.resample('min').mean()
df_minuteGrav['lat'] = df_gravMerge.latitud.resample('min').mean()
df_minuteGrav['sog'] = df_gravMerge.sog.resample('min').mean()
df_minuteGrav['cog'] = df_gravMerge.cog.resample('min').mean()
df_minuteGrav['depth'] = df_gravMerge.profundidad.resample('min').mean()
df_minuteGrav.tail()
df_minuteGrav.size
df_minuteGrav2=df_minuteGrav.loc['2019-01-20 00:00:00':'2019-01-24 00:00:00']
df_temp=df_minuteGrav.loc['2019-01-26 21:00:00':'2019-02-05 23:58:00']
df_minuteGrav2=df_minuteGrav2.append(df_temp)
df_minuteGrav2.hvplot.points('lon', 'lat', 
                      height=500, 
                      color='proc_gravity', 
                      cmap='colorwheel', 
                      size=3, 
                      hover_cols=['depth'], title= 'proc_gravity',
                      fontsize={'title': 16, 'labels': 14, 'xticks': 12, 'yticks': 12})
#df_minuteGrav2.hvplot.heatmap(x='lon', y='lat', C='proc_gravity', reduce_function=np.mean, colorbar=True)<jupyter_output><empty_output><jupyter_text>Things to notice:1. The depth signiature is visable2. Examine crossing paths... there is a directioal dependence to our readings related to ship direction. 3. Is the difference between these lines just the ETVOS correction or are their other corrections that need to be applied? 4. Whould you please share the processing stream?<jupyter_code>df_minuteGrav2.hvplot.points('index', 'proc_gravity', color='proc_gravity',
                             cmap='colorwheel', size=.5,
                             hover_cols=['cog'], title= 'proc_gravity')
df_minuteGrav2.head(1)
cond1 = df_minuteGrav2["lat"] < -62.44    
cond2 = df_minuteGrav2["lat"] > -62.45
cond3 = df_minuteGrav2["lon"] > -58.42
cond4 = df_minuteGrav2["lon"] < -58.36

df_minuteGrav3 = df_minuteGrav2[cond1 & cond2 & cond3 & cond4]
del df_minuteGrav3['eotvos']
del df_minuteGrav3['grav_corr']
df_minuteGrav3.head()
df_minuteGrav3.hvplot.scatter('lon', 'lat', 
                      height=500, 
                      color='proc_gravity', 
                      cmap='colorwheel', 
                      size=50, 
                      hover_cols=['depth'], title= 'proc_gravity subset').opts(bgcolor= grey)
df_minuteGrav3.to_csv('proc_gravity_subset.csv')<jupyter_output><empty_output><jupyter_text>The gravitational constant in SI units :math:`m^3 kg^{-1} s^{-1}` GRAVITATIONAL_CONST = 0.00000000006673  Bouguer Correction The mass of the material between the gravity station and the datum also causes a variation of gravity with elevation (Figure 1). This mass effect causes gravity at higher stations to be greater than at stations with lower elevations and thus partly offsets the Free Air effect. To calculate the effect of this mass, a model of the topography must be constructed and its density must be estimated. The traditional approach is crude but has been proven to be effective. In this approach, each station is assumed to sit on a slab of material that extends to infinity laterally and to the elevation datum vertically (Figure 1). The formula for the gravitational attraction of this infinite slab is derived by employing a volume integral to calculate its mass. The resulting correction is named for the French geodesist <NAME>: Bouguer Correction = BC = 2pgrh, where g is the International gravitational constant, r is the density, and h = (elevation - datum elevation). As discussed below, the need to estimate density for the calculation of the Bouguer correction is a significant source of uncertainty in gravity studies. With Gobs being observed gravity corrected for drift and tides, the Bouguer anomaly (BA) is then defined as: BA = Gobs - Gt + FAC - BC If terrain corrections (see below) are not applied, the term simple Bouguer anomaly is used. If they have, the term complete Bouguer anomaly is used. A second order correction to account for the curvature of the Earth is often added to this calculation.<jupyter_code>ellipsoid = get_ellipsoid()
 #Convert latitude to radians
    latitude_rad = np.radians(latitude)
     prime_vertical_radius = ellipsoid.semimajor_axis / np.sqrt(1 - ellipsoid.first_eccentricity ** 2 * np.sin(latitude_rad) ** 2)
        # Instead of computing X and Y, we only comupute the projection on the XY plane:
        # xy_projection = sqrt( X**2 + Y**2 )
 xy_projection = (height + prime_vertical_radius) * np.cos(latitude_rad)
 z_cartesian = (height + (1 - ellipsoid.first_eccentricity ** 2) * prime_vertical_radius) * np.sin(latitude_rad)
 radius = np.sqrt(xy_projection ** 2 + z_cartesian ** 2)
 geocentric_latitude = 180 / np.pi * np.arcsin(z_cartesian / radius)

    return geocentric_latitude, radius<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1409582689335394, 'fraction_numerical': 0.05059247810407007, 'mean_word_length': 4.898207231844424, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '661663', 'license': 'MIT', 'n_tokens_mistral': 8605, 'n_tokens_neox': 7757, 'n_words': 933, 'path': 'notebooks/local_versions/MagRaw_dask-local.ipynb', 'repo_name': 'daxsoule/BRAVOSEIS', 'size': '19418'}