Skip to content

Commit

Permalink
new PCK files just dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
rahil-makadia committed Aug 28, 2024
1 parent e5edc8b commit dce336c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 31 deletions.
9 changes: 0 additions & 9 deletions grss/fit/fit_radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def add_radar_obs(obs_df, t_min_tdb=None, t_max_tdb=None, verbose=False):
print(f"Read in {num_obs} radar observations from JPL radar API.")
data = raw_data['data']
time_range_count = 0
pre1972_count = 0
for i in range(num_obs):
obs = data[num_obs-i-1]
date = Time(obs[1], format='iso', scale='utc')
Expand Down Expand Up @@ -105,14 +104,6 @@ def add_radar_obs(obs_df, t_min_tdb=None, t_max_tdb=None, verbose=False):
obs_df.loc[idx,'frq'] = freq
obs_df.loc[idx,'sigDelay'] = obs_sigma if delay else np.nan
obs_df.loc[idx,'sigDoppler'] = obs_sigma if doppler else np.nan
if date.utc.mjd < 41317:
pre1972_count += 1
obs_df.loc[idx,'selAst'] = 'd'
if pre1972_count > 0:
print(f"\tWARNING: {pre1972_count} radar observations were taken before 1972.\n"
"\t\tThese residuals cannot be reliably computed because high-accuracy Earth "
"orientation kernels are not available for this time period.\n"
"\t\tForce deleting them...")
if verbose:
print(f"\tFiltered to {num_obs-time_range_count} observations that satisfy the "
"time range constraints.")
Expand Down
20 changes: 10 additions & 10 deletions grss/kernels/get_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,26 @@

# get the earth orientation binary spice kernels and their comments if they are not already present
# latest earth pck
latest_earth_pck_exists = os.path.exists(f'{script_dir}/earth_latest_high_prec.bpc')
latest_earth_pck_exists = os.path.exists(f'{script_dir}/earth_latest.bpc')
latest_earth_pck_old = (latest_earth_pck_exists and
time.time() - os.path.getmtime(f'{script_dir}/earth_latest_high_prec.bpc')
time.time() - os.path.getmtime(f'{script_dir}/earth_latest.bpc')
> 86400)
if not latest_earth_pck_exists or latest_earth_pck_old:
print('Downloading latest Earth binary PCK...')
os.system((f'curl --silent --show-error -o {script_dir}/earth_latest_high_prec.bpc '
os.system((f'curl --silent --show-error -o {script_dir}/earth_latest.bpc '
f'{NAIF_SITE}/pck/earth_latest_high_prec.bpc'))
# historical earth pck
historical_earth_pck_exists = os.path.exists(f'{script_dir}/earth_720101_230601.bpc')
historical_earth_pck_exists = os.path.exists(f'{script_dir}/earth_historic.bpc')
if not historical_earth_pck_exists:
print('Downloading historical Earth binary PCK...')
os.system((f'curl --silent --show-error -o {script_dir}/earth_720101_230601.bpc '
f'{NAIF_SITE}/pck/earth_720101_230601.bpc'))
print('Downloading historic Earth binary PCK...')
os.system((f'curl --silent --show-error -o {script_dir}/earth_historic.bpc '
f'{NAIF_SITE}/pck/earth_620120_240827.bpc'))
# predicted earth pck
predicted_earth_pck_exists = os.path.exists(f'{script_dir}/earth_200101_990825_predict.bpc')
predicted_earth_pck_exists = os.path.exists(f'{script_dir}/earth_predict.bpc')
if not predicted_earth_pck_exists:
print('Downloading predicted Earth binary PCK...')
os.system((f'curl --silent --show-error -o {script_dir}/earth_200101_990825_predict.bpc '
f'{NAIF_SITE}/pck/earth_200101_990825_predict.bpc'))
os.system((f'curl --silent --show-error -o {script_dir}/earth_predict.bpc '
f'{NAIF_SITE}/pck/earth_200101_990827_predict.bpc'))
# generic frame kernels
generic_frame_kernel_exists = os.path.exists(f'{script_dir}/pck00011.tpc')
if not generic_frame_kernel_exists:
Expand Down
2 changes: 1 addition & 1 deletion grss/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.2
4.2.3
13 changes: 7 additions & 6 deletions src/simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ void get_baseBodyFrame(const int &spiceId, const real &tMjdTDB,
break;
case 399:
baseBodyFrame = "ITRF93";
// High precision frame is not defined before 1972 JAN 01
// 00:00:42.183 TDB or after 2099 AUG 25 00:01:09.182 TDB
if (tMjdTDB < 41317.000488239L || tMjdTDB > 87940.000800717L) {
// High precision frame is not defined
// before 1962 JAN 20 00:00:41.184 TDB or
// after 2099 AUG 27 00:01:09.182 TDB
if (tMjdTDB < 37684.0004767L || tMjdTDB > 87942.0008007L) {
baseBodyFrame = "IAU_EARTH";
}
break;
Expand Down Expand Up @@ -691,9 +692,9 @@ PropSimulation::PropSimulation(std::string name, real t0,
}
this->spkEphem.mbPath = kernel_mb;
this->spkEphem.sbPath = kernel_sb;
this->pckEphem.histPckPath = DEkernelPath + "earth_720101_230601.bpc";
this->pckEphem.latestPckPath = DEkernelPath + "earth_latest_high_prec.bpc";
this->pckEphem.predictPckPath = DEkernelPath + "earth_200101_990825_predict.bpc";
this->pckEphem.histPckPath = DEkernelPath + "earth_historic.bpc";
this->pckEphem.latestPckPath = DEkernelPath + "earth_latest.bpc";
this->pckEphem.predictPckPath = DEkernelPath + "earth_predict.bpc";
}

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/cpp/prop/pck_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ int main(){
std::random_device rd; // Will be used to obtain a seed for the random number engine
std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd()
// limits of distribution are dictated by the time span of
// earth_720101_230601.bpc and earth_200101_990825_predict.bpc
std::uniform_real_distribution<> dis(41317.0005, 87940.0008);
// earth_620120_240827.bpc and earth_200101_990827_predict.bpc
std::uniform_real_distribution<> dis(37684.0004767L, 87942.0008007L);

std::cout
<< "/////////////////////// PCK map accuracy test ///////////////////////"
Expand All @@ -24,9 +24,9 @@ int main(){
std::string from = "ITRF93";
std::string to = "J2000";
std::string pck_text = "../../../grss/kernels/pck00011.tpc";
std::string pck_hist = "../../../grss/kernels/earth_720101_230601.bpc";
std::string pck_latest = "../../../grss/kernels/earth_latest_high_prec.bpc";
std::string pck_predict = "../../../grss/kernels/earth_200101_990825_predict.bpc";
std::string pck_hist = "../../../grss/kernels/earth_historic.bpc";
std::string pck_latest = "../../../grss/kernels/earth_latest.bpc";
std::string pck_predict = "../../../grss/kernels/earth_predict.bpc";

//////////// GRSS ////////////
PckEphemeris pckEphem;
Expand Down

0 comments on commit dce336c

Please sign in to comment.