Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion AraSim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ int main(int argc, char **argv) { // read setup.txt file
// IceModel *icemodel=new IceModel(ICE_MODEL + NOFZ*10,CONSTANTICETHICKNESS * 1000 + CONSTANTCRUST * 100 + FIXEDELEVATION * 10 + 0,MOOREBAY);// creates Antarctica ice model
IceModel *icemodel=new IceModel(settings1->ICE_MODEL + settings1->NOFZ*10,settings1->CONSTANTICETHICKNESS * 1000 + settings1->CONSTANTCRUST * 100 + settings1->FIXEDELEVATION * 10 + 0,settings1->MOOREBAY);// creates Antarctica ice model
// IceModel inherits from EarthModel

cout<<endl;
cout<<"Surface at (log:0, lat:0) : "<<icemodel->Surface(0., 0.)<<endl;
cout<<"SurfaceAboveGeoid at (log:0, lat:0) : "<<icemodel->SurfaceAboveGeoid(0., 0.)<<endl;
Expand Down
41 changes: 41 additions & 0 deletions IceModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,31 @@ void IceModel::setUpIceModel(int model) {
i++;
}
westlanddown.close();

//Add Greenland attenuation lengths
ifstream greenlandUpper("data/greenland_attenlength_bogorodsky_upper.txt");
if(greenlandUpper.fail())
{cerr << "Failed to open greenland_attenlength_bogorodsky_upper.txt";
exit(1);
}
i=0;
while(greenlandUpper>>d_greenlandUpper[i]>>l_greenlandUpper[i])
{
i++;
}
greenlandUpper.close();

ifstream greenlandLower("data/greenland_attenlength_bogorodsky_lower.txt");
if(greenlandLower.fail())
{cerr << "Failed to open greenland_attenlength_bogorodsky_lower.txt";
exit(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does exit(1) correctly kill the program? That is, will it terminate all of AraSim? I prefer throw std::runtime_error, but it's a matter of taste. The important thing is that it stops AraSim.

}
i=0;
while(greenlandLower>>d_greenlandLower[i]>>l_greenlandLower[i])
{
i++;
}
greenlandLower.close();


// new ARA ice attenuation measurement values (at 300 MHz)
Expand Down Expand Up @@ -1378,6 +1403,7 @@ double IceModel::EffectiveAttenuationLength(const Position &pos,const int &which
cerr << " wrong attenuation length " <<endl;
}


if(mooreBayFlag)//if use Moore's Bay measured data for the west land
attenuation_length*=1.717557; //about 450 m (field attenuation length) for one whole way when assuming -3dB for the power loss at the bottom
}
Expand All @@ -1399,6 +1425,7 @@ double IceModel::EffectiveAttenuationLength(const Position &pos,const int &which
cerr << " wrong attenuation length " <<endl;
} //else


return attenuation_length;
} //EffectiveAttenuationLengthUp

Expand Down Expand Up @@ -1441,6 +1468,13 @@ double IceModel::EffectiveAttenuationLength(Settings *settings1, const Position
else
cerr << " wrong attenuation length " <<endl;
}
//Adding Greenland Ice attenuation lengths
if(settings1->GREENLAND_ATTEN == 1) {
attenuation_length=l_greenlandUpper[depth_index];
}
else if(settings1->GREENLAND_ATTEN == 2) {
attenuation_length=l_greenlandLower[depth_index];
}

//if(mooreBayFlag)//if use Moore's Bay measured data for the west land
if(settings1->MOOREBAY)//if use Moore's Bay measured data for the west land
Expand All @@ -1463,6 +1497,13 @@ double IceModel::EffectiveAttenuationLength(Settings *settings1, const Position
else
cerr << " wrong attenuation length " <<endl;
} //else
//Adding Greenland Ice attenuation lengths
if(settings1->GREENLAND_ATTEN == 1) {
attenuation_length=l_greenlandUpper[depth_index];
}
else if(settings1->GREENLAND_ATTEN == 2) {
attenuation_length=l_greenlandLower[depth_index];
}

return attenuation_length;
} //EffectiveAttenuationLengthUp
Expand Down
6 changes: 5 additions & 1 deletion IceModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ void ENtoLonLat(int e_coord,
const static int N_westlanddown=420;
double d_westlanddown[N_westlanddown],l_westlanddown[N_westlanddown];


// Attenuation lengths of Greenland Ice using the Bogorodsky model from Figure 7 of doi.org/10.1017/jog.2022.40
const static int N_greenlandUpper=2810;
double d_greenlandUpper[N_greenlandUpper], l_greenlandUpper[N_greenlandUpper];
const static int N_greenlandLower=2810;
double d_greenlandLower[N_greenlandLower], l_greenlandLower[N_greenlandLower];

public:

Expand Down
2 changes: 2 additions & 0 deletions Settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ outputdir="outputs"; // directory where outputs go
APPLY_NOISE_FIGURE=0; // default: 0 - don't use new noise figure information

CUSTOM_ELECTRONICS=0; //default: 0 -- don't use custom electronics, load regular "ARA_Electronics_TotalGain_TwoFilter.tst"

GREENLAND_ATTEN=0; //default:0 -- Uses South Pole attenuation length. 1 & 2 use Greenland attenuation lengths via RNO-G.


/*
Expand Down
4 changes: 4 additions & 0 deletions Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ class Settings

int CUSTOM_ELECTRONICS; //0 (default): use the regular "ARA_Electronics_TotalGain_TwoFilter.txt" file
//1 : load a custom electronics file, stored as "custom_electronics.txt" in the `data` directory

int GREENLAND_ATTEN; // 0 (default): Use regular Ara attenuation lengths
// 1: Use upper limit of bogorodsky curve fron RNO-G
// 2: Use lower limit of bogorodsky curve fron RNO-G


//arrays for saving read in event features in EVENT_GENERATION_MODE=1
Expand Down
Loading