0

I had downloaded a file from https://co2.jpl.nasa.gov/build/?dataset=OCO2L2Stdv8&product=FULL#download

The data is freely available and you can download it without registering

It is a Netcdf4 file. I am interested in getting values for a particular latitude/longitude for a product. The product is xco2. I tried converting it to .tif without success using gdal_translate.

Here is the output of gdalinfo on the file.

Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files: oco2_LtCO2_190830_B9003r_190919005446s.nc4
Size is 512, 512
Coordinate System is `'
Metadata:
  NC_GLOBAL#bc_function=oco2_bias_correct_b9
  NC_GLOBAL#Bias_Correction_land=XCO2_Bias_Corrected = (XCO2_Raw + 0.900*(dpfrac + 0.0) + 0.0290*(co2_grad_del - 15.0) + 9.00*(DWS + 0.0) - footprint_bias)/0.99540
  NC_GLOBAL#Bias_Correction_oceanGL=XCO2_Bias_Corrected = (XCO2_Raw + 0.245*(dp_sco2 + 0.0) - 0.0900*((co2_grad_del<(-6.)) + 6.00) - footprint_bias)/0.99530
  NC_GLOBAL#Bias_Uncertainty=Bias correction parameter uncertainties are given in the data users guide.
  NC_GLOBAL#BuildId=B8.1.02
  NC_GLOBAL#contact=Chris O'Dell: odell@atmos.colostate.edu
  NC_GLOBAL#creation_date=Sep 2019
  NC_GLOBAL#filtering state=Filtered with oco2_lite_file_prefilter_b8a
  NC_GLOBAL#filter_function=oco2_xco2_quality_flag_b9
  NC_GLOBAL#Footprint_bias_land=Assumed footprint biases in xco2 [ppm] for footprints 1-8: -0.36, -0.15, -0.16, -0.14, 0.02, 0.33, 0.13, 0.34
  NC_GLOBAL#Footprint_bias_oceanGL=Assumed footprint biases in xco2 [ppm] for footprints 1-8: -0.36, -0.15, -0.16, -0.14, 0.02, 0.33, 0.13, 0.34
  NC_GLOBAL#identifier_product_doi=10.5067/W8QGIYNKS3JC
  NC_GLOBAL#identifier_product_doi_authority=http://dx.doi.org/
  NC_GLOBAL#Note_regarding_bias_correction=There is some uncertainty in not only the bias correction coefficients but in the chosen parameters themselves. This release bias correction may be slightly different that of previous releases, and also somewhat different from those of previous ACOS algorithm versions.  This has to do with details of the particular retrieval algorithm version and is considered normal (though not ideal).
  NC_GLOBAL#Platform=OCO-2
  NC_GLOBAL#Sensor=OCO-2
  NC_GLOBAL#title=ACOS L2 Lite Output
  NC_GLOBAL#warn_level_function=oco2_warn_levels_b8
Subdatasets:
  SUBDATASET_1_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":date
  SUBDATASET_1_DESC=[140067x7] date (16-bit integer)
  SUBDATASET_2_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":vertex_latitude
  SUBDATASET_2_DESC=[140067x4] vertex_latitude (32-bit floating-point)
  SUBDATASET_3_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":vertex_longitude
  SUBDATASET_3_DESC=[140067x4] vertex_longitude (32-bit floating-point)
  SUBDATASET_4_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":pressure_levels
  SUBDATASET_4_DESC=[140067x20] pressure_levels (32-bit floating-point)
  SUBDATASET_5_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":co2_profile_apriori
  SUBDATASET_5_DESC=[140067x20] co2_profile_apriori (32-bit floating-point)
  SUBDATASET_6_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":xco2_averaging_kernel
  SUBDATASET_6_DESC=[140067x20] xco2_averaging_kernel (32-bit floating-point)
  SUBDATASET_7_NAME=NETCDF:"oco2_LtCO2_190830_B9003r_190919005446s.nc4":pressure_weight
  SUBDATASET_7_DESC=[140067x20] pressure_weight (32-bit floating-point)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

Then i read the file using netCDF4 module in python3. enter image description here

The following image shows the shapes of the 4 variables I read. The variable latitude/longitude refer to the center-point of the pixel and the variable xco2 refers to the xco2 value at that pixel. The variable vertex_latitude/vertex_longitude respectively contains the pixel corner latitudes and longitudes.

How can I save a raster using this information to create a georeferenced .tiff file? If that is not possible, is there any way using this information to extract xco2 value for a particular latitude/longitude?

enter image description here

I will be grateful for any kind of help/lead in this!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.