libSBE.pl
changeset 38 15c603bc4f70
parent 36 04e8cb4f8073
child 51 14ce2387de5e
equal deleted inserted replaced
37:b24d11f7dfc4 38:15c603bc4f70
     1 #======================================================================
     1 #======================================================================
     2 #                    L I B S B E . P L 
     2 #                    L I B S B E . P L 
     3 #                    doc: Mon Nov  3 12:42:14 2014
     3 #                    doc: Mon Nov  3 12:42:14 2014
     4 #                    dlm: Mon Apr 23 21:03:27 2018
     4 #                    dlm: Thu Jan  3 14:06:25 2019
     5 #                    (c) 2014 A.M. Thurnherr
     5 #                    (c) 2014 A.M. Thurnherr
     6 #                    uE-Info: 25 105 NIL 0 0 72 2 2 4 NIL ofnI
     6 #                    uE-Info: 17 30 NIL 0 0 72 2 2 4 NIL ofnI
     7 #======================================================================
     7 #======================================================================
     8 
     8 
     9 # HISTORY:
     9 # HISTORY:
    10 #	Nov  3, 2014: - exported from [importCNV]
    10 #	Nov  3, 2014: - exported from [importCNV]
    11 #	Jun 16, 2015: - cosmetics
    11 #	Jun 16, 2015: - cosmetics
    12 #	Jun 17, 2015: - ensured numeric retvals of SBE_parseheader are returned as numbers
    12 #	Jun 17, 2015: - ensured numeric retvals of SBE_parseheader are returned as numbers
    13 #	Jun 18, 2015: - BUG: binary code had several bugs
    13 #	Jun 18, 2015: - BUG: binary code had several bugs
    14 #	Sep 29, 2015: - added potemp and sigma standard field names
    14 #	Sep 29, 2015: - added potemp and sigma standard field names
    15 #	Mar 19, 2016: - BUG: conductivity unit checking on input had multiple bugs
    15 #	Mar 19, 2016: - BUG: conductivity unit checking on input had multiple bugs
    16 #				  - solution for files with multiple conductivity units: ignore
    16 #				  - solution for files with multiple conductivity units: ignore
    17 #				    all conducitivities with units not equal to the first cond var
    17 #				    all conductivities with units not equal to the first cond var
    18 #				  - added $libSBE_quiet to suppress diagnostic messages
    18 #				  - added $libSBE_quiet to suppress diagnostic messages
    19 #	May 31, 2016: - made successfully decoding lat/lon optional
    19 #	May 31, 2016: - made successfully decoding lat/lon optional
    20 #	Mar 10, 2017: - made lat/lon decoding more flexible
    20 #	Mar 10, 2017: - made lat/lon decoding more flexible
    21 #	Mar  3, 2018: - adapted SBE37 fields (multiple changes)
    21 #	Mar  3, 2018: - adapted SBE37 fields (multiple changes)
    22 #				  - added default field name for sound speed (sspd)
    22 #				  - added default field name for sound speed (sspd)
    23 #	Mar  8, 2018: - BUG: SBE_parseHeader() did not correctly detect missing lat/lon
    23 #	Mar  8, 2018: - BUG: SBE_parseHeader() did not correctly detect missing lat/lon
    24 #				  - suppressed warnings in SBE_parseHeader()
    24 #				  - suppressed warnings in SBE_parseHeader()
    25 #	Apr 23, 2018: - BUG: header lat/lon was incorrectly parsed when there was no spaced before hemisphere
    25 #	Apr 23, 2018: - BUG: header lat/lon was incorrectly parsed when there was no space
       
    26 #						 before hemisphere
       
    27 #	Jan  3, 2019: - BUG: SBE_parseHeader() did not correctly detect missing lat/lon
    26 
    28 
    27 #----------------------------------------------------------------------
    29 #----------------------------------------------------------------------
    28 # fname_SBE2std($)
    30 # fname_SBE2std($)
    29 #	- standardize field names (also adds correct unit %PARAMs)
    31 #	- standardize field names (also adds correct unit %PARAMs)
    30 #----------------------------------------------------------------------
    32 #----------------------------------------------------------------------
   325 	croak("$0: cannot determine file layout\n")
   327 	croak("$0: cannot determine file layout\n")
   326 		unless (@antsNewLayout && defined($nfields) && defined($nrecs));
   328 		unless (@antsNewLayout && defined($nfields) && defined($nrecs));
   327 	croak("$0: cannot determine missing value\n")
   329 	croak("$0: cannot determine missing value\n")
   328 	    unless defined($badval);
   330 	    unless defined($badval);
   329 
   331 
       
   332 	$lat = nan unless defined($lat);
       
   333 	$lon = nan unless defined($lon);
       
   334 
   330 	@antsLayout = @antsNewLayout;
   335 	@antsLayout = @antsNewLayout;
   331 	return (1*$nfields,1*$nrecs,1*$sampint,1*$badval,$ftype,1*$lat,1*$lon);
   336 	return (1*$nfields,1*$nrecs,1*$sampint,1*$badval,$ftype,$lat,$lon);
   332 }
   337 }
   333 
   338 
   334 #----------------------------------------------------------------------
   339 #----------------------------------------------------------------------
   335 # SBEin($$)
   340 # SBEin($$)
   336 #	- read SBE CTD data
   341 #	- read SBE CTD data