Skip to content

Commit f97e24b

Browse files
committed
fix errors due to change in dropsonde data and add readme
1 parent 9ce5354 commit f97e24b

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

scripts/arts_calibration/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ARTS for HAMP
2+
3+
This README gives a quick introduction on how to use ARTS for calculating brightness temperatures at the HAMP radiometer frequencies from dropsonde data.
4+
5+
### Getting Started:
6+
1. Create a conda environment with
7+
```conda env create -f environment.yaml```
8+
2. Check whether you can run ```arts_bt_calculation.py```
9+
3. You can run the analysis script ```arts_bt_calculation.py``` and loop over all flights within the script, or you can submit it as a batch job for each flight using ```master_submitter.py```. Then you will need to delete the loop over flights in ```arts_bt_calculation.py```.
10+
11+
### Code Structure
12+
```arts_bt_calculation.py``` is the main script to run the brightness temperature calculations. It reads in dropsonde data, sets up the ARTS simulation, and outputs brightness temperatures. You need to run this script from the root directory of the repository.
13+
14+
```analyse_bt_diffs.py``` is a script to analyse the differences between measured and simulated brightness temperatures. It reads in the output from ```arts_bt_calculation.py``` and compares it with HAMP measurements.

scripts/arts_calibration/arts_bt_calculation.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,17 @@ def calc_arts_bts(date, flightletter, ds_dropsonde, cfg):
6969
f"{cfg['save_dir']}/radiometer/{flightname}_radio.zarr", engine="zarr"
7070
)
7171
ds_dropsonde = ds_dropsonde.where(
72-
(ds_dropsonde["interp_time"] > pd.to_datetime(date))
73-
& (ds_dropsonde["interp_time"] < pd.to_datetime(date) + pd.DateOffset(hour=23))
72+
(ds_dropsonde["interpolated_time"] > pd.to_datetime(date))
73+
& (
74+
ds_dropsonde["interpolated_time"]
75+
< pd.to_datetime(date) + pd.DateOffset(hour=23)
76+
)
7477
).dropna(dim="sonde", how="all")
7578

7679
print("Calculate Cloud Mask")
7780
ds_dropsonde = ds_dropsonde.assign(
7881
radar_cloud_flag=(
79-
ds_radar.sel(time=ds_dropsonde.sonde_time, method="nearest").sel(
82+
ds_radar.sel(time=ds_dropsonde.launch_time, method="nearest").sel(
8083
height=slice(200, None)
8184
)["dBZe"]
8285
> -30

src/arts_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def fit_constant(x, y):
690690

691691
def get_profiles(sonde, ds_dropsonde, radiometers):
692692
ds_dropsonde_loc = ds_dropsonde.sel(sonde=sonde)
693-
drop_time = ds_dropsonde_loc["sonde_time"].values
693+
drop_time = ds_dropsonde_loc["launch_time"].values
694694
hampdata_loc = radiometers.dropna("time").sel(time=drop_time, method="nearest")
695695
height = float(hampdata_loc.plane_altitude.values)
696696
return ds_dropsonde_loc, hampdata_loc, height, drop_time

0 commit comments

Comments
 (0)