NASA Logo
Ocean Color Science Software

ocssw V2022
get_dataday.cpp File Reference
#include "get_dataday.h"
#include "get_dataday.hpp"
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/optional.hpp>
#include <get_geospatial.hpp>
#include <cstdlib>
#include <iostream>
#include <netcdf>
#include "sensorDefs.h"
#include "sensorInfo.h"
#include "timeutils.h"
#include "version.h"
Include dependency graph for get_dataday.cpp:

Go to the source code of this file.

Namespaces

 ddvals
 

Macros

#define _PRINT_(...)   if(ddvals::verbosity) printf(__VA_ARGS__)
 

Typedefs

typedef bg::model::point< double, 2, bg::cs::spherical_equatorial< bg::degree > > Point_t
 
typedef bg::model::linestring< Point_tLinestring_t
 
typedef bg::model::polygon< Point_tPolygon_t
 
typedef bg::model::multi_point< Point_tMultiPoint_t
 

Enumerations

enum  DL {
  NOT_CROSSED, CROSSED, CROSSED_NORTH_POLE, CROSSED_SOUTH_POLE,
  CROSSED_IRREGULAR, NOT_CROSSED, CROSSED, CROSSED_NORTH_POLE,
  CROSSED_SOUTH_POLE, CROSSED_IRREGULAR
}
 

Functions

Polygon_t parse_wkr_polygon (const std::string &wkt_string)
 
Polygon_t gRing_to_gPolygon (float *gRingLats, float *gRingLons, size_t length)
 
void printUsage (int32_t exitStatus)
 
void get_datadays (time_t starttime, float equatorialCrossingTime, DL dateLineCrossed, float west, float east, int32_t *dataday0, int32_t *dataday1)
 
void getEquatorCrossingTime (int32_t sensorID, bool dayNight, time_t starttime, float *equatorialCrossingTime, int32_t *plusDay)
 
std::string dataday_to_isodate (int32_t dataday)
 
int32_t get_plusday ()
 
float get_equatorial_crossingTime ()
 
std::pair< int32_t, int32_t > get_datadays (const std::string &filepath)
 
std::pair< int32_t, int32_t > get_datadays (const NcFile &nc_input, float deltaeqcross, int night_flag)
 
int get_datadays (const char *path, int32_t *day0, int32_t *day1)
 
void set_verbosity (int val)
 

Variables

boost::optional< float > equatorialCrossingTime
 
int32_t plus_day {0}
 
float deltaeqcross {0.0}
 
bool verbosity = false
 

Macro Definition Documentation

◆ _PRINT_

#define _PRINT_ (   ...)    if(ddvals::verbosity) printf(__VA_ARGS__)

Definition at line 20 of file get_dataday.cpp.

Typedef Documentation

◆ Linestring_t

typedef bg::model::linestring<Point_t> Linestring_t

Definition at line 34 of file get_dataday.cpp.

◆ MultiPoint_t

typedef bg::model::multi_point<Point_t> MultiPoint_t

Definition at line 36 of file get_dataday.cpp.

◆ Point_t

typedef bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> > Point_t

Definition at line 33 of file get_dataday.cpp.

◆ Polygon_t

typedef bg::model::polygon<Point_t> Polygon_t

Definition at line 35 of file get_dataday.cpp.

Enumeration Type Documentation

◆ DL

enum DL
strong
Enumerator
NOT_CROSSED 
CROSSED 
CROSSED_NORTH_POLE 
CROSSED_SOUTH_POLE 
CROSSED_IRREGULAR 
NOT_CROSSED 
CROSSED 
CROSSED_NORTH_POLE 
CROSSED_SOUTH_POLE 
CROSSED_IRREGULAR 

Definition at line 80 of file get_dataday.cpp.

Function Documentation

◆ dataday_to_isodate()

std::string dataday_to_isodate ( int32_t  dataday)

Definition at line 256 of file get_dataday.cpp.

◆ get_datadays() [1/4]

int get_datadays ( const char *  path,
int32_t *  day0,
int32_t *  day1 
)

Get the datadays object.

Parameters
path- path to the input granule
day0- the earliset day the granule covers
day1- the latest day the granule covers
Returns
int

Definition at line 377 of file get_dataday.cpp.

◆ get_datadays() [2/4]

std::pair<int32_t, int32_t> get_datadays ( const NcFile &  nc_input,
float  deltaeqcross,
int  night_flag 
)

ending reading the file

Definition at line 292 of file get_dataday.cpp.

◆ get_datadays() [3/4]

std::pair<int32_t,int32_t> get_datadays ( const std::string filepath)

Definition at line 276 of file get_dataday.cpp.

◆ get_datadays() [4/4]

void get_datadays ( time_t  starttime,
float  equatorialCrossingTime,
DL  dateLineCrossed,
float  west,
float  east,
int32_t *  dataday0,
int32_t *  dataday1 
)

Definition at line 113 of file get_dataday.cpp.

◆ get_equatorial_crossingTime()

float get_equatorial_crossingTime ( )

Get the equatorial crossing time.

Returns
float

Definition at line 267 of file get_dataday.cpp.

◆ get_plusday()

int32_t get_plusday ( )

Get the plus day.

Returns
int

Definition at line 262 of file get_dataday.cpp.

◆ getEquatorCrossingTime()

void getEquatorCrossingTime ( int32_t  sensorID,
bool  dayNight,
time_t  starttime,
float *  equatorialCrossingTime,
int32_t *  plusDay 
)

Definition at line 155 of file get_dataday.cpp.

◆ gRing_to_gPolygon()

Polygon_t gRing_to_gPolygon ( float *  gRingLats,
float *  gRingLons,
size_t  length 
)

Definition at line 82 of file get_dataday.cpp.

◆ parse_wkr_polygon()

Polygon_t parse_wkr_polygon ( const std::string wkt_string)

ttps://www.vertica.com/docs/11.0.x/HTML/Content/Authoring/AnalyzingData/Geospatial/Spatial_Definitions/WellknownTextWKT.htm

Parameters
wkt_string

Definition at line 49 of file get_dataday.cpp.

◆ printUsage()

void printUsage ( int32_t  exitStatus)

prints error code

Parameters
exitStatus

Definition at line 96 of file get_dataday.cpp.

◆ set_verbosity()

void set_verbosity ( int  val)

Set the verbosity.

Parameters
valif val > 0 verbosity is set to 1 (true)

Definition at line 384 of file get_dataday.cpp.