Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update TEMPEST converter for uplifted data #1610

Merged
merged 9 commits into from
Feb 6, 2025

Conversation

BenjaminRuston
Copy link
Collaborator

Description

The TEMPEST data has been uplifted and is available via NASA Earthdata

Issue(s) addressed

Resolves #1609

Impact

Expected impact on downstream repositories:
enables
https://github.com/JCSDA-internal/ewok/pull/1097
https://github.com/JCSDA-internal/skylab/pull/664

Checklist

  • I have performed a self-review of my own code
  • I have run the unit tests before creating the PR

@BenjaminRuston
Copy link
Collaborator Author

@ashley314 think this should work in general...

I disabled the QC (not ideal) as I think my sample file was from a period of blackout. the international space station (ISS) has a lot of activities and various obstructions and periods of outage unique from free flying spacecraft.

So will try this for a few more dates and try to see if indeed the sample file is from an inconvenient period

@ashley314
Copy link
Contributor

Thank you! I will try it out with TEMPEST and COWVR today

@BenjaminRuston BenjaminRuston requested a review from fcvdb January 30, 2025 17:29
@ashley314
Copy link
Contributor

I am still getting the following error using data from 2025-01-24.

++ python3 /Users/agriffin/JEDI_developing/jedi-bundle/iodaconv/src/hdf5/cowvr_hdf5_2ioda.py -d 2025012400 -i obs.tempest_iss.20250124T000000Z.0.h5 -o /Users/agriffin/JEDI_developing/workdir/4dcbab/20250124T000000Z/obs_tempest_iss/obs.tempest_iss.20250124T000000Z.0.nc4
 ... starting timer: 1881379.691
Traceback (most recent call last):
 File "/Users/agriffin/JEDI_developing/jedi-bundle/iodaconv/src/hdf5/cowvr_hdf5_2ioda.py", line 443, in <module>
   main(args)
 File "/Users/agriffin/JEDI_developing/jedi-bundle/iodaconv/src/hdf5/cowvr_hdf5_2ioda.py", line 78, in main
   file_obs_data = get_data_from_files(afile)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/agriffin/JEDI_developing/jedi-bundle/iodaconv/src/hdf5/cowvr_hdf5_2ioda.py", line 156, in get_data_from_files
   obs_data = get_tempest_data(f, obs_data)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/agriffin/JEDI_developing/jedi-bundle/iodaconv/src/hdf5/cowvr_hdf5_2ioda.py", line 182, in get_tempest_data
   np.array(f['GeolocationAndFlags']['instr_scan_ang'], dtype='float32'),
            ~^^^^^^^^^^^^^^^^^^^^^^^
 File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
 File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
 File "/Users/agriffin/JCSDA/spack-stack-1.8.0-sonoma/spack-stack/envs/ue.agriffin/install/apple-clang/14.0.3/py-h5py-3.11.0-onv25l2/lib/python3.11/site-packages/h5py/_hl/group.py", line 357, in __getitem__
   oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
 File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
 File "h5py/h5o.pyx", line 241, in h5py.h5o.open
KeyError: "Unable to synchronously open object (object 'GeolocationAndFlags' doesn't exist)"

obs_data[('solarZenithAngle', metaDataName)] = np.array(f['Geolocation']['sat_solar_zen'], dtype='float32')
obs_data[('solarAzimuthAngle', metaDataName)] = np.array(f['Geolocation']['sat_solar_az'], dtype='float32')
obs_data[('sensorZenithAngle', metaDataName)] = np.array(f['Geolocation']['earth_inc_ang'], dtype='float32')
obs_data[('sensorAzimuthAngle', metaDataName)] = np.array(f['Geolocation']['earth_az_ang'], dtype='float32')
obs_data[('sensorViewAngle', metaDataName)] = compute_scan_angle(
np.array(f['GeolocationAndFlags']['instr_scan_ang'], dtype='float32'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be updated to np.array(f['Geolocation']['instr_scan_ang'], dtype='float32'),?

Copy link
Contributor

Choose a reason for hiding this comment

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

I updated this line and got the converter to successfully run for TEMPEST and COWVR. Thanks!

@ashley314
Copy link
Contributor

The converter is working but the plot for TEMPEST looks like this...
image

@BenjaminRuston
Copy link
Collaborator Author

@ashley314 did you do Jan2025 (or 2024) both of those dates believe the instruments was essentially off

I'm running May2024 and timed out on the first conversion (converted 6 of 7)... notice the files are not much smaller than the original:

(venv_orion) orion-login-3: /hdf5 >ll /work2/noaa/jcsda/bruston/work/JCSDA/JEDI/tmp/ewok/40c309/20240501T000000Z/obs_tempest_iss
total 237704
drwxr-s--- 2 bruston jcsda     4096 Jan 30 17:46 .
drwxr-s--- 3 bruston jcsda     4096 Jan 30 17:30 ..
-rw-r----- 1 bruston jcsda 25635757 Jan 30 17:34 obs.tempest_iss.20240501T000000Z.0.nc4
-rw-r----- 1 bruston jcsda 25583898 Jan 30 17:36 obs.tempest_iss.20240501T000000Z.1.nc4
-rw-r----- 1 bruston jcsda 25469919 Jan 30 17:37 obs.tempest_iss.20240501T000000Z.2.nc4
-rw-r----- 1 bruston jcsda 25507665 Jan 30 17:40 obs.tempest_iss.20240501T000000Z.3.nc4
-rw-r----- 1 bruston jcsda 25916486 Jan 30 17:42 obs.tempest_iss.20240501T000000Z.4.nc4
-rw-r----- 1 bruston jcsda 24950166 Jan 30 17:44 obs.tempest_iss.20240501T000000Z.5.nc4
-rw-r----- 1 bruston jcsda 25374707 Jan 30 17:46 obs.tempest_iss.20240501T000000Z.6.nc4
-rw-r----- 1 bruston jcsda 64915624 Oct 31 00:01 obs.tempest_iss.20240501T000000Z.7.h5

now running with the apply_qc and it's running faster and the files are much smaller:

-rw-r----- 1 bruston jcsda 64915624 Oct 31 00:01 obs.tempest_iss.20240501T000000Z.7.h5
-rw-r----- 1 bruston jcsda 65862789 Oct 31 00:01 obs.tempest_iss.20240501T000000Z.6.h5
drwxr-s--- 3 bruston jcsda     4096 Jan 30 18:10 ..
-rw-r----- 1 bruston jcsda    20858 Jan 30 18:10 response.json
-rw-r----- 1 bruston jcsda  9671505 Jan 30 18:13 obs.tempest_iss.20240501T000000Z.0.nc4
-rw-r----- 1 bruston jcsda  9635534 Jan 30 18:15 obs.tempest_iss.20240501T000000Z.1.nc4

@BenjaminRuston
Copy link
Collaborator Author

yay! this is working for a day with valid data:
image

now will try for a date with potentially all flagged data

@ashley314
Copy link
Contributor

Awesome! Thank you! I will give it a shot as well.

@ashley314
Copy link
Contributor

With these updates it fixes the plot for the same date I ran as before:
image

@BenjaminRuston BenjaminRuston marked this pull request as ready for review January 31, 2025 18:55
Copy link
Contributor

@ashley314 ashley314 left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@haydenlj haydenlj left a comment

Choose a reason for hiding this comment

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

Thanks @BenjaminRuston this worked for me

@BenjaminRuston BenjaminRuston merged commit e984f85 into develop Feb 6, 2025
@BenjaminRuston BenjaminRuston deleted the feature/tempest4ingestsuite branch February 6, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update converter for uplifted public released data from TEMPEST
3 participants