Skip to content

Commit 1186ba4

Browse files
committed
remove redundant variables from radiometers and iwv and add clara as contributor
1 parent 381cc65 commit 1186ba4

File tree

2 files changed

+53
-13
lines changed

2 files changed

+53
-13
lines changed

scripts/process_hamp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
add_metadata_iwv,
1919
add_georeference,
2020
correct_radar_height,
21+
cleanup_iwv,
22+
cleanup_radiometers,
2123
)
2224
from src.ipfs_helpers import get_encoding, read_nc, read_mf_nc
2325

@@ -160,12 +162,14 @@ def postprocess_hamp(date, flightletter, version):
160162
filter_radiometer(ds_radiometers_lev1_concat)
161163
.pipe(add_masks_radiometer, sea_land_mask)
162164
.pipe(add_metadata_radiometer, flight_id=f"{date}{flightletter}")
165+
.pipe(cleanup_radiometers)
163166
.transpose("time", "frequency")
164167
)
165168
ds_iwv_lev2 = (
166169
filter_radiometer(ds_iwv_lev1)
167170
.pipe(add_metadata_iwv, flight_id=f"{date}{flightletter}")
168171
.pipe(add_masks_iwv, sea_land_mask)
172+
.pipe(cleanup_iwv)
169173
)
170174

171175
print(f"Saving data for {date}")

src/process.py

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -647,13 +647,13 @@ def add_metadata_radar(ds, flight_id):
647647
"MIRA Cloud Radar Moments from the HALO Microwave Package (Level 3)"
648648
)
649649
ds.attrs["summary"] = (
650-
"This dataset contains measurements from the MIRA cloud radar onboard the HALO aircraft during the ORCESTRA campaign."
651-
"The measurements are processed and quality controlled. The processing includes formatting the data, adding georeference information,"
650+
"This dataset contains measurements from the MIRA cloud radar onboard the HALO aircraft during the ORCESTRA campaign. "
651+
"The measurements are processed and quality controlled. The processing includes formatting the data, adding georeference information, "
652652
"filtering for noise, clutter and valid radar states, and adding masks for calibration, ground reflections, and roll segments."
653653
)
654-
ds.attrs["creator_name"] = "Jakob Deutloff, Lukas Kluft"
654+
ds.attrs["creator_name"] = "Jakob Deutloff, Lukas Kluft, Clara Bayley"
655655
ds.attrs["creator_email"] = (
656-
"jakob.deutloff@uni-hamburg.de, lukas.kluft@mpimet.mpg.de"
656+
"jakob.deutloff@uni-hamburg.de, lukas.kluft@mpimet.mpg.de, clara.bayley@mpimet.mpg.de"
657657
)
658658
ds.attrs["project"] = "ORCESTRA, PERCUSION"
659659
ds.attrs["platform"] = "HALO"
@@ -693,13 +693,13 @@ def add_metadata_radiometer(ds, flight_id):
693693
ds.attrs["flight_id"] = flight_id
694694
ds.attrs["title"] = "Radiometer Data from the Halo Microwave Package (Level 2)"
695695
ds.attrs["summary"] = (
696-
"This dataset contains measurements from the radiometers onboard the HALO aircraft during the ORCESTRA campaign."
697-
"The measurements are processed and quality controlled. The processing includes formatting the data,"
696+
"This dataset contains measurements from the radiometers onboard the HALO aircraft during the ORCESTRA campaign. "
697+
"The measurements are processed and quality controlled. The processing includes formatting the data, "
698698
"adding georeference information, and filtering for altitudes above 4800 m and adding a land-sea mask."
699699
)
700-
ds.attrs["creator_name"] = "Jakob Deutloff, Lukas Kluft"
700+
ds.attrs["creator_name"] = "Jakob Deutloff, Lukas Kluft, Clara Bayley"
701701
ds.attrs["creator_email"] = (
702-
"jakob.deutloff@uni-hamburg.de, lukas.kluft@mpimet.mpg.de"
702+
"jakob.deutloff@uni-hamburg.de, lukas.kluft@mpimet.mpg.de, clara.bayley@mpimet.mpg.de"
703703
)
704704
ds.attrs["project"] = "ORCESTRA, PERCUSION"
705705
ds.attrs["platform"] = "HALO"
@@ -743,14 +743,14 @@ def add_metadata_iwv(ds, flight_id):
743743
"Integrated Water Vapor Retrieval from the K-Band and W-Band Microwave Radiometers"
744744
)
745745
ds.attrs["summary"] = (
746-
"This dataset contains retrievals of integrated water vapor (IWV) from the K-band and W-band microwave radiometers onboard the HALO aircraft during the ORCESTRA campaign."
747-
"The retrieval is based on a linear regression model and should not be used for quantitative analysis."
748-
"The purpose of this data was to provide an estimate of IWV during the flights. The processing includes formatting the data,"
746+
"This dataset contains retrievals of integrated water vapor (IWV) from the KV-band microwave radiometer onboard the HALO aircraft during the ORCESTRA campaign. "
747+
"The retrieval is based on a linear regression model and should not be used for quantitative analysis. "
748+
"The purpose of this data was to provide an estimate of IWV during the flights. The processing includes formatting the data, "
749749
"adding georeference information, filtering for altitudes above 4800 m and adding a land-sea mask."
750750
)
751-
ds.attrs["creator_name"] = "Jakob Deutloff, Lukas Kluft"
751+
ds.attrs["creator_name"] = "Jakob Deutloff, Lukas Kluft, Clara Bayley"
752752
ds.attrs["creator_email"] = (
753-
"jakob.deutloff@uni-hamburg.de, lukas.kluft@mpimet.mpg.de"
753+
"jakob.deutloff@uni-hamburg.de, lukas.kluft@mpimet.mpg.de, clara.bayley@mpimet.mpg.de"
754754
)
755755
ds.attrs["project"] = "ORCESTRA, PERCUSION"
756756
ds.attrs["platform"] = "HALO"
@@ -775,3 +775,39 @@ def add_metadata_iwv(ds, flight_id):
775775
ds.attrs.pop("Radiometer_System", None)
776776

777777
return ds
778+
779+
780+
def cleanup_radiometers(ds):
781+
"""Remove unnecessary variables from radiometer dataset.
782+
783+
Parameters
784+
----------
785+
ds : xr.Dataset
786+
Level1 radiometer dataset.
787+
788+
Returns
789+
-------
790+
xr.Dataset
791+
Radiometer dataset without unnecessary variables.
792+
"""
793+
794+
return ds.drop_vars(["Rad_ID", "IntSampCnt", "file_code", "RSFactor", "Min_TBs"])
795+
796+
797+
def cleanup_iwv(ds):
798+
"""Remove unnecessary variables from IWV dataset.
799+
800+
Parameters
801+
----------
802+
ds : xr.Dataset
803+
Level1 IWV dataset.
804+
805+
Returns
806+
-------
807+
xr.Dataset
808+
IWV dataset without unnecessary variables.
809+
"""
810+
811+
return ds.drop_vars(
812+
["Rad_ID", "IntSampCnt", "file_code", "RSFactor", "Max_IWV", "Min_IWV"]
813+
)

0 commit comments

Comments
 (0)