rweigel / cdawmeta

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

psp_fld_l3_rfs_hfr #12

Open rweigel opened 2 months ago

rweigel commented 2 months ago

When attempting to determine the cadence for psp_fld_l3_rfs_hfr, I encountered the following (read_cdf uses the Python CDF library).

url = 'https://cdaweb.gsfc.nasa.gov/sp_phys/data/psp/fields/l3/rfs_hfr/2023/psp_fld_l3_rfs_hfr_20231031_v03.cdf'
depend_0_name = 'epoch_hfr_coher_V1_V2'
data = cdawmeta.io.read_cdf(url, variables=depend_0_name, iso8601=False)
print(data)

{'epoch_hfr_coher_V1_V2': {'VarDescription': {'BlockingFactor': 0, 'Compress': 0, 'DataTypeValue': 33, 'DataType': 'CDF_TIME_TT2000', 'DimSizes': [], 'DimVariances': [], 'LastRecord': -1, 'Num': 300, 'NumDims': 0, 'NumElements': 1, 'PadValue': array([-9223372036854775807]), 'RecVariance': True, 'SparseRecords': 'No_sparse', 'VarType': 'zVariable', 'VariableName': 'epoch_hfr_coher_V1_V2'}, 'VarAttributes': {'FIELDNAM': 'epoch_hfr_coher_V1_V2', 'MONOTON': 'INCREASE', 'FORMAT': 'I22', 'LABLAXIS': 'epoch', 'VAR_TYPE': 'support_data', 'FILLVAL': -9223372036854775808, 'DISPLAY_TYPE': 'time_series', 'VALIDMIN': 315576066184000000, 'VALIDMAX': 1577880069183999999, 'SCALEMIN': -9223372036854775807, 'SCALEMAX': -9223372036854775807, 'UNITS': 'ns', 'CATDESC': 'Time for HFR Cross Coherence, Ch0: V1 Ch1: V2', 'TIME_BASE': 'J2000'}, 'VarData': None}}

The LastRecord=-1 and Num=300 is suspicious.

Autoplot gives

Screen Shot 2024-09-17 at 7 55 07 AM
rweigel commented 1 month ago

From Scott Boarsen

I’m finding bad data, the fillval they are using is not correct for CDF_TIME_TT2000

IDL> help, d.epoch_hfr_coher_V1_V2

** Structure <4faca208>, 71 tags, length=1480, data length=1476, refs=2:

VARNAME STRING 'epoch_hfr_coher_V1_V2'

TITLE STRING 'PSP FIELDS RFS HFR data'

PROJECT STRING 'PSP'

DISCIPLINE STRING Array[2]

SOURCE_NAME STRING 'PSP_FLD>Parker Solar Probe FIELDS'

DESCRIPTOR STRING 'RFS_HFR>Radio Frequency Spectrometer H'...

DATA_TYPE STRING 'L3>Level 3 Data'

DATA_VERSION STRING '03'

TEXT STRING Array[16]

MODS STRING Array[3]

LOGICAL_FILE_ID STRING 'psp_flds_l3_rfs_hfr_20231031000004_202'...

LOGICAL_SOURCE STRING 'PSP_FLDS_L3_RFS_HFR'

LOGICAL_SOURCE_DESCRIPTION

               STRING    'DERIVED FROM: PSP FIELDS RFS HFR Data'

PI_NAME STRING 'Stuart D. Bale (bale@ssl.berkeley.edu)'

PI_AFFILIATION STRING 'UC Berkeley Space Sciences Laboratory'

INSTRUMENT_TYPE STRING Array[3]

MISSION_GROUP STRING 'Parker Solar Probe (PSP)'

PARENTS STRING Array[5]

DEPENDENCIES STRING 'None'

FILE_NAMING_CONVENTION

               STRING    'source_datatype_descriptor_yyyyMMdd'

SPASE_DATASETRESOURCEID

               STRING    'spase://NASA/NumericalData/ParkerSolar'...

DOI STRING 'https://doi.org/TBD'

GENERATED_BY STRING 'PSP FIELDS SOC'

RULES_OF_USE STRING 'PSP/FIELDS Rules of the Road available'...

GENERATION_DATE STRING 'Fri Sep 15 16:28:06 2023'

HTTP_LINK STRING 'http://fields.ssl.berkeley.edu/data/'

LINK_TEXT STRING 'PSP/FIELDS RFS HFR and LFR data availa'...

LINK_TITLE STRING 'PSP/FIELDS SOC'

TIME_RESOLUTION STRING 'Varies with instrument mode (see TEXT)'

SVN_VERSION STRING '32306'

CDAWEB_PARENTS STRING Array[3]

CDFMAJOR STRING 'COL_MAJOR'

FIELDNAM STRING 'epoch_hfr_coher_V1_V2'

MONOTON STRING 'INCREASE'

FORMAT STRING 'I22'

FORM_PTR STRING ''

LABLAXIS STRING 'epoch'

VAR_TYPE STRING 'support_data'

FILLVAL LONG64 9999

DEPEND_0 STRING ''

DEPEND_1 STRING ''

DEPEND_2 STRING ''

DEPEND_3 STRING ''

DISPLAY_TYPE STRING 'time_series'

VALIDMIN LONG64 315576066184000000

VALIDMAX LONG64 1577880069183999999

SCALEMIN LONG64 -9223372036854775807

SCALEMAX LONG64 -9223372036854775807

UNITS STRING 'ns'

SI_CONV STRING ''

CATDESC STRING 'Time for HFR Cross Coherence, Ch0: V1 '...

TIME_BASE STRING 'J2000'

VAR_NOTES STRING ''

UNIT_PTR STRING ''

SCAL_PTR STRING ''

SCALETYP STRING ''

LABL_PTR_1 STRING ''

LEAP_SECONDS_INCLUDED

               STRING    ''

RESOLUTION STRING ''

BIN_LOCATION STRING ''

TIME_SCALE STRING ''

REFERENCE_POSITION

               STRING    ''

ABSOLUTE_ERROR STRING ''

RELATIVE_ERROR STRING ''

VARIABLE_PURPOSE

               STRING    ''

DIM_SIZES LONG 0

CDFTYPE STRING 'CDF_TIME_TT2000'

CDFRECVARY STRING 'VARY'

IDLSIZE LONG Array[3]

HANDLE LONG 0

DAT LONG64 -9223372036854775808

IDL>

IDL> print, d.epoch_hfr_coher_V1_V2.dat

-9223372036854775808

IDL> print, d.epoch_hfr_coher_V1_V2.fillval

              9999

Scott

; .compile bobw.pro

restore, getenv('cdfwebservices')

dataset_id= 'PSP_FLD_L3_RFS_HFR'

; PSP FIELDS RFS HFR Data - Stuart D. Bale (bale@ssl.berkeley.edu) (UC Berkeley Space Sciences Laboratory)

; Time range: 2018-10-02T03:48:16.000Z - 2024-04-30T23:59:55.000Z

; 20231031

date = ['2023-10-31T00:00:00.000Z','2023-11-01T00:00:00.000Z']

;dates = sab_dataset_dates(dataset_id)

;date = dates[, n_elements(dates[0,])-1]

d = spdfgetdata(dataset_id,['ALL-VARIABLES+'], date)

help, d, /str

end